Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3242398rwb; Fri, 30 Sep 2022 00:12:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75rcSRtiBj4aZrtJ0I8enfK/yHZOHvmo4zjZ8fA0XvGoX7nO7tQ6e1ItMmsMPUBaZeVGmT X-Received: by 2002:a17:907:9495:b0:787:84e9:35c3 with SMTP id dm21-20020a170907949500b0078784e935c3mr5555210ejc.701.1664521979299; Fri, 30 Sep 2022 00:12:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664521979; cv=pass; d=google.com; s=arc-20160816; b=zxP+ZXHRVHgclXAiIRr4dKBR2VsLrSCC5cXwxqBUKLzd9tkzku1oR7Rd04VZWn25z8 E9byHewSPXrwHJztWQDjhYdaHf8REzKtTrN/RHt9ynVDvywqh3iWSwvDckmev3kMm6WI fogZRKNbrzy7cSFmM46pRzhgV+Iw3QXG/BC6slRK60qtAP44NydnupzoLtxyrRF6WwK7 wxe/oejNLJm7V9joeyQsacCaYkwbesM96W1aY5qkOw0AkHZt9bITlGDWopEwuHckXioL oPoQkMNukRVxgHtZMwY2w7wLnboQVWZHrgJgmufDlx/d+neclu/jDzfxf0edo1ZDtCUr Xtdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=ig5/f9yGkJ9lGAtU8YAhY4+anw7sGzZbBu/lcG43jwk=; b=VvKQj2NJgf1QY90pesiVRQyYPPAtZ/FLEDOrQpRN1bvw5dWXLt4Vhbml/cSY3Mu6wY d/kSnIEVjUAfFjhq5DDI4K5rCz4DzJ7/8/gVYsVtH+Y5i/Vz/SlqLxn9w5o4S5venZCN +za7nPUEqX8zqwwioB2Dlw4eiLUpgmoo6LzbOl8G0knJ4KBO8KtSP62vY29EBJ6VUuPK i9vbmzwqduD6PZzZw4sP4s4CrHJ0OyvmjiNps8tKRx6n6hlC99buJ8weLwUY7y1hb9je akju5kwOB939+m9kWaVUrwGDv7Nq1K9qme+ELRp4dEY9X7CoPOGSzbDDs39WPuHYQHhg 505Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b="YrHo/l8t"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a170906490100b007829d30452asi1146854ejq.583.2022.09.30.00.12.30; Fri, 30 Sep 2022 00:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b="YrHo/l8t"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230450AbiI3Goj (ORCPT + 99 others); Fri, 30 Sep 2022 02:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbiI3Go2 (ORCPT ); Fri, 30 Sep 2022 02:44:28 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140082.outbound.protection.outlook.com [40.107.14.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0883DC77D2; Thu, 29 Sep 2022 23:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aMhftuYmIpZd2kcU82FdL1vpqKzb+hHWeXh/AJsbK4XyDn3QBsdBqIC/F0x2Voei2EWL7ta9Fc2cUaWLUzySBm4o2HSKO9rL8MtX9fbFgO6lpdW+qXUV2XJqq7gycrlAAV6EwHMCiJiFvUbquICRMgfP9JV7fBe7NPBMjYRCTAnjVewFiR7/1FKgFGHGFLA+XTbDW0fLDRg3RSX7OwZRpwY/mCaM4WSEWoKBHAC6wVJePaPFvAf/knCZJpzNB3fJfQ6gmyEsCyh/tQGNpvnZ4vX8F5oVNoL0p/yT+NjBbwvfus8QG6oeUjpf5sdPILGuyYk2gN8GsHMmbZEoEJrvDA== 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=ig5/f9yGkJ9lGAtU8YAhY4+anw7sGzZbBu/lcG43jwk=; b=cgHtxCOIMcQ+1xKN/dfS27i4LCeSxos2wF+ome7jtPjd2CiAYKQm9aVX6Tvv6BJqPZBGeNUGRWOIqG2amb1BAmenee2ZNa3CbmiX+rUvunzbJ2eV3eFptTETX4v3xIFBNzZ2r0LmqBwa0cSK7A2oh6oCbhTAl2lqIMpAbnsUPC12uwxS9TZJvshSXdYyzXD7tdEiYxgECf0nxq/KoMfaW24b3GCbYokSeNpHZhJP7Nkg3O7AioVAGhqMSjlkW4/VDB3qfO4zY4bBIKFOGXCgcYDKUK5QFtX8tRSHNYLcKqiNeB8PuKwC5kve2piWWES3oK8VKC/epjPyGgaOd0TCEg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ig5/f9yGkJ9lGAtU8YAhY4+anw7sGzZbBu/lcG43jwk=; b=YrHo/l8tL+I9+xzdq2f6HTJhx0KMWPTwKNtVJreIA9fAY8IscYwQE7rF7JeYVput+Ck1XQXFqXTDHxZthzFJA/gC8+3IgUnh3AsW1AmtWWq+4CdzLLYWrdx4C2DYOJ3qtspZH+seVp8kIqfcL6fORmvo8PlPsZNntHl9fsCXbh1upZlZiHjRm5Lo+ShT7Vs0rT586s91EETfP8q7nLa9chuka6BfEPY5sZCSMPUeiL2ii6sDTEeX+K+QJWZ6tJ6cIAqmQj6pLaaU3gj2TQR+JBxcRLQ9/3maNggQWK/upskHiy4ieB9kbFSsc8CbaN7n1b04UIIiATlU/0yUDGXQNA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PA4PR04MB7599.eurprd04.prod.outlook.com (2603:10a6:102:ea::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 06:44:22 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2459:15ae:e6cb:218a]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2459:15ae:e6cb:218a%7]) with mapi id 15.20.5676.023; Fri, 30 Sep 2022 06:44:22 +0000 Message-ID: <282a225d-8782-0321-6f0e-19dd4510dc42@suse.com> Date: Fri, 30 Sep 2022 08:44:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v4 1/2] Avoid using EFI tables Xen may have clobbered Content-Language: en-US To: Demi Marie Obenour Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Ard Biesheuvel , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck , =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= References: From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0115.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::14) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|PA4PR04MB7599:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c3e36ac-11b0-44f5-5e38-08daa2af3571 X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fdiBvFBMCuhOYcClgqCAmmK5Oj3HkE72rjo5wKVmRpr40GAPp/yuhJpEYWyJUMht+ZJ/1iKcNiDCj8LFeJYFAwvMuXX8/Qm7bQ2gHb4VaWMLdspf6PldtVn+f8hJAdPdD11hYvevZbzBa0oiusWEa4xrRSXkZ8U99P35WGGynW/GsWWOjzhfqyU4vfBPBia7iqg6mMSZGwQNGzPx9QJiZHaVAEOgQMuKSyXddjqYHxfNVJJBBGaMUz2KgzxJQWj2z+INzpMlwZHNEu1Pn67HjxGu0sEIRhwwzijFHdVgGnh7M23AWluYBXtKKQ8tlUWiV7loewSIplTvTTlmamL6b1CJpq+Wqn4cybI6lyf/oiPFLtaMhzy/dYFdkXzyTxOqHc6d3rlfFKLc/p7II0vxAL5xU2ZwFMJOEaHjCFgyjeutXvhAzzDqA+/A2UJqDpUR4fAmekO5kDF1vky82Ta1ntQLagfIJS4vxp3Xghgbt033l8gBVrBhjM3quttfO5BFsaBe/jPsKL08eXtm2psEAoEx8P9wsjJ4WHtVX4j4sk+a3mDEaEyTcW8nJPBzI+VoWjkXC6aro9991OrwrZ3KPzu9Oq6ta4LYAhM+pGiNGW+Jtkx+zJ2mbs8rarLGel9Xsc9DeIjutvr5WMgA7DZMH3DXnsFknH97PM+Q7EhjWmvbgsKeu2NtnOsYITpl3xQqW4jM8TK0WZWknEjit8d6lM6XVyRQP+CsjwWyMy0Z4P831wv5/8MFj7nMuCk2dTuILn29KePYpHDoR7rTVPl3+5fzi7bMIx98pGvhEPnzJOk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(366004)(396003)(346002)(39860400002)(376002)(451199015)(31686004)(2906002)(7416002)(26005)(8676002)(6506007)(41300700001)(36756003)(4326008)(38100700002)(86362001)(31696002)(2616005)(186003)(6486002)(316002)(54906003)(6916009)(478600001)(53546011)(5660300002)(6512007)(66476007)(8936002)(66946007)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UjFpZGhHWFFudDI5TnZUdmJ6RkdPSm1FcGFxc2tZVWg4dE1XdEtVZmpFT3Vq?= =?utf-8?B?Q1J3czVNZWZUWG9hQmVKSFBQZWY2Nm9xdC9ZVWFzQ1lvMWxrWHg5YWtrTHhl?= =?utf-8?B?S01ya1RCNTVOYk1xN1NiM3hzNWZRN0twUzhHdzFUUHp6MExBd0s0bkRjdVhs?= =?utf-8?B?OExvRjROekFXOEtUUnZraVJsQWg2Nmw0bVB3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V0FK?= =?utf-8?B?SlpJbG5HMzkzcEpmdFZVbHNubUtyUFA4Q1hZTjFLM3R6R1VMaTBlTGQ1Szdl?= =?utf-8?B?aG9BWXlBVHdUeU1iMGVqaVhMRW9KelkvY1RiVGhqTFp5Z1hEdlRDTWpHSDd4?= =?utf-8?Q?As/S/jjNhCRkUFvM/3TGdo8VH?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c3e36ac-11b0-44f5-5e38-08daa2af3571 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2022 06:44:22.7351 (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: JK4TLx9Mlmq6iDe2pHvLEl9vzDDLN3esgfaVZQbkls7E7M10lZx7mGfuwsKPfLmpx+4Has+jda+B3AY0/LG1SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7599 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.09.2022 01:02, Demi Marie Obenour wrote: > Memory of type EFI_CONVENTIONAL_MEMORY, EFI_LOADER_CODE, EFI_LOADER_DATA, > EFI_BOOT_SERVICES_CODE, and EFI_BOOT_SERVICES_DATA may be clobbered by > Xen before Linux gets to start using it. Therefore, Linux under Xen > must not use EFI tables from such memory. Most of the remaining EFI > memory types are not suitable for EFI tables, leaving only > EFI_ACPI_RECLAIM_MEMORY, EFI_RUNTIME_SERVICES_DATA, and > EFI_RUNTIME_SERVICES_CODE. When running under Xen, Linux should only > use tables that are located in one of these types of memory. > > This patch ensures this, and also adds a function > (xen_config_table_memory_region_max()) that will be used later to > replace the usage of the EFI memory map in esrt.c when running under > Xen. This function can also be used in mokvar-table.c and efi-bgrt.c, > but I have not implemented this. > > Signed-off-by: Demi Marie Obenour In Xen we don't clobber EfiBootServices{Code,Data} when xen.efi was passed "-mapbs". Should we perhaps extend the interface such that Dom0 can then also use tables located in such regions, perhaps by faking EFI_MEMORY_RUNTIME in the attributes returned by XEN_FW_EFI_MEM_INFO? Jan