git: 418d8f0dc269 - main - dtrace: Address KMSAN warnings in dtrace_disx86

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 22 Nov 2024 14:05:09 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=418d8f0dc269b314bba51de63869b20da1d9a76e

commit 418d8f0dc269b314bba51de63869b20da1d9a76e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-22 13:50:26 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-22 14:03:40 +0000

    dtrace: Address KMSAN warnings in dtrace_disx86
    
    wbit was not being initialized in a couple of cases.
    
    Reported by:    asomers
    MFC after:      2 weeks
---
 sys/cddl/dev/dtrace/x86/dis_tables.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/cddl/dev/dtrace/x86/dis_tables.c b/sys/cddl/dev/dtrace/x86/dis_tables.c
index 1afadc94afc2..44c96437055b 100644
--- a/sys/cddl/dev/dtrace/x86/dis_tables.c
+++ b/sys/cddl/dev/dtrace/x86/dis_tables.c
@@ -3720,8 +3720,8 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode)
 	x->d86_len = 0;
 	x->d86_rmindex = -1;
 	x->d86_error = 0;
-#ifdef DIS_TEXT
 	x->d86_numopnds = 0;
+#ifdef DIS_TEXT
 	x->d86_seg_prefix = NULL;
 	x->d86_mnem[0] = 0;
 	for (i = 0; i < 4; ++i) {
@@ -4860,6 +4860,7 @@ mm_shift:
 		dtrace_rex_adjust(rex_prefix, mode, NULL, &r_m);
 		dtrace_get_operand(x, mode, r_m, LONG_OPND, vbit);
 		dtrace_get_operand(x, REG_ONLY, reg, SEG_OPND, 1 - vbit);
+		wbit = SEG_OPND;
 		break;
 
 	/*
@@ -5787,6 +5788,7 @@ xmmprm:
 #endif
 			dtrace_rex_adjust(rex_prefix, mode, &reg, &r_m);
 			dtrace_get_operand(x, mode, r_m, BYTE_OPND, 0);
+			wbit = LONG_OPND;
 		}
 		break;
 
@@ -6442,7 +6444,7 @@ done:
 		else
 			x->d86_memsize = dp->it_size;
 
-	} else if (wbit == 0) {
+	} else if (wbit == BYTE_OPND) {
 		x->d86_memsize = 1;
 
 	} else if (wbit == LONG_OPND) {