Date: Mon, 21 Oct 2024 12:24:20 GMT From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: e5f33d429780 - main - arm64: Handle RES1 ID register fields Message-ID: <202410211224.49LCOKPB049110@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e5f33d429780f649635452ef4142e1072ed149c8 commit e5f33d429780f649635452ef4142e1072ed149c8 Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2024-10-18 09:17:01 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2024-10-21 12:23:15 +0000 arm64: Handle RES1 ID register fields Some special registers we may want to emulate for userspace have fields that are reserved to be 1. Add support for these fields. As there is no value to print jump over printing them in print_id_fields. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47123 --- sys/arm64/arm64/identcpu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 48ac5c59274d..126df01edfa3 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -365,6 +365,15 @@ struct mrs_field { u_int shift; }; +#define MRS_FIELD_RES1(_width, _shift) \ + { \ + .sign = false, \ + .type = MRS_EXACT | MRS_SAFE((1u << (_width)) - 1) | \ + MRS_USERSPACE, \ + .width = (_width), \ + .shift = (_shift), \ + } + #define MRS_FIELD_HWCAP(_register, _name, _sign, _type, _visibility, \ _values, _hwcap) \ { \ @@ -2549,9 +2558,8 @@ print_id_fields(struct sbuf *sb, uint64_t reg, const void *arg) for (i = 0; fields[i].type != 0; i++) { fv = fields[i].values; - /* TODO: Handle with an unknown message */ if (fv == NULL) - continue; + goto next; field = (reg & fields[i].mask) >> fields[i].shift; for (j = 0; fv[j].desc != NULL; j++) { @@ -2566,6 +2574,7 @@ print_id_fields(struct sbuf *sb, uint64_t reg, const void *arg) sbuf_printf(sb, "%sUnknown %s(%x)", SEP_STR, fields[i].name, field); +next: reg &= ~(((1ul << fields[i].width) - 1) << fields[i].shift); }help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410211224.49LCOKPB049110>
