From nobody Sun Feb 8 03:11:52 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1565128231; cv=none; d=zoho.com; s=zohoarc; b=APVed6gNGFLPpTsJSVKx5tu3+TnN/3KSv1/1egMprLTCnX7S8vmfX/P7m5siNaTyMtX3j21qJIJ0oe8q/crZdYkjI3Gb2B/UktCv606olY+Sr8UoId9lGP9uD1nRwEF6YGD3cdBR2CEnc1SoqGyeKW9RwjU7sOY/7dZfRaoWSGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565128231; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=AZpxNRn+9MbSLOum9CqMN4M5g5WZGGpw8cjhrETTlcA=; b=Hf+jgZuACX5Ataz4dVSoQ56CfV+8s/NjKA3PCep/4BYNo8QTF/abA1I2qjcK7Sr6SqDN4+TbLCOdNiMvCZKF3xUBk7bVKqhUiEPpOVVPyYLr1uBdS0t2yaLsLmvl3kFbKq2EYDTBWaueO66xeAZM7KeUVi+P0tbgkSND71rXHus= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1565128231291616.4663204934002; Tue, 6 Aug 2019 14:50:31 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hv7Kl-0000oN-6Y; Tue, 06 Aug 2019 21:49:31 +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.89) (envelope-from ) id 1hv7Kj-0000mp-Le for xen-devel@lists.xenproject.org; Tue, 06 Aug 2019 21:49:29 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 10e667e6-b894-11e9-a110-bf1bed7548b1; Tue, 06 Aug 2019 21:49:29 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s.xilinx.com (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C292218A6; Tue, 6 Aug 2019 21:49:28 +0000 (UTC) X-Inumbo-ID: 10e667e6-b894-11e9-a110-bf1bed7548b1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565128168; bh=sZgajqit8qqVgB1Vr0FiUXVVgAwfUQFWMQOw4YHUJkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBOk+VirK5qYMkxIB1lK6i9Lqq37Fgw+nVRJAjCNDRWqlYWR+IwCrwHeMUWRdForR +GmP1oh/K1p9PttXqpaYNkpZ9oses9My9sqy9TJnSFk2ZUcJUxWK9Dykcn/EZBQ129 OWDsmVnO/JZ54Q2EFqBd4UtmMVtHWAeWPVM3FQfM= From: Stefano Stabellini To: xen-devel@lists.xenproject.org Date: Tue, 6 Aug 2019 14:49:24 -0700 Message-Id: <20190806214925.7534-6-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [Xen-devel] [PATCH v4 6/7] xen/arm: don't iomem_permit_access for reserved-memory regions X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , julien.grall@arm.com, sstabellini@kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Don't allow reserved-memory regions to be remapped into any guests, until reserved-memory regions are properly supported in Xen. For now, do not call iomem_permit_access for them. Signed-off-by: Stefano Stabellini --- Changes in v4: - compare the parent name with reserved-memory - use dt_node_cmp Changes in v3: - new patch --- xen/arch/arm/domain_build.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 4c8404155a..267e0549e2 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1153,17 +1153,25 @@ static int __init map_range_to_domain(const struct = dt_device_node *dev, struct map_range_data *mr_data =3D data; struct domain *d =3D mr_data->d; bool need_mapping =3D !dt_device_for_passthrough(dev); + const struct dt_device_node *parent =3D dt_get_parent(dev); int res; =20 - res =3D iomem_permit_access(d, paddr_to_pfn(addr), - paddr_to_pfn(PAGE_ALIGN(addr + len - 1))); - if ( res ) + /* + * Don't give iomem permissions for reserved-memory ranges until + * reserved-memory support is complete. + */ + if ( dt_node_cmp(dt_node_name(parent), "reserved-memory") =3D=3D 0 ) { - printk(XENLOG_ERR "Unable to permit to dom%d access to" - " 0x%"PRIx64" - 0x%"PRIx64"\n", - d->domain_id, - addr & PAGE_MASK, PAGE_ALIGN(addr + len) - 1); - return res; + res =3D iomem_permit_access(d, paddr_to_pfn(addr), + paddr_to_pfn(PAGE_ALIGN(addr + len - 1))= ); + if ( res ) + { + printk(XENLOG_ERR "Unable to permit to dom%d access to" + " 0x%"PRIx64" - 0x%"PRIx64"\n", + d->domain_id, + addr & PAGE_MASK, PAGE_ALIGN(addr + len) - 1); + return res; + } } =20 if ( need_mapping ) --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel