Re: [kvm-unit-tests PATCH v4 5/7] s390x: pv: Add sie entry intercept and validity test

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

 



Quoting Janosch Frank (2023-05-02 13:59:29)
[...]
> diff --git a/s390x/pv-icptcode.c b/s390x/pv-icptcode.c
> new file mode 100644
> index 00000000..f8e9d137
> --- /dev/null
> +++ b/s390x/pv-icptcode.c
[...]
> +static void test_validity_timing(void)
> +{
> +       extern const char SNIPPET_NAME_START(asm, pv_icpt_vir_timing)[];
> +       extern const char SNIPPET_NAME_END(asm, pv_icpt_vir_timing)[];
> +       extern const char SNIPPET_HDR_START(asm, pv_icpt_vir_timing)[];
> +       extern const char SNIPPET_HDR_END(asm, pv_icpt_vir_timing)[];
> +       int size_hdr = SNIPPET_HDR_LEN(asm, pv_icpt_vir_timing);
> +       int size_gbin = SNIPPET_LEN(asm, pv_icpt_vir_timing);
> +       uint64_t time_exit, time_entry;
> +
> +       report_prefix_push("manipulated cpu time");
> +       snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_icpt_vir_timing),
> +                       SNIPPET_HDR_START(asm, pv_icpt_vir_timing),
> +                       size_gbin, size_hdr, SNIPPET_UNPACK_OFF);
> +
> +       sie(&vm);
> +       report(pv_icptdata_check_diag(&vm, 0x44), "stp done");

s/stp/spt/

> +       stck(&time_exit);
> +       mb();
> +
> +       /* Cpu timer counts down so adding a ms should lead to a validity */
> +       vm.sblk->cputm += S390_CLOCK_SHIFT_US * 1000;
> +       sie_expect_validity(&vm);
> +       sie(&vm);
> +       report(uv_validity_check(&vm), "validity entry cput > exit cput");
> +       vm.sblk->cputm -= S390_CLOCK_SHIFT_US;

Did you mean S390_CLOCK_SHIFT_US * 1000 here? if so, maybe you want to backup cputm and restore it here so your intention is clear.

[...]
> +static void run_icpt_122_tests(unsigned long lc_off)
> +{
> +       uv_export(vm.sblk->mso + lc_off);
> +       sie(&vm);
> +       report(vm.sblk->icptcode == ICPT_PV_PREF, "Intercept 112 for page 0");
> +       uv_import(vm.uv.vm_handle, vm.sblk->mso + lc_off);
> +
> +       uv_export(vm.sblk->mso + lc_off + PAGE_SIZE);

You are likely missing a sie(&vm) here.




[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