From nobody Fri Apr 26 03:41:38 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557837147; cv=none; d=zoho.com; s=zohoarc; b=B9a+F5hN4OFfL6xc2GEx6YGik4J3TuBy5SHIwkpser98Q6k49Hie1IcGd5c2Pouvvuh+mD+XhsCS85+h5n0F0kpWz4kGATfpeZLl2wvqVjBUIE0oSJoDn98mvXAcvWOa+F5Gth7NKpTvXoOg3U2o7f/q/x6lZbeolgMX3uBSBXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557837147; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=EoGUuu7rYiZT8b39UakCMSwcCzcEDBQRX+JSS26gZQM=; b=VdMch5hp5bQkI7siRh1cMQp1YSAxIvff7KUZvsM3u6aAxqMiFCCvoUQFvGapKz33mDHp1g6mgdqNR53R+1LaG17oiszee9EbMTaB4WRlxwIVbI3FmAPJTfIvfS6KEqsY1hU4U1QuVC3Oenbw0JwdHl3G78cZI1mHprn3xqS6h1M= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1557837147571991.2031325268507; Tue, 14 May 2019 05:32:27 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWaq-0005Md-K4; Tue, 14 May 2019 12:31:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWaq-0005MN-3t for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:31:40 +0000 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 3860fc25-7644-11e9-8980-bc764e045a96; Tue, 14 May 2019 12:31:38 +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 9137315AD; Tue, 14 May 2019 05:31:38 -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 5DFA63F71E; Tue, 14 May 2019 05:31:37 -0700 (PDT) X-Inumbo-ID: 3860fc25-7644-11e9-8980-bc764e045a96 From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:31:18 +0100 Message-Id: <20190514123125.29086-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190514123125.29086-1-julien.grall@arm.com> References: <20190514123125.29086-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH MM-PART3 v2 05/12] xen/arm: mm: Introduce _PAGE_PRESENT and _PAGE_POPULATE 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 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, the flags are not enough to describe what kind of update will done on the VA range. They need to be used in conjunction with the enum xenmap_operation. It would be more convenient to have all the information for the update in a single place. Two new flags are added to remove the relience on xenmap_operation: - _PAGE_PRESENT: Indicate whether we are adding/removing the mapping - _PAGE_POPULATE: Indicate whether we only populate page-tables Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov --- Changes in v2: - Add Andrii's reviewed-by --- xen/arch/arm/mm.c | 2 +- xen/include/asm-arm/page.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 9de2a1150f..2192dede55 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1083,7 +1083,7 @@ int map_pages_to_xen(unsigned long virt, =20 int populate_pt_range(unsigned long virt, unsigned long nr_mfns) { - return xen_pt_update(RESERVE, virt, INVALID_MFN, nr_mfns, 0); + return xen_pt_update(RESERVE, virt, INVALID_MFN, nr_mfns, _PAGE_POPULA= TE); } =20 int destroy_xen_mappings(unsigned long v, unsigned long e) diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index 2bcdb0f1a5..caf2fac1ff 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -76,6 +76,8 @@ * * [0:2] Memory Attribute Index * [3:4] Permission flags + * [5] Present bit + * [6] Populate page table */ #define PAGE_AI_MASK(x) ((x) & 0x7U) =20 @@ -86,12 +88,15 @@ #define PAGE_XN_MASK(x) (((x) >> _PAGE_XN_BIT) & 0x1U) #define PAGE_RO_MASK(x) (((x) >> _PAGE_RO_BIT) & 0x1U) =20 +#define _PAGE_PRESENT (1U << 5) +#define _PAGE_POPULATE (1U << 6) + /* * _PAGE_DEVICE and _PAGE_NORMAL are convenience defines. They are not * meant to be used outside of this header. */ -#define _PAGE_DEVICE _PAGE_XN -#define _PAGE_NORMAL MT_NORMAL +#define _PAGE_DEVICE (_PAGE_XN|_PAGE_PRESENT) +#define _PAGE_NORMAL (MT_NORMAL|_PAGE_PRESENT) =20 #define PAGE_HYPERVISOR_RO (_PAGE_NORMAL|_PAGE_RO|_PAGE_XN) #define PAGE_HYPERVISOR_RX (_PAGE_NORMAL|_PAGE_RO) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel