From patchwork Mon Oct 8 18:33:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 148432 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3982187lji; Mon, 8 Oct 2018 11:36:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV61/VAAMluI7BILH12Fb+cb7Fej21BC3/Lit/W9vrrRZGRpoh2Jq2+QkDxVHS8xJOg7WNElp X-Received: by 2002:a24:ac01:: with SMTP id s1-v6mr218141ite.69.1539023782764; Mon, 08 Oct 2018 11:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539023782; cv=none; d=google.com; s=arc-20160816; b=0+2dlYKJk4LIjiGYGzdk7a3kOTnwYhrkSPCUt20YiteTbgTk9xvCAkLtZWLQ9JIkEL 19Hdc4PZvGcRyBUU+LRaZBf+N3eXTOq9lUgvZJurcBatFXfOZkyn4hmJbRk5GgFPMzYU tlJcYxS2L0mlkdjPSBd9EJKEFnpUThrsmou27joKp4GrHcoXdj/I8Kgdis3fRlemDo41 PPwjrRodFVS4nqYpNj6xC6e8CcChaJNbGIrAqSYWLuyBA8pbMwtKfN0hL2/45RdqO7X9 0Y7EOhuTqU66GgR9JcohBteWj0DxRBe3J6xjX6GoOvUDakWIAcAC231Zc71e8xgHRP11 8W6w== 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=63uWvx+ZL8mmoIcGJxuVWNtkXPqI8ynOdiWzXFj51I0=; b=DxZS0KxQTqV6CLvlq9OTUiRnBYOMzlvOs9diIlfcr5YnJectwxuz57R8UdqmJVZZsr S9Q+BGTdBYt95kGVxh62MOCs+cbAOgaGcf0KUmhU++kBV0S9Np9pDaOAm52h3lJqHMRY hmbjMP8Goq+uYhoJqbRB4FCUso0r9g1om9/41yDN9ig5fTvHNbcXq0itFo3XOkyb2uE9 QWhoQZzYf5zkMBig0RaRHzfvfc+NJg1mde4S+/La8b2P0SqfjOYp/adlER3nAbgyKYek gYg8wALPtyCbMEY4PNkWnLrjy6xYGHnVfRs88lPyDrrjbeqbX4/a7oNT35rZ03cq2lmo xGBg== 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 v15-v6si8418770itb.108.2018.10.08.11.36.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Oct 2018 11:36:22 -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 1g9aMF-0005og-4u; Mon, 08 Oct 2018 18:34:19 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1g9aMD-0005mr-La for xen-devel@lists.xen.org; Mon, 08 Oct 2018 18:34:17 +0000 X-Inumbo-ID: 688bbb0d-cb28-11e8-a8a5-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 688bbb0d-cb28-11e8-a8a5-bc764e045a96; Mon, 08 Oct 2018 20:31:44 +0200 (CEST) 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 2C6341596; Mon, 8 Oct 2018 11:34:16 -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 429D73F5B3; Mon, 8 Oct 2018 11:34:15 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 8 Oct 2018 19:33:49 +0100 Message-Id: <20181008183352.16291-14-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181008183352.16291-1-julien.grall@arm.com> References: <20181008183352.16291-1-julien.grall@arm.com> Subject: [Xen-devel] [RFC 13/16] 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, andre.przywara@linaro.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently, we only allow to flush cache on region mapped as p2m_ram_{rw,ro}. There are no real problem to flush cache on any RAM region such as grants and foreign mapping. Therefore, relax the cache to allow flushing the cache on any RAM region. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- 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 8537b7bab1..12b459924b 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1532,7 +1532,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 */