All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <Alistair.Francis@wdc.com>
To: "alex.bennee@linaro.org" <alex.bennee@linaro.org>,
	"daniel.barboza@oss.qualcomm.com"
	<daniel.barboza@oss.qualcomm.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"joel@jms.id.au" <joel@jms.id.au>
Cc: "npiggin@gmail.com" <npiggin@gmail.com>,
	"mpe@kernel.org" <mpe@kernel.org>,
	"portias@oss.tenstorrent.com" <portias@oss.tenstorrent.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"chao.liu@processmission.com" <chao.liu@processmission.com>,
	"asrinivasan@oss.tenstorrent.com"
	<asrinivasan@oss.tenstorrent.com>,
	"qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>,
	"zhiwei_liu@linux.alibaba.com" <zhiwei_liu@linux.alibaba.com>,
	"liwei1518@gmail.com" <liwei1518@gmail.com>
Subject: Re: [PATCH 04/12] tests/tcg/riscv64: Update semihosting linker script
Date: Mon, 31 Aug 2026 01:14:08 +0000	[thread overview]
Message-ID: <21db8838b7fcfd4c40fe06efa7b15f700cc0d254.camel@wdc.com> (raw)
In-Reply-To: <20260827050953.67184-5-joel@jms.id.au>

On Thu, 2026-08-27 at 14:39 +0930, Joel Stanley wrote:
> Keep the tests at the start of RAM but bound them with a MEMORY
> region,
> and use this to define __stack_top, which the multiarch system test
> boot
> code will use.
> 
> Add more sections generated by the test binaries so they are placed
> explicitly.
> 
> Split text and data into separate rx/rw regions, instead of one rwx
> region to avoid binutils warnings.
> 
> A -kernel boot jumps to the lowest loaded address rather than the ELF
> entry point, so _start must be first in .text. Use a .text._start
> input
> section to make that explicit.
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  tests/tcg/riscv64/semihost.ld | 47 +++++++++++++++++++++++++++------
> --
>  1 file changed, 36 insertions(+), 11 deletions(-)
> 
> diff --git a/tests/tcg/riscv64/semihost.ld
> b/tests/tcg/riscv64/semihost.ld
> index a59cc56b289a..eff3701e4a19 100644
> --- a/tests/tcg/riscv64/semihost.ld
> +++ b/tests/tcg/riscv64/semihost.ld
> @@ -1,21 +1,46 @@
> +/*
> + * Linker script for the RISC-V system tests
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
>  ENTRY(_start)
>  
> +MEMORY
> +{
> +    /*
> +     * Virt machine, RAM starts at 2GB
> +     *
> +     * Separate sections for executable and writable data to avoid
> linker
> +     * warnings.
> +     */
> +    TXT (rx) : ORIGIN = 0x80000000, LENGTH = 2M
> +    DAT (rw) : ORIGIN = 0x80000000 + 2M, LENGTH = 2M
> +}
> +
>  SECTIONS
>  {
> -    /* virt machine, RAM starts at 2gb */
> -    . = 0x80000000;
>      .text : {
> +        *(.text._start)
>          *(.text)
> -    }
> +    } > TXT
> +
>      .rodata : {
> -        *(.rodata)
> -    }
> -    /* align r/w section to next 2mb */
> -    . = ALIGN(1 << 21);
> +        *(.rodata .rodata.*)
> +        *(.eh_frame)
> +    } > TXT
> +
> +    .got : {
> +        *(.got .got.plt)
> +    } > DAT
> +
>      .data : {
> -        *(.data)
> -    }
> +        *(.data .data.* .sdata .sdata.*)
> +    } > DAT
> +
>      .bss : {
> -        *(.bss)
> -    }
> +        *(.bss .bss.* .sbss .sbss.*)
> +    } > DAT
> +
> +    /* Stack grows down from the end of the data region */
> +    __stack_top = ORIGIN(DAT) + LENGTH(DAT);
>  }

  reply	other threads:[~2026-08-31  1:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27  5:09 [PATCH 00/12] tests/tcg: Multiarch tests for riscv64 Joel Stanley
2026-08-27  5:09 ` [PATCH 01/12] tests/tcg/riscv64: Include stdint.h in semicall.h Joel Stanley
2026-08-31  1:07   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 02/12] tests/tcg/riscv64: Clean up semicall.h inline asm Joel Stanley
2026-08-31  1:09   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 03/12] tests/tcg/riscv64: Boot semihost tests with -bios none -kernel Joel Stanley
2026-08-31  1:10   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 04/12] tests/tcg/riscv64: Update semihosting linker script Joel Stanley
2026-08-31  1:14   ` Alistair Francis [this message]
2026-08-27  5:09 ` [PATCH 05/12] tests/tcg/riscv64: Rework rules for semihost tests Joel Stanley
2026-08-31  1:17   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 06/12] tests/tcg/riscv64: Enable multiarch system tests Joel Stanley
2026-08-31  1:20   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 07/12] tests/tcg/riscv64: Enable memory record and replay test Joel Stanley
2026-08-31  1:21   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 08/12] tests/tcg/aarch64: Don't leak memory-sve CFLAGS Joel Stanley
2026-09-22  5:39   ` Alistair Francis
2026-09-22  7:17   ` Alex Bennée
2026-08-27  5:09 ` [PATCH 09/12] tests/tcg/multiarch: Fix vectorisation of memory test Joel Stanley
2026-08-31  1:24   ` Alistair Francis
2026-09-01 10:06   ` Alex Bennée
2026-08-27  5:09 ` [PATCH 10/12] tests/tcg/riscv64: Enable vectorised " Joel Stanley
2026-08-31  1:25   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 11/12] configure: Provide OBJDUMP to the tcg tests Joel Stanley
2026-08-31  1:25   ` Alistair Francis
2026-08-27  5:09 ` [PATCH 12/12] tests/tcg: Check vector memory tests contain vector ops Joel Stanley
2026-08-31  1:26   ` Alistair Francis
2026-09-22  9:50 ` [PATCH 00/12] tests/tcg: Multiarch tests for riscv64 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=21db8838b7fcfd4c40fe06efa7b15f700cc0d254.camel@wdc.com \
    --to=alistair.francis@wdc.com \
    --cc=alex.bennee@linaro.org \
    --cc=asrinivasan@oss.tenstorrent.com \
    --cc=chao.liu@processmission.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=joel@jms.id.au \
    --cc=liwei1518@gmail.com \
    --cc=mpe@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=portias@oss.tenstorrent.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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.