Skip to content

task switch fixes

Marcelo Tosatti kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: task switch: translate guest segment limit to virt-extension byte granular fieldarch/x86/kvm/x86.c+10 -23 replies
2/3KVM: task switch: check task busy statearch/x86/kvm/x86.c+16 -40 replies
3/3KVM: task switch: check for segment base translation failurearch/x86/kvm/x86.c+20 -41 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/3] task switch fixes

Some more fixes for the task switch emulation.

Quoted 3 lines

I think the problem is in seg_desct_to_kvm_desct() (besides the extra T's). It copies the limit from the descriptor directly to the kvm_segment structure.

You're right.

After fixing that 2003 Server task switches successfully to an EIP that contains junk, a few UD's are injected and then a GP, which BSOD's asking for a reboot.

All task switch state is valid, can't find anything that would generate any exception. And even if it did, #GP and #TS are handled with a BSOD.

Xen has this special case for when the TSS's first 104 bytes cross a page boundary (docs mention this should be avoided since processor uses the physical addresses as base), but not the case with 2003.

XP sets CR3 with invalid bits. Xen simply resets the guest in that case, KVM could do the same.