Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-15 Thread Marc Zyngier
Hi Yanan, On 2020-12-14 07:20, wangyanan (Y) wrote: diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c index a74a62283012..e3c6133567c4 100644 --- a/arch/arm64/kvm/hyp/pgtable.c +++ b/arch/arm64/kvm/hyp/pgtable.c @@ -45,6 +45,10 @@  #define KVM_PTE_LEAF_ATTR_HI_S2_XN

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-13 Thread wangyanan (Y)
Hi Will, Marc, On 2020/12/11 18:00, Will Deacon wrote: On Fri, Dec 11, 2020 at 09:49:28AM +, Marc Zyngier wrote: On 2020-12-11 08:01, Yanan Wang wrote: @@ -461,25 +462,56 @@ static int stage2_map_set_prot_attr(enum kvm_pgtable_prot prot, return 0; } +static bool

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-13 Thread wangyanan (Y)
On 2020/12/11 17:49, Marc Zyngier wrote: Hi Yanan, On 2020-12-11 08:01, Yanan Wang wrote: In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the same GPA could occur

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-13 Thread wangyanan (Y)
On 2020/12/11 17:53, Will Deacon wrote: Hi Yanan, On Fri, Dec 11, 2020 at 04:01:15PM +0800, Yanan Wang wrote: In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-11 Thread Will Deacon
On Fri, Dec 11, 2020 at 09:49:28AM +, Marc Zyngier wrote: > On 2020-12-11 08:01, Yanan Wang wrote: > > @@ -461,25 +462,56 @@ static int stage2_map_set_prot_attr(enum > > kvm_pgtable_prot prot, > > return 0; > > } > > > > +static bool stage2_set_valid_leaf_pte_pre(u64 addr, u32 level, > >

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-11 Thread Will Deacon
Hi Yanan, On Fri, Dec 11, 2020 at 04:01:15PM +0800, Yanan Wang wrote: > In dirty-logging, or dirty-logging-stopped time, even normal running > time of a guest configed with huge mappings and numbers of vCPUs, > translation faults by different vCPUs on the same GPA could occur > successively

Re: [RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-11 Thread Marc Zyngier
Hi Yanan, On 2020-12-11 08:01, Yanan Wang wrote: In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the same GPA could occur successively almost at the same time. There

[RFC PATCH] KVM: arm64: Add prejudgement for relaxing permissions only case in stage2 translation fault handler

2020-12-11 Thread Yanan Wang
In dirty-logging, or dirty-logging-stopped time, even normal running time of a guest configed with huge mappings and numbers of vCPUs, translation faults by different vCPUs on the same GPA could occur successively almost at the same time. There are two reasons for it. (1) If there are some vCPUs