qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Nikita Novikov <nnovikov@NB-7271.syntacore.com>
Cc: n.novikov@syntacore.com, pbonzini@redhat.com,
	qemu-devel@nongnu.org, qemu-riscv@nongnu.org
Subject: Re: [PATCH] accel/tcg: Pass actual memop_size to tlb_fill instead of 0
Date: Wed, 22 Oct 2025 14:20:51 -0500	[thread overview]
Message-ID: <6083717e-a013-4089-a54f-4c2ecc98a351@linaro.org> (raw)
In-Reply-To: <busf3stsde5y7hq7zslr2kfyibp5ve2wrvrrawik3xbfpmsr7f@2nr5m4kdlltn>

On 10/22/25 13:59, Nikita Novikov wrote:
>>> Fixes: ec03dd972378 ("accel/tcg: Hoist first page lookup above pointer_wrap")

This cannot be true, btw, because ...

>>> -        if (mmu_lookup1(cpu, &l->page[1], 0, l->mmu_idx, type, ra)) {
>>> +        if (mmu_lookup1(cpu, &l->page[1], l->memop, l->mmu_idx, type, ra)) {

... this line did not change with that patch.

>>>                uintptr_t index = tlb_index(cpu, l->mmu_idx, addr);
>>>                l->page[0].full = &cpu->neg.tlb.d[l->mmu_idx].fulltlb[index];
>>>            }
>>
>> How is the memop really applicable to the second half of a split-page operation?
>>
> Because the second half is still part of the same guest memory operation. It must obey
> the same size, alignment, and atomicity rules. Passing the real memop ensures correct
> alignment and atomic checks even if the access crosses a page boundary.

How?

Let's use a concrete example: Access MO_64 | MO_UNALN at 0x1fffd.

The first tlb_fill gets to see the start address 0x1fffd, and the length 3 (and also the 
memop).

The second tlb_fill gets to see the second page address 0x20000 and the length 5 (but not 
the memop).

Exactly what is the second tlb_fill going to do with 0x20000 and MO_64 | MO_UNALN?



r~


  reply	other threads:[~2025-10-22 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 11:52 [PATCH] accel/tcg: Pass actual memop_size to tlb_fill instead of 0 Nikita Novikov
2025-10-22 15:24 ` Philippe Mathieu-Daudé
2025-10-22 15:32 ` Richard Henderson
2025-10-22 18:59   ` Nikita Novikov
2025-10-22 19:20     ` Richard Henderson [this message]
2025-10-23  6:38       ` Nikita Novikov

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=6083717e-a013-4089-a54f-4c2ecc98a351@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=n.novikov@syntacore.com \
    --cc=nnovikov@NB-7271.syntacore.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@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).