From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
Gleb Natapov <gleb@redhat.com>
Subject: [PATCH] KVM: x86: Adjust KVM_VCPUEVENT flag names
Date: Tue, 15 Dec 2009 23:57:10 +0100 [thread overview]
Message-ID: <4B281446.7020903@web.de> (raw)
In-Reply-To: <4B27C27F.9090504@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3408 bytes --]
Avi Kivity wrote:
> On 12/15/2009 06:41 PM, Jan Kiszka wrote:
>>
>> OK, but calling these bits "SET" makes no sense anymore. What about
>> KVM_VCPUEVENT_VALID_*?
>>
>
> Sure. Want to patch?
>
Here we go:
--------->
KVM: x86: Adjust KVM_VCPUEVENT flag names
They are also used on KVM_GET_VCPU_EVENTS, so 'VALID' is a better name
element than 'SET'.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Documentation/kvm/api.txt | 4 ++--
arch/x86/include/asm/kvm.h | 4 ++--
arch/x86/kvm/x86.c | 12 ++++++------
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt
index b22592d..2811e45 100644
--- a/Documentation/kvm/api.txt
+++ b/Documentation/kvm/api.txt
@@ -706,8 +706,8 @@ from the update. These fields are nmi.pending and sipi_vector. Keep the
corresponding bits in the flags field cleared to suppress overwriting the
current in-kernel state. The bits are:
-KVM_VCPUEVENT_SET_NMI_PENDING - transfer nmi.pending to the kernel
-KVM_VCPUEVENT_SET_SIPI_VECTOR - transfer sipi_vector
+KVM_VCPUEVENT_VALID_NMI_PENDING - transfer nmi.pending to the kernel
+KVM_VCPUEVENT_VALID_SIPI_VECTOR - transfer sipi_vector
5. The kvm_run structure
diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
index d1a67ae..f46b79f 100644
--- a/arch/x86/include/asm/kvm.h
+++ b/arch/x86/include/asm/kvm.h
@@ -255,8 +255,8 @@ struct kvm_reinject_control {
};
/* When set in flags, include corresponding fields on KVM_SET_VCPU_EVENTS */
-#define KVM_VCPUEVENT_SET_NMI_PENDING 0x00000001
-#define KVM_VCPUEVENT_SET_SIPI_VECTOR 0x00000002
+#define KVM_VCPUEVENT_VALID_NMI_PENDING 0x00000001
+#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
/* for KVM_GET/SET_VCPU_EVENTS */
struct kvm_vcpu_events {
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index e181c6f..0113752 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1945,8 +1945,8 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
events->sipi_vector = vcpu->arch.sipi_vector;
- events->flags = (KVM_VCPUEVENT_SET_NMI_PENDING
- | KVM_VCPUEVENT_SET_SIPI_VECTOR);
+ events->flags = (KVM_VCPUEVENT_VALID_NMI_PENDING
+ | KVM_VCPUEVENT_VALID_SIPI_VECTOR);
vcpu_put(vcpu);
}
@@ -1954,8 +1954,8 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
struct kvm_vcpu_events *events)
{
- if (events->flags &
- ~(KVM_VCPUEVENT_SET_NMI_PENDING | KVM_VCPUEVENT_SET_SIPI_VECTOR))
+ if (events->flags & ~(KVM_VCPUEVENT_VALID_NMI_PENDING
+ | KVM_VCPUEVENT_VALID_SIPI_VECTOR))
return -EINVAL;
vcpu_load(vcpu);
@@ -1972,11 +1972,11 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
kvm_pic_clear_isr_ack(vcpu->kvm);
vcpu->arch.nmi_injected = events->nmi.injected;
- if (events->flags & KVM_VCPUEVENT_SET_NMI_PENDING)
+ if (events->flags & KVM_VCPUEVENT_VALID_NMI_PENDING)
vcpu->arch.nmi_pending = events->nmi.pending;
kvm_x86_ops->set_nmi_mask(vcpu, events->nmi.masked);
- if (events->flags & KVM_VCPUEVENT_SET_SIPI_VECTOR)
+ if (events->flags & KVM_VCPUEVENT_VALID_SIPI_VECTOR)
vcpu->arch.sipi_vector = events->sipi_vector;
vcpu_put(vcpu);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-12-15 22:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 16:55 [PATCH] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Jan Kiszka
2009-12-06 17:05 ` Avi Kivity
2009-12-06 17:12 ` Jan Kiszka
2009-12-15 14:54 ` Avi Kivity
2009-12-15 16:41 ` Jan Kiszka
2009-12-15 17:08 ` Avi Kivity
2009-12-15 22:57 ` Jan Kiszka [this message]
2009-12-16 9:59 ` [PATCH] KVM: x86: Adjust KVM_VCPUEVENT flag names Avi Kivity
2009-12-06 17:24 ` [PATCH v2] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Jan Kiszka
2009-12-08 14:02 ` Marcelo Tosatti
2009-12-08 14:07 ` Avi Kivity
2009-12-08 20:52 ` Marcelo Tosatti
2009-12-08 21:17 ` Jan Kiszka
2009-12-15 14:50 ` Avi Kivity
2009-12-15 16:43 ` Jan Kiszka
2009-12-15 17:10 ` Avi Kivity
2009-12-15 17:29 ` Jan Kiszka
2009-12-14 10:32 ` [PATCH] " Jan Kiszka
2009-12-14 10:34 ` Avi Kivity
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=4B281446.7020903@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.