trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: Add ifdef around IA64 ioctls.
@ 2015-02-05  1:06 Vinson Lee
  0 siblings, 0 replies; only message in thread
From: Vinson Lee @ 2015-02-05  1:06 UTC (permalink / raw)
  To: trinity; +Cc: Vinson Lee

From: Vinson Lee <vlee@twitter.com>

Fix build error.

  CC	ioctls/kvm.o
In file included from ioctls/kvm.c:8:0:
ioctls/kvm.c:115:8: error: ‘KVM_IA64_VCPU_GET_STACK’ undeclared here (not in a function)
  IOCTL(KVM_IA64_VCPU_GET_STACK),
        ^
include/ioctls.h:53:15: note: in definition of macro ‘IOCTL’
  { .request = _request, .name = #_request, }
               ^
ioctls/kvm.c:116:8: error: ‘KVM_IA64_VCPU_SET_STACK’ undeclared here (not in a function)
  IOCTL(KVM_IA64_VCPU_SET_STACK),
        ^
include/ioctls.h:53:15: note: in definition of macro ‘IOCTL’
  { .request = _request, .name = #_request, }

IA64 ioctls were removed in Linux 3.19.

commit 6b397158d07f885154b871a15f879d25b3de7579
Author: Radim Krčmář <rkrcmar@redhat.com>
Date:   Thu Nov 20 14:43:18 2014 +0100

    kvm: remove IA64 ioctls

    KVM ia64 is no longer present so new applications shouldn't use them.
    The main problem is that they most likely didn't work even before,
    because of a conflict in the #defines:

      #define KVM_SET_GUEST_DEBUG       _IOW(KVMIO,  0x9b, struct kvm_guest_debug)
      #define KVM_IA64_VCPU_SET_STACK   _IOW(KVMIO,  0x9b, void *)

    The argument to KVM_SET_GUEST_DEBUG is:

      struct kvm_guest_debug {
        __u32 control;
        __u32 pad;
        struct kvm_guest_debug_arch arch;
      };

      struct kvm_guest_debug_arch {
      };

    meaning that sizeof(struct kvm_guest_debug) == sizeof(void *) == 8
    and KVM_SET_GUEST_DEBUG == KVM_IA64_VCPU_SET_STACK.

    KVM_SET_GUEST_DEBUG is handled in virt/kvm/kvm_main.c before even calling
    kvm_arch_vcpu_ioctl (which would have handled KVM_IA64_VCPU_SET_STACK),
    so KVM_IA64_VCPU_SET_STACK would just return -EINVAL.

    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Vinson Lee <vlee@twitter.com>
---
 ioctls/kvm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ioctls/kvm.c b/ioctls/kvm.c
index ddd7e29..df64356 100644
--- a/ioctls/kvm.c
+++ b/ioctls/kvm.c
@@ -112,8 +112,10 @@ static const struct ioctl kvm_ioctls[] = {
 	IOCTL(KVM_SET_GUEST_DEBUG),
 	IOCTL(KVM_X86_SETUP_MCE),
 	IOCTL(KVM_X86_GET_MCE_CAP_SUPPORTED),
+#if defined(KVM_IA64_VCPU_GET_STACK)
 	IOCTL(KVM_IA64_VCPU_GET_STACK),
 	IOCTL(KVM_IA64_VCPU_SET_STACK),
+#endif
 	IOCTL(KVM_ENABLE_CAP),
 	IOCTL(KVM_DIRTY_TLB),
 	IOCTL(KVM_GET_ONE_REG),
-- 
2.2.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-05  1:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05  1:06 [PATCH] kvm: Add ifdef around IA64 ioctls Vinson Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).