From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH 08/16] target/arm: Use SVEContLdSt in sve_ld1_r
Date: Fri, 17 Apr 2020 20:41:07 -0700 [thread overview]
Message-ID: <ba2b5050-4d21-dfad-ae81-667438dbd89b@linaro.org> (raw)
In-Reply-To: <CAFEAcA-v9O6+iZu9_grS6iW=QhmJeLGVfnJ8BOe59KzaPMczzg@mail.gmail.com>
On 4/16/20 6:26 AM, Peter Maydell wrote:
> On Wed, 11 Mar 2020 at 06:44, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> First use of the new helper functions, so we can remove the
>> unused markup. No longer need a scratch for user-only, as
>> we completely probe the page set before reading; system mode
>> still requires a scratch for MMIO.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>
>> + /* The entire operation is in RAM, on valid pages. */
>> +
>> + memset(vd, 0, reg_max);
>> + mem_off = info.mem_off_first[0];
>> + reg_off = info.reg_off_first[0];
>> + reg_last = info.reg_off_last[0];
>> + host = info.page[0].host;
>> +
>> + while (reg_off <= reg_last) {
>> + uint64_t pg = vg[reg_off >> 6];
>> + do {
>> + if ((pg >> (reg_off & 63)) & 1) {
>> + host_fn(vd, reg_off, host + mem_off);
>> + }
>> + reg_off += 1 << esz;
>> + mem_off += 1 << msz;
>> + } while (reg_off <= reg_last && (reg_off & 63));
>> + }
>> +
>> + /*
>> + * Use the slow path to manage the cross-page misalignment.
>> + * But we know this is RAM and cannot trap.
>> + */
>> + mem_off = info.mem_off_split;
>> + if (unlikely(mem_off >= 0)) {
>> + tlb_fn(env, vd, info.reg_off_split, addr + mem_off, retaddr);
>> + }
>> +
>> + mem_off = info.mem_off_first[1];
>> + if (unlikely(mem_off >= 0)) {
>> + reg_off = info.reg_off_first[1];
>> + reg_last = info.reg_off_last[1];
>> + host = info.page[1].host;
>> +
>> + do {
>> + uint64_t pg = vg[reg_off >> 6];
>> + do {
>> + if ((pg >> (reg_off & 63)) & 1) {
>> + host_fn(vd, reg_off, host + mem_off);
>> + }
>> + reg_off += 1 << esz;
>> + mem_off += 1 << msz;
>> + } while (reg_off & 63);
>> + } while (reg_off <= reg_last);
>
> Does this loop for the second page need to be phrased
> differently than the loop for the first page was? I was
> expecting the two chunks of code to be identical, and they
> almost are, but not quite...
Yes, they do need to be different. In particular, the first page may only have
the one element that crosses the page boundary, so we may have reg_first >
reg_last. The second page is never has that problem.
r~
next prev parent reply other threads:[~2020-04-18 3:49 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 6:44 [PATCH 00/16] target/arm: sve load/store improvements Richard Henderson
2020-03-11 6:44 ` [PATCH 01/16] accel/tcg: Add block comment for probe_access Richard Henderson
2020-04-16 11:50 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 02/16] accel/tcg: Add probe_access_flags Richard Henderson
2020-03-12 4:33 ` [PATCH v2 " Richard Henderson
2020-04-16 11:54 ` Peter Maydell
2020-04-18 0:05 ` Richard Henderson
2020-03-12 4:38 ` [PATCH " Richard Henderson
2020-03-11 6:44 ` [PATCH 03/16] exec: Add cpu_probe_watchpoint Richard Henderson
2020-04-16 12:08 ` Peter Maydell
2020-04-18 2:14 ` Richard Henderson
2020-03-11 6:44 ` [PATCH 04/16] target/arm: Use cpu_*_data_ra for sve_ldst_tlb_fn Richard Henderson
2020-04-16 12:19 ` Peter Maydell
2020-04-18 2:16 ` Richard Henderson
2020-03-11 6:44 ` [PATCH 05/16] target/arm: Drop manual handling of set/clear_helper_retaddr Richard Henderson
2020-04-16 12:23 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 06/16] target/arm: Add sve infrastructure for page lookup Richard Henderson
2020-04-16 13:03 ` Peter Maydell
2020-04-18 3:11 ` Richard Henderson
2020-03-11 6:44 ` [PATCH 07/16] target/arm: Adjust interface of sve_ld1_host_fn Richard Henderson
2020-04-16 13:16 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 08/16] target/arm: Use SVEContLdSt in sve_ld1_r Richard Henderson
2020-04-16 13:26 ` Peter Maydell
2020-04-18 3:41 ` Richard Henderson [this message]
2020-03-11 6:44 ` [PATCH 09/16] target/arm: Handle watchpoints " Richard Henderson
2020-04-16 13:29 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 10/16] target/arm: Use SVEContLdSt for multi-register contiguous loads Richard Henderson
2020-04-16 13:35 ` Peter Maydell
2020-04-18 3:26 ` Richard Henderson
2020-03-11 6:44 ` [PATCH 11/16] target/arm: Update contiguous first-fault and no-fault loads Richard Henderson
2020-04-16 14:15 ` Peter Maydell
2020-04-18 3:36 ` Richard Henderson
2020-03-11 6:44 ` [PATCH 12/16] target/arm: Use SVEContLdSt for contiguous stores Richard Henderson
2020-04-16 14:18 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 13/16] target/arm: Reuse sve_probe_page for gather first-fault loads Richard Henderson
2020-04-16 14:23 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 14/16] target/arm: Reuse sve_probe_page for scatter stores Richard Henderson
2020-04-16 14:25 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 15/16] target/arm: Reuse sve_probe_page for gather loads Richard Henderson
2020-04-16 14:21 ` Peter Maydell
2020-03-11 6:44 ` [PATCH 16/16] target/arm: Remove sve_memopidx Richard Henderson
2020-04-16 14:27 ` Peter Maydell
2020-03-11 7:10 ` [PATCH 00/16] target/arm: sve load/store improvements no-reply
2020-04-16 14:28 ` Peter Maydell
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=ba2b5050-4d21-dfad-ae81-667438dbd89b@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).