From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=helo; client-ip=104.47.40.88; helo=nam03-co1-obe.outbound.protection.outlook.com; envelope-from=brijesh.singh@amd.com; receiver=edk2-devel@lists.01.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0088.outbound.protection.outlook.com [104.47.40.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DA99122402E14 for ; Wed, 28 Feb 2018 08:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9jsC5HFPmL19gTJNhbhBJGTDAN4HSeDecqladNslucs=; b=EOS7qjnGPbN1BedJqtThS6+13IAWRX6puhpOCkKHOlj6Mtbkb2DVvA312FfSOIhOSgDU/mpNCoxd5qmYa4gxHBurQKZYnFj5uJIGOjRqdQIapxuYobomMSauZcQGMKamWGndbZ9DiBTbSoo7vChgVk4taryn6koMEIwR+jR9QpE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Wed, 28 Feb 2018 16:15:24 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Tom Lendacky , Paolo Bonzini , Michael Kinney , Brijesh Singh , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Date: Wed, 28 Feb 2018 10:14:13 -0600 Message-Id: <20180228161415.28723-1-brijesh.singh@amd.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0501CA0079.namprd05.prod.outlook.com (2603:10b6:803:22::17) To SN1PR12MB0158.namprd12.prod.outlook.com (2a01:111:e400:5144::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 84198bb5-530f-4a99-1942-08d57ec67933 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:s6rpbRCTIQmYJS9+SVy6i4O9AwkWBimM1l8u5A5ajK01lrzSZSH0kIBOfaZHVRygVkQit+JCXy9MdsBUCGBAR+DQdPmYgaTynliVSgk6wO9+vXiCgGQfcnSg9Xn1jk+KmYGrXXwJHqFH6dOWKXXi/1/o5siaziNAeW8kjslaEmai6DmVuVrAnnHASdfV5wXwUeIfuIPoV7Yz4k9QofZNbw4aOdm46/LpNtQkjw5Hs8ypnO1O4DrVi6PxJWWGbxDu; 25:bJ5rifzl7VGeTnSbOdbpL5reIUndN2dCjdUcT3T011EpUPgXTa+FaLQXBgEVwxM1hcT7bO8m8opFbz96pK+/oY86N3BNWd+b/w7WkXddU2tiATDgJGq8HyZToCwjYz2ps5wfXbKYFVbCDkp95ZSvn72GwD0Dop1bFHPrvCs2uCCPo6LaHVpUHTdVIR7xwatFGiURIgSAK+Zaei4AS5xJMfLYnOu2HFB8XktibfXSsojBtdnPvA47EXME0hOyRWQNPnbPclmLPibwEo0ZpvLWYNlAbFm/bZy6jQWQxRYs9JwxdRJ36sE6EEyylkGBadAncbb+qeV1nGlUP5EllPmZBQ==; 31:VBsjgggSgNhc6jtZgNQAP4Z75GjDg6HGe1OYpHxHL28zHpx1xXLOtqcRCX2OdhTtflqvdzoXXnUz0whZm3ql0c5bKxMiQ5dzj2ZIznnGr4HBAKGVnJ690/cycmOfjetUXJZ/BR5z1ik1m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ispam-Report-Test: UriScan:(166708455590820)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231220)(944501161)(52105095)(10201501046)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Forefront-PRVS: 0597911EE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(376002)(366004)(39860400002)(346002)(199004)(189003)(53416004)(25786009)(3846002)(305945005)(47776003)(386003)(6306002)(26005)(8936002)(8676002)(106356001)(2361001)(7736002)(2351001)(81166006)(66066001)(81156014)(59450400001)(50226002)(16526019)(54906003)(316002)(16586007)(86362001)(6116002)(4326008)(1076002)(186003)(2906002)(53936002)(6486002)(97736004)(6916009)(966005)(6666003)(50466002)(7696005)(52116002)(478600001)(36756003)(48376002)(51416003)(68736007)(105586002)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:b1wrLux/4LNkR9R31dm/vNP9tU9XYilp13qKuPgb2?= =?us-ascii?Q?UQqwl88UCrPL57/uZv9uQsI8bUo/Y2qf85HTmIZGqEuRBFXeYKcrcFjyeBV5?= =?us-ascii?Q?dsf0FhsFRcDkdxzO0JC3tO8H2oGyYH4oXv4H0988NdPi0+dZYaPh0sEFq+aQ?= =?us-ascii?Q?SJ+CC/VOGJMuwJTsT2SU3HHOYXmMkbqz6DqjprzHeR9bZkWjblCM8p3XZ2Tu?= =?us-ascii?Q?ppQ6R/z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iQUQTbc/9o2eL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:pdc+LR8w3IAmgkpeodE8FcxBmvl+cZGJczbmsdDZjbIcNbeY/HnwWNaFmvMdZl933TV9uRLlbEnTVNKMYQWaAPmZSZ7496SgF4BiO/kR1A8U07J7PAIEF4lQVqi6MbffgBJya+mlk2LFMp51eh0Ou5NPF4hqaQup0JuQaHpzQ1Xz/NPkYHWY1RDBz/JeUoSvxfTKX/97BIX2MTUGViypJGIH1gqM/LTrPpuqEuKn3hSDdCgwp1WccsdTqwSncmd6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2018 16:15:24.2622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84198bb5-530f-4a99-1942-08d57ec67933 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [PATCH v2 0/2] Add SMM support when SEV is active X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 16:09:19 -0000 Content-Type: text/plain The series adds the SMM support for the SEV guest. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel repo: https://github.com/codomania/edk2.git branch: smm-v2 Changes since v1: - add more comments to explain why we are not clearing the C-bit from relocated SMM Saved area. - restore the C-bit of initial SMM Saved Area after SMBASE is relocated. - Drop "Fvb" prefix from BeforeFlashProbe() and call this from Qemu flash initialization. Brijesh Singh (2): OvmfPkg/AmdSevDxe: Clear the C-bit from SMM Saved State OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Clear C-bit when SEV is active OvmfPkg/AmdSevDxe/AmdSevDxe.inf | 4 +++ OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 1 + OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf | 1 + OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h | 7 ++++ OvmfPkg/AmdSevDxe/AmdSevDxe.c | 35 ++++++++++++++++++++ OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 21 ++++++++++++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceDxe.c | 12 +++++++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockServiceSmm.c | 33 ++++++++++++++++++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 6 ++++ 9 files changed, 120 insertions(+) -- 2.14.3