From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>,
Janosch Frank <frankja@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2] s390x/intercept: Test invalid prefix argument to SET PREFIX
Date: Tue, 28 Jun 2022 11:03:42 +0200 [thread overview]
Message-ID: <20220628110342.5b83f459@p-imbrenda> (raw)
In-Reply-To: <20220627152412.2243255-1-scgl@linux.ibm.com>
On Mon, 27 Jun 2022 17:24:11 +0200
Janis Schoetterl-Glausch <scgl@linux.ibm.com> wrote:
> According to the architecture, SET PREFIX must try to access the new
> prefix area and recognize an addressing exception if the area is not
> accessible.
> Test that the exception occurs when we try to set a prefix higher
> than the available memory.
>
> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
thanks, queued
> ---
>
> v1 -> v2
> * report skip if we're running with too much memory (thanks Claudio)
>
>
> s390x/intercept.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/s390x/intercept.c b/s390x/intercept.c
> index 86e57e11..54bed5a4 100644
> --- a/s390x/intercept.c
> +++ b/s390x/intercept.c
> @@ -74,6 +74,22 @@ static void test_spx(void)
> expect_pgm_int();
> asm volatile(" spx 0(%0) " : : "r"(-8L));
> check_pgm_int_code(PGM_INT_CODE_ADDRESSING);
> +
> + new_prefix = get_ram_size() & 0x7fffe000;
> + if (get_ram_size() - new_prefix < 2 * PAGE_SIZE) {
> + expect_pgm_int();
> + asm volatile("spx %0 " : : "Q"(new_prefix));
> + check_pgm_int_code(PGM_INT_CODE_ADDRESSING);
> +
> + /*
> + * Cannot test inaccessibility of the second page the same way.
> + * If we try to use the last page as first half of the prefix
> + * area and our ram size is a multiple of 8k, after SPX aligns
> + * the address to 8k we have a completely accessible area.
> + */
> + } else {
> + report_skip("inaccessible prefix area");
> + }
> }
>
> /* Test the STORE CPU ADDRESS instruction */
>
> base-commit: 110c69492b53f0070e1bbce986fb635e72a423b4
prev parent reply other threads:[~2022-06-28 9:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 15:24 [kvm-unit-tests PATCH v2] s390x/intercept: Test invalid prefix argument to SET PREFIX Janis Schoetterl-Glausch
2022-06-28 9:03 ` Claudio Imbrenda [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220628110342.5b83f459@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=scgl@linux.ibm.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox