All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vaishali Thakkar <vaishali.thakkar@vates.tech>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com,
	roger.pau@citrix.com, wl@xen.org,
	Vaishali Thakkar <vaishali.thakkar@vates.tech>
Subject: [PATCH v3 3/3] x86/svmdebug: Print np, sev and sev_es vmcb bits
Date: Wed, 13 Mar 2024 16:41:30 +0000	[thread overview]
Message-ID: <f71fc11c1411f17a3570e3f8c8c088c1276b8552.1710347950.git.vaishali.thakkar@vates.tech> (raw)
In-Reply-To: <cover.1710347950.git.vaishali.thakkar@vates.tech>

Currently only raw _np_ctrl is being printed. It can
be informational to know about which particular bits
are enabled. So, this commit adds the bit-by-bit decode
for np, sev and sev_es bits.

Note that while, only np is enabled in certain scenarios
at the moment, work for enabling sev and sev_es is in
progress. And it'll be useful to have this information as
part of svmdebug.

Signed-off-by: Vaishali Thakkar <vaishali.thakkar@vates.tech>
---
Changes since v1:
        - Pretty printing
Changes since v2:
        - Minor changes in pretty printing to make information
          clear
        - Improve commit log and subject to include _np bit
---
 xen/arch/x86/hvm/svm/svmdebug.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svmdebug.c b/xen/arch/x86/hvm/svm/svmdebug.c
index 0d714c728c..9d3badcf5d 100644
--- a/xen/arch/x86/hvm/svm/svmdebug.c
+++ b/xen/arch/x86/hvm/svm/svmdebug.c
@@ -51,8 +51,11 @@ void svm_vmcb_dump(const char *from, const struct vmcb_struct *vmcb)
            vmcb->exitcode, vmcb->exit_int_info.raw);
     printk("exitinfo1 = %#"PRIx64" exitinfo2 = %#"PRIx64"\n",
            vmcb->exitinfo1, vmcb->exitinfo2);
-    printk("np_ctrl = %#"PRIx64" asid = %#x\n",
-           vmcb_get_np_ctrl(vmcb), vmcb_get_asid(vmcb));
+    printk("asid = %#x np_ctrl = %#"PRIx64":%s%s%s\n",
+           vmcb_get_asid(vmcb), vmcb_get_np_ctrl(vmcb),
+           vmcb_get_np(vmcb)     ? " NP"     : "",
+           vmcb_get_sev(vmcb)    ? " SEV"    : "",
+           vmcb_get_sev_es(vmcb) ? " SEV_ES" : "");
     printk("virtual vmload/vmsave = %d, virt_ext = %#"PRIx64"\n",
            vmcb->virt_ext.fields.vloadsave_enable, vmcb->virt_ext.bytes);
     printk("cpl = %d efer = %#"PRIx64" star = %#"PRIx64" lstar = %#"PRIx64"\n",
-- 
2.44.0


  parent reply	other threads:[~2024-03-13 16:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 16:41 [PATCH v3 0/3] Misc changes for few VMCB bits Vaishali Thakkar
2024-03-13 16:41 ` [PATCH v3 1/3] x86/svm: Drop the _enabled suffix from vmcb bits Vaishali Thakkar
2024-03-13 16:41 ` [PATCH v3 2/3] x86/svm: Drop the suffix _guest from vmcb bit Vaishali Thakkar
2024-03-14 16:04   ` Jan Beulich
2024-03-18  8:04     ` Vaishali Thakkar
2024-03-13 16:41 ` Vaishali Thakkar [this message]
2024-03-14 16:05   ` [PATCH v3 3/3] x86/svmdebug: Print np, sev and sev_es vmcb bits Jan Beulich

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=f71fc11c1411f17a3570e3f8c8c088c1276b8552.1710347950.git.vaishali.thakkar@vates.tech \
    --to=vaishali.thakkar@vates.tech \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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.