From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by mx.groups.io with SMTP id smtpd.web08.6754.1624966907117020980 for ; Tue, 29 Jun 2021 04:41:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=cl0E0+Lt; spf=pass (domain: suse.com, ip: 194.104.111.102, mailfrom: jbeulich@suse.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1624966905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=anQvnD7gWPZuTT393Pi7tGYU/BRpMTif+tKygLPp5G8=; b=cl0E0+LtW8O5pO5i0mQBRIa9pyx/VFDZAJ49rtonl0hhDI5oPg9BC9CCS1VUDkT61E5Y7j k2eNAXzkqr6YHsaVlXlpjyLntssAfw5LX/V3SeqMZTfkHQvmKjNrf/a2uzcLu6Eft9mUmu DTduaOB5iqE3wlxiYjCDWKdoe64bPLs= Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2056.outbound.protection.outlook.com [104.47.5.56]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-14-AnIwmKz_MO-M_GgUtt_wzw-1; Tue, 29 Jun 2021 13:41:43 +0200 X-MC-Unique: AnIwmKz_MO-M_GgUtt_wzw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GCWFy+WK88TaMgrV61hSg+7IanbhIKF6MQ5Vdzgi4ee6irqn4b0W7d51kT+S7qRnbuJi1aK8MB13tqgubjuVnvilKgePlNrrGGeemeqcFfqmW7enfM7m2FdKM18KhvFGFfvemd6gO64wz6V8ts1vM9Ovh0S+90crW00vOqcEstCZtbV88KhvYB3G3gNcaxzd8Yj5Xi26tT3dYgWAN8WT2k/r8rUzWN1th/vOFDOoL8PbvfExELwl+SWshSBiyiv23L4iEYDmIf7/aH3bt8CbezIvHD7h7mGafe9ITxpycTCIOqqU5UTZtqiuQT7NL93oiCju7ecbIwaZ7i1mfAxbYw== 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=++vpy8n20q7VGHoVFdLPisbbTx0lp8rnKC7Dp70lO4U=; b=FXw2RsSqjMf4ZV4UOQvbzGqL2qjRgv/Fu9F9BY4y+zLYmdy0d2RMh3271wrEyiBu6fULTHWUS9mZe3Cy+2j6SI/ZU73X6P5X2WvjERxKmC8YFGYxSO1sOjJ0aIto47zTabzK6HR2UtLh/Opkgvfn7DZuJcRxJ1vSZ0MS4imdMAeBF1t5X4ZTGayYcP4V93fOTkqb4l5b5gq8n+ftnP/YeLtaRqdnidRPe3TL2d9z++NHo6FSlFLrtb69UUbNk4/Ps0D3E1jF/U3U7Y4qyAfok9BSWE472m95G+h57wMtt8egYEI6jyb4IxaS9GNrJoDQzBtKD/Ha0t4q56e7M4S49w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB7087.eurprd04.prod.outlook.com (2603:10a6:800:12a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18; Tue, 29 Jun 2021 11:41:42 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::99d3:99cd:8adf:3eea]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::99d3:99cd:8adf:3eea%5]) with mapi id 15.20.4264.026; Tue, 29 Jun 2021 11:41:41 +0000 Subject: Re: [edk2-devel] [PATCH] OvmfPkg/XenPlatformPei: Relocate shared_info page mapping To: Laszlo Ersek CC: Ard Biesheuvel , devel@edk2.groups.io, anthony.perard@citrix.com, Andrew Cooper References: <20210628132337.46345-1-anthony.perard@citrix.com> <4d4af77a-8d70-d473-179f-14b3cbc0e6fd@redhat.com> <4960ad34-2097-0f08-553c-477e90e19fe2@citrix.com> From: Jan Beulich Message-ID: <24915ac4-7892-cd27-f587-a59dcee9f5b7@suse.com> Date: Tue, 29 Jun 2021 13:41:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: X-Originating-IP: [37.24.206.209] X-ClientProxiedBy: PR3P191CA0002.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:54::7) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) Return-Path: jbeulich@suse.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.156.60.236] (37.24.206.209) by PR3P191CA0002.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:54::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19 via Frontend Transport; Tue, 29 Jun 2021 11:41:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39b9987e-01ef-48c4-b812-08d93af2dd2e X-MS-TrafficTypeDiagnostic: VI1PR04MB7087: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7MxjhqQA92hURHSFQtUfm9Glv2RwhcW6t0zA82AdKe37scUfEKyG/rqZOfQrqDifTDvbcJ8fdUom4pb1RBYXvpMZ6MPWkkwb40SORXWLNJuBGBk1Xksx2I/i9e2/IzyFKc1WI4adcMEXfk9dUzVut4DiP0J3fOqF7NLYbdZzhdpMbmAsmD1d2C6aPeOBVwCrl1bzcJqmFFMeMW4UZ6BT3bAndfBmeTz8FSJsANJHBwo6nJWrCavoRBrLlLCWaXLGzL1DT2bJd6nLRncH8JV1wo4jdnHIW+tRPHYdDz/chqIofukYmtxxe8Y/Q1EIaAuVRPEE9ZaWkunOTt+va8HqYpq0EWdAL6EGG4ba5gCztRkes2Y+gugCcVRRQUtlSAZDbDYma4hekxs4JOfcWs9EdoLDblXDvz35/VANkwX+pC0+ZaSBKL1+8ZIjY2Vmt+qzVOEhk8MLwTA/SoPHPI1N8uGhOga3+pNltcqa+wNXPyJm8oefqvS/fjOtwqLsVu2eTxdMzzvaPHI9fx86pA7UGxBu2WfuMT2TN3p+XZtfls2EsP3RtzI/24Qlv0ZkbNbJWn8C6b4wMbtjH2bwfTpQvy8CYcidutIOEeugPef56z4uZKa0xwVZl3F2o7Gcr9OsevKctD6lLItVGi8mY2aVV68EbJLEm87/bSw26fZmOg+u8GtCBJPHQnn40ugac/lG0yO+8OPveaXcNIakGa2s/e+z5L/XHwif+JETv1p1tuZOpGsXhAQ0MnACb2FomfSbHGKZLDIgmb39E5RwhXcP6BoF4xIIIcBOBpsK+3+cuaqxbfIKPIogKsRLMs6iGMrPHsb4qUEKXEEDmcv3t6SJxV8K0+wwonD+SPjFCJ1XzlE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(39850400004)(136003)(396003)(366004)(376002)(36756003)(2616005)(956004)(86362001)(83380400001)(8936002)(31696002)(16576012)(6486002)(966005)(16526019)(2906002)(31686004)(38100700002)(6916009)(478600001)(54906003)(4326008)(66556008)(66946007)(66476007)(26005)(316002)(5660300002)(186003)(53546011)(8676002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?az6BTzxKAtlsyjh0bqfwjB7ONy+2yDwVas4wPU8Rl/8IzTWfBL4v/daKyqZM?= =?us-ascii?Q?ZDuFwX+kgbncQDpyAWoOF1kt9n1ezlJElE+WMvdiov7P99ZVucmnYceAuypG?= =?us-ascii?Q?iX72YEWoOHrEWs9UCnXBFyilZFUFGpiRke+/8eU1vf4XD9QrAWS/Rvfir5R3?= =?us-ascii?Q?xRFmP5s8xoUE8gnzncBeGtXEGwOrA8WB2/NlHq7BQ/LhGmfIsCiNZ+OLLW0P?= =?us-ascii?Q?0+ebDeHKVRWvprlpzDtgli7IQx+8jKLKr64EFVyjI7RKlBfHDLOWHFSLLR5O?= =?us-ascii?Q?jyCsG0a83TZy71FJxQSK0xG59a/ArHby0pfta9qbGtGFlcBuv+shaMuvRxZT?= =?us-ascii?Q?f2VqBj+QBKL6t/g7bD8m6XWeej4bjwWpboxmZkl9Xgw4KIrpC3hUHNJIZ1YY?= =?us-ascii?Q?Vyv+ByXaUhIsvNCoqIcUIIiPoOnbzJHC4BbcwhW901TDiN7tpwUgsyMSbbT6?= =?us-ascii?Q?NW1eav6xXyvv8Jj9/hvJBa5A440GTByjnUWrMZJYFTNB3asPSqFTSAsi04+j?= =?us-ascii?Q?1IydNA0cKXf1n34a7DKnAuilF3Y83V2RKF7UitgWSQPvtIHnQd0PpG4hlv4W?= =?us-ascii?Q?fH9DHo46nD7qyO7KGxu/8GQRcLZNP9A9PehbOUukVul5+f7CXDYDJHv0dJ8a?= =?us-ascii?Q?+s4X6NJMrLrjCydPpACmEQZoYw9ICrNxnA4iMm+RzxJCFTbonh0EqD1+UXZe?= =?us-ascii?Q?AvYmq7FxhtOzgtu/a7zVjOFTdwpWRbnn4KdkPlsvPjx2w975dx2hSi1/JI4o?= =?us-ascii?Q?gpwZYg3Wja2c+pYkr0Feef0kS5feCPTRZbbCCh9Y10lzN+LQu98EyRbJNfI/?= =?us-ascii?Q?oVnbspkZAjHi1f6pNMbYMSV1HUB6GUlN8C+FgkPdGSOOfNu9/uTYi72ypQ4A?= =?us-ascii?Q?2siBRoaxqOg6gLr6mEt92aDVg5TbORlGnb9XZvukMC/Xurly94e9QPGj7ShO?= =?us-ascii?Q?lNry2pEa0gcolCc0v5bD00wSYfZy+zCs4J1pETX3ahyHbezUsapVCtand+YG?= =?us-ascii?Q?SWu35L4/07U3+tqoinUxF0aLh47I6gPtIMn4VXcmPSdTAEuwMuwRcE00Ywle?= =?us-ascii?Q?q5SS4p3bkl8m0x6qqsRYGwO3Z/6UCRacltQ8tvQS8ikucye0gtG9oIPa2u6J?= =?us-ascii?Q?oLHdCTRzGTPmUsYJd12oqK5L2eTfee/QnqQyb8VhJSqr2M9wQ0CVsyUwICbL?= =?us-ascii?Q?pPmAtzNmHK2zwaMr3Ij4erblQ7z9AKTRuFVEuF0P80ZEPzSydYInSRQbwGPn?= =?us-ascii?Q?6laU02eEs6SnpK+Bejrw9k4VUaE0StXl7zkdRsUmJ5YErqW+CUXNmNm+G8e4?= =?us-ascii?Q?eNxpDrpShgNw832k1uMbDIeq?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39b9987e-01ef-48c4-b812-08d93af2dd2e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2021 11:41:41.8518 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MeEmi3BRsLrB0Am8zS4rM9wWqiARl2HBKTM3VQKE4nw7rdLj6Ur+StQQGv5JTapqnhL+fSp/dqdhyhSeW/KqJA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB7087 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 29.06.2021 13:29, Laszlo Ersek wrote: > On 06/29/21 12:35, Andrew Cooper wrote: >> On 29/06/2021 11:07, Jan Beulich wrote: >>> On 29.06.2021 11:20, Laszlo Ersek wrote: >>>> On 06/28/21 15:23, Anthony PERARD via groups.io wrote: >>>>> From: Anthony PERARD >>>>> >>>>> Unfortunately, Xen isn't ready to deal with mapping at the top of the >>>>> physical address space, so we relocate the mapping after the LAPIC >>>>> location. >>>>> >>>>> See this thread about the issue with the mapping: >>>>> - https://lore.kernel.org/xen-devel/f8c4151a-6dac-d87c-ef46-eb35ada07= bd9@suse.com/ >>>>> >>>>> The PhysicalAddressIdentityMapping() call isn't going to do anything >>>>> anymore since everything under 4GB is already mapped, but there is no >>>>> need to remove the call. >>>>> >>>>> CC: Jan Beulich >>>>> CC: Andrew Cooper >>>>> Signed-off-by: Anthony PERARD >>>>> --- >>>>> OvmfPkg/XenPlatformPei/Xen.c | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>> >>>>> diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xe= n.c >>>>> index a4e82b356936..9c6641895970 100644 >>>>> --- a/OvmfPkg/XenPlatformPei/Xen.c >>>>> +++ b/OvmfPkg/XenPlatformPei/Xen.c >>>>> @@ -569,7 +569,7 @@ CalibrateLapicTimer ( >>>>> EFI_STATUS Status; >>>>> =20 >>>>> =20 >>>>> - SharedInfo =3D (VOID*)((1ULL << mPhysMemAddressWidth) - EFI_PAGE_S= IZE); >>>>> + SharedInfo =3D (VOID*)((UINTN)PcdGet32 (PcdCpuLocalApicBaseAddress= ) + SIZE_1MB); >>>>> Status =3D PhysicalAddressIdentityMapping ((EFI_PHYSICAL_ADDRESS)S= haredInfo); >>>>> if (EFI_ERROR (Status)) { >>>>> DEBUG ((DEBUG_ERROR, >>>>> >>>> Acked-by: Laszlo Ersek >>>> >>>> I guess I should merge this after Jan and/or Andrew ack it. >>> Well, I can informally ack that a move like this is needed, but I can't >>> really give an Acked-by on the change, as I know next to nothing about >>> ovmf, and hence I cannot, for example, tell whether the chosen new >>> location is okay to use there. >> >> That bit is easy, although it probably does warrant a code comment.=C2= =A0 The >> choice of location doesn't matter specifically (so long as it's not too >> high for 32bit toolstacks to cope with), but wants to be something which >> isn't RAM, and ideally doesn't shatter a superpage. >> >> The various MMIO ranges (IO-APIC, TPM, LAPIC) are 2M aligned, so LAPIC + >> 1M is firmly in the middle of a range not used by anything else, and >> with APICV/AVIC, the LAPIC does have a 4k mapping to the sink page. >=20 > I'm OK with informal ACKs of course, just please let me know when you > guys feel it's OK for me to merge the patch. I saw the CCs and so I > didn't want to hasten and merge the patch before you could object. I think you are fine going ahead as long as from the ovmf side all is good here. Jan