From patchwork Tue Jun 5 17:12:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 137789 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1217346lji; Tue, 5 Jun 2018 10:15:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKvMafS4HTrl7g0lfiRnk/TWoSbq+Fd0k7R4vX0soWs0sWtZKuoIICVC36NPLfX4CJUMYqZ X-Received: by 2002:a6b:954c:: with SMTP id x73-v6mr25667841iod.225.1528218941830; Tue, 05 Jun 2018 10:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528218941; cv=none; d=google.com; s=arc-20160816; b=npvElrYewPhj/opdU5LLlVZRP4b0AvAsxd1XLG0VOmvjpIBC6uz9f+B1Q8qsi/yvBM HKsqKP2CJqwI/uXKk1dP9BsO5iSbCHewU4qm0JEor7w9u+/AHp0e9nxThwZ2g/b9LnlW O8ak+GTUqEgLV+986z7vuSCCl59K/CwIzx6paqSPwMOWzbfSJLQLfKGSoVA1iOxm0qzR 4S77ZEUc7uuyqae5V7a/x6cJNT5jTpFKIwHIy9u7fBt9JM/PT9zTZzL9ZYBLU3EWCtGl jPs3CNdyjwe6pG5N7/psSalQlQ2wBVWGxSDpQQZFYfRiS792lVpNJ9uhyQuJI4UBPdAO gZsw== 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=QQ9GevMmqoZ0LsMuSff5IJ4CFUZma/vjt+DDOx0pmKE=; b=wbxu0uegznuPL4rOHYvos/kDtUtt2icuq6iSXbO17cdpDOps1LcO+MiZqAxjI8gyke 2t3KkE2jkWU1NBlwX+lWJJS1b87QVS0TOmOg0nrR8KYyN9hEZQnpqs92UuR3Z91KFvqg Yq6Yx4Yt96hLHGeDBsqcOw+Z+kOOD5zGXnZxCOnII04GvRJJyZivqRkNa7Qy9c9HFm5x WGM8SD+qwGoHi6YR2/EAoi/pPioW450Zq5Z782KesQmjx409tB7SIQ4SI7dXGOV+Gl4o ny0nH551MtJFlFKAzNgGiMISuLdEJK0JP4oOYiw9JipsBd2d09o/BuJyyoDEivf0vaPu +7Xw== 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 138-v6si1955991itw.101.2018.06.05.10.15.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 10:15:41 -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 1fQFVt-0007vV-P9; Tue, 05 Jun 2018 17:12:53 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fQFVs-0007v9-Lo for xen-devel@lists.xenproject.org; Tue, 05 Jun 2018 17:12:52 +0000 X-Inumbo-ID: 5d1c4c0f-68e3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 5d1c4c0f-68e3-11e8-9728-bc764e045a96; Tue, 05 Jun 2018 19:10:36 +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 A1D621529; Tue, 5 Jun 2018 10:12:50 -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 B797B3F25D; Tue, 5 Jun 2018 10:12:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org, xen-devel@lists.xen.org Date: Tue, 5 Jun 2018 18:12:31 +0100 Message-Id: <20180605171237.30601-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180605171237.30601-1-julien.grall@arm.com> References: <20180605171237.30601-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 --- 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;