From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 89AAED8004D for ; Fri, 2 Feb 2024 19:28:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=QOUoBaIEQx9Vk2W5IVxanbnNQ39MZjeZFr80KScLrX8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706902134; v=1; b=PsN12IbS82FzOEpoBdvGQ8syu/e9F8xCOpdmpyFh5awBnA9s2ad9/vTvVLfzr5Qu5/nocHLw wjrhx3UM7SoJmWbf8rsSpO1LgVTw8eRhwjGxj2LzwOqDPxzb9wOkGJmzyOE4yfITQJ1wlPiR88Q kugh5lHwY4f2RppU/gkRtw7A= X-Received: by 127.0.0.2 with SMTP id 1yI0YY7687511xNx3vuKlMIA; Fri, 02 Feb 2024 11:28:54 -0800 X-Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.46]) by mx.groups.io with SMTP id smtpd.web10.1329.1706902133367857103 for ; Fri, 02 Feb 2024 11:28:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O7QrPRDRJ4CB9WvTektgWzZop/uJQXSXo7k01dd4QjmANvNN77+MRfKdymrKIGCUBNKKje0WqrZwU4IWL/rgh5u5ZvFMLqLCGmEoFhBcL3ZnG0xnSJbiw2iDUkR9crL574uKRDWEm+HpLVc3nWUQuPhf5S0S/tvxa58XdmaJ35P3XnoZEluyPF+uF1vPDsS1J2UUewI/BuhAH5YG2pGH9IUCwgVzsEdJBKjhmjGz840wnVr/F0dwh2iH+FuwhxiA8V4PcBRnwXPfdulNBhd3Mgwt33HWk0xk3Ne6NrNoNOIRQdhdlK+cS2HkYDfdxU3jnntfTVkvXEKUGiwgdjUKzw== 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=SvLmwTOfvgUdYX7x7EOsZukVAqWizdzM2eRIg+IuQVE=; b=LecgFsh+mOmq+vzDJI7uqHdL4vT7S32wultA5saMqmJGzYwZ/vPtWu86qvsf4lb1A0IfxIOGMu5y/giyNvFu4vM2JklfgSwd8tUTeEBSIz1JR4BkiTQ1n+I/QfgWuW5j4oU+28LXVmSfpGsbEVoU000DShTUBmC9isprW9S2jg7RdGi8SgQrQHZTe9j+g1N4Tc/gFmjKZObnJO4Cog+RTpxv/oD9scjQ6bhbyj3ztatGbFdfYXkiYCzmXp3/BFHpYLsIAOr2SG7aZCniwxBpr3ObtUjpWZb/LHdt+w+xZI5ZAyKOmVTbvlBFKXkHanih+LkJobLcoueVkbkO+XjTiQ== 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 X-Received: from BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) by SA3PR12MB7950.namprd12.prod.outlook.com (2603:10b6:806:31c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22; Fri, 2 Feb 2024 19:28:50 +0000 X-Received: from BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::200:c1d0:b9aa:e16c]) by BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::200:c1d0:b9aa:e16c%4]) with mapi id 15.20.7270.009; Fri, 2 Feb 2024 19:28:50 +0000 Message-ID: <0ed8abc3-e2ce-6468-1a10-bf53be129b7f@amd.com> Date: Fri, 2 Feb 2024 13:28:47 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [edk2-devel] [PATCH v2 0/5] OvmfPkg: Add support for 5-level paging To: Gerd Hoffmann , "Xu, Min M" Cc: "devel@edk2.groups.io" , "Aktas, Erdem" , Oliver Steffen , "Yao, Jiewen" , Ard Biesheuvel , Michael Roth , Liming Gao , Laszlo Ersek References: <20240130123204.764453-1-kraxel@redhat.com> <3jj3lyr7gmuzzdp6f7dnj3ow6sox5uikdx7ysb6xuoxryghuzn@r3jatiaty24n> From: "Lendacky, Thomas via groups.io" In-Reply-To: X-ClientProxiedBy: SN6PR04CA0077.namprd04.prod.outlook.com (2603:10b6:805:f2::18) To BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5732:EE_|SA3PR12MB7950:EE_ X-MS-Office365-Filtering-Correlation-Id: c8884747-c244-4886-07fb-08dc24252ee4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: ah3ovBtc0pxTd9IM0btO9KBYgMzllH1vwIPKcWJbAdWOMuX9QlAqoIFo0F/Kb7fx84Qsdt/lHsdyvyh1AgBiPF2v87dUEhq+BG3WIfYBoRSrIJWvIsWvJs8tKg4Dqc5aJG9AfZYZAyXTIva5spfhsUR7nUXMY1eNv2qYv0mzRs4Oc65isZGj27jjVOR1esg93I2GBQMIjU+GlXqIl43W0LG+9ltsns2uzfY1s2PSEAofKaOARg8pXAntzrkXdln+772kCcsuRCwTXs1aWfH1VAaqplNnkh2QrjGbBs/aNVtXUbdvLO94Rh6nWz2EPoPg49Ck86GWSJeoFzpWHP4pXISU6y6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XU4bVQzOUhRajRreVQrcGY3dnBST2ZsYTRHNWFB?= =?utf-8?B?bXBzelFiSDBZSU9pL21xTFdLYlZ5K1JWcUVrZDNmMXZyUkgzMlNVUjdJbFE3?= =?utf-8?B?a0NDOXJwOWorWTJxOWRpWi9ObklqVHlyWWpJTlViUmhiaVBNcnVEeGJMRmR6?= =?utf-8?B?b3lnZG5qSnhlY1QxNjA3QWtMeHBISWpYKzJ0ekRYVXUxTFhLbG9aQUJ2M3BE?= =?utf-8?B?d3pQdUNwdkJnZ0JQV1NDUjRnWHFhbldxL1Jnck11NXIvcGRFSVdGbGtXbE1D?= =?utf-8?B?NVV0ZzdNNCtjTmg1VktPZU02TmhyNEliWENtT2ZPdlhmNUkzbjB5TFBML0px?= =?utf-8?B?R2dwTzFxQ2E5bjAzWkc2STVaU2tXenBDT1JQcXZnd3o3S250blhmcnRmekZ1?= =?utf-8?B?M2lKWUZ2SUp2VERtclhndDc3bERIVGxrUlFRWmJEMFBTWU5qdkFBZlNBTVBJ?= =?utf-8?B?cEdiVk04ZGhBSit1cVRIZmZWWUxTK1dsaGc2SnFpTUJlM09nWEFzV2ZNUzJL?= =?utf-8?B?YzFBYW1LQWJVS1RuZkdTb1k5TjlLU2RNNUlFeUZPb29uM2ZUdFZ6eW1xekVV?= =?utf-8?B?VnlkUmhJd2Z2cmhxTmhvN3VvVEZXQ0RQanpacDFhK05GVjBPSnF6NWgrMTZz?= =?utf-8?Q?Jx5lSuvUmSL56xkO/bzULJ/Mf?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8884747-c244-4886-07fb-08dc24252ee4 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5732.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 19:28:49.9842 (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: eGPZJaW+ZeDiWTGA2KUx6PNen/NCq/HGYIwFus2YnRklYukoH06Gn2BgfIXohAXKMFFWCLeJ9eNMtjDvjxmG9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7950 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,thomas.lendacky@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0R7aQD4m1GHKrUgUJ5ljlup1x7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=PsN12IbS; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") On 2/2/24 02:44, Gerd Hoffmann wrote: > On Fri, Feb 02, 2024 at 08:30:23AM +0000, Xu, Min M wrote: >>> Pushed branch with two experimental patches: >>> https://github.com/kraxel/edk2/commits/devel/paging-5lvl/ >>> >>> One for tdx, writing different values into TDX_WORK_AREA_PGTBL_READY fo= r >>> 4-level and 5-level paging modes. >>> >>> One for sev, which adds a 2-level page directory for the first gigabyte= and >>> places it at the same physical address it has in 4-level paging. >>> With that SevClearPageEncMaskForGhcbPage should work unmodified in 5- >>> level mode. >>> >>> Test results are welcome. >> >> Thanks Gerd, it works in TDX. One typo in the patch that pageTableEntrie= sLoopla57 and pageTableEntriesLoopLa57. >=20 > Thanks for testing. >=20 > Added a second sev patch to the branch, rearranging the #vc > handler uninstall to make the la57 cpuid checks work on sev. >=20 > @Tom: Would be great if you can give this a test So this gets us past the ASM code CPUID instructions, however, the SEV support is still assuming 4-level paging and so: SEV ASSERT: AmdSevDxe:SetMemoryEncDec: bad PML4 for Physical=3D0x8000000000 ASSERT_EFI_ERROR (Status =3D No mapping) ASSERT [AmdSevDxe] /root/kernels/ovmf-gerd-build-X64/OvmfPkg/AmdSevDxe/A= mdSevDxe.c(235): !(((INTN)(RETURN_STATUS)(Status)) < 0) SEV-ES and SEV-SNP ASSERT: PlatformPei:SetMemoryEncDec: bad PDPE for Physical=3D0x7FE5C000 ASSERT_RETURN_ERROR (Status =3D No mapping) ASSERT [PlatformPei] /root/kernels/ovmf-gerd-build-X64/OvmfPkg/PlatformP= ei/AmdSev.c(254): !(((INTN)(RETURN_STATUS)(Status)) < 0) FYI, this uncovered an SNP CPUID table processing bug in the ResetVector code and so I sent a fix to the mailing list. Thanks, Tom >=20 > thanks & take care, > Gerd >=20 > PS: I'll be offline next week. >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115069): https://edk2.groups.io/g/devel/message/115069 Mute This Topic: https://groups.io/mt/104052206/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-