Re: [GIT PULL] KVM/arm64 fixes for 5.18, take #3

2022-05-17 Thread Paolo Bonzini

On 5/16/22 14:51, Marc Zyngier wrote:

Paolo,

Here's the third (and hopefully final) set of fixes for 5.18. Two
rather simple patches: one addressing a userspace-visible change in
behaviour with GICv3, and a fix for pKVM in combination with CPUs
affected by Spectre-v3a.

Please pull,

M.

The following changes since commit 85ea6b1ec915c9dd90caf3674b203999d8c7e062:

   KVM: arm64: Inject exception on out-of-IPA-range translation fault 
(2022-04-27 23:02:23 +0100)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git 
tags/kvmarm-fixes-5.18-3

for you to fetch changes up to 2e40316753ee552fb598e8da8ca0d20a04e67453:

   KVM: arm64: Don't hypercall before EL2 init (2022-05-15 12:14:14 +0100)


KVM/arm64 fixes for 5.18, take #3

- Correctly expose GICv3 support even if no irqchip is created
   so that userspace doesn't observe it changing pointlessly
   (fixing a regression with QEMU)

- Don't issue a hypercall to set the id-mapped vectors when
   protected mode is enabled


Marc Zyngier (1):
   KVM: arm64: vgic-v3: Consistently populate ID_AA64PFR0_EL1.GIC

Quentin Perret (1):
   KVM: arm64: Don't hypercall before EL2 init

  arch/arm64/kvm/arm.c  | 3 ++-
  arch/arm64/kvm/sys_regs.c | 3 +--
  2 files changed, 3 insertions(+), 3 deletions(-)



Pulled, thanks.

Paolo

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


Re: [kvm-unit-tests PATCH] arm/run: Use TCG with qemu-system-arm on arm64 systems

2022-05-17 Thread Andrew Jones
On Thu, Mar 17, 2022 at 06:03:07PM +, Alexandru Elisei wrote:
> Hi,
> 
> On Thu, Mar 17, 2022 at 06:45:07PM +0100, Andrew Jones wrote:
> > On Thu, Mar 17, 2022 at 04:56:01PM +, Alexandru Elisei wrote:
> > > From: Andrew Jones 
> > > 
> > > If the user sets QEMU=qemu-system-arm on arm64 systems, the tests can only
> > > be run by using the TCG accelerator. In this case use TCG instead of KVM.
> > > 
> > > Signed-off-by: Andrew Jones 
> > > [ Alex E: Added commit message ]
> > > Signed-off-by: Alexandru Elisei 
> > > ---
> > >  arm/run | 12 ++--
> > >  1 file changed, 10 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/arm/run b/arm/run
> > > index 28a0b4ad2729..128489125dcb 100755
> > > --- a/arm/run
> > > +++ b/arm/run
> > > @@ -10,16 +10,24 @@ if [ -z "$KUT_STANDALONE" ]; then
> > >  fi
> > >  processor="$PROCESSOR"
> > >  
> > > -ACCEL=$(get_qemu_accelerator) ||
> > > +accel=$(get_qemu_accelerator) ||
> > >   exit $?
> > >  
> > > -if [ "$ACCEL" = "kvm" ]; then
> > > +if [ "$accel" = "kvm" ]; then
> > >   QEMU_ARCH=$HOST
> > >  fi
> > >  
> > >  qemu=$(search_qemu_binary) ||
> > >   exit $?
> > >  
> > > +if [ "$QEMU" ] && [ -z "$ACCEL" ] &&
> > > +   [ "$HOST" = "aarch64" ] && [ "$ARCH" = "arm" ] &&
> > > +   [ "$(basename $QEMU)" = "qemu-system-arm" ]; then
> > > + accel=tcg
> > > +fi
> > > +
> > > +ACCEL=$accel
> > > +
> > >  if ! $qemu -machine '?' 2>&1 | grep 'ARM Virtual Machine' > /dev/null; 
> > > then
> > >   echo "$qemu doesn't support mach-virt ('-machine virt'). Exiting."
> > >   exit 2
> > > -- 
> > > 2.35.1
> > >
> > 
> > Ha, OK, I guess you posting this is a strong vote in favor of this
> > behavior. I've queued it
> 
> Ah, yes, maybe I should've been more clear about it. I think this is more
> intuitive for the new users who might not be very familiar with
> run_tests.sh internals, and like you've said it won't break existing users
> who had to set ACCEL=tcg to get the desired behaviour anyway.
> 
> Thanks you for queueing it so fast! Should probably have also mentioned
> this as a comment in the commit, but I take full responsibility for
> breaking stuff.
> 
> Alex
> 
> > 
> > https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/arm/queue

I finally merged this.

Thanks,
drew

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


Re: [kvm-unit-tests PATCH] arm64: Check for dynamic relocs with readelf

2022-05-17 Thread Andrew Jones
On Wed, May 04, 2022 at 04:04:46PM -0700, Bill Wendling wrote:
> Clang's version of objdump doesn't recognize "setftest.elf" as a dynamic
> object and produces an error stating such.
> 
>   $ llvm-objdump -R ./arm/selftest.elf
>   arm/selftest.elf:   file format elf64-littleaarch64
>   llvm-objdump: error: './arm/selftest.elf': not a dynamic object
> 
> This causes the ARM64 "arch_elf_check" check to fail. Using "readelf
> -rW" is a better option way to get the same information and produces the
> same information in both binutils and LLVM.
> 
> Signed-off-by: Bill Wendling 
> ---
>  arm/Makefile.arm64 | 6 +++---
>  configure  | 2 ++
>  2 files changed, 5 insertions(+), 3 deletions(-)

Merged to https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git master

Thanks,
drew



> 
> diff --git a/arm/Makefile.arm64 b/arm/Makefile.arm64
> index 6feac76f895f..42e18e771b3b 100644
> --- a/arm/Makefile.arm64
> +++ b/arm/Makefile.arm64
> @@ -14,9 +14,9 @@ mno_outline_atomics := $(call cc-option, 
> -mno-outline-atomics, "")
>  CFLAGS += $(mno_outline_atomics)
>  
>  define arch_elf_check =
> - $(if $(shell ! $(OBJDUMP) -R $(1) >&/dev/null && echo "nok"),
> - $(error $(shell $(OBJDUMP) -R $(1) 2>&1)))
> - $(if $(shell $(OBJDUMP) -R $(1) | grep R_ | grep -v R_AARCH64_RELATIVE),
> + $(if $(shell ! $(READELF) -rW $(1) >&/dev/null && echo "nok"),
> + $(error $(shell $(READELF) -rW $(1) 2>&1)))
> + $(if $(shell $(READELF) -rW $(1) | grep R_ | grep -v 
> R_AARCH64_RELATIVE),
>   $(error $(1) has unsupported reloc types))
>  endef
>  
> diff --git a/configure b/configure
> index 86c3095a245a..23085da7dcc5 100755
> --- a/configure
> +++ b/configure
> @@ -12,6 +12,7 @@ cflags=
>  ld=ld
>  objcopy=objcopy
>  objdump=objdump
> +readelf=readelf
>  ar=ar
>  addr2line=addr2line
>  arch=$(uname -m | sed -e 
> 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/')
> @@ -372,6 +373,7 @@ CFLAGS=$cflags
>  LD=$cross_prefix$ld
>  OBJCOPY=$cross_prefix$objcopy
>  OBJDUMP=$cross_prefix$objdump
> +READELF=$cross_prefix$readelf
>  AR=$cross_prefix$ar
>  ADDR2LINE=$cross_prefix$addr2line
>  TEST_DIR=$testdir
> -- 
> 2.36.0.464.gb9c8b46e94-goog
> 

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