From 23cd1207e7f6ee3e51fb42e11dba8d7cdb28e1e5 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 25 Apr 2024 16:38:01 +0200 Subject: [PATCH] VMX: no open-coding in vmx_get_cpl() Neither X86_SEG_AR_DPL nor MASK_EXTR() should really be avoided here, using literal number instead. No difference in generated code (with gcc13 at least). Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- xen/arch/x86/hvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 0935762378..5f67a48592 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1192,7 +1192,7 @@ unsigned int vmx_get_cpl(void) __vmread(GUEST_SS_AR_BYTES, &attr); - return (attr >> 5) & 3; + return MASK_EXTR(attr, X86_SEG_AR_DPL); } static unsigned int cf_check _vmx_get_cpl(struct vcpu *v) -- 2.39.5