From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.84]) by mx.groups.io with SMTP id smtpd.web11.6234.1689366525599283937 for ; Fri, 14 Jul 2023 13:28:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=eHzn4Lff; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.93.84, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uwm31g8I97VwBcv25qZbPeZ1Rv+1agt1OIPpTf2VHd0Q7YV4MIh1FgMNMQiXqu0yovhR1XSpD0cKurP0n72/ADxX95W+YhuiB16Kt/VQ8njBgAnQUZGey3UziGfbMvynDUdMNuqlVEGAqBcrePGPSv1+x/3qmZ3xroltm9cINiwqYq5cvsgImNAAGMD456/lygezDhJqdIlpTrJGWOpyCr54MDvpbH86wCWOIfuJY9KNE8KZ1MJnuxsIHsbbWl8f+2GJWbMIj6XZVJuZbTW/XBpNHtOHKxwjGHLtgRH8zbOSKq7Wevy4pOKSpVZ2I+gbsmDztGxMquO2u39T1yqcWw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q5vboW8OioXcwPgtJ9/ogBa3PY+eqmH12FEcoEfTOv8=; b=GY0ho7hAQ2tLscpuugTDe6FJrarPSmXS4NTl8Ikg72o9OyyCTS4ZxMpPbo/QmUkSTtk1gAGrvVBlmkTi8Vd0Jje0VgKyn2Jc7de6Psy9vAxnKcPspvHCokRRFW17NTKYD/JkiYv4IYEr+wq/+L4yRudepu7MCdxB/TqxjWghvgBTWoASAeiXujW6C1VGg6YlE4EdfQtzqZuLyqV9au9nkQA/Rk2zuqC/CayaMlQ1fyH+J6csq1Lr1gtPNVUNldG/eNjMHs3tywFG7lKIUShLEp4dwGZxPWBMgGg0syZki5LoMifoSO5siMUn9oeB0wzjvWOV2dAgAeG9xSSWv66J/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=q5vboW8OioXcwPgtJ9/ogBa3PY+eqmH12FEcoEfTOv8=; b=eHzn4LffHslKL0zvVyVNTYYzXWhB/f5uLOTYsnv9/+e+gWrEN1wPsBWs/xMEayFnuG3kttcT4E60jfTilnO5McKK3bmTCVfJ0bTaPAGwUG0DXXu0bhU6kieic0mdS6viEPTczYbznpdcDgYZ1lLPCYcW8wEZTXBs5BDOmSu1Nio= Received: from MW4PR03CA0062.namprd03.prod.outlook.com (2603:10b6:303:b6::7) by DM3PR12MB9416.namprd12.prod.outlook.com (2603:10b6:0:4b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.32; Fri, 14 Jul 2023 20:28:43 +0000 Received: from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::3e) by MW4PR03CA0062.outlook.office365.com (2603:10b6:303:b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.27 via Frontend Transport; Fri, 14 Jul 2023 20:28:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.28 via Frontend Transport; Fri, 14 Jul 2023 20:28:43 +0000 Received: from tlendack-t1.amdoffice.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 14 Jul 2023 15:28:41 -0500 From: "Lendacky, Thomas" To: CC: Ard Biesheuvel , Jiewen Yao , Jordan Justen , "Gerd Hoffmann" , Erdem Aktas , "James Bottomley" , Min Xu , Michael Roth Subject: [PATCH] OvmfPkg/ResetVector: Fix assembler bit test flag check Date: Fri, 14 Jul 2023 15:28:26 -0500 Message-ID: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Return-Path: Thomas.Lendacky@amd.com X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT013:EE_|DM3PR12MB9416:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b3a1363-846f-48fb-0250-08db84a8ead6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3Vgm7M7FBQwhXdGbyzDq2fQN6VJcIW1nn7SYwXvOPrB6DhZ0g2LEef0wmrfzsHl4IGW/fRESfszYE76TkLSO3+naiDvOnYvCHPylopbfFwgFnQW0zRB3o+BwzmK4iRaVs6LWH8wwwK0lEkzMov5fzV+oPWznrnNCFffBfZRQEGyBIzHHbJAnJKQhIOCWS1kxc4QaRc1h8Jznv4q3EmChjBv0BfO+c/BjtBhrwozvOBGG2BubnyaIkJJ0Y4dekgVOh5w7h8/tLMhict5DrZF6bVy5cbFkogPL1wP8q7YGjU2tIF6eg7hcwvNJfa/WZwuPertOX4VWQ7bEulAemftMJ7ET963VANkS3pbR2zwoHF/Vi3uw1BCKGOx0jS7YgR5jfEWoz7/Vo5f2odch7s+LwkhQLmetE8zA6GPSnm50GKopAvoSkqpjRcx0bZmxZsP0oTxoAInttgtFmLdmtKa6Dz+4KF3YIk377SO2vmoSmR6nClFUau3m2qYiHKAhRrbjphCyQ+WRDnFEG6LaENYxr18CdHC8ixEhosexpCQgna+x+Qf2fPHzU5dJc1ortwH9l9t9+6R/vp3q9rhMAMvcSQQA6clduHaShJNG1/MrDdoDDhK61xSMrQfRD+QPx1O6Ikw9dTJmSDVkDdNBWn3yyhuFKX/IS7iRcGeZdF2IuSH5q3n47u4zW7nr+fFFkvoae4R386EDmh/o/y0YLO+A/h20YFGZ52wDZL9mxbRz1oPJdd18QggzdVBimdGm1SgMLR7fVCcIdRd1G7foopjeMQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(6916009)(4326008)(70206006)(70586007)(478600001)(82740400003)(81166007)(40480700001)(26005)(356005)(54906003)(19627235002)(6666004)(316002)(41300700001)(82310400005)(8676002)(8936002)(40460700003)(86362001)(83380400001)(5660300002)(186003)(16526019)(2906002)(2616005)(36756003)(336012)(426003)(47076005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 20:28:43.0916 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b3a1363-846f-48fb-0250-08db84a8ead6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9416 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Commit 63c50d3ff2854a76432b752af4f2a76f33ff1974 changed the check that is used to determine if SEV-ES is active. Originally, a CMP instruction with a supporting JZ instruction was used for the check. It was changed to use the BT instruction but not JZ instruction. The result of a BT instruction changes the the carry flag (CF) and not the zero flag (ZF). As a result, the wrong condition is being checked. Update the JZ to a JNC to properly detect if SEV-ES is active. Fixes: 63c50d3ff285 ("OvmfPkg/ResetVector: cache the SEV status MSR...") Signed-off-by: Tom Lendacky --- OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm b/OvmfPkg/ResetVec= tor/Ia32/Flat32ToFlat64.asm index c5c683ebed3e..429a58c5efd3 100644 --- a/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm +++ b/OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm @@ -44,7 +44,7 @@ Transition32FlatTo64Flat: =20 mov ecx, 1 bt [SEV_ES_WORK_AREA_STATUS_MSR], ecx - jz EnablePaging + jnc EnablePaging =20 ; ; SEV-ES is active, perform a quick sanity check against the reported --=20 2.40.1