Skip to contentSkip to conversation

package/qemu: Move patches to version directory

PATCH New guoren at kernel.org 3 participants 7 messages Jun 3, 2019 – Jun 22, 2019 C-sky architecture

lore
Share & tools
lore

guoren at kernel.org

author maintainer
#0 lore raw

PATCH 1/2 package/qemu: Move patches to version directory

From: Guo Ren <[email protected]>

Cc Thomas Petazzoni <[email protected]>
---
 ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 -------------
 .../qemu/0002-configure-improve-usbfs-check.patch  | 60 ----------------------
 ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 +++++++++++++
 .../3.1.0/0002-configure-improve-usbfs-check.patch | 60 ++++++++++++++++++++++
 4 files changed, 95 insertions(+), 95 deletions(-)
 delete mode 100644 package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
 delete mode 100644 package/qemu/0002-configure-improve-usbfs-check.patch
 create mode 100644 package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
 create mode 100644 package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch
package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch deleted +0 -35
deleted file mode 100644
index a0c4a62..0000000
@@ -1,35 +0,0 @@
-From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
-Date: Fri, 5 May 2017 09:07:15 +0200
-Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc
-
-user-exec.c has some conditional code to decide how to use the
-mcontext structure. Unfortunately, since uClibc defines __GLIBC__, but
-with old versions of __GLIBC__ and __GLIBC_MINOR__, an old code path
-gets used, which doesn't apply to uClibc.
-
-Fix this by excluding __UCLIBC__, which ensures we fall back to the
-general case of using uc_mcontext.arm_pc, which works fine with
-uClibc.
-
-Signed-off-by: Thomas Petazzoni <[email protected]>
----
- user-exec.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
-index 6db0758..2b3d116 100644
---- a/accel/tcg/user-exec.c
-+++ b/accel/tcg/user-exec.c
-@@ -463,7 +463,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
- 
- #if defined(__NetBSD__)
-     pc = uc->uc_mcontext.__gregs[_REG_R15];
--#elif defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
-+#elif defined(__GLIBC__) && !defined(__UCLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
-     pc = uc->uc_mcontext.gregs[R15];
- #else
-     pc = uc->uc_mcontext.arm_pc;
--- 
-2.7.4
-
package/qemu/0002-configure-improve-usbfs-check.patch deleted +0 -60

60 lines not on this page · raw message

package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch new file +35 -0
new file mode 100644
index 0000000..a0c4a62
@@ -0,0 +1,35 @@
+From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Fri, 5 May 2017 09:07:15 +0200
+Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc
+
+user-exec.c has some conditional code to decide how to use the
+mcontext structure. Unfortunately, since uClibc defines __GLIBC__, but
+with old versions of __GLIBC__ and __GLIBC_MINOR__, an old code path
+gets used, which doesn't apply to uClibc.
+
+Fix this by excluding __UCLIBC__, which ensures we fall back to the
+general case of using uc_mcontext.arm_pc, which works fine with
+uClibc.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ user-exec.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
+index 6db0758..2b3d116 100644
+--- a/accel/tcg/user-exec.c
++++ b/accel/tcg/user-exec.c
+@@ -463,7 +463,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
+ 
+ #if defined(__NetBSD__)
+     pc = uc->uc_mcontext.__gregs[_REG_R15];
+-#elif defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
++#elif defined(__GLIBC__) && !defined(__UCLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
+     pc = uc->uc_mcontext.gregs[R15];
+ #else
+     pc = uc->uc_mcontext.arm_pc;
+-- 
+2.7.4
+
package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH 2/2 package/qemu: Add C-SKY qemu support

From: Guo Ren <[email protected]>

Cc Thomas Petazzoni <[email protected]>
---
 package/qemu/Config.in.host |  1 +
 package/qemu/qemu.hash      |  1 +
 package/qemu/qemu.mk        | 12 ++++++++++++
 3 files changed, 14 insertions(+)
package/qemu/Config.in.host +1 -0
index 8a0df38..effe58b 100644
@@ -3,6 +3,7 @@ config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
 	default y if BR2_arm
 	default y if BR2_armeb
 	default y if BR2_aarch64
+	default y if BR2_csky
 	default y if BR2_i386
 	default y if BR2_m68k
 	default y if BR2_microblazeel
package/qemu/qemu.hash +1 -0
index 338d2ae..9ee9833 100644
@@ -2,3 +2,4 @@
 sha256 6a0508df079a0a33c2487ca936a56c12122f105b8a96a44374704bef6c69abfc  qemu-3.1.0.tar.xz
 sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100  COPYING
 sha256 48ffe9fc7f1d5462dbd19340bc4dd1d8a9e37c61ed535813e614cbe4a5f0d4df  COPYING.LIB
+sha256 61091767ffd16002e77f005155d096208094e69dee35e6d5ddcaa6c8a13b5e26  qemu-b517e1dc3125a57555d67a8deed9eac7b42288e2.tar.gz
package/qemu/qemu.mk +12 -0
index 19bcafa..012406e 100644
@@ -4,9 +4,14 @@
 #
 ################################################################################
 
+ifeq ($(BR2_csky),y)
+QEMU_VERSION = b517e1dc3125a57555d67a8deed9eac7b42288e2
+QEMU_SITE = $(call github,c-sky,qemu,$(QEMU_VERSION))
+else
 QEMU_VERSION = 3.1.0
 QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz
 QEMU_SITE = http://download.qemu.org
+endif
 QEMU_LICENSE = GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c
 QEMU_LICENSE_FILES = COPYING COPYING.LIB
 #?NOTE: there is no top-level license file for non-(L)GPL licenses;
@@ -209,6 +214,13 @@ endif
 ifeq ($(HOST_QEMU_ARCH),sh4aeb)
 HOST_QEMU_ARCH = sh4eb
 endif
+ifeq ($(HOST_QEMU_ARCH),csky)
+ifeq ($(BR2_ck610),y)
+HOST_QEMU_ARCH = cskyv1
+else
+HOST_QEMU_ARCH = cskyv2
+endif
+endif
 HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH)
 
 ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
Signature · 1 line
2.7.4
author maintainer
#2 lore raw

PATCH 2/2 package/qemu: Add C-SKY qemu support

Hello Thomas,

Ping ...

As you've asked in:
https://lore.kernel.org/linux-csky/20190603093212.74f84255 at windsurf/T/#u

Is the patch all right for buildroot?

Best Regards
Guo Ren

Quoted 72 lines · On Mon, Jun 3, 2019 at 8:28 PM <[email protected]> wrote:

From: Guo Ren <[email protected]>

Cc Thomas Petazzoni <[email protected]>
---
 package/qemu/Config.in.host |  1 +
 package/qemu/qemu.hash      |  1 +
 package/qemu/qemu.mk        | 12 ++++++++++++
 3 files changed, 14 insertions(+)
package/qemu/Config.in.host +1 -0
index 8a0df38..effe58b 100644
@@ -3,6 +3,7 @@ config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
        default y if BR2_arm
        default y if BR2_armeb
        default y if BR2_aarch64
+       default y if BR2_csky
        default y if BR2_i386
        default y if BR2_m68k
        default y if BR2_microblazeel
package/qemu/qemu.hash +1 -0
index 338d2ae..9ee9833 100644
@@ -2,3 +2,4 @@
 sha256 6a0508df079a0a33c2487ca936a56c12122f105b8a96a44374704bef6c69abfc  qemu-3.1.0.tar.xz
 sha256 6f04ae8364d0079a192b14635f4b1da294ce18724c034c39a6a41d1b09df6100  COPYING
 sha256 48ffe9fc7f1d5462dbd19340bc4dd1d8a9e37c61ed535813e614cbe4a5f0d4df  COPYING.LIB
+sha256 61091767ffd16002e77f005155d096208094e69dee35e6d5ddcaa6c8a13b5e26  qemu-b517e1dc3125a57555d67a8deed9eac7b42288e2.tar.gz
package/qemu/qemu.mk +12 -1
index 19bcafa..012406e 100644
@@ -4,9 +4,14 @@
 #
 ################################################################################
 
+ifeq ($(BR2_csky),y)
+QEMU_VERSION = b517e1dc3125a57555d67a8deed9eac7b42288e2
+QEMU_SITE = $(call github,c-sky,qemu,$(QEMU_VERSION))
+else
 QEMU_VERSION = 3.1.0
 QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz
 QEMU_SITE = http://download.qemu.org
+endif
 QEMU_LICENSE = GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c
 QEMU_LICENSE_FILES = COPYING COPYING.LIB
 # NOTE: there is no top-level license file for non-(L)GPL licenses;
@@ -209,6 +214,13 @@ endif
 ifeq ($(HOST_QEMU_ARCH),sh4aeb)
 HOST_QEMU_ARCH = sh4eb
 endif
+ifeq ($(HOST_QEMU_ARCH),csky)
+ifeq ($(BR2_ck610),y)
+HOST_QEMU_ARCH = cskyv1
+else
+HOST_QEMU_ARCH = cskyv2
+endif
+endif
 HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH)
 
 ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
--

2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw

PATCH 1/2 package/qemu: Move patches to version directory

In reply to guoren at kernel.org

Am Mon, 3 Jun 2019 20:28:06 +0800
schrieb guoren at kernel.org:

Quoted 7 lines

From: Guo Ren <[email protected]>

Cc Thomas Petazzoni <[email protected]>
---
 ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 -------------
 .../qemu/0002-configure-improve-usbfs-check.patch  | 60
Quoted 11 lines

---------------------- ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 +++++++++++++ .../3.1.0/0002-configure-improve-usbfs-check.patch | 60 ++++++++++++++++++++++ 4 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch delete mode 100644 package/qemu/0002-configure-improve-usbfs-check.patch create mode 100644 package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch create mode 100644 package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch

At least the usbfs patch seems to be included in QEMU v4.0, so maybe it would be better to bump the version to 4.0 first?

Thomas, did you ever send the first patch to upstream QEMU, too? Looks like a valid patch to me, so I think it should be accepted there, too...?

Thomas H

author maintainer
#4 lore raw

PATCH 1/2 package/qemu: Move patches to version directory

Hi Thomas,

Quoted 23 lines · Thomas Huth

Am Mon, 3 Jun 2019 20:28:06 +0800
schrieb guoren at kernel.org:

Quoted 7 lines

From: Guo Ren <[email protected]>

Cc Thomas Petazzoni <[email protected]>
---
 ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 -------------
 .../qemu/0002-configure-improve-usbfs-check.patch  | 60
Quoted 11 lines

---------------------- ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 +++++++++++++ .../3.1.0/0002-configure-improve-usbfs-check.patch | 60 ++++++++++++++++++++++ 4 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch delete mode 100644 package/qemu/0002-configure-improve-usbfs-check.patch create mode 100644 package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch create mode 100644 package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch

Quoted 2 lines

At least the usbfs patch seems to be included in QEMU v4.0, so maybe it would be better to bump the version to 4.0 first?

I've no idea about qemu 4.0 and these patch can't apply to csky-qemu-3.0. So I need to move them
to their own version's directory.

Best Regards
Guo Ren

#5 lore raw

PATCH 1/2 package/qemu: Move patches to version directory

In reply to Thomas Huth
Quoted 2 lines · On Tue, 4 Jun 2019 09:56:05 +0200 Thomas Huth <[email protected]> wrote:

At least the usbfs patch seems to be included in QEMU v4.0, so maybe it would be better to bump the version to 4.0 first?

Bumping to 4.0 would certainly be nice, but it really is a different thing than what Guo is doing. Since it's not really necessary to add support for C-SKY's Qemu version, I don't want to make bumping to 4.0 a requirement for Guo's work.

Quoted 3 lines

Thomas, did you ever send the first patch to upstream QEMU, too? Looks like a valid patch to me, so I think it should be accepted there, too...?

To be honest, I don't remember if I ever sent it upstream :-/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH 1/2 package/qemu: Move patches to version directory

In reply to guoren at kernel.org
Quoted 4 lines · On Mon, 3 Jun 2019 20:28:06 +0800 guoren at kernel.org wrote:

From: Guo Ren <[email protected]>

Cc Thomas Petazzoni <[email protected]>
Quoted 10 lines
---
 ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 -------------
 .../qemu/0002-configure-improve-usbfs-check.patch  | 60 ----------------------
 ...ix-usage-of-mcontext-structure-on-ARM-uCl.patch | 35 +++++++++++++
 .../3.1.0/0002-configure-improve-usbfs-check.patch | 60 ++++++++++++++++++++++
 4 files changed, 95 insertions(+), 95 deletions(-)
 delete mode 100644 package/qemu/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
 delete mode 100644 package/qemu/0002-configure-improve-usbfs-check.patch
 create mode 100644 package/qemu/3.1.0/0001-user-exec-fix-usage-of-mcontext-structure-on-ARM-uCl.patch
 create mode 100644 package/qemu/3.1.0/0002-configure-improve-usbfs-check.patch

Thanks, both patches applied!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com