[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] x86/hvm: Use system descriptor type names in hvm_task_switch()



commit 384a4d98f8233cc461cc03082792dec0e7b33621
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Thu Aug 20 10:09:25 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Sep 24 20:54:37 2026 +0100

    x86/hvm: Use system descriptor type names in hvm_task_switch()
    
    ... rather than magic numbers.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 192309c2fc..d62f0b3866 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3067,7 +3067,8 @@ void hvm_task_switch(
     if ( tr.g )
         tr.limit = (tr.limit << 12) | 0xfffu;
 
-    if ( tr.type != ((taskswitch_reason == TSW_iret) ? 0xb : 0x9) )
+    if ( tr.type != (taskswitch_reason == TSW_iret
+                     ? SYS_DESC_tss_busy : SYS_DESC_tss_avail) )
     {
         hvm_inject_hw_exception(
             (taskswitch_reason == TSW_iret) ? X86_EXC_TS : X86_EXC_GP,
@@ -3193,7 +3194,7 @@ void hvm_task_switch(
             goto out;
     }
 
-    tr.type = 0xb; /* busy 32-bit tss */
+    tr.type = SYS_DESC_tss_busy;
     hvm_set_segment_register(v, x86_seg_tss, &tr);
 
     v->arch.hvm.guest_cr[0] |= X86_CR0_TS;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.