From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (NAM02-BL2-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.10746.1591363673877273318 for ; Fri, 05 Jun 2020 06:27:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=rbJK8cxa; spf=none, err=SPF record not found (domain: amd.com, ip: , mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYDhpOvXzU3bBpl7CK0BmZYz4c+PpBDO1UJ+csYYTNh3HUbzG9WWcGC6r3qwgsr2BV8vrYBnIR2cgZLmTP/ApAFXciiTFGbVnCgZJlFmxRNw6iL34Qc6rp3Azz2UpQEXebQF1TqHvlhM55CaFydGc/DnxuvtrwsyAxP4mIRTGK26ugLpa5pLovq6wG2rWJHliTClzxuTJuc5GI9D3NCM8hFTzLmc4UgQltGsrL4e3DuaGxxdjW7EJUM7kyOTM0GE3325yeKXieHJVy6kLnciOLFNqyVnPL6EIpuJRYOprC8+pKoALv6DeUhG4qeF21aKwzLpNJooCA/qB5wLO4Xc/w== 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=0pldI0n76QZNio+OtGA3D2OP46qeETs1IJRR/1gE+rg=; b=K8ZqRt9xkkcbRJdnDeW7TX4LrNkjapz1k87k7notqmbXFDpuAeGRf2p5ebT5sMoLeypTnbmKTleHEuw231kIWFhxpvEgS4AawzCMZ4yda9B8Ojs6euAQ7cZ0azP5lpv06ADj8amBrR38tBcz9XmCsoVWISGWvg5YAVta2FJB6bfsc2JIlhz7zzBwDQyUKq/SVR+62sJ7J3TK75kKyOh6ym14aFgRhrgRFB4jZSdKSGoiE3EQC1X71qIgckWrj2MNgRlHePPfy9YJPh/UjHwn+koaNuK+PY7YSpQZkVkjBLvSnT63n+AvZbqah0vMAP8yZ+x6foAkeGiJnQ+uaoDmaA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0pldI0n76QZNio+OtGA3D2OP46qeETs1IJRR/1gE+rg=; b=rbJK8cxa9dNxAFpoV7GxaY54DYJZnRFPb9PkZmmsCuiXyn/McKbvxhK0yNapUmHBEDent4eCop7AleSiefgeNfbN/OdMni1nWzUZF1Z6JZ4n6Alt3VR8pkwZUHQ9dhk8hRRi4WHKoWTK1GDJ8rRB5Yr/MxHCXqK/eSJCmasEoTA= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM5PR12MB1594.namprd12.prod.outlook.com (2603:10b6:4:e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18; Fri, 5 Jun 2020 13:27:52 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4ce1:9947:9681:c8b1]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4ce1:9947:9681:c8b1%10]) with mapi id 15.20.3066.019; Fri, 5 Jun 2020 13:27:52 +0000 From: "Lendacky, Thomas" To: devel@edk2.groups.io Cc: Brijesh Singh , Ard Biesheuvel , Eric Dong , Jordan Justen , Laszlo Ersek , Liming Gao , Michael D Kinney , Ray Ni Subject: [PATCH v9 03/46] MdePkg: Add the MSR definition for the GHCB register Date: Fri, 5 Jun 2020 08:26:54 -0500 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: X-ClientProxiedBy: DM5PR19CA0060.namprd19.prod.outlook.com (2603:10b6:3:116::22) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from tlendack-t1.amd.com (165.204.77.1) by DM5PR19CA0060.namprd19.prod.outlook.com (2603:10b6:3:116::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Fri, 5 Jun 2020 13:27:51 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 67b09f24-5eaa-497e-6239-08d809543fa4 X-MS-TrafficTypeDiagnostic: DM5PR12MB1594: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0425A67DEF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QvnIaOTjby1AI7E0U9drgsoLD6PHw/3fc3ogrJRZU+5rGH57t3CD0qg9nW6Yw7eUj0yvohMHpNT4liPbNtUmGgxcZV6pKr0ezUUFBNNehIFzMaY9KCx5VpyDjt1+mxyMTSoG0uQxVBININ7wQn26yVgiHkjsbfCipHAm+42uQibmTUH5klYc1GrlsYAioEFSFB5W23jgiX/U5PmJcd9oyMav407bQEDoPTvG7BNjSCRAP59UxeKhEow/JhPTvpN0BIhpqNeuaef3206OFirbkjTfRMfoWRSjcIFxDZQyB0gxh0J05/3fdrb1Y8Nv2qZzglyaosMX8H8Tc9CrVhxUAhdZuPz5M7pluk4mFDKBg4YQT1NMlCmFgWoGOFmJz45Ir0IjreFdPUtiE8oE5qaMTG0Ug5N1M2QLp1MIIjco5aOO5pa2Mhq/Qip6LyK3QChusqFSE1PgnBjf1SF0oTQZGA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(366004)(346002)(376002)(396003)(136003)(83380400001)(6486002)(4326008)(16526019)(26005)(2906002)(2616005)(956004)(186003)(8936002)(7696005)(52116002)(8676002)(6916009)(19627235002)(36756003)(66476007)(66946007)(5660300002)(66556008)(966005)(316002)(478600001)(86362001)(54906003)(136400200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hRI64H/vEpq1iqQqulxy4BV8GmeBpG+3POMy/HhbwHnALbfg078en9zDcH2GPw8Upl/s5LdXYyhGGh/I2JBB0Qv4X8V5FGCaPd/NXvT/EIjD24BdV4xYfx9CBStSsnXWrh27OoS0/GlWSD62EBf4JMCQ2wArp1tDu/jrEbyuGa+Gyog8Sr1VlDvk4AispdEmb07fls97KxxeQHRn1ALGZCW2Lbnwrn6fwJ2vU4XjSlpKEU+furpk4TtQB4DkY18/9OPcJAdNLv6YkUQ5RoJ6llZJgGlB1wk22eDK/TB89MKyzFAfwRQWq8E6qfCzuTsPKcXSX4qEV6TTQ7fL6C4DzzmYl0Pxp9RfpppM8F376hOHsrqUZj88QAO5mVoLC+oG9KMw4c/Ohua5R+2ehMS0Qm3Q9xeEjT0srlcuFZbUh0e9mMGPUSb/oHQvSqSlIzUCKXaZCOSEPxS62pETBj8ExjtvQ6PMnIqEuLAoN4ooPD0= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67b09f24-5eaa-497e-6239-08d809543fa4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2020 13:27:52.4804 (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: YD84oAzftiMhoFlb2IxmCPPSNDfCC5PWGWzJTtUOdV4WpqZIZZxiXV1uMITqsJDmJR5E5JyoJtQ9IIyugGcfmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1594 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2198 For SEV-ES, the GHCB page address is stored in the GHCB MSR register (0xc0010130). Define the register and the format used for register during GHCB protocol negotiation. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Tom Lendacky --- MdePkg/Include/Register/Amd/Fam17Msr.h | 42 ++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h b/MdePkg/Include/Regist= er/Amd/Fam17Msr.h index 6ef45a9b21d3..466a3143599c 100644 --- a/MdePkg/Include/Register/Amd/Fam17Msr.h +++ b/MdePkg/Include/Register/Amd/Fam17Msr.h @@ -17,6 +17,48 @@ #ifndef __FAM17_MSR_H__=0D #define __FAM17_MSR_H__=0D =0D +/**=0D + Secure Encrypted Virtualization - Encrypted State (SEV-ES) GHCB register= =0D +=0D +**/=0D +#define MSR_SEV_ES_GHCB 0xc0010130=0D +=0D +/**=0D + MSR information returned for #MSR_SEV_ES_GHCB=0D +**/=0D +typedef union {=0D + struct {=0D + UINT64 Function:12;=0D + } GhcbInfo;=0D +=0D + struct {=0D + UINT8 Reserved[3];=0D + UINT8 SevEncryptionBitPos;=0D + UINT16 SevEsProtocolMin;=0D + UINT16 SevEsProtocolMax;=0D + } GhcbProtocol;=0D +=0D + struct {=0D + UINT64 Function:12;=0D + UINT64 ReasonCodeSet:4;=0D + UINT64 ReasonCode:8;=0D + } GhcbTerminate;=0D +=0D + VOID *Ghcb;=0D +=0D + UINT64 GhcbPhysicalAddress;=0D +} MSR_SEV_ES_GHCB_REGISTER;=0D +=0D +#define GHCB_INFO_SEV_INFO 1=0D +#define GHCB_INFO_SEV_INFO_GET 2=0D +#define GHCB_INFO_CPUID_REQUEST 4=0D +#define GHCB_INFO_CPUID_RESPONSE 5=0D +#define GHCB_INFO_TERMINATE_REQUEST 256=0D +=0D +#define GHCB_TERMINATE_GHCB 0=0D +#define GHCB_TERMINATE_GHCB_GENERAL 0=0D +#define GHCB_TERMINATE_GHCB_PROTOCOL 1=0D +=0D /**=0D Secure Encrypted Virtualization (SEV) status register=0D =0D --=20 2.27.0