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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7334C433F5 for ; Thu, 7 Oct 2021 10:57:58 +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 8485461037 for ; Thu, 7 Oct 2021 10:57:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8485461037 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=xenproject.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.203476.358606 (Exim 4.92) (envelope-from ) id 1mYR5t-0001zD-Cj; Thu, 07 Oct 2021 10:57:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 203476.358606; Thu, 07 Oct 2021 10:57:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mYR5t-0001z6-9l; Thu, 07 Oct 2021 10:57:45 +0000 Received: by outflank-mailman (input) for mailman id 203476; Thu, 07 Oct 2021 10:57:44 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mYR5s-0001z0-A0 for xen-devel@lists.xenproject.org; Thu, 07 Oct 2021 10:57:44 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mYR5s-00018k-5s for xen-devel@lists.xenproject.org; Thu, 07 Oct 2021 10:57:44 +0000 Received: from iwj (helo=mariner.uk.xensource.com) by xenbits.xenproject.org with local-bsmtp (Exim 4.92) (envelope-from ) id 1mYR5s-00041B-4s for xen-devel@lists.xenproject.org; Thu, 07 Oct 2021 10:57:44 +0000 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.89) (envelope-from ) id 1mYR5m-0006CA-Vc; Thu, 07 Oct 2021 11:57:38 +0100 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xenproject.org; s=20200302mail; h=References:In-Reply-To:Subject:Cc:To:Date :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:From; bh=prGYN0ziHtbQ/xbBVY+4Jucrl7ufzTOwijogI2BxJ2E=; b=4iQv3PE4c9S2NUrKaUkDLFXQ7s SebsS3SSFMTHTs3dWTbOkum5DBvrG9Qh2c83mfILIVyqCjJVamW3H1TqDRLvcQzB41eek2Qn0bVys p+pRXQmXo+X52UokBbsHXRG7p/gCN/pL6TDEljtKX2L9KqpbKI20IHiqhtznV1sJ5r9k=; From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <24926.53922.628049.481827@mariner.uk.xensource.com> Date: Thu, 7 Oct 2021 11:57:38 +0100 To: Stefano Stabellini Cc: Oleksandr , xen-devel@lists.xenproject.org, Oleksandr Tyshchenko , Wei Liu , Anthony PERARD , Juergen Gross , Julien Grall , Volodymyr Babchuk Subject: Re: [PATCH V5 2/3] libxl/arm: Add handling of extended regions for DomU In-Reply-To: References: <1633519346-3686-1-git-send-email-olekstysh@gmail.com> <1633519346-3686-3-git-send-email-olekstysh@gmail.com> <24925.35278.762786.539238@mariner.uk.xensource.com> <224ed316-aac0-3ad4-22a1-efc592e717e2@gmail.com> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) Stefano Stabellini writes ("Re: [PATCH V5 2/3] libxl/arm: Add handling of extended regions for DomU"): > On Wed, 6 Oct 2021, Oleksandr wrote: > > On 06.10.21 14:34, Ian Jackson wrote: > > > Oleksandr Tyshchenko writes ("[PATCH V5 2/3] libxl/arm: Add handling of > > > extended regions for DomU"): > > > > The extended region (safe range) is a region of guest physical > > > > address space which is unused and could be safely used to create > > > > grant/foreign mappings instead of wasting real RAM pages from > > > > the domain memory for establishing these mappings. > > > Please forgive me for asking this question now, but: why is this > > > ARM-specific ? > > > > > > Sorry, I can't say for sure which x86 mode also suffers from > > that. I might be wrong, but as I understand that x86 in PVH (and > > HVM?) mode uses unpopulated memory ranges (which are unused from > > Linux PoV, actually everything not yet allocated or reserved from > > "iomem_resource") to create foreign/grant mappings. So the real > > RAM pages are not ballooned out to get an physical address space > > to create these mappings. The problem is that we cannot follow > > Linux advise which memory ranges are unused on Arm for several > > reasons, this is why this patch series makes the hypervisor to > > start allocating and exposing these ranges. So it sounds like you are saying this is an ARM-specific problem ? The key being the "several reasons" which you mention. Are they ARM-specifc problems. > Two more things about this being ARM-specific. > > Even if x86 was affected exactly by the same problem, the code to expose > the safe memory ranges to DomU is arch-specific (currently device tree.) > > Also the code to calculate the safe memory ranges is arch-specific as it > depends on the DomU memory layout which is arch-specific. This demonstrates that the implementation is arch-specific. But one of libxl's functions is to abstract away implementation details and provide an interface that can be used to "do the right thing". Ian.