Re: [kvm-unit-tests PATCH v5 6/6] s390x: add a test for SIE without MSO/MSL

Thomas Huth
2023-07-14T08:41:34Z

On 14/07/2023 10.35, Nico Boehr wrote:
> Quoting Thomas Huth (2023-07-13 10:29:48)
> [...]
>>> diff --git a/s390x/sie-dat.c b/s390x/sie-dat.c
>>> new file mode 100644
>>> index 000000000000..b326995dfa85
>>> --- /dev/null
>>> +++ b/s390x/sie-dat.c
>>> @@ -0,0 +1,115 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-only */
>>> +/*
>>> + * Tests SIE with paging.
>>> + *
>>> + * Copyright 2023 IBM Corp.
>>> + *
>>> + * Authors:
>>> + * Nico Boehr <nrb@linux.ibm.com>
>>> + */
>>> +#include <libcflat.h>
>>> +#include <vmalloc.h>
>>> +#include <asm/pgtable.h>
>>> +#include <mmu.h>
>>> +#include <asm/page.h>
>>> +#include <asm/interrupt.h>
>>> +#include <alloc_page.h>
>>> +#include <sclp.h>
>>> +#include <sie.h>
>>> +#include <snippet.h>
>>> +
>>> +static struct vm vm;
>>> +static pgd_t *guest_root;
>>> +
>>> +/* keep in sync with TEST_PAGE_COUNT in s390x/snippets/c/sie-dat.c */
>>> +#define GUEST_TEST_PAGE_COUNT 10
>>> +
>>> +/* keep in sync with TOTAL_PAGE_COUNT in s390x/snippets/c/sie-dat.c */
>>> +#define GUEST_TOTAL_PAGE_COUNT 256
>>
>> I'd maybe put the defines rather in a header a la s390x/snippets/c/sie-dat.h
>> and include that header here and in the snippet C code.
>
> I'd have to
>
> #include "../s390x/snippets/c/sie-dat.h"
>
> and it feels like I shouldn't be doing this, should I?

Why "../s390x/" ? Isn't #include "snippets/c/sie-dat.h" enough? ... that
would look reasonable to me.

Thomas