All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Clark <christopher.w.clark@gmail.com>
To: meta-virtualization@lists.yoctoproject.org
Cc: bruce.ashfield@gmail.com, cardoe@gentoo.org, Bertrand.Marquis@arm.com
Subject: [meta-virtualization][gatesgarth][PATCH 2/3] xen: drop patch to workaround prelink on aarch64
Date: Sat, 21 May 2022 12:04:38 -0700	[thread overview]
Message-ID: <20220521190447.135705-3-christopher.w.clark@gmail.com> (raw)
In-Reply-To: <20220521190447.135705-1-christopher.w.clark@gmail.com>

Patch is not needed for image prelinking since the gcc toolchain
in this branch successfully links Xen without it.

Remove the patch from the stable branch since the BSD license of the
modified header file differs vs the GPLv2 source code referenced.
Removal preferred to replacement with a new patch that moves the function
into GPLv2 .c source files since the build now succeeds without it.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
---
 ...xen-arm64-implement-atomic-fetch-add.patch | 50 -------------------
 recipes-extended/xen/xen_4.14.bb              |  1 -
 recipes-extended/xen/xen_git.bb               |  1 -
 3 files changed, 52 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch

diff --git a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch b/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
deleted file mode 100644
index 6e957a5..0000000
--- a/recipes-extended/xen/files/xen-arm64-implement-atomic-fetch-add.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Christopher Clark <christopher.w.clark@gmail.com>
-Date: Fri, 26 June 2020 16:34:00 -0800
-Subject: [PATCH] xen: implement atomic op to fix arm64 compilation
-
-Xen's ARM implementation of arch_fetch_and_add since f9cc3cd9
-uses a builtin, despite the build being performed with -fno-builtin.
-With gcc 10.1.0, this now breaks prelinking spinlock.c, so
-implement the one atomic operation that is required with logic
-derived from Linux's atomic_ll_sc.h: ATOMIC_FETCH_OP and comparison with
-the binary produced with and without the patch with gcc 9.2.0.
-
-Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
-diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
-index e5d062667d..c46dd3ac71 100644
---- a/xen/include/asm-arm/system.h
-+++ b/xen/include/asm-arm/system.h
-@@ -55,7 +55,32 @@ static inline int local_abort_is_enabled(void)
-     return !(flags & PSR_ABT_MASK);
- }
- 
-+#ifdef CONFIG_ARM_64
-+
-+/* see atomic_ll_sc.h:  ATOMIC_FETCH_OP(name, mb, acq, rel, cl, op, asm_op, constraint) */
-+static inline int arch_fetch_and_add(unsigned int *ptr, unsigned long i)
-+{
-+    int register lptr asm("x0");
-+    int register result asm("w1");
-+    int register newval asm("w2");
-+    int register status asm("w3");
-+
-+    asm volatile(
-+    "   mov       %[lptr], %[ptr]\n"
-+    "1: ldxr      %w[result], [%[lptr]]\n"
-+    "   add       %w[newval], %w[result], %w[i]\n"
-+    "   stlxr     %w[status], %w[newval], [%[lptr]]\n"
-+    "   cbnz      %w[status], 1b\n"
-+    "   dmb       ish\n"
-+    : [result] "=&r" (result), [lptr] "=&r" (lptr), [newval] "=&r" (newval), [status] "=&r" (status), [i] "+r" (i), "+Q" (*ptr)
-+    : [ptr] "r" (ptr), "r" (i)
-+    : "memory");
-+
-+    return result;
-+}
-+#else
- #define arch_fetch_and_add(x, v) __sync_fetch_and_add(x, v)
-+#endif
- 
- extern struct vcpu *__context_switch(struct vcpu *prev, struct vcpu *next);
- 
diff --git a/recipes-extended/xen/xen_4.14.bb b/recipes-extended/xen/xen_4.14.bb
index 653e3b6..6ac3236 100644
--- a/recipes-extended/xen/xen_4.14.bb
+++ b/recipes-extended/xen/xen_4.14.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "stable-${XEN_REL}"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
diff --git a/recipes-extended/xen/xen_git.bb b/recipes-extended/xen/xen_git.bb
index 2b62c5c..fba12e5 100644
--- a/recipes-extended/xen/xen_git.bb
+++ b/recipes-extended/xen/xen_git.bb
@@ -5,7 +5,6 @@ XEN_BRANCH ?= "master"
 
 SRC_URI = " \
     git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \
-    file://xen-arm64-implement-atomic-fetch-add.patch \
     file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \
     "
 
-- 
2.25.1



  parent reply	other threads:[~2022-05-21 19:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 19:04 [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
2022-05-21 19:04 ` Christopher Clark [this message]
2022-05-21 19:04 ` [meta-virtualization][gatesgarth][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 1/3] linux-yocto-dev, raspberrypi: apply fixed revision to kernel Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][hardknott][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 1/3] linux-yocto-dev, xen, raspberrypi: remove tracking bbappend Christopher Clark
2022-05-23  9:50   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 2/3] xen: drop patch to workaround prelink on aarch64 Christopher Clark
2022-05-23  9:55   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][honister][PATCH 3/3] xen: fix boot on the Raspberry Pi 4 with Xen 4.14 Christopher Clark
2022-05-23  9:50   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][kirkstone][PATCH] xen, raspberry pi: replace linux-yocto-dev with linux-yocto 5.15 Christopher Clark
2022-05-23  9:53   ` Bertrand Marquis
2022-05-21 19:04 ` [meta-virtualization][PATCH] " Christopher Clark
2022-05-23  9:53   ` Bertrand Marquis
2022-05-23  9:47 ` [meta-virtualization][gatesgarth,hardknott,honister,kirkstone,master][PATCH 0/11] Xen on Raspberry Pi 4 fixes Bertrand Marquis
2022-05-25 15:36 ` Bruce Ashfield
2022-05-25 17:00   ` Christopher Clark

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=20220521190447.135705-3-christopher.w.clark@gmail.com \
    --to=christopher.w.clark@gmail.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=cardoe@gentoo.org \
    --cc=meta-virtualization@lists.yoctoproject.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.