U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Liang <ycliang@andestech.com>
To: Yao Zi <ziyao@disroot.org>
Cc: Rick Chen <rick@andestech.com>, Tom Rini <trini@konsulko.com>,
	"Mayuresh Chitale" <mchitale@ventanamicro.com>,
	Anton Blanchard <antonb@tenstorrent.com>,
	Simon Glass <sjg@chromium.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jerome Forissier <jerome.forissier@linaro.org>,
	Evgeny Bachinin <EABachinin@salutedevices.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Andrew Davis <afd@ti.com>, "Nishanth Menon" <nm@ti.com>,
	<u-boot@lists.denx.de>, Nathaniel Hourt <I@nathaniel.land>
Subject: Re: [PATCH 2/2] riscv: Access gd with inline assembly when building with LTO or Clang
Date: Mon, 12 May 2025 17:36:09 +0800	[thread overview]
Message-ID: <aCHBCXzGA_lDiSwt@swlinux02> (raw)
In-Reply-To: <20250427145011.17331-3-ziyao@disroot.org>

On Sun, Apr 27, 2025 at 02:50:11PM +0000, Yao Zi wrote:
> Similar to AArch64's case, Clang may wrongly fold accesses to gd pointer
> which is defined with register qualifier into constants, breaking
> various components.
> 
> This patch defines gd as a macro when building with Clang or LTO, which
> expands to get_gd() that accesses gp pointer in assembly, making RISC-V
> ports function properly and preparing for introduction of LTO in the
> future. Board initialization code is also adapted for non-assignable gd.
> 
> Reported-by: Nathaniel Hourt <I@nathaniel.land>
> Signed-off-by: Yao Zi <ziyao@disroot.org>
> ---
>  arch/riscv/cpu/cpu.c                 |  6 ++++++
>  arch/riscv/include/asm/global_data.h | 19 +++++++++++++++++++
>  common/board_r.c                     |  4 +++-
>  common/init/board_init.c             |  7 +++++--
>  4 files changed, 33 insertions(+), 3 deletions(-)

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

  reply	other threads:[~2025-05-12  9:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-27 14:50 [PATCH 0/2] Clang compatibility improvements for RISC-V Yao Zi
2025-04-27 14:50 ` [PATCH 1/2] Makefile: Strip leading spaces when preprocessing generated_defconfig Yao Zi
2025-04-27 15:19   ` Heinrich Schuchardt
2025-04-27 15:46     ` Yao Zi
2025-04-27 16:16       ` Tom Rini
2025-04-28  3:57         ` Yao Zi
2025-04-28 14:49           ` Tom Rini
2025-04-29 12:31             ` Yao Zi
2025-04-29 19:14               ` Tom Rini
2025-04-27 14:50 ` [PATCH 2/2] riscv: Access gd with inline assembly when building with LTO or Clang Yao Zi
2025-05-12  9:36   ` Leo Liang [this message]
2025-05-05 23:35 ` (subset) [PATCH 0/2] Clang compatibility improvements for RISC-V Tom Rini

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=aCHBCXzGA_lDiSwt@swlinux02 \
    --to=ycliang@andestech.com \
    --cc=EABachinin@salutedevices.com \
    --cc=I@nathaniel.land \
    --cc=afd@ti.com \
    --cc=ansuelsmth@gmail.com \
    --cc=antonb@tenstorrent.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=mchitale@ventanamicro.com \
    --cc=nm@ti.com \
    --cc=rick@andestech.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ziyao@disroot.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