From patchwork Tue May 14 12:31:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10942961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 183B81398 for ; Tue, 14 May 2019 12:32:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0891D28481 for ; Tue, 14 May 2019 12:32:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06F9A2870D; Tue, 14 May 2019 12:32:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A60D28705 for ; Tue, 14 May 2019 12:32:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWaj-0005Ks-T8; Tue, 14 May 2019 12:31:33 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWai-0005Km-M1 for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:31:32 +0000 X-Inumbo-ID: 3406c379-7644-11e9-8980-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 3406c379-7644-11e9-8980-bc764e045a96; Tue, 14 May 2019 12:31:31 +0000 (UTC) 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 4457A341; Tue, 14 May 2019 05:31: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 32CB13F71E; Tue, 14 May 2019 05:31:30 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:31:13 +0100 Message-Id: <20190514123125.29086-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH MM-PART3 v2 00/12] xen/arm: Provide a generic function to update Xen PT 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: Oleksandr_Tyshchenko@epam.com, Julien Grall , Stefano Stabellini , Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi all, This is the third part of the boot/memory rework for Xen on Arm. At the moment, the update to Xen PT is scattered all around mm.c. This makes difficult to rework Xen memory layout or even ensuring we are following the Arm Arm properly (and we are not so far!). This part contains code to provide a generic function to update Xen PT. While I could have started from scratch, I decided to base the new function on create_xen_entries() (now renamed xen_pt_update()). This makes slightly easier to follow the changes. In this series, the new generic function will only support 3rd-level update and cannot be used in early boot (i.e because xenheap is not initialized). This will be extended in follow-up series to allow more use within mm.c. There are probably some optimization possible around the TLBs flush. I haven't looked at it so far. The last two patches of this series is to show how existing callers can be converted. There are more conversion to come in follow-up series. This series is based on the first two parts sent separately (see [1] and [2]). For convenience, I provided a branch with all the patches applied based on staging: git://xenbits.xen.org/people/julieng/xen-unstable.git branch mm/part3/v2 Cheers, [1] https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg01109.html [2] https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg01149.html Julien Grall (12): xen/arm: lpae: Add a macro to generate offsets from an address xen/arm: mm: Rename create_xen_entries() to xen_pt_update() xen/arm: mm: Move out of xen_pt_update() the logic to update an entry xen/arm: mm: Only increment mfn when valid in xen_pt_update xen/arm: mm: Introduce _PAGE_PRESENT and _PAGE_POPULATE xen/arm: mm: Sanity check any update of Xen page tables xen/arm: mm: Rework xen_pt_update_entry to avoid use xenmap_operation xen/arm: mm: Remove enum xenmap_operation xen/arm: mm: Use {, un}map_domain_page() to map/unmap Xen page-tables xen/arm: mm: Rework Xen page-tables walk during update xen/arm: mm: Don't open-code Xen PT update in {set, clear}_fixmap() xen/arm: mm: Remove set_pte_flags_on_range() xen/arch/arm/mm.c | 421 ++++++++++++++++++++++++++++++--------------- xen/arch/arm/p2m.c | 23 +-- xen/include/asm-arm/lpae.h | 9 + xen/include/asm-arm/page.h | 9 +- 4 files changed, 305 insertions(+), 157 deletions(-)