[PATCH v4 09/34] KVM: selftests: Add a selftest for guest prints and formatted asserts
Andrew Jones
ajones at ventanamicro.com
Mon Jul 31 11:22:54 PDT 2023
On Mon, Jul 31, 2023 at 10:19:47AM -0700, Sean Christopherson wrote:
> On Mon, Jul 31, 2023, Sean Christopherson wrote:
> > On Mon, Jul 31, 2023, Andrew Jones wrote:
> > > diff --git a/tools/testing/selftests/kvm/include/ucall_common.h b/tools/testing/selftests/kvm/include/ucall_common.h
> > > index 4cf69fa8bfba..4adf526dc378 100644
> > > --- a/tools/testing/selftests/kvm/include/ucall_common.h
> > > +++ b/tools/testing/selftests/kvm/include/ucall_common.h
> > > @@ -6,8 +6,19 @@
> > > */
> > > #ifndef SELFTEST_KVM_UCALL_COMMON_H
> > > #define SELFTEST_KVM_UCALL_COMMON_H
> > > +#include <linux/kvm.h>
> > > #include "test_util.h"
> > >
> > > +#if defined(__aarch64__)
> > > +#define UCALL_EXIT_REASON KVM_EXIT_MMIO
> > > +#elif defined(__x86_64__)
> > > +#define UCALL_EXIT_REASON KVM_EXIT_IO
> > > +#elif defined(__s390x__)
> > > +#define UCALL_EXIT_REASON KVM_EXIT_S390_SIEIC
> > > +#elif defined(__riscv)
> > > +#define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI
> > > +#endif
> > > +
> > > /* Common ucalls */
> > > enum {
> > > UCALL_NONE,
> > >
> > > and then compiled the test for riscv and it passed. I also ran all other
> > > riscv tests successfully.
> >
> > Can I have your SoB for the ucall_common.h patch? I'll write a changelog and fold
> > in a separate prep patch for that change.
>
> On second thought, I take that back. I think it makes more sense to add a ucall.h
> for each arch and #define the exit type there. All then move all of the
> ucall_arch_do_ucall() implementations to ucall.h (except maybe x86 while it has
> the horrific save/restore GPRs hack...). That way the #define is colocated with
> the code that generates the exit reason.
Yup, feel free to just take the above as inspiration and create a
different patch. If you decide you want an s-o-b for the above, though,
then here's one
Signed-off-by: Andrew Jones <ajones at ventanamicro.com>
Thanks,
drew
More information about the linux-arm-kernel
mailing list