From patchwork Wed Mar 13 16:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 13591578 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72325C54791 for ; Wed, 13 Mar 2024 16:41:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.692630.1079978 (Exim 4.92) (envelope-from ) id 1rkRfZ-0000Yi-8p; Wed, 13 Mar 2024 16:41:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 692630.1079978; Wed, 13 Mar 2024 16:41:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rkRfZ-0000YY-5I; Wed, 13 Mar 2024 16:41:33 +0000 Received: by outflank-mailman (input) for mailman id 692630; Wed, 13 Mar 2024 16:41:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rkRfX-0008Dq-8h for xen-devel@lists.xenproject.org; Wed, 13 Mar 2024 16:41:31 +0000 Received: from mail133-16.atl131.mandrillapp.com (mail133-16.atl131.mandrillapp.com [198.2.133.16]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8b1cb283-e158-11ee-afdd-a90da7624cb6; Wed, 13 Mar 2024 17:41:30 +0100 (CET) Received: from pmta13.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1]) by mail133-16.atl131.mandrillapp.com (Mailchimp) with ESMTP id 4Tvx9Q14d0zB5p8C3 for ; Wed, 13 Mar 2024 16:41:30 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 02c8ef692cf34864b336a41beefd05b2; Wed, 13 Mar 2024 16:41:30 +0000 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" X-Inumbo-ID: 8b1cb283-e158-11ee-afdd-a90da7624cb6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1710348090; x=1710608590; bh=FMitaZpjptJvXQpvaxxHZ/aFZkkeDw8TY9xvhcTGIUY=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=NO1+mgHmuB344VkLQH3vs3M/sf9zVdMkXS3QvrvUEe8PmF3CnoqMWI+nSm6U0P0UK jA0YXSdhIbIVxDtAZRBx0Qu2zpqxsQBHg1yPPA/GvGn2yfT5EtPKYx2vFwyXxDs0QR 4ADyf893c7HoLOzTw5Kq46oKQ7VqX8zBc3DCoSCFI/EoJgpNW/i6FSL7cxUpiAB2N4 uIS3ejWHNAZGJxOcg27hCjrcnP9uzgRaTRVWt9dxXDq08JnKDoP/q2LUHHP94I56hQ KwA4EygUDkKE3VPF7BxSRzfBPODe6I3LLaQBLGKTTAIRv/XvEUbsY25QY8Vsfmvu1A CnSyhULIQN9cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1710348090; x=1710608590; i=vaishali.thakkar@vates.tech; bh=FMitaZpjptJvXQpvaxxHZ/aFZkkeDw8TY9xvhcTGIUY=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=VBN6sibtXiH+TGClEeQQ3pqVM2hAo59ljZXcskj8Jkqux+uFWpvwmDmt+La4+y7oc YH83TUYMtJfCnoW2VeCf2vhifyKCUj45mWCHE3djhI+nWyNXcROj2mIciDWdXctTVE nfe1V58e1ZK6xkIjPRZAH4sNQU/uthsOH+ZCNBKBkft/7zY3t3ci1FqWtGSBDrOIRS G8JvAjfMk416jVBc7jKIryxggD8xNAmqfl9hLI4XYU/DUmPXuNhApcNPwl8Pv3jyiH e4+e0ojS/QyLUci6tkwW+26avYtzttuJOs0IqaARLmXoMzl3NwD7a4htSrEP5C9Z6w 0dkrNKcRGWD2Q== From: Vaishali Thakkar Subject: =?utf-8?q?=5BPATCH_v3_3/3=5D_x86/svmdebug=3A_Print_np=2C_sev_and_se?= =?utf-8?q?v=5Fes_vmcb_bits?= X-Mailer: git-send-email 2.44.0 X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1710348088991 To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, wl@xen.org, Vaishali Thakkar Message-Id: In-Reply-To: References: X-Native-Encoded: 1 X-Report-Abuse: =?utf-8?q?Please_forward_a_copy_of_this_message=2C_including?= =?utf-8?q?_all_headers=2C_to_abuse=40mandrill=2Ecom=2E_You_can_also_report_?= =?utf-8?q?abuse_here=3A_https=3A//mandrillapp=2Ecom/contact/abuse=3Fid=3D30?= =?utf-8?q?504962=2E02c8ef692cf34864b336a41beefd05b2?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20240313:md Date: Wed, 13 Mar 2024 16:41:30 +0000 MIME-Version: 1.0 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 Acked-by: Jan Beulich --- 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",