lkml.org 
[lkml]   [2015]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 04/13] KVM: x86: API changes for SMM support
2015-05-27 19:05+0200, Paolo Bonzini:
> This patch includes changes to the external API for SMM support.
> All the changes are predicated by the availability of a new
> capability, KVM_CAP_X86_SMM, which is added at the end of the
> patch series.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> @@ -309,7 +312,13 @@ struct kvm_vcpu_events {
> - __u32 reserved[10];
> + struct {
> + __u8 smm;
> + __u8 pending;
> + __u8 smm_inside_nmi;

(The 'u8 flags' discussion made me see that we just lost 21 bits here,
but it seems worth the sacrifice.)

> + __u8 pad;
> + } smi;
> + __u32 reserved[9];
> @@ -3237,6 +3250,18 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
> + if (events->flags & KVM_VCPUEVENT_VALID_SMM) {
> + if (events->smi.smm)
> + vcpu->arch.hflags |= HF_SMM_MASK;
> + else
> + vcpu->arch.hflags &= ~HF_SMM_MASK;
> + vcpu->arch.smi_pending = events->smi.pending;
> + if (events->smi.smm_inside_nmi)
> + vcpu->arch.hflags |= ~HF_SMM_INSIDE_NMI_MASK;

~~~ ~~ ~ HF_SMM_INSIDE_NMI_MASK.

> + else
> + vcpu->arch.hflags &= ~HF_SMM_INSIDE_NMI_MASK;

(Looks like a use case for a new helper,
__assign_bit(HF_SMM_INSIDE_NMI_MASK,
&vcpu->arch.hflags,
events->smi.smm_inside_nmi);)


\
 
 \ /
  Last update: 2015-05-29 21:21    [W:0.093 / U:3.200 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site