From: Richard Henderson <richard.henderson@linaro.org>
To: Taylor Simpson <tsimpson@quicinc.com>, qemu-devel@nongnu.org
Cc: ale@rev.ng, bcain@quicinc.com, philmd@redhat.com, alex.bennee@linaro.org
Subject: Re: [PATCH 1/2] Hexagon (target/hexagon) do probe_write in HELPER(commit_store)
Date: Wed, 14 Jul 2021 05:33:15 -0700 [thread overview]
Message-ID: <ab3bb7dc-2a19-f5dd-22f0-49c1946f779b@linaro.org> (raw)
In-Reply-To: <1626205589-19208-2-git-send-email-tsimpson@quicinc.com>
On 7/13/21 12:46 PM, Taylor Simpson wrote:
> void HELPER(commit_store)(CPUHexagonState *env, int slot_num)
> {
> - switch (env->mem_log_stores[slot_num].width) {
> + uint8_t width = env->mem_log_stores[slot_num].width;
> + target_ulong va = env->mem_log_stores[slot_num].va;
> +
> +#ifdef CONFIG_USER_ONLY
> + g_assert(width == 1 || width == 2 || width == 4 || width == 8);
> + /* We perform this check elsewhere in system mode */
> + probe_write(env, va, width, MMU_USER_IDX, 0);
> +#endif
> +
> + switch (width) {
> case 1:
> - put_user_u8(env->mem_log_stores[slot_num].data32,
> - env->mem_log_stores[slot_num].va);
> + put_user_u8(env->mem_log_stores[slot_num].data32, va);
The primary problem here is that put_user_* is the wrong set of functions to use. You
should have been using exec/cpu_ldst.h, in particular cpu_ld*_data_ra and cpu_st*_data_ra.
r~
next prev parent reply other threads:[~2021-07-14 12:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-13 19:46 [PATCH 0/2] SIGSEGV fixes Taylor Simpson
2021-07-13 19:46 ` [PATCH 1/2] Hexagon (target/hexagon) do probe_write in HELPER(commit_store) Taylor Simpson
2021-07-14 12:33 ` Richard Henderson [this message]
2021-07-13 19:46 ` [PATCH 2/2] linux-test (tests/tcg/multiarch/linux-test.c) add check Taylor Simpson
2021-07-14 12:35 ` Richard Henderson
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=ab3bb7dc-2a19-f5dd-22f0-49c1946f779b@linaro.org \
--to=richard.henderson@linaro.org \
--cc=ale@rev.ng \
--cc=alex.bennee@linaro.org \
--cc=bcain@quicinc.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tsimpson@quicinc.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;
as well as URLs for NNTP newsgroup(s).