Re: [patch] fix kvm_arch_vcpu_ioctl_[gs]et_regs()
Avi Kivity <[email protected]>
| Newsgroups | org.kernel.vger.kvm-ia64 |
|---|---|
| Message-ID | <[email protected]> |
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