Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56A09C4345F for ; Tue, 30 Apr 2024 02:56:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.714465.1115712 (Exim 4.92) (envelope-from ) id 1s1dez-0007kU-SF; Tue, 30 Apr 2024 02:56:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 714465.1115712; Tue, 30 Apr 2024 02:56:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s1dez-0007kN-Oz; Tue, 30 Apr 2024 02:56:01 +0000 Received: by outflank-mailman (input) for mailman id 714465; Tue, 30 Apr 2024 02:56:00 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s1dey-0007kG-F8 for xen-devel@lists.xenproject.org; Tue, 30 Apr 2024 02:56:00 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060a.outbound.protection.outlook.com [2a01:111:f400:7e88::60a]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2b8951a1-069d-11ef-909b-e314d9c70b13; Tue, 30 Apr 2024 04:55:59 +0200 (CEST) Received: from BN9PR03CA0478.namprd03.prod.outlook.com (2603:10b6:408:139::33) by IA1PR12MB6065.namprd12.prod.outlook.com (2603:10b6:208:3ef::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Tue, 30 Apr 2024 02:55:56 +0000 Received: from BN2PEPF000044AC.namprd04.prod.outlook.com (2603:10b6:408:139:cafe::ca) by BN9PR03CA0478.outlook.office365.com (2603:10b6:408:139::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.31 via Frontend Transport; Tue, 30 Apr 2024 02:55:56 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF000044AC.mail.protection.outlook.com (10.167.243.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 30 Apr 2024 02:55:55 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.35; Mon, 29 Apr 2024 21:55:55 -0500 Received: from [172.31.124.47] (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 29 Apr 2024 21:55:53 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2b8951a1-069d-11ef-909b-e314d9c70b13 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKVaBwEQdSWzUJOrImdl9y2lIISMkdodBFrhxnVaOqkNmLF58Umaw+H4gSWLGIATP4xuAkxhD1FpOhbZXmyazOa9cW7tT32Pg+YyvugipfELAZ5lhaWo8b7maHDu4rdmHWe8fjksKWvw0HaEbH57BXb6F47i8Tj+6uOCfXZa7jiNrot8++XwytUe8rWNNiiPWCZKYGQNbK1LAN3OzWqw7WTCl8cNT4ie8UPRMMi7pWePCFvqdWS0Cl91ixfpC0teBTe0WOMny2DJQdRZcLmreIFnoEcHosvhQtoIv9UQetdhYvcwENZ3Guohz5DTtPhtExCG2b1kNjkNNDenEYPP9Q== 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=oiUZ566o71AWf48GjiUhT6KI92J4Np8zhQZm55hR4ek=; b=oBJ02O84wBIKF6YubxOWbDvqA9LYCQhgSABx/vzPT+MId0DlbEKImmw7oR2Q1sa74+H/QdsuvKPY4daCkV0qccyQEc/R5tF/Mf3SkbI7PQJpbJ0Z719qHCBeHJHfNE06FhhihEx1+0AFMRYXZcTZJyZfmGM72Z6pryCgPpZq9B6VnCUUbi1AFGKUA0HKSYq+q+NfUXy1ow4GTrnL2vvm48OG9tHEbJY+SIJS3TWsteSQi61Prd5s4RHKDJQhm0QcWKlzBU6zM1mhRpFeTIrCsYoNhJV1hjuYfsZ1OYIgykI8IbyRoGkf9DCikId00iEJ/ajQ3rTIE0/qnqqZ4yiMrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=apertussolutions.com 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 (0) 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=oiUZ566o71AWf48GjiUhT6KI92J4Np8zhQZm55hR4ek=; b=HXZHLUgkXeWZpmOTQqwqlzoTw8mUjmK1DTpSkeSDkWXiQrQb4YgGoXdSCQKpiWQHCIu588VQgTBT2PH45zkKbbEW7PZxRYFgfNUVuuuMNcwtKbohrhxymkZl8qsCIfnezPSKsL+s0CLI0ZeQvJIztLVhFYqTFPmw/BGAdi0NVqM= 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 Message-ID: <03357204-0308-46a2-a215-142d681d2b6a@amd.com> Date: Tue, 30 Apr 2024 10:55:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] xen/arm/dom0less-build: Alloc magic pages for Dom0less DomUs from hypervisor To: "Daniel P. Smith" , CC: Anthony PERARD , Juergen Gross , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , "Alec Kwapis" References: <20240426031455.579637-1-xin.wang2@amd.com> <20240426031455.579637-2-xin.wang2@amd.com> Content-Language: en-US From: Henry Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: None (SATLEXMB04.amd.com: xin.wang2@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044AC:EE_|IA1PR12MB6065:EE_ X-MS-Office365-Filtering-Correlation-Id: e88bd28e-bf3b-4894-b36d-08dc68c10e6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400014|1800799015|376005|36860700004; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YS9GR0hBU3hUYTlZbzQ1R0hKVzgveWQwU2o0TzdqdFUzbUhTcDJlem40RWs5?= =?utf-8?B?eDVVWEhpb0FjZm84WHp2RG5QVmR5d1hZL3hadHJRZDkxTEdnRG5tT2Z6T1Ix?= =?utf-8?B?b25Gbk1hYjJyd1BqbGgxWm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SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(82310400014)(1800799015)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2024 02:55:55.9477 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e88bd28e-bf3b-4894-b36d-08dc68c10e6f 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: BN2PEPF000044AC.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6065 Hi Daniel, On 4/30/2024 8:27 AM, Daniel P. Smith wrote: > On 4/25/24 23:14, Henry Wang wrote: >> There are use cases (for example using the PV driver) in Dom0less >> setup that require Dom0less DomUs start immediately with Dom0, but >> initialize XenStore later after Dom0's successful boot and call to >> the init-dom0less application. >> >> An error message can seen from the init-dom0less application on >> 1:1 direct-mapped domains: >> ``` >> Allocating magic pages >> memory.c:238:d0v0 mfn 0x39000 doesn't belong to d1 >> Error on alloc magic pages >> ``` >> This is because currently the magic pages for Dom0less DomUs are >> populated by the init-dom0less app through populate_physmap(), and >> populate_physmap() automatically assumes gfn == mfn for 1:1 direct >> mapped domains. This cannot be true for the magic pages that are >> allocated later from the init-dom0less application executed in Dom0. >> For domain using statically allocated memory but not 1:1 direct-mapped, >> similar error "failed to retrieve a reserved page" can be seen as the >> reserved memory list is empty at that time. >> >> To solve above issue, this commit allocates the magic pages for >> Dom0less DomUs at the domain construction time. The base address/PFN >> of the magic page region will be noted and communicated to the >> init-dom0less application in Dom0. > > Might I suggest we not refer to these as magic pages? I would consider > them as hypervisor reserved pages for the VM to have access to virtual > platform capabilities. We may see this expand in the future for some > unforeseen, new capability. I think magic page is a specific terminology to refer to these pages, see alloc_magic_pages() for both x86 and Arm. I will reword the last paragraph of the commit message to refer them as "hypervisor reserved pages (currently used as magic pages on Arm)" if this sounds good to you. Kind regards, Henry