|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 5/5] x86/svm: Cleanup ns_hostflags type
Rearrange the union to drop the .fields infix, rename bytes to the more
common raw, and adjust types where appropriate. Adjust the users
accordingly.
No functional change intended.
Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---
xen/arch/x86/hvm/svm/nestedsvm.c | 12 ++++++------
xen/arch/x86/include/asm/hvm/svm-types.h | 9 ++++-----
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 1ef4c5c83f16..47704d8ded80 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -151,7 +151,7 @@ int cf_check nsvm_vcpu_reset(struct vcpu *v)
svm->ns_vmcb_guestcr3 = 0;
svm->ns_vmcb_hostcr3 = 0;
svm->ns_asid = 0;
- svm->ns_hostflags.bytes = 0;
+ svm->ns_hostflags.raw = 0;
svm->ns_vmexit.exitinfo1 = 0;
svm->ns_vmexit.exitinfo2 = 0;
@@ -182,7 +182,7 @@ static int nsvm_vcpu_hostsave(struct vcpu *v, unsigned int
inst_len)
n1vmcb->_cr4 = v->arch.hvm.guest_cr[4];
/* Remember the host interrupt flag */
- svm->ns_hostflags.fields.rflagsif = !!(n1vmcb->rflags & X86_EFLAGS_IF);
+ svm->ns_hostflags.rflagsif = !!(n1vmcb->rflags & X86_EFLAGS_IF);
return 0;
}
@@ -651,7 +651,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs
*regs,
svm->ns_hap_enabled = vmcb_get_np(ns_vmcb);
/* Remember the V_INTR_MASK in hostflags */
- svm->ns_hostflags.fields.vintrmask = !!ns_vmcb->_vintr.intr_masking;
+ svm->ns_hostflags.vintrmask = !!ns_vmcb->_vintr.intr_masking;
/* Save l1 guest state (= host state) */
ret = nsvm_vcpu_hostsave(v, inst_len);
@@ -993,7 +993,7 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct
cpu_user_regs *regs)
/* Virtual Interrupts */
ns_vmcb->_vintr = n2vmcb->_vintr;
- if ( !svm->ns_hostflags.fields.vintrmask )
+ if ( !svm->ns_hostflags.vintrmask )
ns_vmcb->_vintr.intr_masking = 0;
/* Interrupt state */
@@ -1174,8 +1174,8 @@ enum hvm_intblk cf_check nsvm_intr_blocked(struct vcpu *v)
{
struct vmcb_struct *n2vmcb = nv->nv_n2vmcx;
- if ( svm->ns_hostflags.fields.vintrmask &&
- !svm->ns_hostflags.fields.rflagsif )
+ if ( svm->ns_hostflags.vintrmask &&
+ !svm->ns_hostflags.rflagsif )
return hvm_intblk_rflags_ie;
/* when l1 guest passes its devices through to the l2 guest
diff --git a/xen/arch/x86/include/asm/hvm/svm-types.h
b/xen/arch/x86/include/asm/hvm/svm-types.h
index beab9a3af203..71427b3c11d1 100644
--- a/xen/arch/x86/include/asm/hvm/svm-types.h
+++ b/xen/arch/x86/include/asm/hvm/svm-types.h
@@ -77,12 +77,11 @@ struct nestedsvm {
} ns_vmexit;
union {
- uint32_t bytes;
struct {
- uint32_t rflagsif:1;
- uint32_t vintrmask:1;
- uint32_t reserved:30;
- } fields;
+ bool rflagsif:1;
+ bool vintrmask:1;
+ };
+ uint32_t raw;
} ns_hostflags;
};
--
2.55.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |