[PATCH v3 0/5] Add LoongArch support to nolibc

chris.chenfeiyang@gmail.com posted 5 patches 2 years, 7 months ago
tools/include/nolibc/arch-loongarch.h   | 200 ++++++++++++++++++++++++
tools/include/nolibc/arch.h             |   2 +
tools/include/nolibc/sys.h              |  58 ++++++-
tools/include/nolibc/types.h            |   5 -
tools/testing/selftests/nolibc/Makefile |  78 ++++-----
5 files changed, 300 insertions(+), 43 deletions(-)
create mode 100644 tools/include/nolibc/arch-loongarch.h
[PATCH v3 0/5] Add LoongArch support to nolibc
Posted by chris.chenfeiyang@gmail.com 2 years, 7 months ago
From: Feiyang Chen <chenfeiyang@loongson.cn>

Add statx() and make stat() rely on statx() if necessary.
Add support for LoongArch (32 and 64 bit) to nolibc.
It was tested on LoongArch64 only.

The latest QEMU support full-system emulation of a LoongArch64
machine, but for the moment we need to specify the firmware manually.
https://github.com/loongson/Firmware/tree/main/LoongArchVirtMachine

QEMU_ARGS_loongarch  = -M virt -bios edk2-loongarch64-code.fd ...

v2:
- Mention that statx() will also benefit other architectures.
- Make stat() rely on statx() when available.
- Put the whitespace changes into one commit.

v3:
- Add #if defined(__NR_statx) guard.
- Keep the check for statx() from the first version.
- Mention that we may use statx() everywhere in the future.
- struct statx stat -> struct statx statx.

Feiyang Chen (5):
  tools/nolibc: Include linux/fcntl.h and remove duplicate code
  tools/nolibc: Add statx() and make stat() rely on statx() if necessary
  tools/nolibc: Add support for LoongArch
  selftests/nolibc: Add support for LoongArch
  selftests/nolibc: Adjust indentation for Makefile

 tools/include/nolibc/arch-loongarch.h   | 200 ++++++++++++++++++++++++
 tools/include/nolibc/arch.h             |   2 +
 tools/include/nolibc/sys.h              |  58 ++++++-
 tools/include/nolibc/types.h            |   5 -
 tools/testing/selftests/nolibc/Makefile |  78 ++++-----
 5 files changed, 300 insertions(+), 43 deletions(-)
 create mode 100644 tools/include/nolibc/arch-loongarch.h

-- 
2.39.0
Re: [PATCH v3 0/5] Add LoongArch support to nolibc
Posted by Willy Tarreau 2 years, 7 months ago
Hi Feiyang,

On Thu, Feb 09, 2023 at 11:24:11AM +0800, chris.chenfeiyang@gmail.com wrote:
> From: Feiyang Chen <chenfeiyang@loongson.cn>
> 
> Add statx() and make stat() rely on statx() if necessary.
> Add support for LoongArch (32 and 64 bit) to nolibc.
> It was tested on LoongArch64 only.
> 
> The latest QEMU support full-system emulation of a LoongArch64
> machine, but for the moment we need to specify the firmware manually.
> https://github.com/loongson/Firmware/tree/main/LoongArchVirtMachine
> 
> QEMU_ARGS_loongarch  = -M virt -bios edk2-loongarch64-code.fd ...
> 
> v2:
> - Mention that statx() will also benefit other architectures.
> - Make stat() rely on statx() when available.
> - Put the whitespace changes into one commit.
> 
> v3:
> - Add #if defined(__NR_statx) guard.
> - Keep the check for statx() from the first version.
> - Mention that we may use statx() everywhere in the future.
> - struct statx stat -> struct statx statx.

I'm personally fine with this one. I'll give it a try with all supported
archs to make sure we don't have any unexpected side effect, and unless
anyone has any other comment, we'll queue this series.

Thank you!
Willy
Re: [PATCH v3 0/5] Add LoongArch support to nolibc
Posted by Huacai Chen 2 years, 7 months ago
Acked-by: Huacai Chen <chenhuacai@loongson.cn>

On Thu, Feb 9, 2023 at 11:35 AM Willy Tarreau <w@1wt.eu> wrote:
>
> Hi Feiyang,
>
> On Thu, Feb 09, 2023 at 11:24:11AM +0800, chris.chenfeiyang@gmail.com wrote:
> > From: Feiyang Chen <chenfeiyang@loongson.cn>
> >
> > Add statx() and make stat() rely on statx() if necessary.
> > Add support for LoongArch (32 and 64 bit) to nolibc.
> > It was tested on LoongArch64 only.
> >
> > The latest QEMU support full-system emulation of a LoongArch64
> > machine, but for the moment we need to specify the firmware manually.
> > https://github.com/loongson/Firmware/tree/main/LoongArchVirtMachine
> >
> > QEMU_ARGS_loongarch  = -M virt -bios edk2-loongarch64-code.fd ...
> >
> > v2:
> > - Mention that statx() will also benefit other architectures.
> > - Make stat() rely on statx() when available.
> > - Put the whitespace changes into one commit.
> >
> > v3:
> > - Add #if defined(__NR_statx) guard.
> > - Keep the check for statx() from the first version.
> > - Mention that we may use statx() everywhere in the future.
> > - struct statx stat -> struct statx statx.
>
> I'm personally fine with this one. I'll give it a try with all supported
> archs to make sure we don't have any unexpected side effect, and unless
> anyone has any other comment, we'll queue this series.
>
> Thank you!
> Willy