From patchwork Mon Aug 12 17:29:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 171113 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3121837ily; Mon, 12 Aug 2019 10:33:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqySDIssgLAWEmPNlQsREFr0inTBlyn3FH0LVFzvQ1uiW9cflQRKnm9wsI5RNSTxcaaxih/X X-Received: by 2002:a6b:b214:: with SMTP id b20mr35164739iof.149.1565631110842; Mon, 12 Aug 2019 10:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565631110; cv=none; d=google.com; s=arc-20160816; b=FY7xnclGnvLNpIST19ZS0UaJMzwirIs093/Z8BpSs2mNznV1MkKNs2GtQM+ZBBeDK/ 7vilGjXeiqNwB9tDDfE8pO3WSmOEF2HeqVk0+g23aR4+RM/u1+YFWoBGtBmAOsUK2FRe SiDKOo+8AoIE95QoUrN932QHVwE7s/hkBzzs7UjCUacfGKE+22dNH9DTYm1QXXsqcvQb 5B2g8xUtR1MskYUGNQ8zo3lMqYfr4/yJdUSCJl6/CEffF2qG7toGWh40XwRxSe9/tKFL dU8n2L2t1DG3AkSrzMnY4mQcVDau3J3b+q9tXm+wVHepM9O8G487pRyKWzCr6NQo8kRH fjmw== 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; bh=2s0JjyzPVynGpQYpZfr30ZCMgXeoLBrG03+SvMh1AAk=; b=ADnaIlONW0ITaxMLbIJQdfAJwpoeQZETr8zvCR0aCsEXm2th9zJr68hLq7s0271a+h g3wY54psquIKEeNm9dgicQSBuWwnMCfaW2Im5h14ZSi2BOCBvOS2010eu/RpU5wsxfg4 1NoWXrZXna1DyJG8dRYUSp/W0wrXQvg1BXeoBCiBOquAwV3s9DttjkVVxjls9p3DBPeR Y1Ku3Yp1k9Ow46XSbYMya2ikOZV9Eyqm7mdD0hEVXWBRqybz/ZgKcPksBsmDJWpW34Dq 28Fv7Mg49VBwqhtDihC+cIrYWONrtc5W5bpXzHRFQdh8/N9W7a5zE73kWrIESzFlk12U FiQw== 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 o10si37559661jam.75.2019.08.12.10.31.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Aug 2019 10:31:50 -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 1hxE9S-0006gy-OS; Mon, 12 Aug 2019 17:30:34 +0000 Received: from [172.99.69.81] (helo=us1-rack-iad1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxE9R-0006ge-KT for xen-devel@lists.xenproject.org; Mon, 12 Aug 2019 17:30:33 +0000 X-Inumbo-ID: e29140f4-bd26-11e9-8483-13847f7cc42a Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id e29140f4-bd26-11e9-8483-13847f7cc42a; Mon, 12 Aug 2019 17:30:31 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC39E19BF; Mon, 12 Aug 2019 10:30:31 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 16AA23F706; Mon, 12 Aug 2019 10:30:30 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 12 Aug 2019 18:29:56 +0100 Message-Id: <20190812173019.11956-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190812173019.11956-1-julien.grall@arm.com> References: <20190812173019.11956-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v3 05/28] xen/arm64: head: Setup TTBR_EL2 in enable_mmu() and add missing isb 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 , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, TTBR_EL2 is setup in create_page_tables(). This is fine as it is called by every CPUs. However, such assumption may not hold in the future. To make change easier, the TTBR_EL2 is not setup in enable_mmu(). Take the opportunity to add the missing isb() to ensure the TTBR_EL2 is seen before the MMU is turned on. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v3: - Add Stefano's acked-by Changes in v2: - Patch added --- xen/arch/arm/arm64/head.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index 925fb93e58..9b703e79ce 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -507,9 +507,7 @@ create_page_tables: cmp x19, #XEN_VIRT_START cset x25, eq /* x25 := identity map in place, or not */ - /* Write Xen's PT's paddr into TTBR0_EL2 */ load_paddr x4, boot_pgtable - msr TTBR0_EL2, x4 /* Setup boot_pgtable: */ load_paddr x1, boot_first @@ -637,6 +635,11 @@ enable_mmu: tlbi alle2 /* Flush hypervisor TLBs */ dsb nsh + /* Write Xen's PT's paddr into TTBR0_EL2 */ + load_paddr x0, boot_pgtable + msr TTBR0_EL2, x0 + isb + mrs x0, SCTLR_EL2 orr x0, x0, #SCTLR_Axx_ELx_M /* Enable MMU */ orr x0, x0, #SCTLR_Axx_ELx_C /* Enable D-cache */