From nobody Wed Dec 11 17:47:52 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y7jk112d8z5gFrs; Wed, 11 Dec 2024 17:47:53 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y7jk06n6fz4LKM; Wed, 11 Dec 2024 17:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733939272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=54s/K7LtWOnQANA5dZNSszOAWjmcDJ6FxBO+/r2JWWg=; b=RQLWxKlhGEQjIGN6+ypBRxhdZWup+shiiVz4deaQZ078Hz3d/+Mixr1p1S6vunIF5fsiCl mhZ8hqCq8ahcHk5vfPVIR+7+mhUu7gJ8pxFdNxbEGn4oPpjEj7Z9Gu48cxw77rDOZceHHy VIeoO9nGVsA1sj6heM+clcMfwSgMQYDVZaVP062hxU5EzvsZi5ZPFzV9tjMlx1Y2RwnlT4 eCoYeuw+U15jpQ8p7cgNbE47RMo/IzP2mhuElyqyNZZTkG0BQsaRAaZM7fh2paUvn+8oZp SARKNAJV2x+CW1wp8G646PI1H4ASfZz3ZGUIyAuIrLbt+2uQDvfPf2ZE8b0eZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733939272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=54s/K7LtWOnQANA5dZNSszOAWjmcDJ6FxBO+/r2JWWg=; b=JkkY2Oy0xGLHCcf/MOzQwx9HtugJEOC4QapSrFxIFp13ICqc1OUTug9nO3Ap3WpbKQTBrI 29WsRCTVbDE8nZCCN1gaEAQoAjxjzmFTAdIOgVg7fy2/VwZp1xjjZQgE01bn32f9GrXidx TBN/JFlR7h/I4tfpCjmFDza+oJ6YWwfU/Wa9o0/mpXx0osaAaybiJjk/R23yvJOGUmKdtk H/09fDfxeWJnTrrEFiR1T0k2QUw0v1ABvHmrZimLBkZEclr+N+8C+eyTfCrqzlEIRot4uW VHBW7UwABDJjFP6z/dYCf9iHe9Y0kVszQvqHGtDGbqlunmDhu063BlYQvYBz+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733939272; a=rsa-sha256; cv=none; b=COsYIGJozs4v9nZVqn6oDHW+ZNUiWZW24h4d7rOXi35hb5q2iHnrdnHOzxiqPHOhofikTn JD0XFuLUBj21nHxeWIcLiliPkVsTmUuaVPMTOUhc+qXrZQJl6yTsET99F0XZBGVY53MWDk W1zmCMHVtWH7UKGcMoGlT0n2Pm4r9H9/E32OVsqtgR2OKaffgzwQLtIgbibgwc7zZ9YTtG amN2m8rnf9z3bV2QTyfDiMd/eMsgHboPCk2kiuzZHHrqkVJ0UJOoWdEFlUu2mDHhzOQ6h0 q4/sKtBmRLT3OYixGbsJ8JcgTlzZnnlbRgNPj8SwUHG+fdL/wPuIvPV9zZ1+xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y7jk06P0ZzHc3; Wed, 11 Dec 2024 17:47:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BBHlqcH049294; Wed, 11 Dec 2024 17:47:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BBHlq08049291; Wed, 11 Dec 2024 17:47:52 GMT (envelope-from git) Date: Wed, 11 Dec 2024 17:47:52 GMT Message-Id: <202412111747.4BBHlq08049291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e7bc16422031 - main - arm64: Add a DBM errata workaround List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e7bc16422031803823fd6ef0c5083631dc7dfffc Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e7bc16422031803823fd6ef0c5083631dc7dfffc commit e7bc16422031803823fd6ef0c5083631dc7dfffc Author: Andrew Turner AuthorDate: 2024-12-11 15:49:15 +0000 Commit: Andrew Turner CommitDate: 2024-12-11 17:02:24 +0000 arm64: Add a DBM errata workaround Add a workaround for Cortex-A55 erratum 1024718 and Cortex-A510 erratum 2051678. Both errata are related to the hardware handling of the dirty field in page tables and can be worked around by disabling this feature. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47809 --- sys/arm64/arm64/pmap.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index b8f519388977..fd6798668626 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1629,10 +1629,24 @@ void pmap_cpu_init(void) { uint64_t id_aa64mmfr1, tcr; + bool enable_dbm; + + enable_dbm = false; /* Enable HAFDBS if supported */ id_aa64mmfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - if (ID_AA64MMFR1_HAFDBS_VAL(id_aa64mmfr1) >=ID_AA64MMFR1_HAFDBS_AF_DBS){ + if (ID_AA64MMFR1_HAFDBS_VAL(id_aa64mmfr1) >= ID_AA64MMFR1_HAFDBS_AF_DBS) + enable_dbm = true; + /* Disable on Cortex-A55 for erratum 1024718 - all revisions */ + if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK, CPU_IMPL_ARM, + CPU_PART_CORTEX_A55, 0, 0)) + enable_dbm = false; + /* Disable on Cortex-A510 for erratum 2051678 - r0p0 to r0p2 */ + else if (CPU_MATCH(CPU_IMPL_MASK | CPU_PART_MASK | CPU_VAR_MASK, + CPU_IMPL_ARM, CPU_PART_CORTEX_A510, 0, 0)) + if (CPU_REV(PCPU_GET(midr)) < 3) + enable_dbm = false; + if (enable_dbm) { tcr = READ_SPECIALREG(tcr_el1) | TCR_HD; WRITE_SPECIALREG(tcr_el1, tcr); isb();