From patchwork Mon Jul 2 16:19:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 140829 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp139955ljj; Mon, 2 Jul 2018 09:21:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4FA4uLDm0Ji8XmjN9YtZNdNjSlcZJAAMs4JS2GxUXTUBa9Ph6/dLGgYV104QE0PCWvIqa X-Received: by 2002:a24:154c:: with SMTP id 73-v6mr10913349itq.51.1530548497677; Mon, 02 Jul 2018 09:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530548497; cv=none; d=google.com; s=arc-20160816; b=W88rVGdvCNkgeeISYvLHIopAtZEktxk39fR8Rry8XXawHcYH2TJYcpccehcDSgFgx7 +bL7OjYqCiNgsTpG23gAmk4CxmY/lYFEiVRtxItkNgoTW34ScxczcoBW3GsMAKh/4Io0 DDbmbt44O8i/0X/v3wfacgJwxzCLWHufnABq2jlN0PAY5FSGiz3SFMm/ID4puBVIJKyj fsahXDGg7W3kqdw1A2nac6jpipideaO08jrUHZQDUStiJMPfuAX7lIlS/ykvEvfNWF1R cz4P5/S1sdODnhgdggqEU/ubE0SuloqnuxLT46Png7mMVnlc9JabVfhqCs+PYiCoBFFf KrwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=BGJlYyorXJL6sCtrIJxAL9EDVQAN/ad5OD2cWZg/n+s=; b=YZpkCXDvJpDAkANLgoont1S9nmnKepSKfxI7KS32bj+O4+lIO+jUfi53Vp+cTF8qbX eQHgI2JXcYbfKG5hY5ajrmmCpGBQxHj8GhrAa95FER8oC5eUjadFjVvAEzNJnm/iANYn LlZmmKIauGZff1JRTRhC2AsPAzHunUshAMS/OKsuaALL1Z4U9v0cKK67huc51/rueZYU 9humbsxAZQdsl2zdKJ4hJlBMxdz4eu9fO0mDlAcUmoA+arf54e361+gLWScJewwu5hME WMOnuac/0jCV50U6SQ5AFUBvOITQcMwwiZGcgUCqUtr4boWZv4Ttks5rR6MWj1UdS1+J EIWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@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.google.com with ESMTPS id l16-v6si5123412ita.108.2018.07.02.09.21.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 09:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xu-0006o3-5x; Mon, 02 Jul 2018 16:19:22 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fa1Xs-0006nT-S4 for xen-devel@lists.xen.org; Mon, 02 Jul 2018 16:19:20 +0000 X-Inumbo-ID: a85e9c68-7e13-11e8-8089-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a85e9c68-7e13-11e8-8089-bc764e045a96; Mon, 02 Jul 2018 18:19:13 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 978E41529; Mon, 2 Jul 2018 09:19:19 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0DA53F5BA; Mon, 2 Jul 2018 09:19:18 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Jul 2018 17:19:04 +0100 Message-Id: <20180702161910.2013-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180702161910.2013-1-julien.grall@arm.com> References: <20180702161910.2013-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 1/7] xen/arm: Remove the variable dom0_11_mapping and open-code the value 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: Julien Grall , Stefano Stabellini MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Dom0 (aka hardware domain on Arm) is always direct mapped. Rather than using a global variable to store a const, directly open-code it or replace the use with is_domain_direct_mapped(...) macros. This will also help a follow-up patch to move all domain_build.c in init. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Stefano's reviewed-by --- xen/arch/arm/domain_build.c | 4 +--- xen/include/asm-arm/domain.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 11cdf05091..3c414c7f73 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -28,8 +28,6 @@ static unsigned int __initdata opt_dom0_max_vcpus; integer_param("dom0_max_vcpus", opt_dom0_max_vcpus); -int dom0_11_mapping = 1; - static u64 __initdata dom0_mem; static int __init parse_dom0_mem(const char *s) @@ -261,7 +259,7 @@ static void allocate_memory(struct domain *d, struct kernel_info *kinfo) * TODO: Implement memory bank allocation when DOM0 is not direct * mapped */ - BUG_ON(!dom0_11_mapping); + BUG_ON(!is_domain_direct_mapped(d)); printk("Allocating 1:1 mappings totalling %ldMB for dom0:\n", /* Don't want format this as PRIpaddr (16 digit hex) */ diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index 7ba6528a74..280c3951fd 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -31,8 +31,8 @@ enum domain_type { #define is_64bit_domain(d) (0) #endif -extern int dom0_11_mapping; -#define is_domain_direct_mapped(d) ((d) == hardware_domain && dom0_11_mapping) +/* The hardware domain has always its memory direct mapped. */ +#define is_domain_direct_mapped(d) ((d) == hardware_domain) struct vtimer { struct vcpu *v;