From owner-svn-src-head@freebsd.org Thu Aug 1 22:48:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F319A3677; Thu, 1 Aug 2019 22:48:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46056Z73hmz4LV6; Thu, 1 Aug 2019 22:48:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFA0621436; Thu, 1 Aug 2019 22:48:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x71Mm6t1038013; Thu, 1 Aug 2019 22:48:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x71Mm641038012; Thu, 1 Aug 2019 22:48:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908012248.x71Mm641038012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Aug 2019 22:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350525 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 350525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 22:48:07 -0000 Author: markj Date: Thu Aug 1 22:48:06 2019 New Revision: 350525 URL: https://svnweb.freebsd.org/changeset/base/350525 Log: Use ATTR_DBM even when hardware dirty bit management is not enabled. The ARMv8 reference manual only states that the bit is reserved in this case; following Linux's example, use it instead of a software-defined bit for the purpose of indicating that a managed mapping is writable. Reviewed by: alc, andrew MFC after: r350004 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21121 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pte.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Aug 1 22:22:06 2019 (r350524) +++ head/sys/arm64/arm64/pmap.c Thu Aug 1 22:48:06 2019 (r350525) @@ -221,8 +221,11 @@ __FBSDID("$FreeBSD$"); * The presence of this flag indicates that the mapping is writeable. * If the ATTR_AP_RO bit is also set, then the mapping is clean, otherwise it is * dirty. This flag may only be set on managed mappings. + * + * The DBM bit is reserved on ARMv8.0 but it seems we can safely treat it + * as a software managed bit. */ -static pt_entry_t ATTR_SW_DBM; +#define ATTR_SW_DBM ATTR_DBM struct pmap kernel_pmap_store; @@ -783,15 +786,6 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ vm_paddr_t start_pa, pa, min_pa; uint64_t kern_delta; int i; - -#ifdef notyet - /* Determine whether the hardware implements DBM management. */ - uint64_t reg = READ_SPECIALREG(ID_AA64MMFR1_EL1); - ATTR_SW_DBM = ID_AA64MMFR1_HAFDBS(reg) == ID_AA64MMFR1_HAFDBS_AF_DBS ? - ATTR_DBM : _ATTR_SW_DBM; -#else - ATTR_SW_DBM = _ATTR_SW_DBM; -#endif kern_delta = KERNBASE - kernstart; Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Thu Aug 1 22:22:06 2019 (r350524) +++ head/sys/arm64/include/pte.h Thu Aug 1 22:48:06 2019 (r350525) @@ -43,8 +43,8 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define ATTR_MASK_L UINT64_C(0x0000000000000fff) #define ATTR_MASK (ATTR_MASK_H | ATTR_MASK_L) /* Bits 58:55 are reserved for software */ -#define ATTR_SW_UNUSED (1UL << 58) -#define _ATTR_SW_DBM (1UL << 57) +#define ATTR_SW_UNUSED2 (1UL << 58) +#define ATTR_SW_UNUSED1 (1UL << 57) #define ATTR_SW_MANAGED (1UL << 56) #define ATTR_SW_WIRED (1UL << 55) #define ATTR_UXN (1UL << 54)