All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Florian Fuchs <fuchsfl@gmail.com>, Rich Felker <dalias@libc.org>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sh: uaccess: Require offsettable operands for 64-bit user access
Date: Thu, 16 Jul 2026 18:52:08 +0100	[thread overview]
Message-ID: <20260716185208.74ed22fa@pumpkin> (raw)
In-Reply-To: <c4177b44450a909ae8dad60da39523f14b5f2005.camel@physik.fu-berlin.de>

On Thu, 16 Jul 2026 19:05:03 +0200
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:

> Hi Florian,
> 
> On Thu, 2026-07-16 at 18:53 +0200, Florian Fuchs wrote:
> > The 64-bit __get_user_u64()/__put_user_u64() paths address the memory
> > operand as %T2 (base+4). This base+4 requires an offsettable address,
> > but "m" also allows the indexed mode @(R0,Rn) (e.g. for a variable-
> > indexed array element), which has no displacement field for the +4.
> > Depending on optimization this build fails with "invalid 'asm'" or an
> > ICE in GCC's change_address_1.
> > 
> > Require an offsettable memory operand, allowing GCC to reload an
> > unsuitable indexed address into an appropriate form.

An alternative would be to pass 'addr' and 'addr + 4' separately so that
the C compilation adds in the offset.
With a bit more effort the define wouldn't need repeating for LE and BE.

There is a bug in the __put_user_u64 code - it is missing the exception
table entry for the second word.
(It is present in __get_user_u64, but a separate label would be better.)

I also wonder whether there should be non-mmu copies?

	David

      reply	other threads:[~2026-07-16 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 16:53 [PATCH] sh: uaccess: Require offsettable operands for 64-bit user access Florian Fuchs
2026-07-16 17:05 ` John Paul Adrian Glaubitz
2026-07-16 17:52   ` David Laight [this message]

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=20260716185208.74ed22fa@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=dalias@libc.org \
    --cc=fuchsfl@gmail.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.