Re: [kvm-unit-tests PATCH v6 1/2] s390x: Add specification exception test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Janis Schoetterl-Glausch (2022-08-26 18:11:11)
> Generate specification exceptions and check that they occur.
> 
> Signed-off-by: Janis Schoetterl-Glausch <scgl@xxxxxxxxxxxxx>

Reviewed-by: Nico Boehr <nrb@xxxxxxxxxxxxx>

with minor nits below you may want to consider

> diff --git a/s390x/spec_ex.c b/s390x/spec_ex.c
> new file mode 100644
[...]
> +static int bad_alignment(void)
> +{
> +       uint32_t words[5] __attribute__((aligned(16)));
> +       uint32_t (*bad_aligned)[4] = (uint32_t (*)[4])&words[1];

Why not simply:

uint32_t *bad_aligned = &words[1];

> +
> +       /* LOAD PAIR FROM QUADWORD (LPQ) requires quadword alignment */
> +       asm volatile ("lpq %%r6,%[bad]"
> +                     : : [bad] "T" (*bad_aligned)
> +                     : "%r6", "%r7"
> +       );
> +       return 0;
> +}
> +
> +static int not_even(void)
> +{
> +       uint64_t quad[2] __attribute__((aligned(16))) = {0};
> +
> +       asm volatile (".insn    rxy,0xe3000000008f,%%r7,%[quad]" /* lpq %%r7,%[quad] */

Here you use .insn above you use lpq - why?




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux