RE: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread zhukeqian
Hi, Cheers for these discussion. :) I am on vacation, and will come back at 2.18. Thanks, Keqian On 21-02-07 18:40:36, Keqian Zhu wrote: > Hi Yi, > > On 2021/2/7 17:56, Yi Sun wrote: > > Hi, > > > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > > > [...] > > > >> +static void vfio_dma_dirty_log_s

Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection

2021-02-09 Thread Quentin Perret
On Thursday 04 Feb 2021 at 10:47:08 (+), Quentin Perret wrote: > On Wednesday 03 Feb 2021 at 14:37:10 (+), Will Deacon wrote: > > > +static void handle___pkvm_init(struct kvm_cpu_context *host_ctxt) > > > +{ > > > + DECLARE_REG(phys_addr_t, phys, host_ctxt, 1); > > > + DECLARE_REG(unsigned

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Yi Sun
On 21-02-09 11:16:08, Robin Murphy wrote: > On 2021-02-07 09:56, Yi Sun wrote: > >Hi, > > > >On 21-01-28 23:17:41, Keqian Zhu wrote: > > > >[...] > > > >>+static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, > >>+struct vfio_dma *dma) > >>+{ > >>+ struct

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Yi Sun
On 21-02-07 18:40:36, Keqian Zhu wrote: > Hi Yi, > > On 2021/2/7 17:56, Yi Sun wrote: > > Hi, > > > > On 21-01-28 23:17:41, Keqian Zhu wrote: > > > > [...] > > > >> +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, > >> + struct vfio_dma *dma) > >> +{

Re: [RFC PATCH v2 16/26] KVM: arm64: Prepare Hyp memory protection

2021-02-09 Thread Will Deacon
On Tue, Feb 09, 2021 at 10:00:29AM +, Quentin Perret wrote: > On Thursday 04 Feb 2021 at 10:47:08 (+), Quentin Perret wrote: > > On Wednesday 03 Feb 2021 at 14:37:10 (+), Will Deacon wrote: > > > > +static void handle___pkvm_init(struct kvm_cpu_context *host_ctxt) > > > > +{ > > > > +

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Robin Murphy
On 2021-02-09 11:57, Yi Sun wrote: On 21-02-07 18:40:36, Keqian Zhu wrote: Hi Yi, On 2021/2/7 17:56, Yi Sun wrote: Hi, On 21-01-28 23:17:41, Keqian Zhu wrote: [...] +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, +struct vfio_dma *dma) +{

[PATCH v2 2/2] KVM: arm64: Don't access PMSELR_EL0/PMUSERENR_EL0 when no PMU is available

2021-02-09 Thread Marc Zyngier
When running under a nesting hypervisor, it isn't guaranteed that the virtual HW will include a PMU. In which case, let's not try to access the PMU registers in the world switch, as that'd be deadly. Reported-by: Andre Przywara Signed-off-by: Marc Zyngier --- arch/arm64/kernel/image-vars.h

[PATCH v2 0/2] KVM: arm64: Prevent spurious PMU accesses when no

2021-02-09 Thread Marc Zyngier
Yet another PMU bug that is only likely to hit under Nested Virt: we unconditionally access PMU registers without checking whether it actually is present. Given that we already have a predicate for this, promote it to a static key, and use that in the world switch. Thanks to Andre for the heads u

[PATCH v2 1/2] KVM: arm64: Turn kvm_arm_support_pmu_v3() into a static key

2021-02-09 Thread Marc Zyngier
We currently find out about the presence of a HW PMU (or the handling of that PMU by perf, which amounts to the same thing) in a fairly roundabout way, by checking the number of counters available to perf. That's good enough for now, but we will soon need to find about about that on paths where per

Re: [RFC PATCH 10/11] vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM

2021-02-09 Thread Robin Murphy
On 2021-02-07 09:56, Yi Sun wrote: Hi, On 21-01-28 23:17:41, Keqian Zhu wrote: [...] +static void vfio_dma_dirty_log_start(struct vfio_iommu *iommu, +struct vfio_dma *dma) +{ + struct vfio_domain *d; + + list_for_each_entry(d, &iommu->domain_lis