From patchwork Tue Sep 17 18:12:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 173913 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1463225ill; Tue, 17 Sep 2019 11:14:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxR3W9t+bqsgwiRmRT3SC9gpPESKoRu7f2SzxkLup2QTlowiHHSgcZEnDZozNP7h0hxhetx X-Received: by 2002:a02:ccba:: with SMTP id t26mr1097089jap.49.1568744070118; Tue, 17 Sep 2019 11:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568744070; cv=none; d=google.com; s=arc-20160816; b=MLUaOc94aUCLA0OUW1s7YnNcC/jR8r5bYar6IPxIirUJFfj9Q2P/rYJJAV6l8bYal+ 0e7fmNorSYcVhUytkyv70Mi+SUfCm5Ku5ugOPYx0Xv9rTebW9mcmephBdstiXxm86BZy CTobMlufj6QO6HBmiPB6hygVineASNEmEqvhzSx0KtEFjv9I06pTaLtY586Z9Tw/IF2W 8ivqS0kgfHKH+JuD6hCPfBHzno9igqJcrswLsVJeBgUy5mE8ta9C5WQxN5qNnzsy1NHS bUe5ILzuasRZoMv1Y/lPMflLadStb36kZv48GktqxSqnuhVqn7qXIK/dSy3CT8B2lAyb qLXA== 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:message-id:date:to:from; bh=qpdwYSIyUDmksYOciVaZsWDp49IFEWXTzwHrbGuaEmg=; b=mshn+SHM0QVstVdE6KNOQiLsvPP8LdKwaRC/72nOH+oy+IwHNUCCkacm8ukU4+Joyl fUYUKesbNWy6lVOmDoJJtsqnDXZSmJJ0Idjf8OpZEAudu1Dj2Z+m773Ey8S6welkC96v vMk/NNMf8zVIqvsJPiiy1wyNFzxNtpM8PzFwLieRHvw90uszRrHflM1OA2ZsskkB08+t ltYPF/EPF8H75hulMzMi8CpbIZc/i7vZdTepU+YCWCYVrgE19BzWdqcEOJC/Wzx1Fd8O kPM5i0fTjQ0Oyudqm+lbylWMNWg4Sfom4iIw7vfjamHHhYvZ2Pm22ccmJoJOuloQ5BhY 9TEQ== 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 u2si3766644ioe.2.2019.09.17.11.14.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Sep 2019 11:14:30 -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 1iAHyN-00089x-JF; Tue, 17 Sep 2019 18:13:07 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iAHyM-00088t-4a for xen-devel@lists.xenproject.org; Tue, 17 Sep 2019 18:13:06 +0000 X-Inumbo-ID: c3daca92-d976-11e9-b299-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id c3daca92-d976-11e9-b299-bc764e2007e4; Tue, 17 Sep 2019 18:12:52 +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 614521000; Tue, 17 Sep 2019 11:12:52 -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 AEC483F67D; Tue, 17 Sep 2019 11:12:51 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 17 Sep 2019 19:12:36 +0100 Message-Id: <20190917181244.30027-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH v4 0/8] xen/arm: Rework head.S to make it more compliant with the Arm Arm 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" Hi all, This is part of the boot/memory rework for Xen on Arm, but not sent as MM-PARTx as this is focusing on the boot code. Similar to the memory code, the boot code is not following the Arm Arm and could lead to memory corruption/TLB conflict abort. I am not aware of any platforms where Xen fails to boot, yet it should be fixed sooner rather than later. While making the code more compliant, I have also took the opportunity to simplify the boot and also add more documentation. After this series, the boot CPU and secondary CPUs path is mostly compliant with the Arm Arm. The only non-compliant places I am aware of are: 1) create_page_tables: Some rework is necessary to update the page-tables safely without the MMU on. 2) The switches between boot and runtime page-tables (for both boot CPU and secondary CPUs) are not safe. All will be addressed in follow-up series. The boot code would also benefits another proof read for missing isb()/dsb(). For convenience I provided a branch based on staging: git://xenbits.xen.org/people/julieng/xen-unstable.git branch boot/v3 Cheers, Julien Grall (8): xen/arm64: head: Remove 1:1 mapping as soon as it is not used xen/arm64: head: Rework and document setup_fixmap() xen/arm32: head: Remove 1:1 mapping as soon as it is not used xen/arm32: head: Rework and document setup_fixmap() xen/arm64: head: Introduce macros to create table and mapping entry xen/arm64: head: Use a page mapping for the 1:1 mapping in create_page_tables() xen/arm32: head: Introduce macros to create table and mapping entry xen/arm32: head: Use a page mapping for the 1:1 mapping in create_page_tables() xen/arch/arm/arm32/head.S | 324 +++++++++++++++++++++++++++++-------------- xen/arch/arm/arm64/head.S | 347 +++++++++++++++++++++++++++++----------------- xen/arch/arm/mm.c | 2 + 3 files changed, 440 insertions(+), 233 deletions(-)