From nobody Mon Nov 23 22:28:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1794009418; cv=none; d=zohomail.com; s=zohoarc; b=XktcH7BZsE8sqtamqb4um493OYN5QGGpjPV/Pxejn4DdPi0ME6my7obTbqgIqwae0njk7Y9rjnBAX97bG1nYx0aRTfOCnyNB1iyyJefi5uz5gA6L8MNIO6z/95WP1JYlBiImwGbSaclmi5w8owOwmECIwWd7Ex4DfnM0nKeoS6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1794009418; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=u/++iBq87OEZlSRysDMyKl+pJtbf6Rmz2e5RRpkSpU4=; b=hy0TVeza4hO2Q25CeivFAYHF7TGnZ9/BrenXVHH6zbR2UedoLdJGgBfnZoV7WnnxPQB5fjfv8b7MfX6kzFwl9HTxlmXPJGEEW8ys9KrQJNQAz8JR017e03QNuIukFM6lKRbvmgh+Grt1k7sbUYxy7uhq//uRj2UpSkTu12GR/6A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1794009418303244.97487161663616; Fri, 6 Nov 2026 15:56:58 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1477593.1682994 (Exim 4.92) (envelope-from ) id 1xPTnO-0007Ny-3O; Fri, 06 Nov 2026 23:56:34 +0000 Received: by outflank-mailman (output) from mailman id 1477593.1682994; Fri, 06 Nov 2026 23:56:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xPTnO-0007Nr-0G; Fri, 06 Nov 2026 23:56:34 +0000 Received: by outflank-mailman (input) for mailman id 1477593; Fri, 06 Nov 2026 23:56:33 +0000 Received: from mx.expurgate.net ([194.145.224.20]) by lists.xenproject.org with esmtp (Exim 4.92) id 1xPTnM-0007Nk-SX for xen-devel@lists.xenproject.org; Fri, 06 Nov 2026 23:56:33 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xPTnM-001LoL-6D for xen-devel@lists.xenproject.org; Sat, 07 Nov 2026 00:56:32 +0100 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6aee6923-8faa-0a2a0a5109dd-0a2a4502b0c2-2 for ; Sat, 07 Nov 2026 00:56:32 +0100 Received: from [209.85.128.46] (helo=mail-wm1-f46.google.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6aee692f-6ca4-0a2a45020019-d155802ea9e8-3 for ; Sat, 07 Nov 2026 00:56:32 +0100 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4a2072b9832so607135e9.1 for ; Fri, 06 Nov 2026 15:56:32 -0800 (PST) Received: from localhost.localdomain (host-78-146-248-75.as13285.net. [78.146.248.75]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b7e32b46a3sm19200735e9.6.2026.11.06.15.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2026 15:56:31 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=citrix.com header.i="@citrix.com" header.h="Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1794009391; x=1794614191; darn=lists.xenproject.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=u/++iBq87OEZlSRysDMyKl+pJtbf6Rmz2e5RRpkSpU4=; b=Frtb/vbV03xeCsWQg1Qx4T50CsPOMeV5fzk3bZk8YPqw8KbNDsHkzmm/tH8N0dzinv 5LNmvXRWR5u0HKV1oEylVsxtYIhZX88Gsb8olkePn4XeP0ejqNZkmxsYwDNHDWbmPtCZ yqcbLafyWNJHJJ6ZRAqOI0kjCTuwKRQa+i17s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794009391; x=1794614191; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=u/++iBq87OEZlSRysDMyKl+pJtbf6Rmz2e5RRpkSpU4=; b=v9WuDSdldINKCZIicjUAEc2lKfPWHiYmEIYuCLAIf5RwWjssDuRoiXe3j7U+G7ON/L Wd0PNti6wk9baIexr0s2a5f6B9OphD42HoGVhgWTUkTJHoH2Cr/uQZsp/BUqIncspUkA zwp5j4RcQ8kJzCToJfds/my+O9w5MLKqQQfG8UwCBREgQFIV9qn18EGZKN6VuPHTdSPl ArGdvO75z40r8wi1hVElnSWLUBwBL9nTK8ywRtBGtF8hti/ssfJtzq+6BlRGgNNrWHuN jK7JbBn4ZqYaCnR6oHyqAQwvy4im0rUMl1N1NAWWCNjF3EwCkJwmTVXZxgke19ceUn6R O2Mg== X-Gm-Message-State: APuU4Z99YTFDridSDD2H6DYgkEPE6eAOuWFJicQY8EjQlqiDiqj3BJXy rby77ue4XvE+bDYg+q9mWHdUe17ROT9wM6d2KUsRqd/RVgYXMNOnnvPOk7EOMYXCPRCYTg6wAaT ZR67xyMg= X-Gm-Gg: AYBFou2pvTJUL6+OY61c+EhR0hF0Iyw5p08PlUaXnp6ReNZWsRq4RYpMLm2EartNDQb IWgvbjLOzQSyzAlfTsiD/G9X1Os+6sX19h69O3eOOhxWJ0BbNJjodVq6CO6NlZH/yn07ez5PPrG TK0MItmomCh6iR/yGgrsZ6KAu1gTjJKEXVw3VuOzCSlKHsQS6ojJjbxFxLzaw7DH9VyExXGqyLW 5gXzs5fk71uD4+4zyzVoVAYfMYcc+MMTioO1wWZuEGwK8O6kdcEGSYhFqFP+hlss6KbqDUfO6rE AV25upougPjNeXF8cvh7r2Jk9ExVgKLk3O555agajZ37a856GMrJVv7J2Ln6gp3HNQOsP9OhUlQ cOaRTwLALfDbfBXugL2Dwk3ZoDjJd6dz8Vh53es30il+xJEbhAImgSSkBhwswxxBE4YQW9VetKm Y9Me6sPJ+Q8/y1Do9hPkquKRuc79I7tPfR6IepkVsHnrHJKTFrRPG3XHV1YpRaW8XCkCUj1Rp84 eYVpRDdV1W8V89ab+f0IJ1ZQ1Pap8ljfOJ9bvH+yIenp6jdNbeLiiNaQhPg1pOVEM3Dnf6ATNPE hm5c4bBwQjm+o0GwMXUmPbMXBwIV1WGsa9H4CEfK9iQOINqRF/SE5FH1z/m9fH9BIybLyMf4oB3 X5wEY9byd+yIScrTR6ES+KEMH X-Received: by 2002:a05:600c:8115:b0:4a2:10f9:37db with SMTP id 5b1f17b1804b1-4b8190f468amr8518525e9.7.1794009391423; Fri, 06 Nov 2026 15:56:31 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Ross Lagerwall , Andrew Cooper , Jason Andryuk , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie , Denis Mukhin Subject: [PATCH v2] x86/svm: Cleanup vintr_t type Date: Fri, 6 Nov 2026 23:56:29 +0000 Message-Id: <20261106235629.2799832-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-720697/1794009392-67ABD2AC-4DD0BECD/10/78276251493 X-purgate-type: spam X-purgate-size: 13355 X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1794009420639158500 From: Ross Lagerwall Rearrange the union to drop the .fields infix, rename bytes to the more common raw, adjust types where appropriate, and simplify some names. Adjust the users accordingly. No functional change intended. Suggested-by: Andrew Cooper Signed-off-by: Ross Lagerwall Reviewed-by: Jason Andryuk Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Teddy Astie CC: Jason Andryuk CC: Ross Lagerwall CC: Denis Mukhin v2: * Further adjustments to names, swap to true/false for bools. --- xen/arch/x86/hvm/svm/intr.c | 19 +++++++-------- xen/arch/x86/hvm/svm/nestedsvm.c | 33 +++++++++++++------------ xen/arch/x86/hvm/svm/svm.c | 18 +++++++------- xen/arch/x86/hvm/svm/vmcb.c | 6 ++--- xen/arch/x86/hvm/svm/vmcb.h | 41 +++++++++++++++----------------- 5 files changed, 55 insertions(+), 62 deletions(-) diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c index 2224f1834741..dfe6d8347605 100644 --- a/xen/arch/x86/hvm/svm/intr.c +++ b/xen/arch/x86/hvm/svm/intr.c @@ -34,9 +34,9 @@ static void svm_inject_nmi(struct vcpu *v) uint32_t general1_intercepts; intinfo_t event; =20 - if ( vintr.fields.vnmi_enable ) + if ( vintr.vnmi_en ) { - vintr.fields.vnmi_pending =3D true; + vintr.nmi_pending =3D true; vmcb_set_vintr(vmcb, vintr); return; } @@ -93,7 +93,7 @@ static void svm_enable_intr_window(struct vcpu *v, struct= hvm_intack intack) */ ASSERT(gvmcb !=3D NULL); intr =3D vmcb_get_vintr(gvmcb); - if ( intr.fields.irq ) + if ( intr.intr_pending ) return; } } @@ -122,10 +122,10 @@ static void svm_enable_intr_window(struct vcpu *v, st= ruct hvm_intack intack) return; =20 intr =3D vmcb_get_vintr(vmcb); - intr.fields.irq =3D 1; - intr.fields.vector =3D 0; - intr.fields.prio =3D intack.vector >> 4; - intr.fields.ign_tpr =3D (intack.source !=3D hvm_intsrc_lapic); + intr.intr_pending =3D true; + intr.intr_prio =3D intack.vector >> 4; + intr.ign_tpr =3D (intack.source !=3D hvm_intsrc_lapic); + intr.vector =3D 0; vmcb_set_vintr(vmcb, intr); vmcb_set_general1_intercepts( vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR); @@ -153,15 +153,14 @@ void asmlinkage svm_intr_assist(void) intblk =3D hvm_interrupt_blocked(v, intack); =20 /* - * When vNMI is active, NMIs can be injected by setting vnmi_pendi= ng + * When vNMI is active, NMIs can be injected by setting nmi_pending * and hardware will deliver them at the next appropriate opportun= ity. * Consider them not blocked, to avoid trying to open an NMI Windo= w. * * Correctness here relies on the fact that all vNMI capable hardw= are * has vGIF, and vGIF is always activated when appropriate. */ - if ( intblk =3D=3D hvm_intblk_nmi_iret && - vmcb->_vintr.fields.vnmi_enable ) + if ( intblk =3D=3D hvm_intblk_nmi_iret && vmcb->_vintr.vnmi_en ) intblk =3D hvm_intblk_none; =20 if ( intblk =3D=3D hvm_intblk_svm_gif ) diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nested= svm.c index d970869cfd96..610c8c213cf2 100644 --- a/xen/arch/x86/hvm/svm/nestedsvm.c +++ b/xen/arch/x86/hvm/svm/nestedsvm.c @@ -427,7 +427,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, stru= ct cpu_user_regs *regs) if ( !clean.tpr ) { n2vmcb->_vintr =3D ns_vmcb->_vintr; - n2vmcb->_vintr.fields.intr_masking =3D 1; + n2vmcb->_vintr.vintr_masking =3D true; } =20 /* Interrupt state */ @@ -637,7 +637,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs = *regs, svm->ns_hap_enabled =3D vmcb_get_np(ns_vmcb); =20 /* Remember the V_INTR_MASK in hostflags */ - svm->ns_hostflags.vintrmask =3D ns_vmcb->_vintr.fields.intr_masking; + svm->ns_hostflags.vintrmask =3D ns_vmcb->_vintr.vintr_masking; =20 /* Save l1 guest state (=3D host state) */ ret =3D nsvm_vcpu_hostsave(v, inst_len); @@ -723,8 +723,8 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user= _regs *regs, struct vmcb_struct *ns_vmcb; struct vmcb_struct *vmcb =3D v->arch.hvm.svm.vmcb; =20 - if ( vmcb->_vintr.fields.vgif_enable ) - vmcb->_vintr.fields.vgif =3D 0; + if ( vmcb->_vintr.vgif_en ) + vmcb->_vintr.gif =3D false; else svm->ns_gif =3D 0; =20 @@ -979,7 +979,7 @@ nsvm_vmcb_prepare4vmexit(struct vcpu *v, struct cpu_use= r_regs *regs) /* Virtual Interrupts */ ns_vmcb->_vintr =3D n2vmcb->_vintr; if ( !svm->ns_hostflags.vintrmask ) - ns_vmcb->_vintr.fields.intr_masking =3D 0; + ns_vmcb->_vintr.vintr_masking =3D false; =20 /* Interrupt state */ ns_vmcb->int_stat =3D n2vmcb->int_stat; @@ -1198,8 +1198,8 @@ nestedsvm_vmexit_defer(struct vcpu *v, struct nestedsvm *svm =3D &vcpu_nestedsvm(v); struct vmcb_struct *vmcb =3D v->arch.hvm.svm.vmcb; =20 - if ( vmcb->_vintr.fields.vgif_enable ) - vmcb->_vintr.fields.vgif =3D 0; + if ( vmcb->_vintr.vgif_en ) + vmcb->_vintr.gif =3D false; else svm->ns_gif =3D 0; =20 @@ -1461,8 +1461,8 @@ nestedsvm_gif_isset(struct vcpu *v) struct vmcb_struct *vmcb =3D v->arch.hvm.svm.vmcb; =20 /* get the vmcb gif value if using vgif */ - if ( vmcb->_vintr.fields.vgif_enable ) - return vmcb->_vintr.fields.vgif; + if ( vmcb->_vintr.vgif_en ) + return vmcb->_vintr.gif; else return svm->ns_gif; } @@ -1509,7 +1509,7 @@ void svm_vmexit_do_clgi(struct cpu_user_regs *regs, s= truct vcpu *v) =20 /* After a CLGI no interrupts should come */ intr =3D vmcb_get_vintr(vmcb); - intr.fields.irq =3D 0; + intr.intr_pending =3D false; general1_intercepts &=3D ~GENERAL1_INTERCEPT_VINTR; vmcb_set_vintr(vmcb, intr); vmcb_set_general1_intercepts(vmcb, general1_intercepts); @@ -1543,12 +1543,11 @@ void svm_nested_features_on_efer_update(struct vcpu= *v) vmcb_set_general2_intercepts(vmcb, general2_intercepts); } =20 - if ( !vmcb->_vintr.fields.vgif_enable && - cpu_has_svm_vgif ) + if ( !vmcb->_vintr.vgif_en && cpu_has_svm_vgif ) { vintr =3D vmcb_get_vintr(vmcb); - vintr.fields.vgif =3D svm->ns_gif; - vintr.fields.vgif_enable =3D 1; + vintr.gif =3D svm->ns_gif; + vintr.vgif_en =3D true; vmcb_set_vintr(vmcb, vintr); general2_intercepts =3D vmcb_get_general2_intercepts(vmcb); general2_intercepts &=3D ~(GENERAL2_INTERCEPT_STGI | @@ -1567,11 +1566,11 @@ void svm_nested_features_on_efer_update(struct vcpu= *v) vmcb_set_general2_intercepts(vmcb, general2_intercepts); } =20 - if ( vmcb->_vintr.fields.vgif_enable ) + if ( vmcb->_vintr.vgif_en ) { vintr =3D vmcb_get_vintr(vmcb); - svm->ns_gif =3D vintr.fields.vgif; - vintr.fields.vgif_enable =3D 0; + svm->ns_gif =3D vintr.gif; + vintr.vgif_en =3D false; vmcb_set_vintr(vmcb, vintr); general2_intercepts =3D vmcb_get_general2_intercepts(vmcb); general2_intercepts |=3D (GENERAL2_INTERCEPT_STGI | diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 666bcd3eb483..3e08610d151f 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -498,8 +498,8 @@ static unsigned cf_check int svm_get_interrupt_shadow(s= truct vcpu *v) if ( vmcb->int_stat.intr_shadow ) intr_shadow |=3D HVM_INTR_SHADOW_MOV_SS | HVM_INTR_SHADOW_STI; =20 - if ( vmcb->_vintr.fields.vnmi_enable - ? vmcb->_vintr.fields.vnmi_blocking + if ( vmcb->_vintr.vnmi_en + ? vmcb->_vintr.nmi_blocked : (vmcb_get_general1_intercepts(vmcb) & GENERAL1_INTERCEPT_IRET) ) intr_shadow |=3D HVM_INTR_SHADOW_NMI; =20 @@ -516,9 +516,9 @@ static void cf_check svm_set_interrupt_shadow( vmcb->int_stat.intr_shadow =3D !!(intr_shadow & (HVM_INTR_SHADOW_MOV_SS|HVM_INTR_SHADOW_STI)); =20 - if ( vintr.fields.vnmi_enable ) + if ( vintr.vnmi_en ) { - vintr.fields.vnmi_blocking =3D block_nmi; + vintr.nmi_blocked =3D block_nmi; vmcb_set_vintr(vmcb, vintr); } else @@ -964,8 +964,7 @@ static void noreturn cf_check svm_do_resume(void) =20 /* Reflect the vlapic's TPR in the hardware vtpr */ intr =3D vmcb_get_vintr(vmcb); - intr.fields.tpr =3D - (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xFF) >> 4; + intr.tpr =3D (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xFF) >> 4; vmcb_set_vintr(vmcb, intr); } =20 @@ -2542,7 +2541,7 @@ void asmlinkage svm_vmexit_handler(void) { intr =3D vmcb_get_vintr(vmcb); vlapic_set_reg(vlapic, APIC_TASKPRI, - ((intr.fields.tpr & 0x0F) << 4) | + ((intr.tpr & 0x0F) << 4) | (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0x0F)); } =20 @@ -2776,7 +2775,7 @@ void asmlinkage svm_vmexit_handler(void) u32 general1_intercepts =3D vmcb_get_general1_intercepts(vmcb); intr =3D vmcb_get_vintr(vmcb); =20 - intr.fields.irq =3D 0; + intr.intr_pending =3D false; general1_intercepts &=3D ~GENERAL1_INTERCEPT_VINTR; =20 vmcb_set_vintr(vmcb, intr); @@ -3067,8 +3066,7 @@ void asmlinkage svm_vmexit_handler(void) =20 /* The exit may have updated the TPR: reflect this in the hardware vtp= r */ intr =3D vmcb_get_vintr(vmcb); - intr.fields.tpr =3D - (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xFF) >> 4; + intr.tpr =3D (vlapic_get_reg(vlapic, APIC_TASKPRI) & 0xFF) >> 4; vmcb_set_vintr(vmcb, intr); } =20 diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index 33c85ea3bfc5..91b9581a2e34 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -105,7 +105,7 @@ static int construct_vmcb(struct vcpu *v) vmcb->_iopm_base_pa =3D __pa(v->domain->arch.hvm.io_bitmap); =20 /* Virtualise EFLAGS.IF and LAPIC TPR (CR8). */ - vmcb->_vintr.fields.intr_masking =3D 1; + vmcb->_vintr.vintr_masking =3D true; =20 /* Don't need to intercept RDTSC if CPU supports TSC rate scaling */ if ( v->domain->arch.vtsc && !cpu_has_tsc_ratio ) @@ -192,7 +192,7 @@ static int construct_vmcb(struct vcpu *v) if ( default_xen_spec_ctrl =3D=3D SPEC_CTRL_STIBP ) v->arch.msrs->spec_ctrl.raw =3D SPEC_CTRL_STIBP; =20 - vmcb->_vintr.fields.vnmi_enable =3D cpu_has_svm_vnmi; + vmcb->_vintr.vnmi_en =3D cpu_has_svm_vnmi; =20 return 0; } @@ -275,7 +275,7 @@ void svm_vmcb_dump(const char *from, const struct vmcb_= struct *vmcb) vmcb_get_iopm_base_pa(vmcb), vmcb_get_msrpm_base_pa(vmcb), vmcb_get_tsc_offset(vmcb)); printk("tlb_control =3D %#x vintr =3D %#"PRIx64" int_stat =3D %#"PRIx6= 4"\n", - vmcb->tlb_control, vmcb_get_vintr(vmcb).bytes, + vmcb->tlb_control, vmcb_get_vintr(vmcb).raw, vmcb->int_stat.raw); printk("event_inj %016"PRIx64", valid? %d, ec? %d, type %u, vector %#x= \n", vmcb->event_inj.raw, vmcb->event_inj.v, diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h index 8b351679fac5..bfe4a4521dcb 100644 --- a/xen/arch/x86/hvm/svm/vmcb.h +++ b/xen/arch/x86/hvm/svm/vmcb.h @@ -328,28 +328,25 @@ typedef union { uint64_t raw; } intstat_t; =20 -typedef union -{ - u64 bytes; - struct - { - u64 tpr: 8; - u64 irq: 1; - u64 vgif: 1; - u64 : 1; - u64 vnmi_pending: 1; - u64 vnmi_blocking:1; - u64 : 3; - u64 prio: 4; - u64 ign_tpr: 1; - u64 rsvd1: 3; - u64 intr_masking: 1; - u64 vgif_enable: 1; - u64 vnmi_enable: 1; - u64 : 5; - u64 vector: 8; - u64 rsvd3: 24; - } fields; +typedef union { + struct { /* Cleanbit 3 (TPR), APM Name */ + uint8_t tpr; /* c V_TPR */ + bool intr_pending:1; /* c V_IRQ */ + bool gif:1; /* VGIF */ + bool :1; + bool nmi_pending:1; /* c V_NMI */ + bool nmi_blocked:1; /* c V_NMI_MASK */ + uint8_t :3; + uint8_t intr_prio:4; /* c V_INTR_PRIO */ + bool ign_tpr:1; /* c V_IGN_TPR */ + uint8_t :3; + bool vintr_masking:1; /* c V_INTR_MASKING */ + bool vgif_en:1; /* VGIF_EN */ + bool vnmi_en:1; /* V_NMI_ENABLE */ + uint8_t :5; + uint8_t vector; /* c V_INTR_VECTOR */ + }; + uint64_t raw; } vintr_t; =20 typedef union --=20 2.39.5