diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 75e9df097845..2ad8c97f58cc 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -246,6 +246,10 @@ int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3) | |||
246 | ret = 1; | 246 | ret = 1; |
247 | 247 | ||
248 | memcpy(vcpu->arch.pdptrs, pdpte, sizeof(vcpu->arch.pdptrs)); | 248 | memcpy(vcpu->arch.pdptrs, pdpte, sizeof(vcpu->arch.pdptrs)); |
249 | __set_bit(VCPU_EXREG_PDPTR, | ||
250 | (unsigned long *)&vcpu->arch.regs_avail); | ||
251 | __set_bit(VCPU_EXREG_PDPTR, | ||
252 | (unsigned long *)&vcpu->arch.regs_dirty); | ||
249 | out: | 253 | out: |
250 | 254 | ||
251 | return ret; | 255 | return ret; |
@@ -261,6 +265,10 @@ static bool pdptrs_changed(struct kvm_vcpu *vcpu) | |||
261 | if (is_long_mode(vcpu) || !is_pae(vcpu)) | 265 | if (is_long_mode(vcpu) || !is_pae(vcpu)) |
262 | return false; | 266 | return false; |
263 | 267 | ||
268 | if (!test_bit(VCPU_EXREG_PDPTR, | ||
269 | (unsigned long *)&vcpu->arch.regs_avail)) | ||
270 | return true; | ||
271 | |||
264 | r = kvm_read_guest(vcpu->kvm, vcpu->arch.cr3 & ~31u, pdpte, sizeof(pdpte)); | 272 | r = kvm_read_guest(vcpu->kvm, vcpu->arch.cr3 & ~31u, pdpte, sizeof(pdpte)); |
265 | if (r < 0) | 273 | if (r < 0) |
266 | goto out; | 274 | goto out; |