From nobody Mon Oct 21 12:24:16 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 4XXDy92Gcmz5YwY8; Mon, 21 Oct 2024 12:24:17 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXDy90zs3z4DXS; Mon, 21 Oct 2024 12:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729513457; 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=8pXWwTY0FoECZkmq0agyX4o6T+zZUK5vmPeH6x8Epy8=; b=epc3R08XKTAJ0F+HEQrlKyl9rD5AYooAq4UBtbici8wvYr78rRDkmiFkeKGnUs6PNqvRoa rprhar540XRbrg0wD5aiUB/JCYHKKDLW8iat77rEFwhjfyG808k5ZbYh2uJhvdyYOSP9Zk rYiPZaLQ1FTfOmcWOmHUghap5XE3z0e5J/VFQRA78ytqouzoag/LS4RF96ABBqzTez20Rc 0jELZqV1erbpCFU9m+ZyT6/wTYLsfzDaeH4XltKkfedANgUo5gNMTclDa9uYzIK5VloFSA NZ2+Vza5YVfglimHDstaq7VgE9v11BTYDivPUfzFYjLJmfEIjspHMWPMwW/9Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729513457; 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=8pXWwTY0FoECZkmq0agyX4o6T+zZUK5vmPeH6x8Epy8=; b=YIzeD9SFEwjyKrACMWqD3rByJJ749BQj3pBMBCOLw9rBitCxexkrFAGSFBn2yaSmMDd4gC lAt+WmZ/CUc+hB1zwTuhqrYruMcdBLVAM5RFCEo7MBq7yJl/jxs1jl1hjCaN33XvCQfNxd JSbwuMXuiW5CGUs/UY+8R14CJMCKaMvMBSHHOqz3Pc4K1MEPIiYF9oEVq5n9BNAAP2T9Yi s3met98PwfJ3Z1fyTq21XSr+DoGW/oINgh7j0bJhrOTe5AFSkaSUCUmZ6bMIAZebo6D4Tj +uFw6NwK7/K+dgqti/KUlX2kG2qYGu9cWuLD1Aex8yQdkPMKI/mFy6S385/ssw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729513457; a=rsa-sha256; cv=none; b=a0gSCVvXOL/5UWgOTq8Cz9ImQFOdZMXH29TMS/kutNE0uE/z0k/pEOfZqf1lUJH0N5EHx0 ccOXgOoatBrKZCopJY7B66JJMYG5kFZQ79HQ7GsTedyhY+IYh5q0AW0P5ugeom6Y7lCJFk sibN4YVlmgu1VkGRKGeYr914OOTWGCx0nVQlGY1K18V6RlUAl+OiEWeh/q9W4r+zEQmw3R wY+A8Vh8HrkkpCrokurj0jWwRoDsaLdcMIQTnwStpn4EEr1mVEST+2ddMHJowF8A7gBY9w Y498n/tuNFxY5yszkqn09P9pmmAJRqCz0XNGEdqbw89ZRVKtNcURL75Kr7QBiw== 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 4XXDy90bpszVr6; Mon, 21 Oct 2024 12:24:17 +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 49LCOGff048951; Mon, 21 Oct 2024 12:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LCOG8T048948; Mon, 21 Oct 2024 12:24:16 GMT (envelope-from git) Date: Mon, 21 Oct 2024 12:24:16 GMT Message-Id: <202410211224.49LCOG8T048948@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: ffdf9db281f5 - main - arm64: Add MRS_SAFE to hold a safe ID field value 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: ffdf9db281f5cb8edfd819fec1e1c696e52d042c Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ffdf9db281f5cb8edfd819fec1e1c696e52d042c commit ffdf9db281f5cb8edfd819fec1e1c696e52d042c Author: Andrew Turner AuthorDate: 2024-10-18 09:16:18 +0000 Commit: Andrew Turner CommitDate: 2024-10-21 12:23:15 +0000 arm64: Add MRS_SAFE to hold a safe ID field value To support reworking the arm64 CPU ID code to add CTR_EL0, the cache type register, start to move the safe value to be encoded as a named field rather than part of MRS_EXACT. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47120 --- sys/arm64/arm64/identcpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 1627515361f7..c36428cfa1d6 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -294,9 +294,11 @@ const struct cpu_implementers cpu_implementers[] = { #define MRS_TYPE_LNX_SHIFT 8 #define MRS_INVALID 0 #define MRS_EXACT 1 -#define MRS_EXACT_VAL(x) (MRS_EXACT | ((x) << 4)) -#define MRS_EXACT_FIELD(x) (((x) >> 4) & 0xf) #define MRS_LOWER 2 +#define MRS_SAFE_SHIFT 4 +#define MRS_SAFE_MASK (0xfu << MRS_SAFE_SHIFT) +#define MRS_SAFE(x) (((x) << MRS_SAFE_SHIFT) & MRS_SAFE_MASK) +#define MRS_SAFE_VAL(x) (((x) & MRS_SAFE_MASK) >> MRS_SAFE_SHIFT) struct mrs_field_value { uint64_t value; @@ -498,7 +500,7 @@ static const struct mrs_field id_aa64dfr0_fields[] = { MRS_FIELD(ID_AA64DFR0, PMUVer, false, MRS_EXACT, id_aa64dfr0_pmuver), MRS_FIELD(ID_AA64DFR0, TraceVer, false, MRS_EXACT, id_aa64dfr0_tracever), - MRS_FIELD(ID_AA64DFR0, DebugVer, false, MRS_EXACT_VAL(0x6), + MRS_FIELD(ID_AA64DFR0, DebugVer, false, MRS_EXACT | MRS_SAFE(0x6), id_aa64dfr0_debugver), MRS_FIELD_END, }; @@ -2158,7 +2160,7 @@ update_special_reg_field(uint64_t user_reg, u_int type, uint64_t value, switch (type & MRS_TYPE_MASK) { case MRS_EXACT: user_reg &= ~(0xful << shift); - user_reg |= (uint64_t)MRS_EXACT_FIELD(type) << shift; + user_reg |= (uint64_t)MRS_SAFE(type) << shift; break; case MRS_LOWER: user_reg = update_lower_register(user_reg, value, shift, width,