Re: [1/1] kvm-unit-tests: s390: test for gen15a/b cpu model dependencies

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

 



On 23/07/2019 13.54, Christian Borntraeger wrote:
> This adds a test for the cpu model gen15a/b. The test check for
> dependencies and proper subfunctions.

I can't say much about the contents here since I don't have the PoP for
gen15 yet, so just some cosmetical comments below...

> +++ b/s390x/gen15.c
> @@ -0,0 +1,191 @@
> +/*
> + * Test the facilities and subfunctions of the new gen15 cpu model
> + * Unless fully implemented this will only work with kvm as we check
> + * for all subfunctions
> + *
> + * Copyright 2019 IBM Corp.
> + *
> + * Authors:
> + *    Christian Borntraeger <borntraeger@xxxxxxxxxx>
> + *
> + * This code is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU Library General Public License version 2.
> + */
> +
> +#include <asm/facility.h>
> +
> +static void test_minste3(void)
> +{
> +

Please remove the empty line.

> +	report_prefix_push("minste");
> +
> +	/* Dependency */
> +	report("facility 45 available", test_facility(45));
> +
> +	report_prefix_pop();
> +}
> +
> +static void test_vxeh2(void)
> +{
> +

dito

> +	report_prefix_push("vxeh2");
> +
> +	/* Dependencies */
> +	report("facility 129 available", test_facility(129));
> +	report("facility 135 available", test_facility(135));
> +
> +	report_prefix_pop();
> +}
> +
> +static void query_opcode(unsigned int opcode, unsigned long query[4])
> +{
> +        register unsigned long r0 asm("0") = 0; /* query function */
> +        register unsigned long r1 asm("1") = (unsigned long) query;
> +
> +        asm volatile(
> +                /* Parameter regs are ignored */
> +                "       .insn   rrf,%[opc] << 16,2,4,6,0\n"
> +                : "=m" (*query)
> +                : "d" (r0), "a" (r1), [opc] "i" (opcode)
> +                : "cc");
> +}

Could you add a comment in front of the query_opcode() function,
describing what it is doing?

> +
> +static void query_cpuid(struct cpuid *id)
> +{
> +	asm volatile ("stidp %0\n" : "+Q"(*id));
> +}
> +
> +/* Big Endian BIT macro that uses the bit value within a 64bit value */
> +#define BIT(a) (1UL << (63-(a % 64)))
> +#define DEFLTCC_GEN15 (BIT(0)  | BIT(1)  | BIT(2)  | BIT(4))
> +#define DEFLTCC_GEN15_F (BIT(0))
> +static void test_deflate(void)
> +{
> +	unsigned long query[4];
> +	struct cpuid id = {};
> +
> +	report_prefix_push("deflate");
> +
> +	query_opcode(0xb939, query);

Any chance that you could add already a comment with the mnemonic here?

 Thomas



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux