[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B0D2B22.4030403@redhat.com>
Date: Wed, 25 Nov 2009 15:03:30 +0200
From: Avi Kivity <avi@...hat.com>
To: Gleb Natapov <gleb@...hat.com>
CC: kvm@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, mingo@...e.hu,
a.p.zijlstra@...llo.nl, tglx@...utronix.de, hpa@...or.com,
riel@...hat.com
Subject: Re: [PATCH v2 08/12] Inject asynchronous page fault into a guest
if page is swapped out.
On 11/23/2009 04:06 PM, Gleb Natapov wrote:
> If guest access swapped out memory do not swap it in from vcpu thread
> context. Setup slow work to do swapping and send async page fault to
> a guest.
>
> Allow async page fault injection only when guest is in user mode since
> otherwise guest may be in non-sleepable context and will not be able to
> reschedule.
>
> +
> +void kvm_arch_inject_async_page_present(struct kvm_vcpu *vcpu,
> + struct kvm_async_pf *work)
> +{
> + put_user(KVM_PV_REASON_PAGE_READY, vcpu->arch.apf_data);
> + kvm_inject_page_fault(vcpu, work->arch.token, 0);
> + trace_kvm_send_async_pf(work->arch.token, work->gva,
> + KVM_PV_REASON_PAGE_READY);
> +}
>
What if the guest is now handling a previous asynv pf or ready
notification? We're clobbering the data structure.
> +
> +bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
> +{
> + return !kvm_event_needs_reinjection(vcpu)&&
> + kvm_x86_ops->interrupt_allowed(vcpu);
> +}
>
Okay, so this is only allowed with interrupts disabled. Need to make
sure the entire pf path up to async pf executes with interrupts disabled.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists