From: David Hildenbrand <david@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org
Subject: Re: [PATCH 1/2] Revert "target/s390x: Use probe_access_flags in s390_probe_access"
Date: Wed, 24 Aug 2022 09:34:17 +0200 [thread overview]
Message-ID: <cab7188e-dc8f-2caf-af61-98c0090f23e6@redhat.com> (raw)
In-Reply-To: <20220823213805.1970804-2-richard.henderson@linaro.org>
On 23.08.22 23:38, Richard Henderson wrote:
> This reverts commit db9aab5783a2fb62250e12f0c4cfed5e1778c189.
>
> This patch breaks the contract of s390_probe_access, in that
> it no longer returns an exception code, nor set __excp_addr.
>
> Reported-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/s390x/tcg/mem_helper.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
> index fc52aa128b..4c0f8baa39 100644
> --- a/target/s390x/tcg/mem_helper.c
> +++ b/target/s390x/tcg/mem_helper.c
> @@ -142,12 +142,20 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size,
> MMUAccessType access_type, int mmu_idx,
> bool nonfault, void **phost, uintptr_t ra)
> {
> -#if defined(CONFIG_USER_ONLY)
> - return probe_access_flags(env, addr, access_type, mmu_idx,
> - nonfault, phost, ra);
> -#else
> int flags;
>
> +#if defined(CONFIG_USER_ONLY)
> + flags = page_get_flags(addr);
> + if (!(flags & (access_type == MMU_DATA_LOAD ? PAGE_READ : PAGE_WRITE_ORG))) {
> + env->__excp_addr = addr;
> + flags = (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING;
> + if (nonfault) {
> + return flags;
> + }
> + tcg_s390_program_interrupt(env, flags, ra);
> + }
> + *phost = g2h(env_cpu(env), addr);
> +#else
> /*
> * For !CONFIG_USER_ONLY, we cannot rely on TLB_INVALID_MASK or haddr==NULL
> * to detect if there was an exception during tlb_fill().
> @@ -166,8 +174,8 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size,
> (access_type == MMU_DATA_STORE
> ? BP_MEM_WRITE : BP_MEM_READ), ra);
> }
> - return 0;
> #endif
> + return 0;
> }
>
> static int access_prepare_nf(S390Access *access, CPUS390XState *env,
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-08-24 7:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 21:38 [PATCH 0/2] target/s390x: s390_probe_access fixes Richard Henderson
2022-08-23 21:38 ` [PATCH 1/2] Revert "target/s390x: Use probe_access_flags in s390_probe_access" Richard Henderson
2022-08-24 7:34 ` David Hildenbrand [this message]
2022-08-23 21:38 ` [PATCH 2/2] target/s390x: Align __excp_addr in s390_probe_access Richard Henderson
2022-08-24 7:34 ` David Hildenbrand
2022-08-24 7:33 ` [PATCH 0/2] target/s390x: s390_probe_access fixes David Hildenbrand
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=cab7188e-dc8f-2caf-af61-98c0090f23e6@redhat.com \
--to=david@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).