Re: [PATCH 0/3] KVM: arm64: nv: Fixes for Nested Virtualization issues

2022-10-09 Thread Ganapatrao Kulkarni






Hi Marc,

Any review comments on this series?

On 24-08-2022 11:33 am, Ganapatrao Kulkarni wrote:

This series contains 3 fixes which were found while testing
ARM64 Nested Virtualization patch series.

First patch avoids the restart of hrtimer when timer interrupt is
fired/forwarded to Guest-Hypervisor.

Second patch fixes the vtimer interrupt drop from the Guest-Hypervisor.

Third patch fixes the NestedVM boot hang seen when Guest Hypersior
configured with 64K pagesize where as Host Hypervisor with 4K.

These patches are rebased on Nested Virtualization V6 patchset[1].

[1] https://www.spinics.net/lists/kvm/msg265656.html

D Scott Phillips (1):
   KVM: arm64: nv: only emulate timers that have not yet fired

Ganapatrao Kulkarni (2):
   KVM: arm64: nv: Emulate ISTATUS when emulated timers are fired.
   KVM: arm64: nv: Avoid block mapping if max_map_size is smaller than
 block size.

  arch/arm64/kvm/arch_timer.c | 8 +++-
  arch/arm64/kvm/mmu.c| 2 +-
  2 files changed, 8 insertions(+), 2 deletions(-)



Thanks,
Ganapat
___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm


Re: [PATCH] KVM: arm64: selftests: Fix multiple versions of GIC creation

2022-10-09 Thread Oliver Upton
On Sun, Oct 09, 2022 at 11:31:31AM +0800, Zenghui Yu wrote:
> Commit 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to
> separate helper") wrongly converted a "real" GIC device creation to
> __kvm_test_create_device() and caused the test failure on my D05 (which
> supports v2 emulation). Fix it.
> 
> Fixes: 98f94ce42ac6 ("KVM: selftests: Move KVM_CREATE_DEVICE_TEST code to 
> separate helper")
> Signed-off-by: Zenghui Yu 

Reviewed-by: Oliver Upton 

--
Thanks,
Oliver

> ---
>  tools/testing/selftests/kvm/aarch64/vgic_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/aarch64/vgic_init.c 
> b/tools/testing/selftests/kvm/aarch64/vgic_init.c
> index e05ecb31823f..9c131d977a1b 100644
> --- a/tools/testing/selftests/kvm/aarch64/vgic_init.c
> +++ b/tools/testing/selftests/kvm/aarch64/vgic_init.c
> @@ -662,8 +662,8 @@ int test_kvm_device(uint32_t gic_dev_type)
>: KVM_DEV_TYPE_ARM_VGIC_V2;
>  
>   if (!__kvm_test_create_device(v.vm, other)) {
> - ret = __kvm_test_create_device(v.vm, other);
> - TEST_ASSERT(ret && (errno == EINVAL || errno == EEXIST),
> + ret = __kvm_create_device(v.vm, other);
> + TEST_ASSERT(ret < 0 && (errno == EINVAL || errno == EEXIST),
>   "create GIC device while other version exists");
>   }
>  
> -- 
> 2.33.0
> 
> 
___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm


Re: [PATCH 02/14] KVM: arm64: Tear down unlinked stage-2 subtree after break-before-make

2022-10-09 Thread Oliver Upton
Hey Ricardo,

On Tue, Sep 13, 2022 at 05:20:11PM -0700, Ricardo Koller wrote:

[...]

> > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c
> > index d8127c25424c..5c0c8028d71c 100644
> > --- a/arch/arm64/kvm/hyp/pgtable.c
> > +++ b/arch/arm64/kvm/hyp/pgtable.c
> > @@ -763,17 +763,21 @@ static int stage2_map_walker_try_leaf(u64 addr, u64 
> > end, u32 level,
> > return 0;
> >  }
> >  
> > +static int stage2_map_walk_leaf(u64 addr, u64 end, u32 level, kvm_pte_t 
> > *ptep,
> > +   struct stage2_map_data *data);
> > +
> >  static int stage2_map_walk_table_pre(u64 addr, u64 end, u32 level,
> >  kvm_pte_t *ptep,
> >  struct stage2_map_data *data)
> >  {
> > -   if (data->anchor)
> > -   return 0;
> > +   struct kvm_pgtable_mm_ops *mm_ops = data->mm_ops;
> > +   kvm_pte_t *childp = kvm_pte_follow(*ptep, mm_ops);
> > +   struct kvm_pgtable *pgt = data->mmu->pgt;
> > +   int ret;
> >  
> > if (!stage2_leaf_mapping_allowed(addr, end, level, data))
> > return 0;
> >  
> > -   data->childp = kvm_pte_follow(*ptep, data->mm_ops);
> > kvm_clear_pte(ptep);
> >  
> > /*
> > @@ -782,8 +786,13 @@ static int stage2_map_walk_table_pre(u64 addr, u64 
> > end, u32 level,
> >  * individually.
> >  */
> > kvm_call_hyp(__kvm_tlb_flush_vmid, data->mmu);
> > -   data->anchor = ptep;
> > -   return 0;
> > +
> > +   ret = stage2_map_walk_leaf(addr, end, level, ptep, data);
> 
> I think this always ends up calling stage2_map_walker_try_leaf() (at
> least it should). In that case, I think it might be clearer to do so, as
> the intention is to just install a block.

Yikes, I missed this in v2. I do agree with your point, it reads a bit
odd to call something that could reinstall a table.

Picked up the fix for v3. Thanks!

--
Best,
Oliver
___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm