From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.8097.1595493336792551908 for ; Thu, 23 Jul 2020 01:35:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=AMwgS2UG; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: liming.gao@intel.com) IronPort-SDR: Uu64acsRqQLNT5sld6J04KylosSG7pZicFvS5grlXBQ46LnBVqrBh3QxQvCHTWsLyJ0ZT9BJJy +fOJT/ToOu1Q== X-IronPort-AV: E=McAfee;i="6000,8403,9690"; a="235354194" X-IronPort-AV: E=Sophos;i="5.75,386,1589266800"; d="scan'208";a="235354194" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2020 01:35:36 -0700 IronPort-SDR: rc9GWI/No0SBq8drAXuQbmXCXfjdTXnqQeDEbtgDFxUwq+SkPmdrLtB217H1NcVKsCDDohJBmx +1bUtPjuN4Pw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,386,1589266800"; d="scan'208";a="302233497" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 23 Jul 2020 01:35:35 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jul 2020 01:33:22 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 23 Jul 2020 01:33:21 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 23 Jul 2020 01:33:21 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 Jul 2020 01:33:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKmQAvSeFsIaVVftdsbthZGYiNZ2Oc9UkGGDbIqjNsZf1MD+7X0XpBCvTtsbdpLFJl6ci6wmfOcz255fN8x9XWAJckd+v0k8Cit+R3NKCy6UEDnah0DW7csXdo5PnqDpW/0Pftvaf/l/JetpxyAhkC7grhrqFJGAfQPQoSzWiJdl23DyxAZxSW9a5TpAgcZsrsP/pq0zrJrZd6CThOeFIKqm3XahGVQ/H9dBmxNeka1jRgwmBgnmuhTgU5qMp+cqgJLF88rPWlF+DpPKyMrOIxf5EQCepdjBGh4/BMC4ifz2thv5ZEstugfoo6CWFqIBfZve5I1ru0NJeF5PmsfDCA== 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=k+/gfj8PVnd9VPsqSKm17YKgPwIaA4YRnWsjtFkIo94=; b=PWeMWiqBwxbS8Szihgfq5Gw2vXcCgG/EaIRsGJo8lcre3LnclfHE0lKd3pTwZfr5/48P5WqZrxOOWa9WACkqN2W+SEi2j/WIzWtYWNA8ST1pJtVVuO7rv8rlC5CwhsMcXDzNF2uZ5++9Unkso4+PgjFALaQy4ZSpefa8kXv9c48dDuED0KYCYsucNn4FvJDWIhlxmvzpIlSJ9EKzgfctXnynykPDxQPr9VlvVlf2QXZexH/xkDbix3gm7HF3tlGnlohvn3uxUzeWUUK3//yGQAnOlh43CZCZNpOabaP2au2R+ocOOoSjcCzId5w0Kneqo/D44VzLX/+aVrNrc/8y5A== 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=k+/gfj8PVnd9VPsqSKm17YKgPwIaA4YRnWsjtFkIo94=; b=AMwgS2UGCPfqzibQ88RSwQscHWfAThqs/3IxKw+he8TCGbc+woyGR4ncYvXs+890GnBUUNPmghFBf4CkaZECEOrUQiZ8mwI0Y7kYpKD4KYG4Ps/vvQ/vmukenF3wKWalfoFHNIfgSUeePIL9pX+wf5pfLgvJMBDOVfnj4NFwJFs= Received: from MWHPR11MB1630.namprd11.prod.outlook.com (2603:10b6:301:e::7) by MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Thu, 23 Jul 2020 08:33:14 +0000 Received: from MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e]) by MWHPR11MB1630.namprd11.prod.outlook.com ([fe80::7847:b564:1b55:b67e%6]) with mapi id 15.20.3216.020; Thu, 23 Jul 2020 08:33:14 +0000 From: "Liming Gao" To: "devel@edk2.groups.io" , "thomas.lendacky@amd.com" CC: Brijesh Singh , Ard Biesheuvel , "Dong, Eric" , "Justen, Jordan L" , Laszlo Ersek , "Kinney, Michael D" , "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v11 03/46] MdePkg: Add the MSR definition for the GHCB register Thread-Topic: [edk2-devel] [PATCH v11 03/46] MdePkg: Add the MSR definition for the GHCB register Thread-Index: AQHWX6TAqe5q1kiX0U22EKXD5+f2qqkU2HuA Date: Thu, 23 Jul 2020 08:33:14 +0000 Message-ID: References: <74e9ee3de48dfe101aebdebc0304e002a88e74f7.1595366363.git.thomas.lendacky@amd.com> In-Reply-To: <74e9ee3de48dfe101aebdebc0304e002a88e74f7.1595366363.git.thomas.lendacky@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; 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: 2e32b9eb-2815-42b6-a7ae-08d82ee30a86 x-ms-traffictypediagnostic: MWHPR11MB1629: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GLsWNq4nwNVdtugleTDVfAYPBbtt0ewk7UjserSta0K25dbgwkU6rWx5LjI/Rb3PepyPSJ27Qt1r5rhq3cbNdn97FOe+JmbX6WRjbmYvi5KbAXGkn64UOYIwr5Ox05Fd6dOn1oyWqoCF4BlSak69wEm7uSjtH5MQhrZsD8d38UbUyiAAOYLlT5SJeqIhsdkhspJu/ztnl5K071Jf5yxZY+2DwIfOIP7okG1hA6maEZM6fw4Lz5/L+IL6EyCV2ww5Mgs33Xn/Tx4hMCQ+4PkW7el0TPYf1H8S5PtufP25a3ZXfvQ7lLuR+SL9fnKiseUUtU9mrY+u3C3p3KNO/CeAraF2ftRG5O1hyB3oSVthOUFnbf+oyEBu6KMWz5ddi3Q9MmVc5VCTcOjGpTErlF0D8g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1630.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(396003)(136003)(346002)(39860400002)(366004)(19627235002)(71200400001)(83380400001)(6506007)(86362001)(186003)(53546011)(5660300002)(478600001)(4326008)(107886003)(7696005)(8936002)(55016002)(26005)(316002)(2906002)(966005)(9686003)(8676002)(52536014)(76116006)(110136005)(66946007)(66476007)(64756008)(66446008)(66556008)(33656002)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: M+heifnGh+YXVIja/qG/KllVPUyUPs7/n/PgZbS8YG96flcXTz+g44O5hypHfpAVLBiIHfM0HcsQztX5jWvuTJ/sFox48nk4GwOVDGvuaBlCYvDS1Zck6kepKuL4auf1hBj5TsckxUGbe8wJSGyiRli7lUSReemLIzA+A/8AU9Wm8H8SqWGiZrtL7RJFh2sEByEYeORBimsk8kzttTrjcWkbMFaLaqNteGxRyfs+S869OWQyUPr/xZrDFToQiEcoSwt7g1/ndgaYxRL4M1Par+zkgbxsLxLP2cVN13Mtc2sDX2egFh6FNr/gCg1fWjluaL637c4xyEVL9Fkr6IwjUZHpdo+ytYrz1MBOToON4Zrda8N0xyEIIXDnYi3/nwNcuw//YQPdmtszLL53Z2k6QULQ6XbB1Rq8cqRMopQRCLjUVSp51FKnK/ggyb1qcZ9PpYdE5CLrFfIiNyt0dY4kuA0lSYCL4a8gRTn/rZEsI/hNezkS3MZP8jk15LmSMG1d MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1630.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e32b9eb-2815-42b6-a7ae-08d82ee30a86 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jul 2020 08:33:14.0326 (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: 8Sanej+Bcbs7fRM2C83237z443zrZ1l6h+Sk+GZmNYroRRrfpY47KSNI0DquY7QXUUjxSRXT2o97U8H43cX+XQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1629 Return-Path: liming.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao -----Original Message----- From: devel@edk2.groups.io On Behalf Of Lendacky, T= homas Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B22=1B$BF|=1B(B 5:19 To: devel@edk2.groups.io Cc: Brijesh Singh ; Ard Biesheuvel ; Dong, Eric ; Justen, Jordan L ; Laszlo Ersek ; Gao, Liming ; Kinney, Michael D ; Ni, Ray Subject: [edk2-devel] [PATCH v11 03/46] MdePkg: Add the MSR definition for= the GHCB register From: Tom Lendacky BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2198 For SEV-ES, the GHCB page address is stored in the GHCB MSR register (0xc0= 010130). Define the register and the format used for register during GHCB p= rotocol negotiation. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Tom Lendacky --- MdePkg/Include/Register/Amd/Fam17Msr.h | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h b/MdePkg/Include/Regis= ter/Amd/Fam17Msr.h index 6ef45a9b21d3..e4db09c5184c 100644 --- a/MdePkg/Include/Register/Amd/Fam17Msr.h +++ b/MdePkg/Include/Register/Amd/Fam17Msr.h @@ -17,6 +17,52 @@ #ifndef __FAM17_MSR_H__ #define __FAM17_MSR_H__ =20 +/** + Secure Encrypted Virtualization - Encrypted State (SEV-ES) GHCB=20 +register + +**/ +#define MSR_SEV_ES_GHCB 0xc0010130 + +/** + MSR information returned for #MSR_SEV_ES_GHCB **/ typedef union { + struct { + UINT32 Function:12; + UINT32 Reserved1:20; + UINT32 Reserved2:32; + } GhcbInfo; + + struct { + UINT8 Reserved[3]; + UINT8 SevEncryptionBitPos; + UINT16 SevEsProtocolMin; + UINT16 SevEsProtocolMax; + } GhcbProtocol; + + struct { + UINT32 Function:12; + UINT32 ReasonCodeSet:4; + UINT32 ReasonCode:8; + UINT32 Reserved1:8; + UINT32 Reserved2:32; + } GhcbTerminate; + + VOID *Ghcb; + + UINT64 GhcbPhysicalAddress; +} MSR_SEV_ES_GHCB_REGISTER; + +#define GHCB_INFO_SEV_INFO 1 +#define GHCB_INFO_SEV_INFO_GET 2 +#define GHCB_INFO_CPUID_REQUEST 4 +#define GHCB_INFO_CPUID_RESPONSE 5 +#define GHCB_INFO_TERMINATE_REQUEST 256 + +#define GHCB_TERMINATE_GHCB 0 +#define GHCB_TERMINATE_GHCB_GENERAL 0 +#define GHCB_TERMINATE_GHCB_PROTOCOL 1 + /** Secure Encrypted Virtualization (SEV) status register =20 -- 2.27.0