From patchwork Wed Feb 24 14:04:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12101917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89CEEC4332B for ; Wed, 24 Feb 2021 14:17:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6678364F00 for ; Wed, 24 Feb 2021 14:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235856AbhBXOOW (ORCPT ); Wed, 24 Feb 2021 09:14:22 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:59044 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232350AbhBXOHm (ORCPT ); Wed, 24 Feb 2021 09:07:42 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11OE58LJ018083; Wed, 24 Feb 2021 14:05:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=Xpw/yhtG2V6Muoah1BF32QpLvcA/5dBWSpMW/TK0kEI=; b=Qy8goXnXpwmkDO/g1ftNVb+TGB7BN7t1Etb00bjnc3LgDJ3oa86DOWn1JhJDfmYh0NMj jhWE+jkVImW02b/uhUFdQPJkkobbfC24OxWWjz9dXylnx8uEqoimX4U0w0/6+q7w90MM NlSfzG8f0hBNtu8NOq73RhztxbgJnZ3eUDWLOiNjBwtNxm6yQ429Ekj9koPZGcmAh8/+ R6cwuZtNCWYHbA3/5S9Jnob9o5furr8C38+EcK1mpwzPYppPoCZyE6zwGP7ZGBkm29Ti 9lWiSIo5J8/Jig5SbwIDDxERvSoAC+s2YJQpQFsk4XOu4sZDinPgEXnOY5gk/Be80Et+ lQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 36vr625bwv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:08 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11ODscsj012587; Wed, 24 Feb 2021 14:05:08 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by aserp3020.oracle.com with ESMTP id 36ucb0sbe5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OOzk64z8SrG7SQ1YHK7yLQmvixHuWg2MX5Hgv94QkRkqi1Z5IsIuU0R8vDONujatmhzT+unFj9ugjSs3eomAVnX7RiNpQXaqUI5Dph8RiGFO/GpusOs6AB4pAXqfES+/PLYJCjh0jSGgmKfB/HWsK8r5Ht2M0430+loOqav3nZKnLhf6lAHAXDTukvqlsyeciqTcSkb1ziQs8Dcl+MWe9q/KKqgpeArkMCk2ansAa9n90lMrOPuDWDKC5MZ70hQhzCVc18eLV/UpS7JWWn42QWfSakINoluTQibzJ+8Vv0TxwMwBex62cB7IQYV2d+2hk33Z6+yMYntvUg0mabTDIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xpw/yhtG2V6Muoah1BF32QpLvcA/5dBWSpMW/TK0kEI=; b=jqgFH9w5lBfZiGrexmMAOvLSimaF6PS10El8bHw+Tc2F/HotOMYqnYIDKP8njWKA1BN+o+VyFJv5kJw2V/xdZDcg3MjfdKXbbd+EavGE6w7Y5GzciSRNOVohJXxMqJf2r+9egkoge0jcjH9e4C3AmurUDREx4TfJLlEBURbEwxTNfoU7vMDbGqu1NgjtAZ3hL2SI3O+plbaPDUHQgf/8Pt7yvzFFHyb7URKJOp2TuI8ca1URG7CVFE7yNI+j+6OGUoaeL1yROzHvqpDultZENSEHrvtZjrUEvnbSGAJx8HOgU9tee3kvYheCUeIBIUigOxIsJ5MpJpTvRavQO4npoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xpw/yhtG2V6Muoah1BF32QpLvcA/5dBWSpMW/TK0kEI=; b=sEnJOI6JltvaFvmr/YKPcIABeHGRSVXb6Jcn9XYYAvIF+5NpmbOXuuD3Iai4jBbzqROqf+U76fxBB8zmXqcXenDB80iTEDgmaceHcilwac69IX/dCL/xtiD4307hn7bw+zyxZjChckey2J5h4L6EtI7sNDJk12xtc9+mRO9SszQ= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2153.namprd10.prod.outlook.com (2603:10b6:4:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.33; Wed, 24 Feb 2021 14:05:05 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934%5]) with mapi id 15.20.3868.033; Wed, 24 Feb 2021 14:05:05 +0000 From: David Edmondson To: linux-kernel@vger.kernel.org Cc: Jim Mattson , Borislav Petkov , Joerg Roedel , Vitaly Kuznetsov , kvm@vger.kernel.org, Wanpeng Li , Thomas Gleixner , Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, David Edmondson Subject: [PATCH v4 1/5] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid Date: Wed, 24 Feb 2021 14:04:52 +0000 Message-Id: <20210224140456.2558033-2-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210224140456.2558033-1-david.edmondson@oracle.com> References: <20210224140456.2558033-1-david.edmondson@oracle.com> X-Originating-IP: [2001:8b0:bb71:7140:64::1] X-ClientProxiedBy: LO4P123CA0411.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::20) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from disaster-area.hh.sledj.net (2001:8b0:bb71:7140:64::1) by LO4P123CA0411.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.30 via Frontend Transport; Wed, 24 Feb 2021 14:05:02 +0000 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 944eff70; Wed, 24 Feb 2021 14:04:56 +0000 (UTC) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e68395ac-0e4a-410b-7075-08d8d8cd2f58 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2153: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wB4+ej7U034mHS0SHaNRvn8kwigRFLkUoSt+BewLaSlSYbPDShcIu54K7SpBN756L3dy2tNUKKrFEeleOD60Ral5LFQ17WBaAyY4HsEeVIv7fAj1jFelmOsLkyBHjyCvzOR+EMZWQnM1VVmhcVfQrrSujOev3FVvHfirpjvQ4wbHT2yFUdKbHLQJ0x34LfoGj7PYwB6Ow2531bWM9i1TY/QUmZgpQej3Jyce8uFUtdv12w0NtxObamdknRwuFxqyi1bQVoYP58U33xmhHMCLzbpZazzVjHsfvTDqIJO5LkEQ4g1B2eSzg+NbF1SsZHMg7hB0IMpGdhL7LeoLS5OKd42I5AE1gXoImF3jjnXi38J52lqt8c37GuXA94epnwKd3E1lTfVMQu2fXvCSH3RjRd2pm/VIseAkSSJ8SLH9PRbnjNfUorCieKaiyDmcifikU+13TLv1ciZNcql+jqCrFu7xWZ3E8Qa2ycyAORLkpr1B5wM30f9av7459Hg7mxt5leJwYIV79R/i1eN4hUan8g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB3148.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(396003)(366004)(376002)(83380400001)(316002)(66476007)(44832011)(8936002)(186003)(2906002)(86362001)(7416002)(8676002)(66556008)(52116002)(36756003)(5660300002)(6916009)(54906003)(1076003)(2616005)(4326008)(6666004)(478600001)(66946007)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2Ob9BIjMsmjxaRcKdwQ5+XOuud+YeB+17Wv8mZyJcN2KQqrOH5n+ndrW9mdRY24Fhyc52uO1+I8HT0StifxhfIwdcOYkhvsl2ClBYhRRfKqj9luKmK4vVfZhKpL5v6B1GmmPrrPdmwKg6SgGjXf52Nakk2SpptehFeQFCt6P1T5vrUtq6lw8pvXKSBjSRxKraxtFYswZDtMAoSj4bR5bqRhT2vYqRJswK/w4QNcGtVveepZRy5pFGN3SWOOa9RNeRfLhA08XYfyPQVorBLqs43bScdFHSkZkMcD8IXIDFc8lsb1ISoaSIejIw+XarawDMANqNOdhu8nINU93FhdXCkSPoOYA165ahHHKaoFwW1FkdX9gyZgkwwHefaIYv2AZqVXq/7HjTb71x2VoucU5+QnaCduvRYcuEERm6f+UN1qCHZbZVIX1ids0W4mkTszqDwbSfaIT7E7j29U6dNDrpR/wbluKu/rvsMWm0e0bPvzzEzHCo07iPiyeyM/i2JEUquT6EnT5M+ZEg/P0T/DwPIZxdc7b15BjLzg7Kla43FJv1TVskB7/ULmOH3OlTHJQr4YKC2S3EhzJJpkui/ZgMSEqfmsx+7Doq/emaUKnSUhTwXR9s2L7qcNOMh9oBwyzsyc8xtA87NpOAsxjpR0a5hBk8T9OVT3pBPz2r9DillSaQnnKX4PlJzN124hiXC/lziMe/27yX2+2aCgcPMDC+dFcmZxqJqepcioFi+W1YfSG3Ns3Jt6gbyFSwJXyftlW93labRZAgeVHf9KaWli8dnE3MdOvSEUPMEnDT3v9H0oAPBZ+hk8UieH1wrQ7OwP4FAYUaeNm4RxFAFvLb6kuLFJRBNS8ePmeHKuTxZXuAX/QiV1gfC/YQkpLAowM+SxwP3JIVHtJk/Oq6Ui8zjRmZQvg6h8qxdx5xXF3OoYfYCEfMVHLNgLmjpkAJpOJwsWs/m25TgjgyQdU3Ork0wmFFf6W3BHprBDzt0NGZiniiVMMjgKinOpqMFlceyBZnzpfcLTPwq3rx2Zr8+J+bF0ci4pCv2rKcPrMzQ6PKrwPgwQJZazz4oxKqXizQyvDer1akLX7ErA9DSkVSavB2+e2W1Qu/ov1v3AfOYF+TK4K4S37eoSBcjKIiJiw4eZyqCiclwD4VRNR1ecMWbpljGd+ZOBf7C0FulS5d8e/eKUTG1javXNvH9CSYdGNzE1pnVmKRiuLbvs5bknLMGArS+VBaysjwgjrb29lIlROxV0SioRd4CWQRiCCAAaAeH00yGH2fYYaPqSRFiVFwZSxOrLGszaunFsKR6tGWfk28eyr9WYenOOQYpjTlEvHPEhMhTkZsuCWSNJpPXeILR+dUhIWYA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e68395ac-0e4a-410b-7075-08d8d8cd2f58 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 14:05:04.9784 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ijYw2SmaYyLZPEWi++pqIU/zZoyLCGgK4Lt07nAK7IR41Ci/wbfLmGFdaupgBd3Xy0E8qLQBzCM8OkBxY0kOuLMNBOOiQI0rIzdrfTfIDKA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2153 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=966 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240108 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 clxscore=1015 mlxlogscore=999 lowpriorityscore=0 phishscore=0 impostorscore=0 adultscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240109 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org If the VM entry/exit controls for loading/saving MSR_EFER are either not available (an older processor or explicitly disabled) or not used (host and guest values are the same), reading GUEST_IA32_EFER from the VMCS returns an inaccurate value. Because of this, in dump_vmcs() don't use GUEST_IA32_EFER to decide whether to print the PDPTRs - always do so if the fields exist. Fixes: 4eb64dce8d0a ("KVM: x86: dump VMCS on invalid entry") Signed-off-by: David Edmondson if valid --- arch/x86/kvm/vmx/vmx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index e0a3a9be654b..ea1b3a671d51 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5815,7 +5815,6 @@ void dump_vmcs(void) u32 vmentry_ctl, vmexit_ctl; u32 cpu_based_exec_ctrl, pin_based_exec_ctrl, secondary_exec_control; unsigned long cr4; - u64 efer; if (!dump_invalid_vmcs) { pr_warn_ratelimited("set kvm_intel.dump_invalid_vmcs=1 to dump internal KVM state.\n"); @@ -5827,7 +5826,6 @@ void dump_vmcs(void) cpu_based_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); pin_based_exec_ctrl = vmcs_read32(PIN_BASED_VM_EXEC_CONTROL); cr4 = vmcs_readl(GUEST_CR4); - efer = vmcs_read64(GUEST_IA32_EFER); secondary_exec_control = 0; if (cpu_has_secondary_exec_ctrls()) secondary_exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); @@ -5839,9 +5837,7 @@ void dump_vmcs(void) pr_err("CR4: actual=0x%016lx, shadow=0x%016lx, gh_mask=%016lx\n", cr4, vmcs_readl(CR4_READ_SHADOW), vmcs_readl(CR4_GUEST_HOST_MASK)); pr_err("CR3 = 0x%016lx\n", vmcs_readl(GUEST_CR3)); - if ((secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT) && - (cr4 & X86_CR4_PAE) && !(efer & EFER_LMA)) - { + if (cpu_has_vmx_ept()) { pr_err("PDPTR0 = 0x%016llx PDPTR1 = 0x%016llx\n", vmcs_read64(GUEST_PDPTR0), vmcs_read64(GUEST_PDPTR1)); pr_err("PDPTR2 = 0x%016llx PDPTR3 = 0x%016llx\n", @@ -5867,7 +5863,8 @@ void dump_vmcs(void) if ((vmexit_ctl & (VM_EXIT_SAVE_IA32_PAT | VM_EXIT_SAVE_IA32_EFER)) || (vmentry_ctl & (VM_ENTRY_LOAD_IA32_PAT | VM_ENTRY_LOAD_IA32_EFER))) pr_err("EFER = 0x%016llx PAT = 0x%016llx\n", - efer, vmcs_read64(GUEST_IA32_PAT)); + vmcs_read64(GUEST_IA32_EFER), + vmcs_read64(GUEST_IA32_PAT)); pr_err("DebugCtl = 0x%016llx DebugExceptions = 0x%016lx\n", vmcs_read64(GUEST_IA32_DEBUGCTL), vmcs_readl(GUEST_PENDING_DBG_EXCEPTIONS)); From patchwork Wed Feb 24 14:04:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12101921 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30835C433DB for ; Wed, 24 Feb 2021 14:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDC8F64EFC for ; Wed, 24 Feb 2021 14:19:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234853AbhBXOQe (ORCPT ); Wed, 24 Feb 2021 09:16:34 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:34912 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232659AbhBXOIk (ORCPT ); Wed, 24 Feb 2021 09:08:40 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11OE4whM096187; Wed, 24 Feb 2021 14:05:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=uQYrDyg9OEqr6VqV3M/PSelONwF7ebIT2Lj+DkG0NYY=; b=s77RfbA9ogwgZUdmJ1jAkRcY1LJtM75IVTBSKsq0/pTfII6aHbUHhQl8zuE8rCW3FF7E 9Utq9Q4XuTBUKtKBSAw07id1TlN6XF0ypi8dTK/UBrj5xRflBq42nKYoPuUkea07ikhP vEZYPmJPMYu+RPrfrRN/UIM8UMx0pldMSOpNn2MyehYvqH2VdpN2D9+bYpWvBNmmGBgd Nxs+OWn/PMUN0jv5/dsWfUVeXRpoCdo2DZOUM6xnP+5BK4rWWMkCuZ+rEoe4pnXiptcR mJfcJVVfJNlthepL9S8v9avZO1bnStxy5tyMjDUe6BCfw557Ctw/UXwf+6IOoyw1YzO+ bw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 36ugq3hvmc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:08 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11ODscsi012587; Wed, 24 Feb 2021 14:05:07 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by aserp3020.oracle.com with ESMTP id 36ucb0sbe5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lmLT4/5XVE4yjT5CyTNAU7/gn4R1sLLtMJaFGBcqiH179RKkjwe71/H0BggxIp6Vfo7u1MRy46TdLyc3to+H70488UoArHg/4tBWJDpiQmvOjsNKAUKPIl+onxT8k9DbIyGUPdwatR58PkIM6VULUq3iWAPOnRs1Tsv7Ez71argjq8itKM9L2ceKicPPZRqbFoK/zWL4ZoKbSq4vU+7luzqp2Bas8Y2UhZ9UVJF0pzhgnKT+uW8TjPP+fEEQSr3eW0MiiLRvVBNyb6cscmtH7/UrtbCw+18ohTgp+rPbkhC9kddx2qGLLRptC+UdmbSv8rCjdXqPx+VaKcTTk0bY2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQYrDyg9OEqr6VqV3M/PSelONwF7ebIT2Lj+DkG0NYY=; b=Y10Wg8U38Im0ptVbHvK1aWHVJof3gR5pQx1YH5aq1N0ppriKLgHhcLuBBsPO1pKpT54RjngAi9nb1xhrNmXzAls3DfLHefZUyE9qKbyWW8zhdq/X8hrf9IWcppB8S7CODBWkJUxdQZxkgjTAuhA+zxvbK0NKG3N7sP8LYWyXI4+xSWdx4RU/I/KlnLoMHrz9gUpNF00Vgf8Uw3YyAn7CvWij7VVGUMxgZm0oRj24+J+zE2MfYI7HX9ePV3rWnIXVaylwLN5p7j+T4y9+LAS4w+5POuCDFW7SOFibP2dlGXkiVEHw/VxM9xyPCb2ddCSn79a4DHxnHuIb7ImFByAf/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQYrDyg9OEqr6VqV3M/PSelONwF7ebIT2Lj+DkG0NYY=; b=b9LwmBw3WOcUKHutQml3bMNY0lz2gM3RbzeJ+OIa2NoMMQL6sJA10sf6N6UF4ex6Gwvvfom84ID7tEs33OFCjAH4sDwcqIrBjCtZxvsGxq3+gGmqn7QaR2xUK7ANDFKiKQKAa6kGLYvAOO1XKp2jEOrBN5ANBoWKLLWOzmUhjYY= Authentication-Results: tencent.com; dkim=none (message not signed) header.d=none;tencent.com; dmarc=none action=none header.from=oracle.com; Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2153.namprd10.prod.outlook.com (2603:10b6:4:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.33; Wed, 24 Feb 2021 14:05:05 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934%5]) with mapi id 15.20.3868.033; Wed, 24 Feb 2021 14:05:04 +0000 From: David Edmondson To: linux-kernel@vger.kernel.org Cc: Jim Mattson , Borislav Petkov , Joerg Roedel , Vitaly Kuznetsov , kvm@vger.kernel.org, Wanpeng Li , Thomas Gleixner , Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, David Edmondson Subject: [PATCH v4 2/5] KVM: x86: dump_vmcs should not conflate EFER and PAT presence in VMCS Date: Wed, 24 Feb 2021 14:04:53 +0000 Message-Id: <20210224140456.2558033-3-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210224140456.2558033-1-david.edmondson@oracle.com> References: <20210224140456.2558033-1-david.edmondson@oracle.com> X-Originating-IP: [2001:8b0:bb71:7140:64::1] X-ClientProxiedBy: LO2P123CA0070.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::34) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from disaster-area.hh.sledj.net (2001:8b0:bb71:7140:64::1) by LO2P123CA0070.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.31 via Frontend Transport; Wed, 24 Feb 2021 14:05:02 +0000 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id fd0bc691; Wed, 24 Feb 2021 14:04:56 +0000 (UTC) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2782f92b-03c3-44ce-14f4-08d8d8cd2f5e X-MS-TrafficTypeDiagnostic: DM5PR1001MB2153: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:389; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tJbd52yp7g90w74kay3VpOhKI4of1O5JOuMSNA9TN8SYLlw/0GYci+l0L3TcQS/7B2xt+nD923v8wW6gRlXUkemFMY87/z1qOm8RWO1n9oW2+jIsTOuoRDVelvWJM8SnbXeVmlY23R5FFgnoOlGt/2g1KzgI2p6tBhls99qzwPmSeEnN+yiSG5GXp+qRHjLNFtTUVLEDBep5S8qlHSIzg0kX8TIzh8sozvG76sjpzElowBDz09w+HO6/RGoScw5msGlKJKaPsRUXv9mH3lzvcX6QFlukFH4p3hpUa1gxaHW1XdPCwa2nW0mcsTJwRQJ5keu/6QxPD3bvkQjafexSZHdGfhMxi3bvNXzzER4AU6xDh98ilN+5GIGz5insBtwRGzpi2/dMMD7z826E6/cmG9PHNjr7eYWlyFb+OTXXSa5BRhefjSa3Vu+R9lOYommcZh3dnUkyT6aJPa50aC2VCXIrMLdL8hjUG50Uq7xafGh7S+i97EgV8N2q/98CBEQuM1S9ZdJRIgd5Rp/iPB5M+w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB3148.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(396003)(366004)(376002)(83380400001)(316002)(66476007)(44832011)(8936002)(186003)(2906002)(86362001)(7416002)(8676002)(66556008)(52116002)(36756003)(5660300002)(6916009)(54906003)(1076003)(2616005)(4326008)(6666004)(478600001)(66946007)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0TduX1DUD6kcMJg9Yc2LXYVa6KVTIfZs6QDrUPAuhFuKGSCMGHZx7zpk6FYxL6SSoaNgJHT5+SlkuYBAII10rBS32LXLMUhxvpxvaKcwDHqqi7RM1htMYh53jkfgmEEDJtpXGtBs8bLqp1t5Ny2zWfGR/JP81MeIouE36HhHTiPh5WL1wF7SiGXCTKOJMn4ifwL5CT4vTZa9Lai3kA9fferMh+2r3pGxg/5djrCbZdJLj75S5q5c7c7A4mrxNk+kNHfT7xI0qSmH7xlbVs+UYfok5ODb72bksS2UGr1T+TiPAUcVwWAbknf+a1GioK4F26WMOM4VAr/j/H0JiuaE/agYTHX5fz7vgbA9gXZ3gzBtIvppFtDOg69vJ6j20OZSKpKG9+1cfyMI/CK2LG4CuXTgId8MFhFlarxNS3Jl/S7xOYS0CSIaguUeg4SoHq0hsmwjffvOWl2KG0oi8ACH2RFfKmcjbPT2mjfzONobWHDw+gHKOEoADnva6NcV0OmAdmAPbmmhzgt8mRcMv2TzKPTQdxe1TDnQOrbirPcGxAVDJI0g+fDjSm3kiywjxtmdLqMYbHViBW0VfGKiMJp4bBRXZqGxqShCXUiFVo8/CqKbv9vuZT2yQjS1bmqw3rkIZLdat+/dBRj8LFDjVGnc4wPWkmGINCXAT9R/0D219D1PjOeb6PTlW5SST+uxi+zBLFxgm2skV5Ze/hY+/i+/p50k+POp1ncSXBxQNW8rKV3DfM2bspVBxxxWvB9ciORg3x7ICRmAq0ZPHLcy/apIcqP9D7vdT09+M5jPnWtIkbN9RcfNRcMyBQ+yE50cgt0Ofj3PRSvXgYekhUWdSwroQhQjdbWbcpqrceiNVlKaCxnU6Ua+Dg0ATLQdTQyDTAQRbFx3ZBEsua4VtzTPHOVI8fflM8B7DLB5QC5T9wsfGYpRKbfuQVhqAhcvAIW1l2iuuaVZwTddqGh1p9F66Sb9dqWyBXdtYTAb1hcthRdAL+0vYbFzgKEmezDKBC2ImfD4T5iyhNYB3N2QApK8tjR/luZA8OP8xG6TxZJ77/zXla5mtC+mu8X9GRjhEDvtZkPGSiZ0E8L9sbs0AXpH6uGv70QeYMvI+GSl2Q8ON7vnUKkAdOom8b13jDUosUrDXyokbTHhWZbSOIm6dgFYJ2AdUnZEWafG3Plv2MPNGwtFBxqMClBhgq6eUgdDJRI0HuEEL1pXdCqSvmzvo8RpAKXNJOxh7V7vQZaS0PAqWVPAIH8JE+QkF0R0Y1aGKnxyh+GMJln1xfZizePfJRIw17KiHqxUlkF/PCd5b8zF1ed+zPdD0lu/ruofqMNubE+IujANwUZ6dIDbAkB3xVBwDlNtkA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2782f92b-03c3-44ce-14f4-08d8d8cd2f5e X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 14:05:04.8384 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gx+sYxSj1d0dQNvLHGHKcLm5LTa9ruF+zyo2cW2jyIQIeySa23JPJx0t/BB7g/AWA87sM4s3VA6zSSK9jd0ZdqjUDpiPILwVDmwmB9mryoA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2153 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240108 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240109 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Show EFER and PAT based on their individual entry/exit controls. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index ea1b3a671d51..90d677d72502 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5860,11 +5860,12 @@ void dump_vmcs(void) vmx_dump_sel("LDTR:", GUEST_LDTR_SELECTOR); vmx_dump_dtsel("IDTR:", GUEST_IDTR_LIMIT); vmx_dump_sel("TR: ", GUEST_TR_SELECTOR); - if ((vmexit_ctl & (VM_EXIT_SAVE_IA32_PAT | VM_EXIT_SAVE_IA32_EFER)) || - (vmentry_ctl & (VM_ENTRY_LOAD_IA32_PAT | VM_ENTRY_LOAD_IA32_EFER))) - pr_err("EFER = 0x%016llx PAT = 0x%016llx\n", - vmcs_read64(GUEST_IA32_EFER), - vmcs_read64(GUEST_IA32_PAT)); + if ((vmexit_ctl & VM_EXIT_SAVE_IA32_EFER) || + (vmentry_ctl & VM_ENTRY_LOAD_IA32_EFER)) + pr_err("EFER= 0x%016llx\n", vmcs_read64(GUEST_IA32_EFER)); + if ((vmexit_ctl & VM_EXIT_SAVE_IA32_PAT) || + (vmentry_ctl & VM_ENTRY_LOAD_IA32_PAT)) + pr_err("PAT = 0x%016llx\n", vmcs_read64(GUEST_IA32_PAT)); pr_err("DebugCtl = 0x%016llx DebugExceptions = 0x%016lx\n", vmcs_read64(GUEST_IA32_DEBUGCTL), vmcs_readl(GUEST_PENDING_DBG_EXCEPTIONS)); @@ -5901,10 +5902,10 @@ void dump_vmcs(void) vmcs_readl(HOST_IA32_SYSENTER_ESP), vmcs_read32(HOST_IA32_SYSENTER_CS), vmcs_readl(HOST_IA32_SYSENTER_EIP)); - if (vmexit_ctl & (VM_EXIT_LOAD_IA32_PAT | VM_EXIT_LOAD_IA32_EFER)) - pr_err("EFER = 0x%016llx PAT = 0x%016llx\n", - vmcs_read64(HOST_IA32_EFER), - vmcs_read64(HOST_IA32_PAT)); + if (vmexit_ctl & VM_EXIT_LOAD_IA32_EFER) + pr_err("EFER= 0x%016llx\n", vmcs_read64(HOST_IA32_EFER)); + if (vmexit_ctl & VM_EXIT_LOAD_IA32_PAT) + pr_err("PAT = 0x%016llx\n", vmcs_read64(HOST_IA32_PAT)); if (cpu_has_load_perf_global_ctrl() && vmexit_ctl & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL) pr_err("PerfGlobCtl = 0x%016llx\n", From patchwork Wed Feb 24 14:04:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12101911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3DA9C433E0 for ; Wed, 24 Feb 2021 14:17:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 983D264EDD for ; Wed, 24 Feb 2021 14:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235793AbhBXOOJ (ORCPT ); Wed, 24 Feb 2021 09:14:09 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:57164 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbhBXOHI (ORCPT ); Wed, 24 Feb 2021 09:07:08 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11ODxM2F101307; Wed, 24 Feb 2021 14:05:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=x7jHoxULYNkvYJ3IUGDkH0gVV6qT/WpX1EUS0pOtzr0=; b=LJNcX2Oss4F8zqP+M+Et6Gv/+GS7tuRJEyIZvekbq7eyYxSk+EKDKAKJw2vA1994rrka 8ccmCW4ghtTc+ggFHu2gvOdp1KE0KVbh/WXTlfBDCJdOYmbt7qJaXeIIeeWCqotl+N+R 6aWYk3JbKLP5YY32syjPuT8czO/tpgS17P6dh+nBosORky0fpW6+ilFRrqddl4lovX2e nid1KEIoVR0FQDDH8jbvIMXjPC5RiZ+6YJlF+02JjJOIuqwrKocCyWsNnQy7T7UGvCf7 MRkf8GLPMDRZF3KcY3m2+A5ahniaT1fPBI8WFFJXG+Y8GLycz7sZWQVKi3s8BJYNrY6f ww== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 36tsur31us-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:09 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11ODscsl012587; Wed, 24 Feb 2021 14:05:09 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by aserp3020.oracle.com with ESMTP id 36ucb0sbe5-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GoBqzNiZkAtaUrnZJb0RQOgmC1gTFfGyWwfA0vsDl0Lq6PkJps77EvQATc80i6VDlycMWHoF6sSVOHneUzjl4i8WdZyIybVHQuBmkQJU3IbmoHOImTF7ONpLdY04yMcYVL9Z3ABDAmggQM9DponJuDsvfwNTzC6aETWmLB8fSZbOrESESg6Mtb+gjOtwdYFfY96n7F6FavGAwlYtiI1PWsG47rZ7t2xP5sAlKzdCYZC29BgdE+W+nGuTEpxIpchsKkvr0uU4SDRTOeME0SxUFdRqWRtAj0rgpD/hyu0qq0Bs/k8THOMppL34NYbxDn2VZrsK3wb2IuyrhyaS8y0awA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x7jHoxULYNkvYJ3IUGDkH0gVV6qT/WpX1EUS0pOtzr0=; b=mGTXsxmslbmWuMwLAIRgAIzmow5eBf+RT2N6MhS/ELFwU5VzUPeT98+OloE6rvg+WrwvOIME0sWJlaDriDQ2MQ3oJipZmQjWRWleuQ3anIa5lMEwEBzT82WZQ9gIKOlW3IjXTG7YmjZHx2neaFbFNxbR8p4ilDT7G84UV5Pc1CcGh96PdbFGZYOaZaLHUJUvFIJ668KlMmQ1/6LvnYqFPWKDpi3GKIhtb/8sJx0QIst1mwRErONxQwFvQN1TX7v0UGQL9W1vANodg2vxqfDW2FUrBE/Ju11iK+wU6LkW0zqqfYBmb/zw4HvIFnzDMY4AssIWid9DrjVq4Lq6R6ElkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x7jHoxULYNkvYJ3IUGDkH0gVV6qT/WpX1EUS0pOtzr0=; b=gZDWOStG/iDnTxEiuKtWUhGxUZbi/sleCrPAQ3ZMQsF5DCvMmqEaFzk2bUBd++0E6nn0LNidl2nlXEFetCr/EoOW2e3UFEQ5WrraCzaPY63dsRfeyCMjMkYBgst1ZnbpgstKGHg8S2EXjT9hbNcDxIYhXEzE02dYbvNCCs4Vk3A= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oracle.com; Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2153.namprd10.prod.outlook.com (2603:10b6:4:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.33; Wed, 24 Feb 2021 14:05:06 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934%5]) with mapi id 15.20.3868.033; Wed, 24 Feb 2021 14:05:06 +0000 From: David Edmondson To: linux-kernel@vger.kernel.org Cc: Jim Mattson , Borislav Petkov , Joerg Roedel , Vitaly Kuznetsov , kvm@vger.kernel.org, Wanpeng Li , Thomas Gleixner , Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, David Edmondson Subject: [PATCH v4 3/5] KVM: x86: dump_vmcs should consider only the load controls of EFER/PAT Date: Wed, 24 Feb 2021 14:04:54 +0000 Message-Id: <20210224140456.2558033-4-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210224140456.2558033-1-david.edmondson@oracle.com> References: <20210224140456.2558033-1-david.edmondson@oracle.com> X-Originating-IP: [2001:8b0:bb71:7140:64::1] X-ClientProxiedBy: LO4P123CA0256.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::9) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from disaster-area.hh.sledj.net (2001:8b0:bb71:7140:64::1) by LO4P123CA0256.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Wed, 24 Feb 2021 14:05:04 +0000 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id deb71382; Wed, 24 Feb 2021 14:04:56 +0000 (UTC) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f38bf87-174e-46cd-c3ac-08d8d8cd3041 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2153: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sPqeS+6ToiFEZuVYTSf0IqZ+/ZoemTy5VSQmDBNHqTEYdcNu7/mrWrOiCl2DVO3RAsX2Rp90sfhxanVfZ47mXCfK/wZXGkhiBSddOAquveAGJ/JL67OJxsVEKG2SSKq/y2GYpldaWtrCNkg15hgltYf0ngz3MDjZkSmlEdXQFfEc8R95TMGJp0xA/OsU/ew6O9elXdHdis5BYxQ+fRyL5pZbAIDr+MPOBKqAp88v0tVlXfaT3noR4KKiXsrHrr3yjetkSJr9ulOYHoMVlSQLRb50VzOctOys9IMt8pzOPL0Ksi0xntR4F7OIaTq0JDGFcmKDQxAsgS0y6eyLxpz+M4wuqiNVOw82gyjgRFByy4iIzzW9n7lEr0mUCo95tOLgYidSlAUXobAXnCXv3bEE/IFNqRt5PssOgN7HorW3MBILHo8oDhT2GInJHIl/zSmoVaFUrLw9eHDcGDBf5Kb4olkpVeViZYIr6WyQ7A2F5xxVjdRWRQsv0FQCft8ssWlrf7Dnjzp+PKiQ9Cebv7+r6A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB3148.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(396003)(366004)(376002)(83380400001)(316002)(66476007)(44832011)(8936002)(186003)(2906002)(86362001)(7416002)(8676002)(66556008)(52116002)(36756003)(5660300002)(6916009)(54906003)(1076003)(2616005)(4326008)(478600001)(66946007)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bIKOIn97McR3uY5OYkSG5mxiOkvmVKpocPOwRxOLevhfd6jnsf2yxQUi3JnzzWe5NdKXogzg447Kgp7l6chfN7HMdiL5/2c8qvfz3z3idzOH2DFWMEF6S1etBj3QpSBZMYHguEkpDHth02KKOiy4uW+hR72DzHh7RzLZK+Obj2MyqYmg8FJJC9tPEYvzYKnjiMbO38T2+DuMXOVEy187d94+SWCsWZboDCQDtOe0u7f5bq0ARWV770HbEDYkAfG2pp1Uiw+klycvpWp0uyxhsY7yzZbnYVQ9BNKr++wjTBkIwGX7mYevnkBD4FLZ6cn1buzIN9/FFHcf9NtGdG8QhfgOxbMIQtwB05DzLlaFFNQ+jVRj6r1x+1fUZmEGL5PqpLa4sqsLpB1+OxRvXP4MnIenKGxSNbCwyh+c7pEKH1JHDVkHvlQiUo1HtQk5O+ASsIKJ4gq5G2fGtOIbA3OZnpoQM49WvszgdEnsAXu7VWNYegdrJ8X/kbowTyX/4Ufr0dR6N2mH0S86haWA0S7KNVwWIEilmv2LVBVDR4FHvRL/ku1VvJx/qk1A28oQ8OhSAl4xGGhTO8COL1jS68faQzB6/3W0qGYmx/AoSO9Q/xeStqaU9tjQW+R/kNsrN+DgX3VRc7Lbtg+Lsqk+br2Qt37a/zg2rUHLwrTKk6k1pA6xp9506XgQYLmheWK0RdTugz28fnTsXWdfEGNvYlTGmoSgntYWl501jdGYouK650vrUVBDe7MfnsKrmTFA4WxsBzx05NzOh22zHpkGLfnmlIbH/xOFd6SCjiDbrx8SLVrBDnI2Ry3MNkoZity7Xm5nqw0a2vg7yrzEZJeZca6O7hY576dY2e51F43wWKT/AImd9DjWiXINW+ufDgOF58qgDUFZfS3xpSiasF0MYKz5G1lX6JUFVs6Nw4ytknrSTCSgG+6uqwIzAPnkPhSNZM7Gj9HNXS7OgP77dYAuWvRVfrxzOd5zi1P0NPLDp4H43058iArAiEDAYwY/ieqLyjMvEj/ynnAg+QjkvANbB2sY7fwhkjkaE8Rz797Ru52ZwnLrTGr5p4uwsLDa9KVWbHHN6pqdVDoqUQThdpVAOhJEk1ZPl/X9Ii7Zuh1Nxb2yl7lSV2EURa4ZdCBaymTzYBLwSyy/pGExMjMcshiA8U982ZxOiKgmzxi1nWNrTH7hGh4pzw6nmWALxLVnMeQFYq3zlRz38hyhStXwWMqn54KcJGfaOd0bTA+FG/RLchIyOLySCjhq6QuF3hrcd+jqhifApIXGKsgdEbbhXiqvlQcYZzTySVxUvnG+b84REEcKTuI4qBtDmhWU0ROZUh7xhz0UczGaR28JQ9/5ugv+06xXOw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f38bf87-174e-46cd-c3ac-08d8d8cd3041 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 14:05:06.4275 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: M4V98i//vRWz+NMn040OL0breRYto4WxK5b8ylk3yc1LC7dGmUC9re3seWG5QQ9o7zdHa6vPtoLDAF4mhl6X1tJ2G5gmKbGe7KvE5KXoAiw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2153 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240108 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 mlxscore=0 malwarescore=0 clxscore=1015 phishscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240108 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When deciding whether to dump the GUEST_IA32_EFER and GUEST_IA32_PAT fields of the VMCS, examine only the VM entry load controls, as saving on VM exit has no effect on whether VM entry succeeds or fails. Suggested-by: Sean Christopherson Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 90d677d72502..faeb3d3bd1b8 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5860,11 +5860,9 @@ void dump_vmcs(void) vmx_dump_sel("LDTR:", GUEST_LDTR_SELECTOR); vmx_dump_dtsel("IDTR:", GUEST_IDTR_LIMIT); vmx_dump_sel("TR: ", GUEST_TR_SELECTOR); - if ((vmexit_ctl & VM_EXIT_SAVE_IA32_EFER) || - (vmentry_ctl & VM_ENTRY_LOAD_IA32_EFER)) + if (vmentry_ctl & VM_ENTRY_LOAD_IA32_EFER) pr_err("EFER= 0x%016llx\n", vmcs_read64(GUEST_IA32_EFER)); - if ((vmexit_ctl & VM_EXIT_SAVE_IA32_PAT) || - (vmentry_ctl & VM_ENTRY_LOAD_IA32_PAT)) + if (vmentry_ctl & VM_ENTRY_LOAD_IA32_PAT) pr_err("PAT = 0x%016llx\n", vmcs_read64(GUEST_IA32_PAT)); pr_err("DebugCtl = 0x%016llx DebugExceptions = 0x%016lx\n", vmcs_read64(GUEST_IA32_DEBUGCTL), From patchwork Wed Feb 24 14:04:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12101915 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33910C43381 for ; Wed, 24 Feb 2021 14:17:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E026964F10 for ; Wed, 24 Feb 2021 14:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235820AbhBXOOO (ORCPT ); Wed, 24 Feb 2021 09:14:14 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:34100 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231840AbhBXOHV (ORCPT ); Wed, 24 Feb 2021 09:07:21 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11OE4Vwp095615; Wed, 24 Feb 2021 14:05:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=4EFv8kvbeqN9dX6NwGyvbIfSq8g5QrDUdhVAur6jsNE=; b=c+y2jE4pgUv+N3bgbGUGsjtpJAmBRjPPrbOgmSA/JEGVV4F2cwEWaOsXCqHIjPNPXTvN l5vTLgYqJ5IBjtg4kA17eQH5HSVu+DnLe7Xg8891lQ2UBmM8il+bOMiBw6SdY9PWTbUY ytVCpsAPZrxduVt8EZgOtWIIgTI3Fn6IeWI6imX0VGnBKswACPHxHIcgWTQthCL+4Jvx UObtE/eU8gaGfUisyKDBND2fG8+lYh7lc2qvDL5A3ahdSJeqOAVedivcW0XAbN4ojqfI vX28a5kM/F8T0oHj90D0sV+91EZoJr2VqsBSpfA5BE18uF0BKZvA55qKamUc+MNXx/Jv 6A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 36ugq3hvmn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:10 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11ODscsm012587; Wed, 24 Feb 2021 14:05:09 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by aserp3020.oracle.com with ESMTP id 36ucb0sbe5-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lB7CuPbozbuH0Pg4zv3TRYq47dWXUs8yKgbb8N2OdkMyFTdZDeOHUL358sGc8O3xYWtju6sIrGOCiIM2kPbreTtec2qQwX/aMBSWy5xtQtvsi6gEV85PMR6kdVKkVyqMLU1TbVvC7ElbgVm5w4YS2kcXvNss1hbBbDZ53gYSMAMXbY9+H7ae/YkEbWGdnbKmHfJQwwGqOnI0PLGhc12E84A8sKBWecuGsasOwjKl8e6MTo2Zxu1TNvReT/3EecXGnhWzdkda5BOsWBiRkRgYc1avPiu/Syhd2HiK9HTGzjN4qd1XkZUvdtaWJjwmKA/dXnM43gX3P0BScQfduJ6WTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4EFv8kvbeqN9dX6NwGyvbIfSq8g5QrDUdhVAur6jsNE=; b=e9QAnr9dW8qxtLkyuGy3jT7zuWnZQB4LWqnAzKhisibr7etMbaajj9eicIdePm/eyb69cJ/ul+l+7OoT7pX3MW4G1Arys5iQEZURBFWdpglNnEMQSmCz1JkcuzWMRBRvpGLbG53k3xEZ/8RsnvcqfBTV11IKk43SKykqow69wVGwEoMIjEa0Pw98Gj5wEORZfgVBCIVoXoLiWxpmoPMc6LFTMvtVyeNqZSbrir5pht8aYI3Ju9WuA/j8Hf9ZrP89XadEXqQkUBwZvblKdXBUkBN/axlrQ+ILC7cwuanUpzFN1icASmD8gLsLinhZw49JF3r54TnxdJOPdHtc18jrsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4EFv8kvbeqN9dX6NwGyvbIfSq8g5QrDUdhVAur6jsNE=; b=fvDfp8EwDkMA3tx3JrYzujpquIAWdDBcafDfjOvE4Hj7ngcuxLsYhFwjBLLcNp6JZIq8MxCtbhlL/08At2Zgwc6CuQeBJ8d7KSqWD8rmNDemjoAfwHdGCkNJeVZyEcmYCgCrGN4+PWBQ46W5fHW56VR0t+BoBIHNsa9CMhtc9pQ= Authentication-Results: google.com; dkim=none (message not signed) header.d=none;google.com; dmarc=none action=none header.from=oracle.com; Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2153.namprd10.prod.outlook.com (2603:10b6:4:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.33; Wed, 24 Feb 2021 14:05:07 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934%5]) with mapi id 15.20.3868.033; Wed, 24 Feb 2021 14:05:07 +0000 From: David Edmondson To: linux-kernel@vger.kernel.org Cc: Jim Mattson , Borislav Petkov , Joerg Roedel , Vitaly Kuznetsov , kvm@vger.kernel.org, Wanpeng Li , Thomas Gleixner , Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, David Edmondson Subject: [PATCH v4 4/5] KVM: x86: dump_vmcs should show the effective EFER Date: Wed, 24 Feb 2021 14:04:55 +0000 Message-Id: <20210224140456.2558033-5-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210224140456.2558033-1-david.edmondson@oracle.com> References: <20210224140456.2558033-1-david.edmondson@oracle.com> X-Originating-IP: [2001:8b0:bb71:7140:64::1] X-ClientProxiedBy: LO2P123CA0070.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::34) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from disaster-area.hh.sledj.net (2001:8b0:bb71:7140:64::1) by LO2P123CA0070.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.31 via Frontend Transport; Wed, 24 Feb 2021 14:05:05 +0000 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 54cc0463; Wed, 24 Feb 2021 14:04:56 +0000 (UTC) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bca8fdb9-fa4c-41b5-b971-08d8d8cd30d1 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2153: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FZrxy01BwzZ2fZjNGRDmHbxHe0Uq67vSj2mwZmhmUu5icf7DWSXVPIX1i5SQ2RXusqwKkOlooEn7tBd1hpJiJ1B1QlSTrhhpy46T3B7O+LFGwj4WKRjorMP3KoWOtYESzP9dWrFh+Rrzdo7IqhEqYNktfYQKfvNohbFBq65Jb7ddcWiAOm2xoSWhbWAQlDkt1rz8fKeEokKAxlPsuArYxEYl+CXudZYfzkNHHDY8a5y1RzTtQL9mKhG0fejXlqOg6Q/UxB9Q0JdnrEnkxfGre6fa5PLVsfwa/1nPlmkUiWCy4nxOvBMV6FjaubBwgcycZNjpC0W2DRxgLme+dnZEI0QVesMKTPgfrXEMh1dW93pbZWqESBugKiracV66ysNX2TnlbnaqY08tYdY1xDXnv4s4lxtWEA7JR/4I2ln6A3EOhtCDV63JuCMb38ShO2hxLwKZcS2r1XuK07m6R7WyvV+duCDlVW3wqduT5JKgi8SjCqRU06QDcET3Y5AHnS5gkcRyAGU6VWL/NZlGMYNpUg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB3148.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(396003)(366004)(376002)(83380400001)(316002)(66476007)(44832011)(8936002)(186003)(2906002)(86362001)(7416002)(8676002)(66556008)(52116002)(36756003)(5660300002)(6916009)(54906003)(1076003)(2616005)(4326008)(478600001)(66946007)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: UOzKmhofidDxRLIR9ifCyyyvyIhopyEdRqk+aAlveUauC5QN0DtMrnoe72E3H+NLYyc7X6lppSzmAfOHWWqfax/qs7DAotDicCWbbPCr+aZXlQsUXH0qYIuNAuOILPcA1rj/pwrASWEi+0mPETbqFbrVMlQWvkxBxKJKE3LRh9AeMYZtOYYoSj/EWrQiIXgUU9OVFnvy8+g/ZIcTllgp0+FAD88hhQweeOTE/2HpUu8mDnwUsF2+qYXR/P1V0Y91vjpadFCV/kl26+h1RuS1FZFzwj3dhejv9WpCuIZIET8f/Bo1xwtw/qSds9F0J/bw65+Uu4vYQFB76Kd60niC4eTq8keg0J8nJhNPxWXmt86dBLgHvg6X8ncW5q/O+bi1Shh4Qg/PhYWH9Spa8cZSS+gMQ6QEK3C0+ytlHpgDgqCMDXvx7HZDIbFMKg3gwnKKl87NDidzb33Dp5XEGzA8qJH2sfYOE70kQG9y6oMDPVb3Op8qxu8dhSOMgWntk13LspSgJ4Y4uzaqIbFdpJIXzqlA86Icl7rb4c/XatNFkgD+Fj4SzE7l9ciW4ObMkXCGy43M3A476wgPmPsDdqa+qe63mh3Iy9xa9/ELWBjZlKOAi4IJUTPo2UxW5r9A3Tq9CSgz1lcnl7Vu/RPHiU8oqXVG4OF38Q7o5M47LGJJ8nGHfZusuyamN+EBtYzB41ZpXrxVinhsqTNE0pYV22y9hzzQgOu3Ec+LPIJUBTCcNllQI535vdFvxQzieGOwnqWXJK9CghTJOutuK11+VhwQDwxQmRaZwt1MPBGXBls9RP8+5CVVL9ZMf3X19nSpj2G2dZwYwMiUzQfgroQdZAg/e1bMkWB2TsnEEJjPnu41luQtwzxn4EcBpPhMYbX4EHioFlv2OAlzvG+ZEfQE6In5YOBmlY6uXZXb/P4Kz9fwGr+4HqbrTOjNnNIPwxwOy0Te41sXdT5ZKeNP1OCvE/gPnUswMXrhX5pIAPAfJ2aHBSxRXyAhGwCk+jSHYcAQH2kjyOcnh2kwZXGGngfvhP00hp1qtnYzpMFTKp6bElrQhTn0YIf08G9Z4NqlqgSgr1zyXJHi1eDrSvYJ3g2pBO39dlbOdPaMA6WLZ+lPHmBv1vj/PIJAasPcZLD5A6q9TM4LzJvxXemcxicTy2nOoa9KmRbdv+Oj52U6FXzn0QkLH8zK7JLsSFoE95niY5AnXARoMo6jnTu2q8N1WsMGGEAMW3yKgvpi5QiPBAv1l2k6LAs4Q2FFCV0tj3BFbM1lm1fBPPt8Xg6gi1jBvqgDj49CuHj38JSgxXwiPmOpJpp87Lo7Myxo0ef+/v6BzIjenUmFZ4Uwk/mR22P4SqHi7rODYQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bca8fdb9-fa4c-41b5-b971-08d8d8cd30d1 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 14:05:07.3820 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lLMofpzdzG4LiZsgCXDBMPrBDjYA47VYMV9vX35POCxB1NrnsCLML1PrpeEyu8KFXDK2OIgJ+qCN12l/SWGHX0Pgx+wFDogd2GFeCZfJTo4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2153 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240108 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240109 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org If EFER is not being loaded from the VMCS, show the effective value by reference to the MSR autoload list or calculation. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 20 ++++++++++++++++---- arch/x86/kvm/vmx/vmx.h | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index faeb3d3bd1b8..b9bb66ad2ac4 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5810,11 +5810,13 @@ static void vmx_dump_dtsel(char *name, uint32_t limit) vmcs_readl(limit + GUEST_GDTR_BASE - GUEST_GDTR_LIMIT)); } -void dump_vmcs(void) +void dump_vmcs(struct kvm_vcpu *vcpu) { + struct vcpu_vmx *vmx = to_vmx(vcpu); u32 vmentry_ctl, vmexit_ctl; u32 cpu_based_exec_ctrl, pin_based_exec_ctrl, secondary_exec_control; unsigned long cr4; + int efer_slot; if (!dump_invalid_vmcs) { pr_warn_ratelimited("set kvm_intel.dump_invalid_vmcs=1 to dump internal KVM state.\n"); @@ -5860,8 +5862,18 @@ void dump_vmcs(void) vmx_dump_sel("LDTR:", GUEST_LDTR_SELECTOR); vmx_dump_dtsel("IDTR:", GUEST_IDTR_LIMIT); vmx_dump_sel("TR: ", GUEST_TR_SELECTOR); + efer_slot = vmx_find_loadstore_msr_slot(&vmx->msr_autoload.guest, MSR_EFER); if (vmentry_ctl & VM_ENTRY_LOAD_IA32_EFER) pr_err("EFER= 0x%016llx\n", vmcs_read64(GUEST_IA32_EFER)); + else if (efer_slot >= 0) + pr_err("EFER= 0x%016llx (autoload)\n", + vmx->msr_autoload.guest.val[efer_slot].value); + else if (vmentry_ctl & VM_ENTRY_IA32E_MODE) + pr_err("EFER= 0x%016llx (effective)\n", + vcpu->arch.efer | (EFER_LMA | EFER_LME)); + else + pr_err("EFER= 0x%016llx (effective)\n", + vcpu->arch.efer & ~(EFER_LMA | EFER_LME)); if (vmentry_ctl & VM_ENTRY_LOAD_IA32_PAT) pr_err("PAT = 0x%016llx\n", vmcs_read64(GUEST_IA32_PAT)); pr_err("DebugCtl = 0x%016llx DebugExceptions = 0x%016lx\n", @@ -6008,7 +6020,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) } if (exit_reason.failed_vmentry) { - dump_vmcs(); + dump_vmcs(vcpu); vcpu->run->exit_reason = KVM_EXIT_FAIL_ENTRY; vcpu->run->fail_entry.hardware_entry_failure_reason = exit_reason.full; @@ -6017,7 +6029,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) } if (unlikely(vmx->fail)) { - dump_vmcs(); + dump_vmcs(vcpu); vcpu->run->exit_reason = KVM_EXIT_FAIL_ENTRY; vcpu->run->fail_entry.hardware_entry_failure_reason = vmcs_read32(VM_INSTRUCTION_ERROR); @@ -6103,7 +6115,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) unexpected_vmexit: vcpu_unimpl(vcpu, "vmx: unexpected exit reason 0x%x\n", exit_reason.full); - dump_vmcs(); + dump_vmcs(vcpu); vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_UNEXPECTED_EXIT_REASON; diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index 12c53d05a902..4d4a24e00012 100644 --- a/arch/x86/kvm/vmx/vmx.h +++ b/arch/x86/kvm/vmx/vmx.h @@ -541,6 +541,6 @@ static inline bool vmx_guest_state_valid(struct kvm_vcpu *vcpu) return is_unrestricted_guest(vcpu) || __vmx_guest_state_valid(vcpu); } -void dump_vmcs(void); +void dump_vmcs(struct kvm_vcpu *vcpu); #endif /* __KVM_X86_VMX_H */ From patchwork Wed Feb 24 14:04:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 12101913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41860C433E9 for ; Wed, 24 Feb 2021 14:17:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1204A64F0E for ; Wed, 24 Feb 2021 14:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235840AbhBXOOS (ORCPT ); Wed, 24 Feb 2021 09:14:18 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:34096 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231721AbhBXOHV (ORCPT ); Wed, 24 Feb 2021 09:07:21 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11OE4iVa095666; Wed, 24 Feb 2021 14:05:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=uvFeAWBXTu0gwLlT2ZXkYAyKT7A3jO9ZRxUCFG5wi0o=; b=nDg6sACJo7pJ/iWW3cTtdJvkgr89JF1pXEbW8f2Yts4pavNLE2oZc640SICaiM1TM5fh OCHlyxGjphp3XFOBl83KhFf8a9iKdMfWWVrW+l0/4bw9kIpb+kNAAo9Eb9es/2d1auUn MWyY9AnVo5GmII4bGP1/YR+tXkV0wEq/3gPCoZSSiGFEkazaRZqRr90OomzMCg9hyNTi LdOULr0gXlPZWxWls9kE3nmCE2q1DANrs3qf1x2HaumaFOMjxmhWKXVYgxlrOKksmAta Xi8pUbXpY/Z4GD//pgoWl2BBayVFTFna8XvOGHVg7fUhKgYFCetY8jRxXmdHr0Pf7q1Y Mg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 36ugq3hvmu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:11 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11ODscsn012587; Wed, 24 Feb 2021 14:05:10 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by aserp3020.oracle.com with ESMTP id 36ucb0sbe5-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Feb 2021 14:05:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAYNVWFhI/Qoc8Kqj9TY93xKzFkAC84jzzIwjL+PepD+smTurKdpYuVtXL/ziWFiAzdqfX0FesZuDcRZj3G4P0esMdHEPakRm20iW0HI+XzHtBCl/2XYphinYkyp32M5KcleH7jh/WQOokNDGubeNWx59C7cNKG3XaddQW+MLvO1wxQdH8ZyAOh2ORB2Y8jHv5gpsOrp3P8av8GcFGEn0Y1M39mEHOuFsDdxGe2eUeFYB+tWIBURV0fB5KPEnsidT+JZBrZ6znn6kU8cYxKks+qX1bxEaTYa1mGzY1xMtBLZ1byVpXMDWR+y/166alyTnMWkbDUMiKLBKVCgskYjOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uvFeAWBXTu0gwLlT2ZXkYAyKT7A3jO9ZRxUCFG5wi0o=; b=SkbNjpZS9TUJ5LdK9JFeZ2h2mYj2tzJkMhEg7g04KKdAAnDGdLWR+rfeYVU35KD0bHW2kd4RB/qsERpCSi/uudlegMTTotZv8G2glN6b5TqeaGHO20F8wlEkuIRhUGgKKViBi379ZA7fIwewNQjpwE31wTQU2MzmLhbD1h5oAuQOYTf/UdMbTdsgaFZ8xqPYX1mEsnMnAh0Pysu1RlFKot65fwei7ZBTGheQkPJLBR6GhGXgBofIaOTl1Qetj+ovnXxDPOFJ4HxLtcZzKzdxFom+a3cSt7N0W9ovs7aO9m+vcwZlVM9B1WmMR1/XUjUoGAyeKChMLtn1eACu1YzlIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uvFeAWBXTu0gwLlT2ZXkYAyKT7A3jO9ZRxUCFG5wi0o=; b=YKBmOptsszHSVN8fO0Ko1VRkxAhWbJsqz6qFfoWEGZiB0McIrx6ghpybRzTYxgBgSN20UNgOho7did47cqlYj4iHXruMnuDARZfWCCqDjezVEt8Le0DiFMSl4lrN/t73o9B6iwwSSuzb65cmQVZXZDCIplgOn4UtpkBe1VNNjck= Authentication-Results: zytor.com; dkim=none (message not signed) header.d=none;zytor.com; dmarc=none action=none header.from=oracle.com; Received: from DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) by DM5PR1001MB2153.namprd10.prod.outlook.com (2603:10b6:4:2c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.33; Wed, 24 Feb 2021 14:05:07 +0000 Received: from DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934]) by DM6PR10MB3148.namprd10.prod.outlook.com ([fe80::f871:5965:2081:3934%5]) with mapi id 15.20.3868.033; Wed, 24 Feb 2021 14:05:07 +0000 From: David Edmondson To: linux-kernel@vger.kernel.org Cc: Jim Mattson , Borislav Petkov , Joerg Roedel , Vitaly Kuznetsov , kvm@vger.kernel.org, Wanpeng Li , Thomas Gleixner , Sean Christopherson , Paolo Bonzini , "H. Peter Anvin" , Ingo Molnar , x86@kernel.org, David Edmondson Subject: [PATCH v4 5/5] KVM: x86: dump_vmcs should include the autoload/autostore MSR lists Date: Wed, 24 Feb 2021 14:04:56 +0000 Message-Id: <20210224140456.2558033-6-david.edmondson@oracle.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210224140456.2558033-1-david.edmondson@oracle.com> References: <20210224140456.2558033-1-david.edmondson@oracle.com> X-Originating-IP: [2001:8b0:bb71:7140:64::1] X-ClientProxiedBy: LO4P123CA0411.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::20) To DM6PR10MB3148.namprd10.prod.outlook.com (2603:10b6:5:1a4::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from disaster-area.hh.sledj.net (2001:8b0:bb71:7140:64::1) by LO4P123CA0411.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:189::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.30 via Frontend Transport; Wed, 24 Feb 2021 14:05:05 +0000 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 4dda7ddb; Wed, 24 Feb 2021 14:04:57 +0000 (UTC) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e1254655-00cc-4c95-e595-08d8d8cd3103 X-MS-TrafficTypeDiagnostic: DM5PR1001MB2153: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bKqK9tgthmwX3h0/dSjJMEfwmpcj9pJQA6TwY7jjrv0KAXKpICg/dqK8YDj9PMLH01+pGr+HU0GTStG8hzrsc95HkLt50i97O4pr0Xo8R9Kf3BF+EOFXEhGDGAb4oYtQRk+3SbAzLG0zXjgCR3NGpCW7r/3kzG+MVlXPsIrHlffUO65FN5FkF6E0K7aqiV+3bhk3ikkrvOVVwI6Cc4u1pGa3WJ6pQHLrZhfyEDw+Ib8yxvNDvRTLGfRT0GiiQmwDZBsA6EUWOttzDA4g5JU2hVBfyWMjnlOIAweBWOyGP8VwLeXwKGUsE+hdAbLhLcj86I718R3+5yRrMW53Wow1triAThspBBF9jsz4ZWtX60NTmmIh/tE1EKe1r2yQYQoawPlBMmFjmW8kVoW/kzPrbq7jBHJc5onqJp1ILwkgmibH6casjd02tX1E65PA83zQ4YxUaGHvYL75tqYH/6nBV2+HFTTrlE4XYzHZpzK0GOOydl4q2qipJdrF3XJGijlji8er5ZB12gI64+ADePYmoA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB3148.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(136003)(39860400002)(346002)(396003)(366004)(376002)(83380400001)(316002)(66476007)(44832011)(8936002)(186003)(2906002)(86362001)(7416002)(8676002)(66556008)(52116002)(36756003)(5660300002)(6916009)(54906003)(1076003)(2616005)(4326008)(478600001)(66946007)(107886003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vEkkc6SRxA1mTn1zd+SAlgepokDtcKbba+yzzuBuWxsB5CbBu9oeEsFV6WCKWzIQ5hJ0CARdhALV6b4Q7wM2RXO4EHCcF2sfHUDwfoSF/QSMnuTanbUOHWXBRxoVXJPWRgn4VI5UF1GUtIZUQm4F+Q0bfQClcrrD65GvJLOw0C5GHtfkj2VYjesEC9ZnC936HrFyeK1yAeWyKagttUOMynYit22de6tfioDykPKJy7v6wjpZUAUE6zMLfGN5QzjMlYNWqC+DZTaHkE5GEYGB+3MJjBarq82cUoaGgyfnIABCGprmrPOzO1Lh6x0n5L99XWcJCf+zsV9uW+OSafpwJeHov4OW1fI3R43OTUmXoIeyab8jeVJyfO+BwxypGdTczl5rNVZNr0+/sdDDcBLTivRehLrOjdXfwf5Jdu0L87pPQuTogcJAa9psWyLUwVfiWqv8CMifL931QY5cq2fehX9UjWLjftqH/ensJp2l9KgneoWLk0qtxVLVxgRQ/3hEcvy0QpHmuQqGDqxwR0ISB3J1GNBokE6FZagoQsXsXiWCgTseIIs57vBSLtzc595EJKxSiaNZepfJhcYXrmG2m7VtK9JxHe2OBVU1LTuTr1VRD/VGbLps8VjMfIwkpuZUU7sofTt39RQwsJKuHpVuraIq7eF3mIBeeYaGOxXXYxbDWUy/NdIGW1ZYkskS7EknRtxXRoy34W4O7SKNpPq1+tq84alcjtcU+dMFo1Q35KS6cHVrp3LiZnnJB7FafXv4AMk2UZjgLpmW+fmF6BYa54QKCQd5QGn7b1Jqyq5+KprrN5D7bdI8nQUP3g4t9Z2c3P97qOxbfaUbdPoKaIrYYUTWG9TKpEmX5gHqqH9LrOqvKAclUVVgvsdqJvhc16zDeGDM0zYydLNF/IRCFopUsb1ki994IDbiNmDYgI+pSNwODubSsKNPYLONiiJUOT1Rr1Cxuh8JZqjPXm0sNn5uqpxZm1z+WRnCDY/NaLL//jaNzCKysQFmIsjGnJiPE/ZzAZJ5HIm4D+9V1CY3YnCUzWy+jjGey/NlmXMNR1ALlMUDiiaEQVDz4xVy+UnUTPPoWCEy6EnE+77XbxUPNqKKdedhW8QP+/Jq55LlCi9dZ1kzGlEOQ/mtPwxWQvKS8JPaAPZQH1mpateE3HWK9Yf1bokRSA2GdXKRMo4aYY6f2SsO5/3F41MFv92cVvQDy8DGNVBEiSKXGX40vT72zd8gGsKE5hE5ZTIeOZ2urvLroIWDMWdXP54bYW4RS7oSsHodsqAB260Sn6FvAsI7aiOX9H91rU6F03oIgnSZujCxCWrQhXkJyeORhSPvAbkQpfRnu+oa8CcBuKlf3lyzhP48oQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1254655-00cc-4c95-e595-08d8d8cd3103 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB3148.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Feb 2021 14:05:07.7218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /FQS24TtsUswtqeqUTOvHh9FRwjwFbfrfp3ADyi/ak2bOcXsRhYOyuUUsbMgtg8lIa1/dRDplwL+o8s8Ez+zsfLuxDGK4a4CBaHYwp4o29c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1001MB2153 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240108 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9904 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102240109 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When dumping the current VMCS state, include the MSRs that are being automatically loaded/stored during VM entry/exit. Signed-off-by: David Edmondson --- arch/x86/kvm/vmx/vmx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index b9bb66ad2ac4..de42b8c14a38 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5810,6 +5810,16 @@ static void vmx_dump_dtsel(char *name, uint32_t limit) vmcs_readl(limit + GUEST_GDTR_BASE - GUEST_GDTR_LIMIT)); } +static void vmx_dump_msrs(char *name, struct vmx_msrs *m) +{ + unsigned int i; + struct vmx_msr_entry *e; + + pr_err("MSR %s:\n", name); + for (i = 0, e = m->val; i < m->nr; ++i, ++e) + pr_err(" %2d: msr=0x%08x value=0x%016llx\n", i, e->index, e->value); +} + void dump_vmcs(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); @@ -5891,6 +5901,10 @@ void dump_vmcs(struct kvm_vcpu *vcpu) if (secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY) pr_err("InterruptStatus = %04x\n", vmcs_read16(GUEST_INTR_STATUS)); + if (vmcs_read32(VM_ENTRY_MSR_LOAD_COUNT) > 0) + vmx_dump_msrs("guest autoload", &vmx->msr_autoload.guest); + if (vmcs_read32(VM_EXIT_MSR_STORE_COUNT) > 0) + vmx_dump_msrs("guest autostore", &vmx->msr_autostore.guest); pr_err("*** Host State ***\n"); pr_err("RIP = 0x%016lx RSP = 0x%016lx\n", @@ -5920,6 +5934,8 @@ void dump_vmcs(struct kvm_vcpu *vcpu) vmexit_ctl & VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL) pr_err("PerfGlobCtl = 0x%016llx\n", vmcs_read64(HOST_IA32_PERF_GLOBAL_CTRL)); + if (vmcs_read32(VM_EXIT_MSR_LOAD_COUNT) > 0) + vmx_dump_msrs("host autoload", &vmx->msr_autoload.host); pr_err("*** Control State ***\n"); pr_err("PinBased=%08x CPUBased=%08x SecondaryExec=%08x\n",