KVM: selftests: Drop superfluous switch() on vm->mode in vcpu_init_sregs()
authorSean Christopherson <seanjc@google.com>
Thu, 14 Mar 2024 23:26:32 +0000 (16:26 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 29 Apr 2024 19:55:17 +0000 (12:55 -0700)
commit1051e29cb9156789e908ab9565f59e7aba470d60
treea004851d96f8d22da3a4b29cb42d54e464881e26
parent2a511ca994933ba02309c65401d88cbf4f19630e
KVM: selftests: Drop superfluous switch() on vm->mode in vcpu_init_sregs()

Replace the switch statement on vm->mode in x86's vcpu_init_sregs()'s with
a simple assert that the VM has a 48-bit virtual address space.  A switch
statement is both overkill and misleading, as the existing code incorrectly
implies that VMs with LA57 would need different to configuration for the
LDT, TSS, and flat segments.  In all likelihood, the only difference that
would be needed for selftests is CR4.LA57 itself.

Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Link: https://lore.kernel.org/r/20240314232637.2538648-14-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/lib/x86_64/processor.c