Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C2D0C433FE for ; Tue, 8 Dec 2020 10:53:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 10B0823A5B for ; Tue, 8 Dec 2020 10:53:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10B0823A5B Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.47334.83810 (Exim 4.92) (envelope-from ) id 1kmacp-0007QH-TX; Tue, 08 Dec 2020 10:53:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 47334.83810; Tue, 08 Dec 2020 10:53:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kmacp-0007QA-QE; Tue, 08 Dec 2020 10:53:43 +0000 Received: by outflank-mailman (input) for mailman id 47334; Tue, 08 Dec 2020 10:53:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kmaco-0007Pr-SD for xen-devel@lists.xenproject.org; Tue, 08 Dec 2020 10:53:42 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1e254554-1d65-4a37-a7aa-8e6df17c2d31; Tue, 08 Dec 2020 10:53:41 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7FD19AC9A; Tue, 8 Dec 2020 10:53:40 +0000 (UTC) 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: 1e254554-1d65-4a37-a7aa-8e6df17c2d31 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607424820; h=from:from:reply-to: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=teVdR5LWjpy28H32W12XwS95Be7kWecWh2vWuKGHkPg=; b=iKSRRceQ9Z5BCHv0dMekUMJWwLEJSjpw1hr/9jiDcEtOk1D9UCtTIHw83H8s9dyW0zcrz2 2uNgzLj2rxNOiW81Q10VcC7wiOSWckjd5F9JpgUHg6oDwdAEM94KHUvBPVDLug58yei0e6 grMaxdMJVmAf0hiqvyFA0HOYXGhLwf4= Subject: Re: [RFC] design: design doc for 1:1 direct-map To: Fam Zheng Cc: Julien Grall , Bertrand.Marquis@arm.com, Kaly.Xin@arm.com, Wei.Chen@arm.com, nd@arm.com, Paul Durrant , Penny Zheng , xen-devel@lists.xenproject.org, sstabellini@kernel.org References: <20201208052113.1641514-1-penny.zheng@arm.com> <6731d0c1-37df-ade8-7b77-d1032c326111@xen.org> <20201208102205.GA118611@dev> From: Jan Beulich Message-ID: <2c7e96e1-9a34-4a9d-2a8f-7479d46f1a92@suse.com> Date: Tue, 8 Dec 2020 11:53:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201208102205.GA118611@dev> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08.12.2020 11:22, Fam Zheng wrote: > On 2020-12-08 10:12, Jan Beulich wrote: >> On 08.12.2020 10:07, Julien Grall wrote: >>> On 08/12/2020 05:21, Penny Zheng wrote: >>>> --- /dev/null >>>> +++ b/docs/designs/1_1_direct-map.md >>>> @@ -0,0 +1,87 @@ >>>> +# Preface >>>> + >>>> +The document is an early draft for direct-map memory map >>>> +(`guest physical == physical`) of domUs. And right now, it constrains to ARM >>> >>> s/constrains/limited/ >>> >>> Aside the interface to the user, you should be able to re-use the same >>> code on x86. Note that because the memory layout on x86 is fixed (always >>> starting at 0), you would only be able to have only one direct-mapped >>> domain. >> >> Even one seems challenging, if it's truly meant to have all of the >> domain's memory direct-mapped: The use of space in the first Mb is >> different between host and guest. > > Speaking about the case of x86, we can still direct-map the ram regions > to the single direct-mapped DomU because neither Xen nor dom0 require > those low mem. > > We don't worry about (i.e. don't direct-map) non-ram regions (or any > range that is not reported as usable ram from DomU's PoV (dictated by > e820 table), so those can be MMIO or arbitrary mapping with EPT. For one, the very first page is considered special in x86 Xen. No guest should gain access to MFN 0, unless you first audit all code and address all the issues you find. And then there's also Xen's low-memory trampoline living there. Plus besides the BDA (at real-mode address 0040:0000) I suppose the EBDA also shouldn't be exposed to a guest, nor anything else that the host finds reserved in E820. IOW it would be the host E820 to dictate some of the guest E820 in such a case. Jan