From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.69]) by mx.groups.io with SMTP id smtpd.web12.2407.1576185553384749854 for ; Thu, 12 Dec 2019 13:19:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=u6X3ILMt; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.243.69, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DPQsdjv6Z79WnSF1WJGesw2eReRaIExr4SgqSJZTkvqnjZVnfiskPlmmxtiO+qpOzwngdXd9A2Sx6qmCqpDros66vvoO7QK6u48cSpGwSGFSjwguP37jkiXFF/TEd8F5eR3CRVrTjayOffHLO651Oi+DflOR2wVO3pLuWp0c/1vMA2VQV8wzND/EqekNng0vKkg36Lg0OWrIHysvJepbHa1EDjzt6bwdv7hmpxv2ARQs+NDyg8AVbcwpoNzqWbP637GzbeC9flKOzGb7E5IMHkDItw4hX8/WVgOvnhyjDNCzFd7uYMWQdnynd1GmTvc4xCJPqpIEqG37ldN99WzbEQ== 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=4QIRedzVjdt/i3YFOM2W6HZ94mQ8RLyRavFCrDF9AX4=; b=kFDJlqWAS0USWq/tVJuxdQ5+x6lz8YhxuTV4Nws0s0zXYhDgcGZi4oKO+aUwuttT3+SaVEEyb/Z4Z0eC4oapn82dw1lGTIYI9+hkLzWMKHuIRJVmEMuOrxz2k6mfy31AcxLDg14fved5HZdZy20K6RDicmsskw+osnQ5j1RlOxTLaDUqmbVxYOw38uHc4J9QnK9iKt0+YkfV21B6A4MasGu0VPAPlPKtsWIwLpmGgU0vfIcE0+zMgoNSFoFv9KWVZrZFIF5F+3jnJ6BI83merj2pMl56cJdJ+TsS1XYEu3R21FVnmi/bogrJT78Vv0tqBrvrydyxsGG/ir6f6MyPIw== 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=4QIRedzVjdt/i3YFOM2W6HZ94mQ8RLyRavFCrDF9AX4=; b=u6X3ILMtT7MCa2/9Xei+hqpOj/KkylA4ovHwVOuDZV6tB76VGUWwE9g/p5ywZtue065oiWNbOUuGVAfYjz/maU8+LTmmZEfrVSEka40xPh3fnrf13O6f2XFuQmfgRfbSzVvw8Riwx+irdqN5IBXr+Tp9G2oohp+6ugUZFaGdTHQ= 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 DM6PR12MB3178.namprd12.prod.outlook.com (20.179.107.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Thu, 12 Dec 2019 21:19:12 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::c16f:b437:4266:dbc1]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::c16f:b437:4266:dbc1%4]) with mapi id 15.20.2516.020; Thu, 12 Dec 2019 21:19:12 +0000 Subject: Re: [edk2-devel] [RFC PATCH v3 33/43] MdeModulePkg: Reserve a 16-bit protected mode code segment descriptor To: devel@edk2.groups.io, ray.ni@intel.com Cc: "Justen, Jordan L" , Laszlo Ersek , Ard Biesheuvel , "Kinney, Michael D" , "Gao, Liming" , "Dong, Eric" , Brijesh Singh , "Wang, Jian J" , "Wu, Hao A" , "Bi, Dandan" References: <734D49CCEBEEF84792F5B80ED585239D5C399A87@SHSMSX104.ccr.corp.intel.com> From: "Lendacky, Thomas" Message-ID: Date: Thu, 12 Dec 2019 15:19:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C399A87@SHSMSX104.ccr.corp.intel.com> X-ClientProxiedBy: SN6PR04CA0088.namprd04.prod.outlook.com (2603:10b6:805:f2::29) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ba325e10-39d2-45c8-7346-08d77f48eed1 X-MS-TrafficTypeDiagnostic: DM6PR12MB3178:|DM6PR12MB3178: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 0249EFCB0B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(136003)(39860400002)(396003)(376002)(346002)(366004)(189003)(199004)(13464003)(6486002)(8676002)(5660300002)(54906003)(26005)(81156014)(316002)(86362001)(7416002)(19627235002)(81166006)(8936002)(31696002)(2616005)(6666004)(186003)(31686004)(966005)(66476007)(66946007)(66556008)(478600001)(2906002)(36756003)(52116002)(45080400002)(6506007)(4326008)(6512007)(53546011);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB3178;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: dvj6YjLytn3VuQmjyg2REEWmAuEI4LXGQkQOvOSq4qcQk1vOxMOe/uxXbWqAirLMaYtpv5zT8lUj1BlOcxc/lhsILaI90aeLOszTGJpLpdFHaSqpiPB33nxeTBnSYZMMlyznRqVddOrGtNHPtfqq4B69PPa7Vc8DkMJh3UmgAGscOAEPDNiBCQgLH4i6E+A+emZtr9uXdvD2rDztAZPPXQOJ05nDrrOMRpWAbtLN+UOCfVU0IBDLYSSSBD59vpMFZgVWirQD+DKeonIVKqnB9nYrrvbRNgtwopKMenPr9svCRkU3gkAjWKttNc8+d48X/r9YBqhirxBBG1Wa2ajl/YXQY4lne3qcNBWEmcu3MwX+qwzwD99lcx4dJV7HyAhEp42ZfWGeH9Lr/2m9UARrHYCLsX1QAVfIywgC7k6PjAYXetHfvXVFz6QcodVNGiAoce3nkdADj3eUGTfACgzN1MHWKJW+nC1MSgWEbhULCN4iyhlwJMWlDcUpZRcizprCwODxySEOyRxPUrCREMYC7fbp1r718FZlr/g2SPEL4vQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba325e10-39d2-45c8-7346-08d77f48eed1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2019 21:19:11.9070 (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: q0tHNSolMkMG2LSg55gJxVBrqxFmod8tmVieL12SO8+cI8ZGZJRxjv+hYDEsAu9VVQqYZ0dU5EeFF7ZGd3qRqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3178 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/12/19 12:57 AM, Ni, Ray via Groups.Io wrote: > Is the 16bit code segment descriptor needed in early DXE before CpuDxe (DXE MP)? I don't believe it is. I did this to keep all of the CS descriptors consistent since the ones here seemed to line up with the ones in UefiCpuPkg/CpuDxe/CpuGdt.c. I can remove this change if that isn't a requirement. Thanks, Tom > >> -----Original Message----- >> From: Tom Lendacky >> Sent: Thursday, November 21, 2019 4:07 AM >> To: devel@edk2.groups.io >> Cc: Justen, Jordan L ; Laszlo Ersek ; Ard Biesheuvel >> ; Kinney, Michael D ; Gao, Liming ; Dong, >> Eric ; Ni, Ray ; Brijesh Singh ; Wang, Jian J >> ; Wu, Hao A ; Bi, Dandan >> Subject: [RFC PATCH v3 33/43] MdeModulePkg: Reserve a 16-bit protected mode code segment descriptor >> >> BZ: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2198&data=02%7C01%7Cthomas.lendacky%40amd.com%7C8ec88e8912cd4b99eb0f08d77ed09b2c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637117306738013792&sdata=PwSQc53mtPMUTALaRhQrcQzGI3ooPUMhcktYLi1ezfk%3D&reserved=0 >> >> SEV-ES guest AP boot support needs to transition from 64-bit long mode >> into 16-bit real mode. This will require a 16-bit code segment descriptor. >> Reserve one of the spare segment descriptors (0x28) for this purpose. >> >> Cc: Jian J Wang >> Cc: Hao A Wu >> Cc: Dandan Bi >> Cc: Liming Gao >> Signed-off-by: Tom Lendacky >> --- >> MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c >> index 284b34818ca7..c9cf2e36214f 100644 >> --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c >> +++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c >> @@ -33,7 +33,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_GDT gGdtEntries[] = { >> /* 0x10 */ {{0xffff, 0, 0, 0xf, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //linear code segment descriptor >> /* 0x18 */ {{0xffff, 0, 0, 0x3, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //system data segment descriptor >> /* 0x20 */ {{0xffff, 0, 0, 0xa, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //system code segment descriptor >> -/* 0x28 */ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, //spare segment descriptor >> +/* 0x28 */ {{0xffff, 0, 0, 0xa, 1, 0, 1, 0xf, 0, 0, 0, 1, 0}}, //system code16 segment descriptor >> /* 0x30 */ {{0xffff, 0, 0, 0x2, 1, 0, 1, 0xf, 0, 0, 1, 1, 0}}, //system data segment descriptor >> /* 0x38 */ {{0xffff, 0, 0, 0xa, 1, 0, 1, 0xf, 0, 1, 0, 1, 0}}, //system code segment descriptor >> /* 0x40 */ {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, //spare segment descriptor >> -- >> 2.17.1 > > > >