From: Paolo Bonzini <pbonzini@redhat.com>
To: Tang Chen <tangchen@cn.fujitsu.com>,
gleb@kernel.org, mtosatti@redhat.com, nadav.amit@gmail.com,
jan.kiszka@web.de
Cc: kvm@vger.kernel.org, laijs@cn.fujitsu.com,
isimatu.yasuaki@jp.fujitsu.com, guz.fnst@cn.fujitsu.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest().
Date: Tue, 16 Sep 2014 13:24:17 +0200 [thread overview]
Message-ID: <54181DE1.3040502@redhat.com> (raw)
In-Reply-To: <1410864122-12434-5-git-send-email-tangchen@cn.fujitsu.com>
Il 16/09/2014 12:42, Tang Chen ha scritto:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 33712fb..0df82c1 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -210,6 +210,11 @@ void kvm_make_scan_ioapic_request(struct kvm *kvm)
> make_all_cpus_request(kvm, KVM_REQ_SCAN_IOAPIC);
> }
>
> +void kvm_reload_apic_access_page(struct kvm *kvm)
> +{
> + make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD);
> +}
> +
> int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
> {
> struct page *page;
> @@ -294,6 +299,13 @@ static void kvm_mmu_notifier_invalidate_page(struct mmu_notifier *mn,
> if (need_tlb_flush)
> kvm_flush_remote_tlbs(kvm);
>
> + /*
> + * The physical address of apic access page is stored in VMCS.
> + * Update it when it becomes invalid.
> + */
> + if (address == gfn_to_hva(kvm, APIC_DEFAULT_PHYS_BASE >> PAGE_SHIFT))
> + kvm_reload_apic_access_page(kvm);
This cannot be in the generic code. It is architecture-specific.
Please add a new function kvm_arch_mmu_notifier_invalidate_page, and
call it outside the mmu_lock.
kvm_reload_apic_access_page need not be in virt/kvm/kvm_main.c, either.
Paolo
> spin_unlock(&kvm->mmu_lock);
> srcu_read_unlock(&kvm->srcu, idx);
> }
next prev parent reply other threads:[~2014-09-16 11:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-16 10:41 [PATCH v6 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page Tang Chen
2014-09-16 10:41 ` [PATCH v6 1/6] kvm: Use APIC_DEFAULT_PHYS_BASE macro as the apic access page address Tang Chen
2014-09-16 10:41 ` [PATCH v6 2/6] kvm: Remove ept_identity_pagetable from struct kvm_arch Tang Chen
2014-09-16 10:41 ` [PATCH v6 3/6] kvm: Make init_rmode_identity_map() return 0 on success Tang Chen
2014-09-16 10:42 ` [PATCH v6 4/6] kvm, mem-hotplug: Reload L1' apic access page on migration in vcpu_enter_guest() Tang Chen
2014-09-16 11:24 ` Paolo Bonzini [this message]
2014-09-17 8:13 ` Tang Chen
2014-09-17 9:14 ` Paolo Bonzini
2014-09-16 10:42 ` [PATCH v6 5/6] kvm, mem-hotplug: Reload L1's apic access page on migration when L2 is running Tang Chen
2014-09-16 11:34 ` Paolo Bonzini
2014-09-16 10:42 ` [PATCH v6 6/6] kvm, mem-hotplug: Unpin and remove kvm_arch->apic_access_page Tang Chen
2014-09-16 11:44 ` [PATCH v6 0/6] kvm, mem-hotplug: Do not pin ept identity pagetable and apic access page Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54181DE1.3040502@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@kernel.org \
--cc=guz.fnst@cn.fujitsu.com \
--cc=isimatu.yasuaki@jp.fujitsu.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=nadav.amit@gmail.com \
--cc=tangchen@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).