From patchwork Tue Dec 4 20:26:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 152851 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp8503368ljp; Tue, 4 Dec 2018 12:29:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/WIz7PhvJC9Mps8f7f6p97gXfm7cE03KOESbcdMiu8WLipyIjcUWaP/L33lVxEdTtII9sep X-Received: by 2002:a81:451:: with SMTP id 78mr21662763ywe.139.1543955364890; Tue, 04 Dec 2018 12:29:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543955364; cv=none; d=google.com; s=arc-20160816; b=s444sCkk19ajw64n2xWZpcckZ5Rf+HwjCFAXsyr9OuTEz8Ndry0XfZoTtwG9TMUs5P uz1PE01kHdsCPHUBsB4YZ70Sf9PU0FngYsrUHDzsXu2CcmrOfFTo0t2z0xUU1UFopwVi ZQEZy3UmfJt/J5Nz7kOF6GlHbRCqrnIEiX3SS0UcDTTIhckzN5xGklHXwx0H/fM0oNoC ON4G+RiWngB6pY6DUNha0O+FO5M31o0Srxqk3Vw+1yLYp2uchou477yypnqa9xZEswkb d+RVtquyHgvu+n4QE7cKNL27U+R8rIskHMWc67gpUPZ3mciCkJTWfPlkWDa2kQJfkYXL zpUg== 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=HsMvb/Ii0uIoym2gvOPgi4FtJwEAK7dM/XPBAO3gH7Y=; b=n/Eq0sOoZtzaVqr+/7UvaQRvmtuw0JlKOKahI8sZOq7u9ft9uJ/0MwTGW6f+fxIyWj xIa9JvvtzILJF55G+DVytU5IiLsvHWmLJvIA9R2p2uKX7SL6LOT0/lBdt7DTwUvWA3Zg LM4j/Z4sW31hQiw5A507CHuBEUPyaDaye4eQKlfqXGETdVvmpKOTnocPBSTWISvxincC pZJ6jKXP0/qI3WFonVBzQhPX92SYl9rAQDr2mT3SToDX3gFzu4p/T4wtvSBdgSOu/Azz 0BxZ4kjD5rRKHEmitZM5xzIeslF9nisbMDF6PvF9zvr2DxV+oiqxJy6sm2PLz8XnsxcK 9znQ== 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 s203si10796343yws.274.2018.12.04.12.29.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Dec 2018 12:29:24 -0800 (PST) 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 1gUHI2-00089J-H8; Tue, 04 Dec 2018 20:27:30 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gUHI1-00088W-J4 for xen-devel@lists.xenproject.org; Tue, 04 Dec 2018 20:27:29 +0000 X-Inumbo-ID: 04aaedc8-f803-11e8-ad94-f3cbc4eb1e68 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 04aaedc8-f803-11e8-ad94-f3cbc4eb1e68; Tue, 04 Dec 2018 20:27:28 +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 0CFA0165C; Tue, 4 Dec 2018 12:27:28 -0800 (PST) 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 449AA3F614; Tue, 4 Dec 2018 12:27:27 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 4 Dec 2018 20:26:44 +0000 Message-Id: <20181204202651.8836-11-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181204202651.8836-1-julien.grall@arm.com> References: <20181204202651.8836-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 v2 10/17] xen/arm: p2m: Allow to flush cache on any RAM region 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 MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently, we only allow to flush cache on regions mapped as p2m_ram_{rw,ro}. There are no real problem in cache flushing any RAM regions such as grants and foreign mapping. Therefore, relax the check to allow flushing the cache on any RAM region. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Fix typoes - Add Stefano's reviewed-by --- xen/arch/arm/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 836157292c..4e0ddbf70b 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1539,7 +1539,7 @@ int p2m_cache_flush_range(struct domain *d, gfn_t start, gfn_t end) next_gfn = gfn_next_boundary(start, order); /* Skip hole and non-RAM page */ - if ( mfn_eq(mfn, INVALID_MFN) || !p2m_is_ram(t) ) + if ( mfn_eq(mfn, INVALID_MFN) || !p2m_is_any_ram(t) ) continue; /* XXX: Implement preemption */