From patchwork Fri Jun 14 17:51:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 166865 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2351158ilk; Fri, 14 Jun 2019 10:53:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbwxdhRvaLnp1yUruAHvlM3i0aMz2ii8+EZAZMtqckDzHdduM/Br4HxypCRvUb8rLIb9S+ X-Received: by 2002:a6b:fb0f:: with SMTP id h15mr11212481iog.266.1560534807682; Fri, 14 Jun 2019 10:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560534807; cv=none; d=google.com; s=arc-20160816; b=c/fUDr+VRwQivrT8kHFlfizIz6Lfa4qWb+iYOiQto9g5pbmEd0+CN0mXrOHPkjPHiX 2iqr9vXuXG8mLfoc8S1JjNQshr8OdKcAs7KRKGunSAcq6Pf3nY0a9wL8dkaKHGgw2P2n vWDR6x12XSPkAm1+3WUadwpR5pcOlhl2ve4tzlRC98ju6paKspXQHfi/l27ANEa9Sn79 +QzroT+kF0PZvDxnYdW9tzc7b8OuvydsFRZJDAXGx3lY0ouhfUjc0KG2lGPULeOOuluY IiSWlIdAqgRVkwWd7OV6RYILUYeio/tS87WWMuLpQHmF00tDqqSNcxtFGWSxEaeqMcli fPdw== 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=uMcBUfKNm34XbnznpQ70GKBdqQDCnXpZlENS6oqBsR8=; b=bapFyaBnot01IxBrnQHO3IsfZQqrT1BrBopZRj5y4aLEB/kCfe+qcN2Qm02T2X46b8 JVPOggHZv3Yx3fp/iAlkfBQUNuHcNghJ5BEU6bDSQ3hVI7XPWuLq1nXSQhDq0/P+7Y8U fAxhEhPxsZm1jpxXWXnIoi0rzbgEtNhHf/INYiWeiEvfai1sKkSGIdTRU3j/Q2WWbM2R EsEvhe/Gpc1LnuFj4pJ8HesmrbfThhb9vmmFqyFc4UWrutYqhzHX+GtX66+Z+jctaYoB TQTWyeojH4zQVHyiF5+rCKbys1nftQOEDMAavXLnVvu33ryEotTOATOABEn8PEK3n44M bxYg== 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 z14si5031337jah.60.2019.06.14.10.53.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 10:53:27 -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 1hbqMl-0001mV-MQ; Fri, 14 Jun 2019 17:51:55 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hbqMk-0001mQ-MS for xen-devel@lists.xenproject.org; Fri, 14 Jun 2019 17:51:54 +0000 X-Inumbo-ID: 1756914e-8ecd-11e9-8980-bc764e045a96 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 1756914e-8ecd-11e9-8980-bc764e045a96; Fri, 14 Jun 2019 17:51: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 1E6F32B; Fri, 14 Jun 2019 10:51: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 511BF3F718; Fri, 14 Jun 2019 10:51:51 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 14 Jun 2019 18:51:35 +0100 Message-Id: <20190614175144.20046-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH MM-PART3 v3 0/9] 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" 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. For convenience, I provided a branch with all the patches applied base on staging. git://xenbits.xen.org/people/julieng/xen-unstable.git branch mm/part3/v3 Cheers, Julien Grall (9): xen/arm: Rework HSCTLR_BASE 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/arm32/head.S | 12 +- xen/arch/arm/arm64/head.S | 10 +- xen/arch/arm/mm.c | 390 +++++++++++++++++++++++++++------------- xen/include/asm-arm/page.h | 9 +- xen/include/asm-arm/processor.h | 56 +++++- 5 files changed, 332 insertions(+), 145 deletions(-)