From nobody Fri Mar 29 04:50:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1589801460; cv=none; d=zohomail.com; s=zohoarc; b=WZqeUNf8tqQ0kZfxG2lmC+aby9NCgXjNLtPYXCw4ybnagz8fI/shYKg1Zh6UtvDkI6hGQDUhli6aDDpmd6AVT5pAbWYM4+TtO7maZVnVX/8LinZuq3dierPUwIderWXVfOy2FANGGKN7DrXEe4q7CIKWGGwwDdjWDpZn4td5gPs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589801460; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=F11MEj5YMT2oxGVhUvZNpiEihGr2ehtJLVZ6B95SzeU=; b=ZzFlJ74WKUV9Q+bOBJAyEqGbHV2hnXKSUCrUvQEczleNJRYDBDPONgNy+OgEcIU/XBRgOV5Q28ASlWVTHF/stwlFJX8FzxwCu+fzViG96QyeUNwCrj5kto4dQBHGVv6dIgK4WVPDn30B6c9pHeStgiwBMxiHr8PxqfrX8eHfS30= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589801460636199.7859461681012; Mon, 18 May 2020 04:31:00 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadya-0005kQ-6k; Mon, 18 May 2020 11:30:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadyY-0005jp-Jv for xen-devel@lists.xenproject.org; Mon, 18 May 2020 11:30:30 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f8a96db6-98fa-11ea-9887-bc764e2007e4; Mon, 18 May 2020 11:30:27 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadyT-0006PI-Je; Mon, 18 May 2020 11:30:25 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jadyT-0000cn-9u; Mon, 18 May 2020 11:30:25 +0000 X-Inumbo-ID: f8a96db6-98fa-11ea-9887-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=F11MEj5YMT2oxGVhUvZNpiEihGr2ehtJLVZ6B95SzeU=; b=N06dxr5K661DEuk0r/cmdE/9Ok KLvxdkXY3T0U6y2bKecDnpty0rVqYwYMSsLmzQjiqXfas/+5loRAA2gmJjuToVHo5Hwge+Kbmqvmd kKp5VzC4xueXrkitSBvWQsn+lnJz7QPCeEeyzE6+03llrMPDdAx8/02IxPxrktZfaEQI=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH for-4.14 1/3] xen/arm: Allow a platform to override the DMA width Date: Mon, 18 May 2020 12:30:06 +0100 Message-Id: <20200518113008.15422-2-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200518113008.15422-1-julien@xen.org> References: <20200518113008.15422-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , minyard@acm.org, Andrew Cooper , Julien Grall , roman@zededa.com, George Dunlap , jeff.kubascik@dornerworks.com, Jan Beulich , Volodymyr Babchuk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall At the moment, Xen is assuming that all the devices are at least 32-bit DMA capable. However, some SoC have devices that may be able to access a much restricted range. For instance, the RPI has devices that can only access the first 1GB of RAM. The structure platform_desc is now extended to allow a platform to override the DMA width. The new is used to implement arch_get_dma_bit_size(). The prototype is now moved in asm-arm/mm.h as the function is not NUMA specific. The implementation is done in platform.c so we don't have to include platform.h everywhere. This should be fine as the function is not expected to be called in hotpath. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini Reviewed-by: Volodymyr Babchuk --- Cc: Jan Beulich Cc: Andrew Cooper Cc: George Dunlap I noticed that arch_get_dma_bit_size() is only called when there is more than one NUMA node. I am a bit unsure what is the reason behind it. The goal for Arm is to use arch_get_dma_bit_size() when deciding how low the first Dom0 bank should be allocated. --- xen/arch/arm/platform.c | 5 +++++ xen/include/asm-arm/mm.h | 2 ++ xen/include/asm-arm/numa.h | 5 ----- xen/include/asm-arm/platform.h | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c index 8eb0b6e57a5a..4db5bbb4c51d 100644 --- a/xen/arch/arm/platform.c +++ b/xen/arch/arm/platform.c @@ -155,6 +155,11 @@ bool platform_device_is_blacklisted(const struct dt_de= vice_node *node) return (dt_match_node(blacklist, node) !=3D NULL); } =20 +unsigned int arch_get_dma_bitsize(void) +{ + return ( platform && platform->dma_bitsize ) ? platform->dma_bitsize := 32; +} + /* * Local variables: * mode: C diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index 7df91280bc77..f8ba49b1188f 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -366,6 +366,8 @@ int arch_acquire_resource(struct domain *d, unsigned in= t type, unsigned int id, return -EOPNOTSUPP; } =20 +unsigned int arch_get_dma_bitsize(void); + #endif /* __ARCH_ARM_MM__ */ /* * Local variables: diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 490d1f31aa14..31a6de4e2346 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -25,11 +25,6 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) =20 -static inline unsigned int arch_get_dma_bitsize(void) -{ - return 32; -} - #endif /* __ARCH_ARM_NUMA_H */ /* * Local variables: diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h index ed4d30a1be7c..997eb2521631 100644 --- a/xen/include/asm-arm/platform.h +++ b/xen/include/asm-arm/platform.h @@ -38,6 +38,8 @@ struct platform_desc { * List of devices which must not pass-through to a guest */ const struct dt_device_match *blacklist_dev; + /* Override the DMA width (32-bit by default). */ + unsigned int dma_bitsize; }; =20 /* --=20 2.17.1 From nobody Fri Mar 29 04:50:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1589801461; cv=none; d=zohomail.com; s=zohoarc; b=he5NTSP2DVuSRCgOeAQ1OFe9t/qHpoTLS1N3JxOwA4quTHHoxNdx45Kh+CDDNkTkT4JvZinw4qNFYKXU1kP3Tk6tJaPnqEPPh7rpYrTRd1eP6446MG7QZrX3SImubGWdaOm1Ez2rt/Ocd2dL0ToU4Trnlp1YlMvsv0awcYQfzew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589801461; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=lD1rKTHPpy3ZHsAcorCh4F2qKZRDeWwZ6XqxYnQhffE=; b=Tpfft2nMGY4WytECVIq7SXU56hi+oFsOvE7z2nAb4x3IVypntFRPWMf2mkSXFwyWdqP4xLVkfwg2SNLtF4lMpYzKJenxl2lskDCVOLuMg7J807l3Q8qAQtQYoYrQqH7Ee/NowGt/YUEVN9HXNmPtIITKpSV5kxS2Ou3ONDxVz94= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589801461793832.6015260051269; Mon, 18 May 2020 04:31:01 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadyY-0005jw-Qp; Mon, 18 May 2020 11:30:30 +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 1jadyX-0005jk-7n for xen-devel@lists.xenproject.org; Mon, 18 May 2020 11:30:29 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f8d52a8d-98fa-11ea-a850-12813bfff9fa; Mon, 18 May 2020 11:30:27 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadyV-0006PN-1F; Mon, 18 May 2020 11:30:27 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jadyU-0000cn-Ns; Mon, 18 May 2020 11:30:26 +0000 X-Inumbo-ID: f8d52a8d-98fa-11ea-a850-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lD1rKTHPpy3ZHsAcorCh4F2qKZRDeWwZ6XqxYnQhffE=; b=YAkxoSZtaUEfszOUP6wQmzgkw2 fb2xZjDNbO2cCQE9Eg/VY/xs7x7D4ZCzU/P3nNC2a2mPX18s/7O4hWryyFz69hh1nRqPRCEnFx1uo Yu7yYNi33gxHa781bH5ZOOf7vc4wTyy/3wXi8jTOkvmI8brsMxOv5SBh21u5bOfeGdpQ=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH for-4.14 2/3] xen/arm: Take into account the DMA width when allocating Dom0 memory banks Date: Mon, 18 May 2020 12:30:07 +0100 Message-Id: <20200518113008.15422-3-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200518113008.15422-1-julien@xen.org> References: <20200518113008.15422-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , minyard@acm.org, Julien Grall , roman@zededa.com, jeff.kubascik@dornerworks.com, Volodymyr Babchuk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall At the moment, Xen is assuming that all the devices are at least 32-bit DMA capable. However, some SoCs have devices that may be able to access a much restricted range. For instance, the Raspberry PI 4 has devices that can only access the first GB of RAM. The function arch_get_dma_bit_size() will return the lowest DMA width on the platform. Use it to decide what is the limit for the low memory. Signed-off-by: Julien GralL --- xen/arch/arm/domain_build.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 430708753642..abc4e463d27c 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -211,10 +211,13 @@ fail: * the ramdisk and DTB must be placed within a certain proximity of * the kernel within RAM. * 3. For dom0 we want to place as much of the RAM as we reasonably can - * below 4GB, so that it can be used by non-LPAE enabled kernels (32-bi= t) + * below 4GB, so that it can be used by non-LPAE enabled kernels (32-bi= t). * or when a device assigned to dom0 can only do 32-bit DMA access. - * 4. For 32-bit dom0 the kernel must be located below 4GB. - * 5. We want to have a few largers banks rather than many smaller ones. + * 4. Some devices assigned to dom0 can only do 32-bit DMA access or + * even be more restricted. We want to allocate as much of the RAM + * as we reasonably can that can be accessed from all the devices.. + * 5. For 32-bit dom0 the kernel must be located below 4GB. + * 6. We want to have a few largers banks rather than many smaller ones. * * For the first two requirements we need to make sure that the lowest * bank is sufficiently large. @@ -245,9 +248,9 @@ fail: * we give up. * * For 32-bit domain we require that the initial allocation for the - * first bank is under 4G. For 64-bit domain, the first bank is preferred - * to be allocated under 4G. Then for the subsequent allocations we - * initially allocate memory only from below 4GB. Once that runs out + * first bank is part of the low mem. For 64-bit, the first bank is prefer= red + * to be allocated in the low mem. Then for subsequent allocation, we + * initially allocate memory only from low mem. Once that runs out out * (as described above) we allow higher allocations and continue until * that runs out (or we have allocated sufficient dom0 memory). */ @@ -262,6 +265,7 @@ static void __init allocate_memory_11(struct domain *d, int i; =20 bool lowmem =3D true; + unsigned int lowmem_bitsize =3D min(32U, arch_get_dma_bitsize()); unsigned int bits; =20 /* @@ -282,7 +286,7 @@ static void __init allocate_memory_11(struct domain *d, */ while ( order >=3D min_low_order ) { - for ( bits =3D order ; bits <=3D (lowmem ? 32 : PADDR_BITS); bits+= + ) + for ( bits =3D order ; bits <=3D lowmem_bitsize; bits++ ) { pg =3D alloc_domheap_pages(d, order, MEMF_bits(bits)); if ( pg !=3D NULL ) @@ -296,24 +300,26 @@ static void __init allocate_memory_11(struct domain *= d, order--; } =20 - /* Failed to allocate bank0 under 4GB */ + /* Failed to allocate bank0 in the lowmem region. */ if ( is_32bit_domain(d) ) panic("Unable to allocate first memory bank\n"); =20 - /* Try to allocate memory from above 4GB */ - printk(XENLOG_INFO "No bank has been allocated below 4GB.\n"); + /* Try to allocate memory from above the lowmem region */ + printk(XENLOG_INFO "No bank has been allocated below %u-bit.\n", + lowmem_bitsize); lowmem =3D false; =20 got_bank0: =20 /* - * If we failed to allocate bank0 under 4GB, continue allocating - * memory from above 4GB and fill in banks. + * If we failed to allocate bank0 in the lowmem region, + * continue allocating from above the lowmem and fill in banks. */ order =3D get_allocation_size(kinfo->unassigned_mem); while ( kinfo->unassigned_mem && kinfo->mem.nr_banks < NR_MEM_BANKS ) { - pg =3D alloc_domheap_pages(d, order, lowmem ? MEMF_bits(32) : 0); + pg =3D alloc_domheap_pages(d, order, + lowmem ? MEMF_bits(lowmem_bitsize) : 0); if ( !pg ) { order --; --=20 2.17.1 From nobody Fri Mar 29 04:50:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1589801462; cv=none; d=zohomail.com; s=zohoarc; b=lbDItFs0mBq4DbGe/Le0o4GZ/vNmp/qSb+7044NPaeZSr65kW9alMESX6kaeNJohEZnzVG5xsCHus3mjcxZtvYZyGuu3MLUKpKZel2zox+GiZZP6c3eoFSoxxD2u+mMdxl65KNxIwuCkVEAAqCT4Wbxd1fddMiL3j9eVPIcvgjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589801462; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Q0wZuBDGyM9VQL31+v5+pRe+uO7y+dOvvr/QwhFBcOc=; b=ROkqteASxyT7TM1ieDaZsGcKmD2SSckC0Uk2hwmI42yCAoSv9Da+AShlEDLTH2lf+sfYd5UF9Yp9ff2gJ1H0fMP24l0n5cZNYZi3dHeaCQFi9MTvpA8KNBcZpX40S/5QCK5GI9dESZ0Izh1DZ6VL2jRj0oRFxoru6YJVmfw7Xwg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589801462394434.26187982319834; Mon, 18 May 2020 04:31:02 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadye-0005lA-GB; Mon, 18 May 2020 11:30:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadyd-0005l0-Je for xen-devel@lists.xenproject.org; Mon, 18 May 2020 11:30:35 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id fa06629a-98fa-11ea-9887-bc764e2007e4; Mon, 18 May 2020 11:30:29 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jadyW-0006PW-FL; Mon, 18 May 2020 11:30:28 +0000 Received: from 54-240-197-227.amazon.com ([54.240.197.227] helo=ufe34d9ed68d054.ant.amazon.com) by xenbits.xenproject.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jadyW-0000cn-5S; Mon, 18 May 2020 11:30:28 +0000 X-Inumbo-ID: fa06629a-98fa-11ea-9887-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q0wZuBDGyM9VQL31+v5+pRe+uO7y+dOvvr/QwhFBcOc=; b=4n/eyLU4N9H7b2z9cd/z9w6PIa oF60eXSivItYOzwZeeR6uK9uEWtnYbr7eWPpxQS2ikP12q+a6yFyJ7v7CftwXl3cQ5V6Y4D8tmZpy UoRUFBB7pze4byUP9c3KSkgphIty5xqauxFQZCeKhwUaB/nVXNwHLfxWPg4mXIzlvH4E=; From: Julien Grall To: xen-devel@lists.xenproject.org Subject: [PATCH for-4.14 3/3] xen/arm: plat: Allocate as much as possible memory below 1GB for dom0 for RPI Date: Mon, 18 May 2020 12:30:08 +0100 Message-Id: <20200518113008.15422-4-julien@xen.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200518113008.15422-1-julien@xen.org> References: <20200518113008.15422-1-julien@xen.org> X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , minyard@acm.org, Julien Grall , roman@zededa.com, jeff.kubascik@dornerworks.com, Volodymyr Babchuk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Julien Grall The raspberry PI 4 has devices that can only DMA into the first GB of the RAM. Therefore we want allocate as much as possible memory below 1GB for dom0. Use the recently introduced dma_bitsize field to specify the DMA width supported. Signed-off-by: Julien Grall Reported-by: Corey Minyard Tested-by: Corey Minyard --- xen/arch/arm/platforms/brcm-raspberry-pi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/plat= forms/brcm-raspberry-pi.c index b697fa2c6c0e..ad5483437b31 100644 --- a/xen/arch/arm/platforms/brcm-raspberry-pi.c +++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c @@ -43,6 +43,7 @@ static const struct dt_device_match rpi4_blacklist_dev[] = __initconst =3D PLATFORM_START(rpi4, "Raspberry Pi 4") .compatible =3D rpi4_dt_compat, .blacklist_dev =3D rpi4_blacklist_dev, + .dma_bitsize =3D 10, PLATFORM_END =20 /* --=20 2.17.1