[Devel] [PATCH rh7 v1 02/36] kvm/x86: Vcpu based page access routines usage
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Feb 16 00:28:31 PST 2016
And what about other hunks from
commit 54bf36aac520315385fe7623a5c3a698e993ceda
Author: Paolo Bonzini <pbonzini at redhat.com>
Date: Wed Apr 8 15:39:23 2015 +0200
KVM: x86: use vcpu-specific functions to read/write/translate GFNs
We need to hide SMRAM from guests not running in SMM. Therefore,
all uses of kvm_read_guest* and kvm_write_guest* must be changed to
check whether the VCPU is in system management mode and use a
different set of memslots. Switch from kvm_* to the newly-introduced
kvm_vcpu_*, which call into kvm_arch_vcpu_memslots_id.
Reviewed-by: Radim Krčmář <rkrcmar at redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
Do we need them?
--
Best regards,
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
On 02/10/2016 06:17 PM, Andrey Smetanin wrote:
> Signed-off-by: Andrey Smetanin <asmetanin at virtuozzo.com>
> ---
> arch/x86/kvm/hyperv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
> index 5828875..32d8d00 100644
> --- a/arch/x86/kvm/hyperv.c
> +++ b/arch/x86/kvm/hyperv.c
> @@ -187,13 +187,13 @@ static int set_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 data)
> break;
> }
> gfn = data >> HV_X64_MSR_APIC_ASSIST_PAGE_ADDRESS_SHIFT;
> - addr = gfn_to_hva(vcpu->kvm, gfn);
> + addr = kvm_vcpu_gfn_to_hva(vcpu, gfn);
> if (kvm_is_error_hva(addr))
> return 1;
> if (__clear_user((void __user *)addr, PAGE_SIZE))
> return 1;
> hv->hv_vapic = data;
> - mark_page_dirty(vcpu->kvm, gfn);
> + kvm_vcpu_mark_page_dirty(vcpu, gfn);
> if (kvm_lapic_enable_pv_eoi(vcpu,
> gfn_to_gpa(gfn) | KVM_MSR_ENABLED))
> return 1;
>
More information about the Devel
mailing list