From patchwork Mon Oct 8 18:33:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 148427 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3982086lji; Mon, 8 Oct 2018 11:36:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV61QW50IBVhzGVb190h368oAquS48qbWL9vXhhGGSdhiEhZChakqJ9hOBBdLwvLIoTPhokz6 X-Received: by 2002:a24:40c7:: with SMTP id n190-v6mr275036ita.44.1539023776820; Mon, 08 Oct 2018 11:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539023776; cv=none; d=google.com; s=arc-20160816; b=bxgE3UU85jQNRW6pgzRXye1yVRSSiRNn1JKjzQgzPnyrXLDLyWlxub7GoxrCSqnE4e bH2y7IBK7EW1ThwPJ0JPtTHeGYOF5Q1CaMvbOif6oG5xQMbLSIvnUpudWk4AP4xc/0yX Gg3sq3xwXsF/r0P5qQaXfwntbfRzR5nU9nCwVObo2+xZhRsoDy72/gY0nSo9AJYQrwoj TFNKv2+QGI4aqN9KPRZ9vwAUUJCPSUI8DPNhdGBuO6kyoLgmIbyGIjYwY7hcGfydYijE VUvQDsLCT122OqnvX2bt1jkYOA7m36kdNEUCCUSPSjryWbOqZKBrlHEZBKdt5aGuA1mu 8XtQ== 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=d28iSkXj3y8g9QguYrCDGinn1AnjDrVfoU9XZl8R0CU=; b=D+t0kWOSBLjC6Tl1450yBv2XkD9ml2bFo51gsCzReWb2/6o4NUenlIEVj/FkLccLQE rLlvQT+oHjuu2AQ0tlS6qdznqB0mNu2Zl2AF95fgkOwJdQQ0VMiKSnjSRzvmLoIPh9Vi JuJ3gpNURFVFer97p+U7JUlcrBDePdhBgm4sfadjcJ6J34AJPN7TsHJQ77UrZ/lOLgT3 KnvnE8k7mmBwgeoCbAYqZ85HmQRokCgff393I3+PbfotNMCoHcPan5CG+FBEXIw7xUij j0mhDhuQ2bHJ/tbMtI4K7wzjwIsKpivHddM4jCg5z/lNCtglCNS9rUUK9yzMA6oXEDsG oxFw== 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 j13-v6si16847680jal.79.2018.10.08.11.36.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Oct 2018 11:36:16 -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 1g9aM0-0005do-Fk; Mon, 08 Oct 2018 18:34:04 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1g9aLz-0005de-E0 for xen-devel@lists.xen.org; Mon, 08 Oct 2018 18:34:03 +0000 X-Inumbo-ID: e7e5f881-cb28-11e8-a6a9-d7ebe60f679a Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id e7e5f881-cb28-11e8-a6a9-d7ebe60f679a; Mon, 08 Oct 2018 18:35:18 +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 D91C3ED1; Mon, 8 Oct 2018 11:34:00 -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 ECC413F5B3; Mon, 8 Oct 2018 11:33:59 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 8 Oct 2018 19:33:36 +0100 Message-Id: <20181008183352.16291-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [RFC 00/16] xen/arm: Implement Set/Way operations 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 , sstabellini@kernel.org, andre.przywara@linaro.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi all, As discussed during Linaro Connect with Stefano, I am sending an early version of the Set/Way implementation to gather feedback on the approach. For more details on the issue, see the commit message of patch #15. A branch with the code is available can be clone from: https://xenbits.xen.org/git-http/people/julieng/xen-unstable.git branch dev-cacheflush Cheers, Julien Grall (16): xen/arm: Introduce helpers to clear/flags flags in HCR_EL2 xen/arm: Introduce helpers to get/set an MFN from/to an LPAE entry xen/arm: Allow lpae_is_{table, mapping} helpers to work on invalid entry xen/arm: guest_walk_tables: Switch the return to bool xen/arm: traps: Move the implementation of GUEST_BUG_ON in traps.h xen/arm: p2m: Introduce a helper to generate P2M table entry from a page xen/arm: p2m: Introduce p2m_is_valid and use it xen/arm: p2m: Handle translation fault in get_page_from_gva xen/arm: p2m: Introduce a function to resolve translation fault xen/arm: vcpreg: Add wrappers to handle co-proc access trapped by HCR_EL2.TVM xen/arm: vsysreg: Add wrapper to handle sysreg access trapped by HCR_EL2.TVM xen/arm: Rework p2m_cache_flush to take a range [begin, end) xen/arm: p2m: Allow to flush cache on any RAM region xen/arm: p2m: Extend p2m_get_entry to return the value of bit[0] (valid bit) xen/arm: Implement Set/Way operations xen/arm: Track page accessed between batch of Set/Way operations xen/arch/arm/arm64/vsysreg.c | 82 ++++++++ xen/arch/arm/domain.c | 14 ++ xen/arch/arm/domain_build.c | 7 + xen/arch/arm/domctl.c | 2 +- xen/arch/arm/guest_walk.c | 52 ++--- xen/arch/arm/mem_access.c | 8 +- xen/arch/arm/mm.c | 12 +- xen/arch/arm/p2m.c | 405 ++++++++++++++++++++++++++++++++++----- xen/arch/arm/traps.c | 36 +--- xen/arch/arm/vcpreg.c | 167 ++++++++++++++++ xen/arch/x86/domain.c | 4 + xen/common/domain.c | 5 +- xen/include/asm-arm/cpregs.h | 1 + xen/include/asm-arm/guest_walk.h | 8 +- xen/include/asm-arm/lpae.h | 14 +- xen/include/asm-arm/p2m.h | 28 ++- xen/include/asm-arm/processor.h | 18 ++ xen/include/asm-arm/traps.h | 24 +++ xen/include/xen/domain.h | 2 + 19 files changed, 764 insertions(+), 125 deletions(-)