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@xxxxxxxxxxx> --- 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:
signature.asc
Description: OpenPGP digital signature