Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] qemu: replace ppc64 musl patches with a generalized ppc32/64 one
Date: Mon, 01 Jul 2019 20:33:40 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-12774@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-power/void-packages qemu
https://github.com/void-linux/void-packages/pull/12774

qemu: replace ppc64 musl patches with a generalized ppc32/64 one
the previous patches didn't cover ppc32, replace both with a bit cleaner unified patch...

A patch file from https://github.com/void-linux/void-packages/pull/12774.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-qemu-12774.patch --]
[-- Type: application/text/x-diff, Size: 5015 bytes --]

From a3798d8a08ed6c81996e2101a3f0d36cd268d0e5 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 1 Jul 2019 20:15:35 +0200
Subject: [PATCH] qemu: replace ppc64 musl patches with a generalized ppc32/64
 one

[ci skip]
---
 srcpkgs/qemu/patches/musl-ppc.patch           | 60 +++++++++++++++++++
 srcpkgs/qemu/patches/musl-ppc64-pt_nip.patch  | 12 ----
 srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch | 16 -----
 3 files changed, 60 insertions(+), 28 deletions(-)
 create mode 100644 srcpkgs/qemu/patches/musl-ppc.patch
 delete mode 100644 srcpkgs/qemu/patches/musl-ppc64-pt_nip.patch
 delete mode 100644 srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch

diff --git a/srcpkgs/qemu/patches/musl-ppc.patch b/srcpkgs/qemu/patches/musl-ppc.patch
new file mode 100644
index 00000000000..86c21df4f1f
--- /dev/null
+++ b/srcpkgs/qemu/patches/musl-ppc.patch
@@ -0,0 +1,60 @@
+--- accel/tcg/user-exec.c
++++ accel/tcg/user-exec.c
+@@ -286,6 +286,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+  */
+ #ifdef linux
+ /* All Registers access - only for local access */
++#if defined(__GLIBC__)
+ #define REG_sig(reg_name, context)              \
+     ((context)->uc_mcontext.regs->reg_name)
+ /* Gpr Registers access  */
+@@ -302,6 +303,19 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #define LR_sig(context)                        REG_sig(link, context)
+ /* Condition register */
+ #define CR_sig(context)                        REG_sig(ccr, context)
++#else /* musl */
++#if defined(_ARCH_PPC64)
++#define REG_sig(reg_num, context) ((context)->uc_mcontext.gp_regs[reg_num])
++#else
++#define REG_sig(reg_num, context) ((context)->uc_mcontext.gregs[reg_num])
++#endif
++#define IAR_sig(context)                       REG_sig(32, context)
++#define MSR_sig(context)                       REG_sig(33, context)
++#define CTR_sig(context)                       REG_sig(35, context)
++#define XER_sig(context)                       REG_sig(37, context)
++#define LR_sig(context)                        REG_sig(36, context)
++#define CR_sig(context)                        REG_sig(38, context)
++#endif
+ 
+ /* Float Registers access  */
+ #define FLOAT_sig(reg_num, context)                                     \
+@@ -309,9 +323,15 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ #define FPSCR_sig(context) \
+     (*(int *)((char *)((context)->uc_mcontext.regs + (48 + 32 * 2) * 4)))
+ /* Exception Registers access */
++#if defined(__GLIBC__)
+ #define DAR_sig(context)                       REG_sig(dar, context)
+ #define DSISR_sig(context)                     REG_sig(dsisr, context)
+ #define TRAP_sig(context)                      REG_sig(trap, context)
++#else /* musl */
++#define DAR_sig(context)                       REG_sig(41, context)
++#define DSISR_sig(context)                     REG_sig(42, context)
++#define TRAP_sig(context)                      REG_sig(40, context)
++#endif
+ #endif /* linux */
+ 
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+--- linux-user/host/ppc64/hostdep.h
++++ linux-user/host/ppc64/hostdep.h
+@@ -27,7 +27,11 @@ extern char safe_syscall_end[];
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+     ucontext_t *uc = puc;
++#if defined(__GLIBC__)
+     unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP];
++#else /* musl */
++    unsigned long *pcreg = &uc->uc_mcontext.gp_regs[32];
++#endif
+ 
+     if (*pcreg > (uintptr_t)safe_syscall_start
+         && *pcreg < (uintptr_t)safe_syscall_end) {
diff --git a/srcpkgs/qemu/patches/musl-ppc64-pt_nip.patch b/srcpkgs/qemu/patches/musl-ppc64-pt_nip.patch
deleted file mode 100644
index 5c5eaea126e..00000000000
--- a/srcpkgs/qemu/patches/musl-ppc64-pt_nip.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-This include is necessary to get PT_NIP on musl.
---- linux-user/host/ppc64/hostdep.h
-+++ linux-user/host/ppc64/hostdep.h
-@@ -17,6 +17,8 @@
- 
- #ifndef __ASSEMBLER__
- 
-+#include <asm/ptrace.h>
-+
- /* These are defined by the safe-syscall.inc.S file */
- extern char safe_syscall_start[];
- extern char safe_syscall_end[];
diff --git a/srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch b/srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch
deleted file mode 100644
index bdd7e7eacab..00000000000
--- a/srcpkgs/qemu/patches/musl-ppc64-pt_regs.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-On musl, the regs field in uc_mcontext is void * so it is necessary to
-cast it. The sys/user.h include is to get access to definition of pt_regs.
---- accel/tcg/user-exec.c
-+++ accel/tcg/user-exec.c
-@@ -285,9 +285,10 @@ int cpu_signal_handler(int host_signum, void *pinfo,
-  * From Wine
-  */
- #ifdef linux
-+#include <sys/user.h>
- /* All Registers access - only for local access */
- #define REG_sig(reg_name, context)              \
--    ((context)->uc_mcontext.regs->reg_name)
-+    (((struct pt_regs *)(context)->uc_mcontext.regs)->reg_name)
- /* Gpr Registers access  */
- #define GPR_sig(reg_num, context)              REG_sig(gpr[reg_num], context)
- /* Program counter */

             reply	other threads:[~2019-07-01 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01 18:33 voidlinux-github [this message]
2019-07-01 19:10 ` [PR PATCH] [Merged]: " voidlinux-github

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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-12774@inbox.vuxu.org \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.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;
as well as URLs for NNTP newsgroup(s).