login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
10
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging guest
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Xiao Guangrong
Subject:
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging guest
Date: Tuesday, November 9, 2010 - 7:08 pm
On 11/09/2010 06:51 PM, Gleb Natapov wrote:
quoted text
> On Tue, Nov 09, 2010 at 05:52:40PM +0800, Xiao Guangrong wrote: >>>>>> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h >>>>>> index 7f20f2c..606978e 100644 >>>>>> --- a/arch/x86/include/asm/kvm_host.h >>>>>> +++ b/arch/x86/include/asm/kvm_host.h >>>>>> @@ -600,6 +600,7 @@ struct kvm_x86_ops { >>>>>> struct kvm_arch_async_pf { >>>>>> u32 token; >>>>>> gfn_t gfn; >>>>>> + bool softmmu; >>>>>> }; >>>>>> >>>>>> extern struct kvm_x86_ops *kvm_x86_ops; >>>>>> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c >>>>>> index f3fad4f..48ca312 100644 >>>>>> --- a/arch/x86/kvm/mmu.c >>>>>> +++ b/arch/x86/kvm/mmu.c >>>>>> static int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn) >>>>>> @@ -2602,6 +2607,7 @@ static int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn) >>>>>> struct kvm_arch_async_pf arch; >>>>>> arch.token = (vcpu->arch.apf.id++ << 12) | vcpu->vcpu_id; >>>>>> arch.gfn = gfn; >>>>>> + arch.softmmu = mmu_is_softmmu(vcpu); >>>>>> >>>>> We can do: >>>>> if (mmu_is_nested(vcpu)) >>>>> gva = vcpu->mmu.gva_to_gpa(gva); >>>>> And this should fix everything no? >>>>> >>>> >>>> No, since it can't help us to avoid NPF when nested guest run again. >>>> >>> Of course it will not prevent NPF if L2 guest touches it again, but from >>> correctness point of view it is OK. So if L1 will re-use the page for >>> L1 process the page will be already mapped. Not a huge gain I agree, but >>> fix is much more simple. >>> >> >> Um, it need hold mmu_lock, and we don't know 'gva''s mapping in PT10 is valid >> or not, also don't know whether it can be accessed later, so the general rule >> is lazily update it. >> > We do know that gva's mapping in PT10 is valid since we wouldn't try apf > otherwise. If nested gpa is mapped to a gpa thst is not valid in L0 then > L0 should emulate instruction for L2, no? >
No need.
quoted text
>> The more important is that we can prefault for softmmu in the later patch, >> it means we can prefault 'gva' in PT20, so don't cook gva here. >> > So may be just apply second patch then? >
Yes, i think so. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH 1/3] KVM: MMU: fix missing post sync audit
, Xiao Guangrong
, (Thu Nov 4, 3:30 am)
[PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging guest
, Xiao Guangrong
, (Thu Nov 4, 3:32 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Thu Nov 4, 3:35 am)
[PATCH 3/3] KVM: MMU: retry #PF for softmmu
, Xiao Guangrong
, (Thu Nov 4, 3:36 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Thu Nov 4, 10:39 pm)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Fri Nov 5, 12:45 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Fri Nov 5, 1:03 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Fri Nov 5, 3:31 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Sun Nov 7, 7:14 pm)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Mon Nov 8, 6:52 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Mon Nov 8, 9:58 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Mon Nov 8, 10:01 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Tue Nov 9, 1:03 am)
Re: [PATCH 3/3] KVM: MMU: retry #PF for softmmu
, Gleb Natapov
, (Tue Nov 9, 1:06 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Tue Nov 9, 1:48 am)
Re: [PATCH 3/3] KVM: MMU: retry #PF for softmmu
, Xiao Guangrong
, (Tue Nov 9, 2:16 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Tue Nov 9, 2:26 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Tue Nov 9, 2:52 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Gleb Natapov
, (Tue Nov 9, 3:51 am)
Re: [PATCH 2/3] KVM: MMU: don not retry #PF for nonpaging ...
, Xiao Guangrong
, (Tue Nov 9, 7:08 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Andi Kleen
Re: - romsignature-checksum-cleanup-2.patch removed from -mm tree
H. Peter Anvin
Re: Typo bug [Re: Linux 2.6.27-rc8]
git
:
Christian Jaeger
Re: Problem with Git.pm bidi_pipe methods
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Junio C Hamano
Re: Teach "git checkout" to use git-show-ref
Junio C Hamano
Re: Start deprecating "git-command" in favor of "git command"
Jon Smirl
stgit: managing signed-off-by lines
git-commits-head
:
Linux Kernel Mailing List
MIPS: Bonito64: Make Loongson independent from Bonito64 code.
Linux Kernel Mailing List
iwlwifi: initialize spinlock before use
Linux Kernel Mailing List
i2c-i801: Add Intel Cougar Point device IDs
Linux Kernel Mailing List
drm/i915: Add information on pinning and fencing to the i915 list debug.
Linux Kernel Mailing List
x86: replace CONFIG_X86_SMP with CONFIG_SMP
linux-netdev
:
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Jan Engelhardt
Re: [PATCH 3/5] can: af_can.c use rcu_barrier() on module unload.
Stephen Hemminger
[PATCH] sky2: RX lockup fix
freebsd-current
:
Boris Samorodov
Re: twa + dump = sbwait
韓家標 Bill Hacker
Re: ZFS honesty
Bjoern A. Zeeb
Re: Can not boot 7.0-BETA3 with IPSEC
Randy Bush
Re: problems making an access point w/current
FreeBSD Tinderbox
[head tinderbox] failure on i386/i386
Colocation donated by:
Syndicate