trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinson Lee <vlee@twopensource.com>
To: trinity@vger.kernel.org
Cc: Vinson Lee <vlee@twitter.com>
Subject: [PATCH] kvm: Add ifdef around IA64 ioctls.
Date: Wed,  4 Feb 2015 17:06:42 -0800	[thread overview]
Message-ID: <1423098402-25569-1-git-send-email-vlee@twopensource.com> (raw)

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

                 reply	other threads:[~2015-02-05  1:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423098402-25569-1-git-send-email-vlee@twopensource.com \
    --to=vlee@twopensource.com \
    --cc=trinity@vger.kernel.org \
    --cc=vlee@twitter.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).