All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ammar Faizi <ammarfaizi2@gnuweeb.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>,
	Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
	Fernanda Ma'rouf <fernandafmr12@gnuweeb.org>,
	Pavel Begunkov <asml.silence@gmail.com>,
	Hao Xu <howeyxu@tencent.com>,
	io-uring Mailing List <io-uring@vger.kernel.org>,
	GNU/Weeb Mailing List <gwml@gnuweeb.org>
Subject: [PATCH liburing v2 0/8] aarch64 support
Date: Thu, 30 Jun 2022 00:58:22 +0700	[thread overview]
Message-ID: <20220629175255.1377052-1-ammar.faizi@intel.com> (raw)

From: Ammar Faizi <ammarfaizi2@gnuweeb.org>

Hi Jens,

This is v2 revision of aarch64 support.

This series contains nolibc support for aarch64 and one extra irrelevant
cleanup (patch #1). The missing bit from aarch64 is get_page_size()
which is a bit complicated to implement without libc.

aarch64 supports three values of page size: 4K, 16K, and 64K which are
selected at kernel compilation time. Therefore, we can't hard code the
page size for this arch. In this series we utilize open(), read() and
close() syscall to find the page size from /proc/self/auxv.

The auxiliary vector contains information about the page size, it is
located at `AT_PAGESZ` keyval pair.

For more details about the auxv data structure, check the link below.

Link: https://github.com/torvalds/linux/blob/v5.19-rc4/fs/binfmt_elf.c#L260
Link: https://lwn.net/Articles/631631/

There are 8 patches in this series. Summary:

- Patch 1 is just a trivial changelog fix.
- Patch 2 and 3 are to add open() and read() syscall. We will need them
  to get the page size on aarch64.
- Patch 4 is to remove __INTERNAL__LIBURING_SYSCALL_H checks.
- Patch 5 is to add get_page_size() function.
- Patch 6 is to enable the nolibc support for aarch64.
- Patch 7 is for GitHub bot build.
- Patch 8 is to update the CHANGELOG to note aarch64 nolibc support.

I have built it with GitHub bot and it compiles just fine. But I don't
have an aarch64 machine to run the tests. Since you are using aarch64,
I can rely on you to test it.

How to test this?

  make clean;
  ./configure --nolibc;
  make -j8;

  ldd src/liburing.so.2.3;
  # Make sure you don't see libc.so from the `ldd` command.

  make runtests;

Please give it a test, thanks!

## Changelog

v1 -> v2:
  - Drop aarch64 renaming directory patch.
  - Fallback the page size to 4K if we fail to get it.
  - Cache the page size after we read it from /proc/self/auxv.
  - Massage commit messages.
  - Note aarch64 nolibc support in CHANGELOG.


Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---

Ammar Faizi (8):
  CHANGELOG: Fixup missing space
  arch: syscall: Add `__sys_open()` syscall
  arch: syscall: Add `__sys_read()` syscall
  arch: Remove `__INTERNAL__LIBURING_LIB_H` checks
  arch/aarch64: lib: Add `get_page_size()` function
  arch: Enable nolibc support for aarch64
  .github: Enable aarch64 nolibc build for GitHub bot
  CHANGELOG: Note about aarch64 support

 .github/workflows/build.yml |  2 +-
 CHANGELOG                   |  7 +++++-
 src/arch/aarch64/lib.h      | 45 +++++++++++++++++++++++++++++++++++++
 src/arch/aarch64/syscall.h  |  8 +++----
 src/arch/generic/lib.h      |  4 ----
 src/arch/generic/syscall.h  | 20 +++++++++++++----
 src/arch/syscall-defs.h     | 12 ++++++++++
 src/arch/x86/lib.h          |  4 ----
 src/arch/x86/syscall.h      |  4 ----
 src/lib.h                   | 32 +++++++++++++-------------
 src/syscall.h               |  2 --
 11 files changed, 100 insertions(+), 40 deletions(-)
 create mode 100644 src/arch/aarch64/lib.h


base-commit: 7d1cce2112ddf358b56ae0abd18c86e8ede9447f
-- 
Ammar Faizi


             reply	other threads:[~2022-06-29 17:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 17:58 Ammar Faizi [this message]
2022-06-29 17:58 ` [PATCH liburing v2 1/8] CHANGELOG: Fixup missing space Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 2/8] arch: syscall: Add `__sys_open()` syscall Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 3/8] arch: syscall: Add `__sys_read()` syscall Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 4/8] arch: Remove `__INTERNAL__LIBURING_LIB_H` checks Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 5/8] arch/aarch64: lib: Add `get_page_size()` function Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 6/8] arch: Enable nolibc support for aarch64 Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 7/8] .github: Enable aarch64 nolibc build for GitHub bot Ammar Faizi
2022-06-29 17:58 ` [PATCH liburing v2 8/8] CHANGELOG: Note about aarch64 support Ammar Faizi
2022-07-04 12:52 ` [PATCH liburing v2 0/8] " Ammar Faizi
2022-07-04 13:05   ` Jens Axboe
2022-07-04 15:36     ` Ammar Faizi

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=20220629175255.1377052-1-ammar.faizi@intel.com \
    --to=ammarfaizi2@gnuweeb.org \
    --cc=alviro.iskandar@gnuweeb.org \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=fernandafmr12@gnuweeb.org \
    --cc=gwml@gnuweeb.org \
    --cc=howeyxu@tencent.com \
    --cc=io-uring@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.