From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.33693.1602479501478494403 for ; Sun, 11 Oct 2020 22:11:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=CARjZhzm; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) IronPort-SDR: 3A5DOsEdGJgBQUZjHpd12eZQLxJNaD5kJz/seFBVlcghtW19iSnFwYxTEzH8EuAYUlvcN1gmsN j/HRwJ2YluyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="145555350" X-IronPort-AV: E=Sophos;i="5.77,365,1596524400"; d="scan'208";a="145555350" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2020 22:11:40 -0700 IronPort-SDR: Wr1YoeGzs+op9q0kuZNAGNI56RJFGDZ6wBSgRXCh/W9EfJNy45xYvVoNeR9VCkMsWzdTzcg9qF MBiyBjh97dGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,365,1596524400"; d="scan'208";a="344731110" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga004.fm.intel.com with ESMTP; 11 Oct 2020 22:11:40 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 11 Oct 2020 22:11:40 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 11 Oct 2020 22:11:40 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.47) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 11 Oct 2020 22:11:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VPQLXPA4p6dKDFBvSr1Z69OkTRYUL829Pc0SbOwj99nf6rhGZS3SNTd4ACSrimfcgdP9+ZXVgvRRgU3DjUeRhV4ANrRJwEo8lLUR9hKdMhbpblupDEJF6GZ9KG9yIBf+vllSn2w74Hr0J0oYnVYOGpHIFw4lJgjXkrc4PYo93TkD6aZIK8hlAQ7TsZFTiIueQhutWU44QlhbOH7rnFiB5x65O2y5A0iUbV+4rzM4rhswF2FXU3kWa9ZIRHQruesd4MNXiJxwSXCcUGfJole3oKdiUfr+DUbMAxOOK+1mEq9KA+AV8pJWcHATu3mPFxrmbAChtP3yBtGoZZqIbUzLCA== 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=bky8pkrG55WVxom046Uq7AuPAMO0DMfv2vRHGfeeyEk=; b=WIpWFjm2SCO4+LCKgZSjBDzBy33ODM2aSco6EFwDoOqBMxo6O6BBPDSz6eJPC30LuKQXUhBuJyS9prVnyryMpL2xryM+61x2we+V4pSMs8aDL1G7/QwlOZEX+JiNbrAw9cVtFpG+9uknFPoiPQSmlH9vKUQtv5RKyxCEukuX8YQdWMyssGxWerRBq7SjUXRr7iIgl22uN8EMi134KdXFB/2Q0b+qheFNu78jOTzH6el6ZcWpgD7EtzW22lhcMZ/X82QRLdpSdKAFrJVSifxXyfww7yh0z8v6g2KIvwMan7PeYan/6fAFniSVGWDc3CQYlRus2Ct0K3JRQ8Z+evG1Rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bky8pkrG55WVxom046Uq7AuPAMO0DMfv2vRHGfeeyEk=; b=CARjZhzmCxi1tq+sH5Kzw7N62vjxLM9NsCIRSsyj+ptNH6tM4c3OeuBTs2pBzudQFeftrz1gc3MZn+ApJcwuXoSu8s/KrK/+Q+6ikWA0tVD6gkHT+LV4hdBmPsQiosmJ4MmIMNuQpefCJmzt6EFEvrSgrd0LRMJDbn7feKlyKVg= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by CO1PR11MB5092.namprd11.prod.outlook.com (2603:10b6:303:6e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.29; Mon, 12 Oct 2020 05:11:38 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::9804:f9c4:d0d7:9961]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::9804:f9c4:d0d7:9961%3]) with mapi id 15.20.3455.029; Mon, 12 Oct 2020 05:11:38 +0000 From: "Ni, Ray" To: Tom Lendacky , "devel@edk2.groups.io" CC: Brijesh Singh , "Dong, Eric" , Laszlo Ersek , "Kumar, Rahul1" Subject: Re: [PATCH 5/9] UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT Thread-Topic: [PATCH 5/9] UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT Thread-Index: AQHWnx+LUc8pf/Ch2EyqD6BCRdsvjamTbadQ Date: Mon, 12 Oct 2020 05:11:37 +0000 Message-ID: References: <2c01c358aea038dcc09eb1b46af19fc1278adb93.1602346027.git.thomas.lendacky@amd.com> In-Reply-To: <2c01c358aea038dcc09eb1b46af19fc1278adb93.1602346027.git.thomas.lendacky@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.194] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 37e70be5-252c-4a19-ebef-08d86e6d4c24 x-ms-traffictypediagnostic: CO1PR11MB5092: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0GQuEfruSzog4NvEwIzLoVn2gU2taz3NPeI8loFC/sESCzw00AAVKu5Bzddpt7JFfkHMZOt751hZvn4Y4EsbBQbEn9B4nYzifUZ0Jpn4qd7m7QVRGc6n3S0O1mYNaOvMLUeN8pG9SGETiCMn4SnsyHtj9Adda0MvlhFUXpf9ryo4IBepGv+Ie24kFToc/nIDF1gZt3xVxxMXru1EYL7YZzZT7n4UtUa0cWqrYG/1I0DjJO1PeHTp/hi++Ox6NUno+SNaoOhBMIJ+NFt/r056Y17zuBHfO/OtWu+zDEapwjLxTKPk5EbHvTyKMVjM9KdIRebnNPVUW8ahibUansV7PA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(366004)(39860400002)(346002)(376002)(136003)(396003)(86362001)(110136005)(71200400001)(83380400001)(66476007)(76116006)(66946007)(66556008)(54906003)(52536014)(19627235002)(5660300002)(66446008)(64756008)(8936002)(9686003)(186003)(2906002)(26005)(8676002)(33656002)(7696005)(55016002)(6506007)(107886003)(53546011)(316002)(4326008)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: AaZqNxg570LipAcNc+77pA8M6i7CKYEiwETx40l/Wqi4WCD7Dc6BEfynkwIscipFBHUrRW6k/dqiVbc8+Uy/0+ENA5/OKGR35XOgNRgxtCiNNiIh9tHFSBeQYMpvCFmsXm42RUVIW1E7j9PWfYCK1cvItFRiJBwkrH3cLLArASzkipw5qP88HCBeM9BByKEE3BZtsS8e76NLFvmaMwPD0oPWpiFy4AXodU2EDhwhV++xEUaO8T5vPrE36GUp5ZmKOtciDQKx1lFOJSelNj/rLkvxeUQHkC1SAMq/VdGSq1VT3BkoxG0I6btnQ7fgiHSDzhT1aZ2o/F2Ak+ZPR6j+utFoTPRgh3XYsa2gVscNrx00hDiaaftOqXHJqw6SXGvC8XsfoS23jE5d4C6eaS2gEJ6Us8aPXJ6tF1CSVv9oV2kXsCHg3e1icOhpk/saCh6X0O60VNAac/yO62VE9ZuaPJtuqtR0vPsqQkehwzpYWJ9Rc6VBIawOnLP0fPAjt2NdBSDczR3sbVtv6l4wZ5OEDBJlDsTAwqfOVqbQI0NWgEvEQj4I0vRFdVmSxQrikxl7b2U/iT6RGVPOu0ebtvMR4wABuHIvX/WLNgVMDdk/T1gyEyglecuMiE3ffjm7uZsG+QOZcHt/xvI823OWI4XQuw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37e70be5-252c-4a19-ebef-08d86e6d4c24 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2020 05:11:37.9400 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OIuTxpgcT0mtTVq2YRwFp84sorkt1ABruf2kIDz6Dpa77RaurW/8I55H5BIidjaZEbktEX52qtJ9ZLUWGOA2xQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5092 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Acked-by: Ray Ni > -----Original Message----- > From: Tom Lendacky > Sent: Sunday, October 11, 2020 12:07 AM > To: devel@edk2.groups.io > Cc: Brijesh Singh ; Dong, Eric ; > Ni, Ray ; Laszlo Ersek ; Kumar, Rahu= l1 > > Subject: [PATCH 5/9] UefiCpuPkg/MpInitLib: Set the SW exit fields when > performing VMGEXIT >=20 > From: Tom Lendacky >=20 > All fields that are set in the GHCB should have their associated bit in > the GHCB ValidBitmap field set. Add support to set the bits for the > software exit information fields when performing a VMGEXIT (SwExitCode, > SwExitInfo1, SwExitInfo2). >=20 > Fixes: 20da7ca42a33 ("UefiCpuPkg/MpInitLib: Prepare SEV-ES guest APs for = OS > use") > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Signed-off-by: Tom Lendacky > --- > UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > index 5d30f35b201c..5532a1d391bc 100644 > --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > @@ -533,6 +533,12 @@ BITS 64 >=20 > mov rax, 0x80000004 ; VMGEXIT AP_RESET_HOLD > mov [rdx + 0x390], rax > + mov rax, 114 ; Set SwExitCode valid bit > + bts [rdx + 0x3f0], rax > + inc rax ; Set SwExitInfo1 valid bit > + bts [rdx + 0x3f0], rax > + inc rax ; Set SwExitInfo2 valid bit > + bts [rdx + 0x3f0], rax >=20 > pop rdx > pop rcx > -- > 2.28.0