qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Palmer Dabbelt <palmer@sifive.com>
Cc: me@carlosedp.com, qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
	joel@sing.id.au, Alistair Francis <Alistair.Francis@wdc.com>,
	marco@decred.org
Subject: Re: [Qemu-devel] [PATCH] atomic failures on qemu-system-riscv64
Date: Wed, 26 Jun 2019 09:48:51 +0200	[thread overview]
Message-ID: <5711ab6f-610c-b05a-c728-4a35a0963a2b@linaro.org> (raw)
In-Reply-To: <mhng-3b5978c4-bfb8-4757-ae5b-0731f2851d30@palmer-si-x1e>

On 6/26/19 8:07 AM, Palmer Dabbelt wrote:
> On Tue, 25 Jun 2019 08:36:28 PDT (-0700), richard.henderson@linaro.org wrote:
>> On 6/24/19 8:08 PM, Joel Sing wrote:
>>> Regarding the alignment for reservations, the
>>> specification does require this, although I do not recall seeing any
>>> enforcement
>>> of this by qemu itself.
>>
>> Ah, I see it now.  Enforcement begins here:
>>
>> static bool trans_lr_w(DisasContext *ctx, arg_lr_w *a)
>> {
>>     REQUIRE_EXT(ctx, RVA);
>>     return gen_lr(ctx, a, (MO_ALIGN | MO_TESL));
>>                            ^^^^^^^^
>>
>> This will force softmmu (but notably not linux-user; a design limitation) to
>> generate an alignment fault for an unaligned address.
> 
> That was probably correct at the time the code went in, as the ISA used to
> allow these to succeed but not be atomic.  No implementations did this, so as
> part of the ratification process we just mandated that unaligned atomics always
> trap.
> 
> Is there a better way to fix this than just doing the alignment check
> explicitly?

You misunderstand.  The code is exactly correct as-is.  The alignment check
happens implicitly as a part of the softmmu tlb resolution.


r~


  reply	other threads:[~2019-06-26  7:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-16 19:19 [Qemu-devel] [PATCH] atomic failures on qemu-system-riscv64 Joel Sing
2019-06-16 20:54 ` no-reply
2019-06-17 23:52 ` Richard Henderson
2019-06-24  6:42   ` Palmer Dabbelt
2019-06-24 18:08   ` Joel Sing
2019-06-25 15:36     ` Richard Henderson
2019-06-26  6:07       ` Palmer Dabbelt
2019-06-26  7:48         ` Richard Henderson [this message]
2019-06-26  8:25           ` Palmer Dabbelt
2019-06-26  8:30             ` Richard Henderson
2019-06-26  8:31               ` Palmer Dabbelt
2019-06-25 15:39     ` Richard Henderson
2019-06-26  6:07       ` Palmer Dabbelt
2019-09-24 18:29     ` Alistair Francis
2019-09-24 20:04       ` Palmer Dabbelt
2019-09-24 23:35         ` Alistair Francis
2019-09-25  1:01           ` Alistair Francis

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=5711ab6f-610c-b05a-c728-4a35a0963a2b@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=Alistair.Francis@wdc.com \
    --cc=joel@sing.id.au \
    --cc=marco@decred.org \
    --cc=me@carlosedp.com \
    --cc=palmer@sifive.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).