From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Wed, 10 Dec 2008 09:00:27 +0000 Subject: Re: [patch] fix kvm_arch_vcpu_ioctl_[gs]et_regs() Message-Id: <493F852B.8030806@redhat.com> List-Id: References: <493E906C.8030800@sgi.com> In-Reply-To: <493E906C.8030800@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ia64@vger.kernel.org Jes Sorensen wrote: > Hi, > > This patch makes these two macros do something sensible on ia64 and > work the way qemu expects to use them. The old versions clearly couldn't > have worked since the get_regs() call expected pointers in the kvm_regs > struct which were never copied in. > > Fix kvm_arch_vcpu_ioctl_[gs]et_regs() to do something meaningful on > ia64. Old versions could never have worked since they required > pointers to be set in the ioctl payload which were never being set by > the ioctl handler for get_regs. > > This version doesn't support copying the KVM kernel stack in/out of > the kernel. This should be implemented in a seperate ioctl call if > ever needed. > > > struct kvm_regs { > - char *saved_guest; > - char *saved_stack; > struct saved_vpd vpd; > /*Arch-regs*/ > int mp_state; > @@ -233,6 +231,8 @@ > unsigned long fp_psr; /*used for lazy float register */ > unsigned long saved_gp; > /*for phycial emulation */ > + > + union context saved_guest; > }; > > This makes several tons of sense, but breaks backwards compatibility. If I understand correctly, get/set was never used so this shouldn't matter? I suggest reserving some space at the end of kvm_regs in case further state needs to be added. Please add a KVM_CAP_ entry to advertise the fixup. This way userspace can determine that it's compiling or running on an old kernel and error out gracefully. -- error compiling committee.c: too many arguments to function