From nobody Tue Nov 26 22:36:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46101+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1566301166997320.6837257909059; Tue, 20 Aug 2019 04:39:26 -0700 (PDT) Return-Path: X-Received: from NAM05-CO1-obe.outbound.protection.outlook.com (NAM05-CO1-obe.outbound.protection.outlook.com [40.107.72.65]) by groups.io with SMTP; Mon, 19 Aug 2019 14:36:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mee4MBfAT6fl11KnEgMmTKUqQnY7jsbDIczryI+hGyeJ6zT96KbA/rK56JD0pdlj05tZ3GuOYhtul2ir5a93ECQ57bLL1GABPyZTu24JAsLa/P8/vUnKY248E8Xh2QwmHlpa8mILL6BKKWOaU1Asj4rnfujSAlK7sJ/I7scOdptfWlXBnZh1iUyqLgiB90TY0PHms660p0TtSLBbzQtnNS25oQSOJXkfVFj1WCRav2mN/19LIDJ6TQL+n9MQ/8iRhwjDhVEHjToElgqAAqcrPCG+qbpE6eblGUmDeucBkdwz+awXz+WkYc7NkchgA7XJ/pPm91s4owk4N5rSyP0URg== 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=HzeyOZv+9ZTEAaSI0TSOYwgHhugLQInBarkdo6XaHO8=; b=Ei158BSujZYtJ9fCmhC3YN6jj8iaop+O0zoowYEKNURbnnmXGAeYev28f0vWp+xVsBYgl/SaO9CAiyhCQ8hYRDEt3/S8vBCMND7aherVPEup6/JOLR9cBYWOzOfV7cV/6iI17hpycEp4Ds5fxA92mU6AG55a0zjmfOPFFn19EvzfxXGaEQQop/LUm9N+oaaadVAxAupSEUX0jeQZY+0wm5+RnQN0dUwrDXF+ho5hWbX0DzIdFRAYW/9eP6zVg4Ko7bkIRIOEcQEtzriZ0sZ0DvCezD4sY/86R+8o2tZ1sWSiAmau5aax1KVHLm1y6YWeAavBQLnt3SV3lWaPW2cxag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from BYAPR12MB3158.namprd12.prod.outlook.com (20.179.92.19) by BYAPR12MB3112.namprd12.prod.outlook.com (20.178.54.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.20; Mon, 19 Aug 2019 21:36:12 +0000 X-Received: from BYAPR12MB3158.namprd12.prod.outlook.com ([fe80::39b9:76bd:a491:1f27]) by BYAPR12MB3158.namprd12.prod.outlook.com ([fe80::39b9:76bd:a491:1f27%6]) with mapi id 15.20.2157.022; Mon, 19 Aug 2019 21:36:12 +0000 From: "Lendacky, Thomas" To: "devel@edk2.groups.io" CC: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Michael D Kinney , Liming Gao , Eric Dong , Ray Ni , "Singh, Brijesh" Subject: [edk2-devel] [RFC PATCH 19/28] UefiCpuPkg/CpuExceptionHandler: Add support for INVD NAE events Thread-Topic: [RFC PATCH 19/28] UefiCpuPkg/CpuExceptionHandler: Add support for INVD NAE events Thread-Index: AQHVVtYf7g+wz1CqikuhdQftiH7NcQ== Date: Mon, 19 Aug 2019 21:36:12 +0000 Message-ID: <6638cbe8e793f831830aafe56998e501819e3a24.1566250534.git.thomas.lendacky@amd.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN2PR01CA0031.prod.exchangelabs.com (2603:10b6:804:2::41) To BYAPR12MB3158.namprd12.prod.outlook.com (2603:10b6:a03:132::19) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a9ce00c9-c18f-4e49-9ede-08d724ed419c x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: BYAPR12MB3112: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2000; Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46101+1787277+3901457@groups.io; helo=web01.groups.io; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mc8Onnsmsn8grk0YqFE0iIFz7G9aExGmoGNMggIUfi1/bHUsiQ8znQNn/DkqsZvhUin6BZ1hlK1Z47vp+e51YKK7Sx+rg8bLw4hSlQgjLWGQW+SM8fh505kHNT8v9vJTJYFIrp5EOCzddpM07y9kem2dXJRVkAPbh64rgzchYSfNeYrGGUfssizK129zVWQUdB0E6zykw1woQ8/oYA4EjVaRjQTAWSnGGqrrRhJZQYrdwPzh91cVZNTKOrJZaYBeTWR+ncxkrmjeUKOp7b4fzu8ovifJuFsUJ6oZuv0Em5f+eR8KeI1fy6w3q7+AMZ2hIeeFuVskcs8ka4vG+4tlo6r2uhxKO2wq+RJgB75iXoisXsaVg/uIOysL2Bjhmtp1T49FYxWoZ/g57A4R7D1+eHlDOQ/WVytAKziRPQijDFU= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9ce00c9-c18f-4e49-9ede-08d724ed419c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Aug 2019 21:36:12.6035 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TnTt/BINneiUR8orx/CB3ng5mEpXPqh6n1EMiuDSw1VWOCR/pqb3XlKlnr3Ars/oymaSJGW/EqRHhT8fe2Q7Aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3112 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,thomas.lendacky@amd.com Content-Language: en-US Content-ID: Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1566301166; bh=UWKosrM0rGNd0hjAqcmKYl7EmR9MfEnNHq7gU8pASKQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=KNV7XX59FZGlHk88Xfad1SW5DksAn1sBgY7sbBnDCSUn9OcDkm/8SQ82bdjwIefGvJm 1iCTmey8P/fzCptUFabBIbcDNPoJAa+D3jT63z+PQ6KE4MSgZk/SsNIFIHaIXSdldgNrP pkTMb3mZRCqEkQPkVPXPGjL2QcGdYohfCs4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Tom Lendacky Under SEV-ES, a INVD intercept generates a #VC exception. VMGEXIT must be used to allow the hypervisor to handle this intercept. Signed-off-by: Tom Lendacky --- .../X64/AMDSevVcCommon.c | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/AMDSevVcCommon.c= b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/AMDSevVcCommon.c index 6c3e7f67f6cb..3f10af401aa0 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/AMDSevVcCommon.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/AMDSevVcCommon.c @@ -818,6 +818,24 @@ IoioExit ( return 0; } =20 +STATIC +UINTN +InvdExit ( + GHCB *Ghcb, + EFI_SYSTEM_CONTEXT_X64 *Regs, + SEV_ES_INSTRUCTION_DATA *InstructionData + ) +{ + UINTN Status; + + Status =3D VmgExit (Ghcb, SvmExitInvd, 0, 0); + if (Status) { + return Status; + } + + return 0; +} + STATIC UINTN CpuidExit ( @@ -940,6 +958,10 @@ DoVcCommon ( NaeExit =3D CpuidExit; break; =20 + case SvmExitInvd: + NaeExit =3D InvdExit; + break; + case SvmExitIoioProt: NaeExit =3D IoioExit; break; --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46101): https://edk2.groups.io/g/devel/message/46101 Mute This Topic: https://groups.io/mt/32966273/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-