From: Marcelo Tosatti Subject: Re: [PATCH][REPOST] Xen PV-on-HVM guest support (v3) Date: Mon, 19 Oct 2009 16:46:39 -0200 Message-ID: <20091019184639.GE14227@amt.cnet> References: <1255645303.18112.10.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Ed Swierk Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39916 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755584AbZJSSxF (ORCPT ); Mon, 19 Oct 2009 14:53:05 -0400 Content-Disposition: inline In-Reply-To: <1255645303.18112.10.camel@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 15, 2009 at 03:21:43PM -0700, Ed Swierk wrote: > [Repost; the patch was garbled in my previous attempt.] > > Support for Xen PV-on-HVM guests can be implemented almost entirely in > userspace, except for handling one annoying MSR that maps a Xen > hypercall blob into guest address space. > > A generic mechanism to delegate MSR writes to userspace seems overkill > and risks encouraging similar MSR abuse in the future. Thus this patch > adds special support for the Xen HVM MSR. > > I implemented a new ioctl, KVM_XEN_HVM_CONFIG, that lets userspace tell > KVM which MSR the guest will write to, as well as the starting address > and size of the hypercall blobs (one each for 32-bit and 64-bit) that > userspace has loaded from files. When the guest writes to the MSR, KVM > copies one page of the blob from userspace to the guest. > > I've tested this patch with a hacked-up version of Gerd's userspace > code, booting a number of guests (CentOS 5.3 i386 and x86_64, and > FreeBSD 8.0-RC1 amd64) and exercising PV network and block devices. > > v3: separate blob_{addr,size}_{32,64}; move xen_hvm_config to struct > kvm_arch; remove unneeded ifdefs; return -EFAULT, -E2BIG, etc. from > xen_hvm_config; use is_long_mode(); remove debug printks; document ioctl > in api.txt > > Signed-off-by: Ed Swierk Applied, thanks.