From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (NAM02-CY1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web10.13506.1574280439944511918 for ; Wed, 20 Nov 2019 12:07:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=MQAHboj3; 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=g0ONo4lj1W6+T89lU0uhVetzLgqnvR0ITxDygy1lar4uDbujFKlO55Bamqb/4nK3qaKWQJUcjPffyKekLIpaO7nt4P9oOA6nlx99xOyK7dI5j9erIAvZB2zjpPOtQgw1QqS4E3M9gPwDO80TBTzrq5eRE1Z6SLKFJdW2HgjRTikKH4FbAGWWwo3fZwxXjr2HJ7/ypEpPQPY1Zwugzu6/JLcn4Y6/Bl9xun4G4qKFdIoHEJRdE6pCiybWGPY+pmL+qw7RJSokMPPg3n62OCBd7p6P7/2uG6OMYDBzQ7YJ0RU8i8x3ymkCKiFyhmcwieO+GToDaSxX4q1aMi73WvgRyw== 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=mWe3cjvlh1lzocBZLfsN/0e1u60Ss7xs3vp8N0XS7Vs=; b=QjDjFRksUvDQ9AdiewKoPB3ml+izcGJ18hosBy2RpXacX0mHaOFWHxzcDW0YKS12FDf8pIdLIk0QjkIt63R9k6a752iboIHIHLGiiRHSqdQbcpgcgpExpOX08xGihDiwG6NF2Gzjy3RoolNP8miZpZCg44MqJ7BlbXwufc5cBoBF0iRe/oxoQONnAMe0XIT9T1FUtl5l3NRUdvyAv3fhTipHeo8iCf6wTooijxVvqMH7qQ/JsuIF/hCkEEd2P4dRn2qeqt4yYftg21nOG2W82Z8sayoiZPchJ+HNqEw5tSlaeEJ01TGlgNPJ5DdwsOSb6s2AKq37dukuo95+OwoXQg== 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=mWe3cjvlh1lzocBZLfsN/0e1u60Ss7xs3vp8N0XS7Vs=; b=MQAHboj35R9I7wUmddbK4chMAD2DTR7agYw1o5IIebf1RE5ancR9UCkPhTAk+noGo6uLq+pY25sf4mZY4bBZUN2czd/u/O3NoZyY5aX98QMsJkCUYk0postwdQsbs5e07lI0whVAhRicxr7/BrdC//jy71keQrtKSr/18ED+pSI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.71.154) by DM6PR12MB3675.namprd12.prod.outlook.com (10.255.76.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.28; Wed, 20 Nov 2019 20:07:19 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::dd0c:8e53:4913:8ef4]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::dd0c:8e53:4913:8ef4%5]) with mapi id 15.20.2451.031; Wed, 20 Nov 2019 20:07:19 +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 , Brijesh Singh Subject: [RFC PATCH v3 02/43] MdePkg: Add the MSR definition for the GHCB register Date: Wed, 20 Nov 2019 14:06:24 -0600 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ClientProxiedBy: DM3PR12CA0087.namprd12.prod.outlook.com (2603:10b6:0:57::31) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 717b50d8-abff-4b83-9150-08d76df53f07 X-MS-TrafficTypeDiagnostic: DM6PR12MB3675: X-MS-Exchange-PUrlCount: 1 X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-Forefront-PRVS: 02272225C5 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(376002)(346002)(396003)(39860400002)(366004)(136003)(189003)(199004)(2361001)(50226002)(81156014)(81166006)(8676002)(2906002)(6486002)(99286004)(66476007)(486006)(47776003)(66556008)(25786009)(2616005)(476003)(54906003)(11346002)(118296001)(8936002)(316002)(2351001)(7736002)(305945005)(66066001)(6916009)(86362001)(16586007)(3846002)(6116002)(48376002)(14454004)(478600001)(966005)(5660300002)(66946007)(446003)(76176011)(36756003)(51416003)(6506007)(386003)(50466002)(52116002)(4326008)(6436002)(6666004)(6306002)(6512007)(19627235002)(26005)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB3675;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hwxsy18bOuG9qoTJ+DUhT/lNLhAhR8VUA+/ozaJAicu7MTY1JpL1vdtJ6XawTBPK+KAlUxr5xCRQSA/EQj9O/X5uil87Jtur7XQlzrL4D5hAMvn2Y5GzutMJTeqwo+mAd5gYIf+Hj71hFNwqST7wX+8oNjIrcfWfL+xTd70uAFF5rKXhzO5sS64ZV+tfAjLnGiRGXF632vszEaPRocjMb9JYzufbtAubkr8Vy1n/Zjs39/jPk/tFILxkKeOax4r246v/WHFEFr0vB8hMwUG7hPW8hejl+axZTx26cj2uv4bhb4OQeV0X8yMk8n7wjigkgtfTVMk6TmX+/93MRXLM3y0jHWJIVMMl6iChv10zKS6gNJlyVd+w47Ft6hULttkJegXWJPJsdPmFlmY6GkWZxNBuwI7m/1+bdcDWNoBIe4bYPrcBnOkp+kRjcN1zabcIZDiqncWuwBTocNZ3JBlE1wool98zsOExsHIYAhyYzK8= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 717b50d8-abff-4b83-9150-08d76df53f07 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2019 20:07:19.0019 (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: 7pj/y4DL7v4Tx8JE0DGnYV9l51Z9H3zsfiU0CcAs+C53bMZNh2UstzquMGDx3/B9ut2fHjusd8yK5Da0i1it0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3675 Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 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 | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h b/MdePkg/Include/Register/Amd/Fam17Msr.h index 37b935dcdb30..55a5723e164e 100644 --- a/MdePkg/Include/Register/Amd/Fam17Msr.h +++ b/MdePkg/Include/Register/Amd/Fam17Msr.h @@ -17,6 +17,34 @@ #ifndef __FAM17_MSR_H__ #define __FAM17_MSR_H__ +/** + Secure Encrypted Virtualization - Encrypted State (SEV-ES) GHCB register + +**/ +#define MSR_SEV_ES_GHCB 0xc0010130 + +/** + MSR information returned for #MSR_SEV_ES_GHCB +**/ +typedef union { + struct { + UINT32 GhcbNegotiateBit:1; + + UINT32 Reserved:31; + } Bits; + + struct { + UINT8 Reserved[3]; + UINT8 SevEncryptionBitPos; + UINT16 SevEsProtocolMin; + UINT16 SevEsProtocolMax; + } GhcbProtocol; + + VOID *Ghcb; + + UINT64 GhcbPhysicalAddress; +} MSR_SEV_ES_GHCB_REGISTER; + /** Secure Encrypted Virtualization (SEV) status register -- 2.17.1