From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web08.15798.1621448415664855986 for ; Wed, 19 May 2021 11:20:16 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=BYkYwzqR; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: , mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFR0DXKQ97lyxkkHpy8E0aocznA+JUT6I53RKX122QzkkaH2mBsEpKYQ2aYKp6NXyznJ2WtjWr4C6jq3KXz0pUKBOl8Z34AQeTxXMOQSENLL5xRI09wjGDUAZhNAw2mPzk7fpc2yey0As3XscW8YqP6jPK4qrdTj/boHViDxddZgLe41SPrZJ8k6VrmBbBFSN7OoSJt307kmyV12a3wPChF1q4Bq6ZUM8d27QnKv+r+iZx9tqBGCun71ZiL+9O6FzxAXJn2gw+vVqpkfUJixk91jJfQpAEvo7AHE6k6KU1Tb4Vkgo6HjElHLPZDaQs+fPEIDwsyN4xxPKIyZr26pNQ== 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=F8Rm49ET0mDGF9wp7X4cXNbdvH36yAyJzBfsZludOwo=; b=jPay+CR5duO6dPcQzkXolH3gu7tySOGFw7h45oq4RLfwb4K3pfCWk1v4qwChEnJn6MPI1D4YsZHLu9zwxRSo/Tp9P5p9HxHTg9dxfmNjgD/n8GNdEyPvSsnb5Hn8Z7Bg2KJmIJblVXaOklk5H3pfzDXcn2yMK3xNAhgN3GZQs+SawWczhOHk9KHXzdncHUzyqfNEuio/F6PAuZ1z65yFeI44O1iw/irsTPftnrHTEJXu8+bKd0uFdunUi48yNF3U2JqwDEwkZ0sF42tsO2sWjtg0fJeUCx4UBp822fkx8fB3k9bbQUDCVOYHOBq5KaWhqiJHtAyqJOOqeJDH+zLlMg== 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=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F8Rm49ET0mDGF9wp7X4cXNbdvH36yAyJzBfsZludOwo=; b=BYkYwzqRmQu6WEDjXEtQ/o8YmNIqBrqkpYunzAvXlCjK9FntN4R54iVMym/49l9xIC9s2sfP5DGMBl+IK5R4tgl+QIkmtGoYV3lFMVbt8i8dcYsLjaw9R9P0XXPouQiWNgiuefNXz9E9Xq0BV9ByvCa9YS8w2ioQMlBdddMh5gM= 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 SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SN1PR12MB2365.namprd12.prod.outlook.com (2603:10b6:802:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Wed, 19 May 2021 18:20:14 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::9898:5b48:a062:db94]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::9898:5b48:a062:db94%6]) with mapi id 15.20.4129.032; Wed, 19 May 2021 18:20:14 +0000 From: "Brijesh Singh" To: devel@edk2.groups.io CC: Brijesh Singh , James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Laszlo Ersek , Erdem Aktas Subject: [PATCH v3 12/13] OvmfPkg/TpmMmioSevDecryptPei: use MemEncryptSevClearMmioPageEncMask() Date: Wed, 19 May 2021 13:19:48 -0500 Message-ID: <20210519181949.6574-13-brijesh.singh@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210519181949.6574-1-brijesh.singh@amd.com> References: <20210519181949.6574-1-brijesh.singh@amd.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN7PR04CA0212.namprd04.prod.outlook.com (2603:10b6:806:127::7) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) Return-Path: brijesh.singh@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sbrijesh-desktop.amd.com (165.204.77.1) by SN7PR04CA0212.namprd04.prod.outlook.com (2603:10b6:806:127::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 19 May 2021 18:20:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5498f8d-76c3-4e50-7938-08d91af2bf19 X-MS-TrafficTypeDiagnostic: SN1PR12MB2365: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xJmJEZ/i9vKTF8sBqLUgBMC40ieZtB/tZF9x4f9oLU0/GHzWeY7uYzZyfAEq0l11un9DUwIVqcZ80J/tYGt9Go/wzecbknYi7V6WIa8y72y8FbYRsHQsgrDimDKu8hLWxN7CFT7jmVz3DfdWA7u9GqfSLc2Y+J6kxjhsszOXdRhrsm5P/D8aJeoyn3SIhBM4zGIne2yN0//gP0OR7xJd7Tgau4r8vahYixw95IkKFOur30Hw4Ef5T9ezG2uxGIJEUZegob4iThiU6Ss0TPgrH9X9Sbb/qyjv7K7HBgu2dBBCnhdjrj3hONiTmUA33pXZdHU+WFnt+Ze2reJuvV/Ni/crLlNkgGHYSyqMYYaYd2LtQocyb1YothI0WarCeeKUwH/UGP6rIZ7gyb15nbYC+MNKxUCTBsVsBgZ2hK09BOwvb56SkoHAMC85gGVbc+/HMgQSZcux4R5POwMl7zAVYp3rsf+nAPvCwpEattSr3uP7ExaCW5otL7h3R0aTUXnaviKZ3+XI5L6sKl+HMp+VXzK0oramk7amXbpC734vLl0j5reSC0ItLMc27DHH/2W+Rf27p1A/UnqRVAQ8KgPPtQGyujUIjYIRWzs45OMsLATS0eST3sZAibc6W1RgBiJgDU0Whsr/WEfX26EkrW6BVI2wyF6SFHL216zeuqL0L0YYKXGF6DHINQqeoyImpS6k7W6PD8lZfeUVKfPpJGtzn1rwf2rrg171n1KAvvTXlhHba2q5O27pgfeB2Rq7ksZgyloQprvPiybSVzJ1bcZJ6w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(346002)(396003)(366004)(376002)(39840400004)(16526019)(4326008)(6916009)(956004)(2616005)(478600001)(1076003)(2906002)(5660300002)(6486002)(966005)(54906003)(66946007)(66476007)(316002)(8676002)(66556008)(8936002)(83380400001)(36756003)(38100700002)(38350700002)(86362001)(26005)(7696005)(52116002)(186003)(44832011)(6666004)(213903007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?E5gXZiIILEJYhuwiO2bU6i0M928RpVeDzFGAPxcSKSy+MDZ9EFYZeNTD4GRA?= =?us-ascii?Q?91K8Az6qFCuSkZuYh0No4cuOBcoKAjwdOXiNdI2AKgbiAcEzCbWhDMCv+7wg?= =?us-ascii?Q?Ruwz2OUFQ5mcWAvP9zBYj/loJljE2iI/BPVYfWwUmUR5AXGj2zzHVwQLxWAk?= =?us-ascii?Q?zvydDwMbwa3GUyfTizeP7/KF5/9rl9JtYS4ph6xfUljn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RLBve6pN7/UbLQcxxWSiRkQW5U9ePGdwJiXSjyFNwA1/7t?= =?us-ascii?Q?6EfDMMQnEg5eILpe2qO4QkM6cBYeLKyfVgnIog8GuH8ZISViwPGbHe96aXo2?= =?us-ascii?Q?jM8zSQqAVZcjPn3MZNXFG/0d+24LopUer7sgXiVcO8ftvbVtNmeDpQd4W1B4?= =?us-ascii?Q?LcAuNanMtAEGetyYz87SYYPkSi40+bIi2/f2Dz9NSn+UEUduNdGTIPf0zkH7?= =?us-ascii?Q?kmy787Gr/q602ulaPOvLzxFY?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5498f8d-76c3-4e50-7938-08d91af2bf19 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2021 18:20:14.1210 (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: merBWvpc37+BMax8rtJwXZ5dFzX/ekOObAMu3fjLQQesf/jeQHl+YJdhCSmKdjZdoBkdqY3Tu0ARN5prYxGzcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2365 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3275 Use the MemEncryptSevClearMmioPageEncMask() to clear memory encryption mask for the Mmio address range. Cc: James Bottomley Cc: Min Xu Cc: Jiewen Yao Cc: Tom Lendacky Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Laszlo Ersek Cc: Erdem Aktas Reviewed-by: Laszlo Ersek Signed-off-by: Brijesh Singh --- OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c b/Ovm= fPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c index df2ad623308d..570c8467a673 100644 --- a/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c +++ b/OvmfPkg/Tcg/TpmMmioSevDecryptPei/TpmMmioSevDecryptPeim.c @@ -62,11 +62,10 @@ TpmMmioSevDecryptPeimEntryPoint ( "%a: mapping TPM MMIO address range unencrypted\n", __FUNCTION__)); =20 - DecryptStatus =3D MemEncryptSevClearPageEncMask ( + DecryptStatus =3D MemEncryptSevClearMmioPageEncMask ( 0, FixedPcdGet64 (PcdTpmBaseAddress), - EFI_SIZE_TO_PAGES ((UINTN) 0x5000), - FALSE + EFI_SIZE_TO_PAGES ((UINTN) 0x5000) ); =20 if (RETURN_ERROR (DecryptStatus)) { --=20 2.17.1