diff options
| -rw-r--r-- | arch/x86/kvm/vmx.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c39b60707e02..c00f03de1b79 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -1488,13 +1488,6 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) | |||
| 1488 | loadsegment(ds, vmx->host_state.ds_sel); | 1488 | loadsegment(ds, vmx->host_state.ds_sel); |
| 1489 | loadsegment(es, vmx->host_state.es_sel); | 1489 | loadsegment(es, vmx->host_state.es_sel); |
| 1490 | } | 1490 | } |
| 1491 | #else | ||
| 1492 | /* | ||
| 1493 | * The sysexit path does not restore ds/es, so we must set them to | ||
| 1494 | * a reasonable value ourselves. | ||
| 1495 | */ | ||
| 1496 | loadsegment(ds, __USER_DS); | ||
| 1497 | loadsegment(es, __USER_DS); | ||
| 1498 | #endif | 1491 | #endif |
| 1499 | reload_tss(); | 1492 | reload_tss(); |
| 1500 | #ifdef CONFIG_X86_64 | 1493 | #ifdef CONFIG_X86_64 |
| @@ -6370,6 +6363,19 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) | |||
| 6370 | #endif | 6363 | #endif |
| 6371 | ); | 6364 | ); |
| 6372 | 6365 | ||
| 6366 | #ifndef CONFIG_X86_64 | ||
| 6367 | /* | ||
| 6368 | * The sysexit path does not restore ds/es, so we must set them to | ||
| 6369 | * a reasonable value ourselves. | ||
| 6370 | * | ||
| 6371 | * We can't defer this to vmx_load_host_state() since that function | ||
| 6372 | * may be executed in interrupt context, which saves and restore segments | ||
| 6373 | * around it, nullifying its effect. | ||
| 6374 | */ | ||
| 6375 | loadsegment(ds, __USER_DS); | ||
| 6376 | loadsegment(es, __USER_DS); | ||
| 6377 | #endif | ||
| 6378 | |||
| 6373 | vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP) | 6379 | vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP) |
| 6374 | | (1 << VCPU_EXREG_RFLAGS) | 6380 | | (1 << VCPU_EXREG_RFLAGS) |
| 6375 | | (1 << VCPU_EXREG_CPL) | 6381 | | (1 << VCPU_EXREG_CPL) |
