From f941586e5f0cd85b7ac4d378a64b20a47276f41626466be4d6bf1abaca05a2b4 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 10 Jan 2012 16:25:36 +0000 Subject: [PATCH] - backport all ppc-1.0 stable patches to our package - add fix for PPC HV KVM on 3.1 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=39 --- ...errupts-by-inline-checking-of-a-flag.patch | 2 +- ...inux-user-fix-QEMU_STRACE-1-segfault.patch | 2 +- 0003-linux-user-save-auxv-length.patch | 2 +- ...-user-add-open-hijack-infrastructure.patch | 2 +- 0005-linux-user-fake-proc-self-maps.patch | 2 +- 0006-linux-user-fake-proc-self-stat.patch | 2 +- 0007-linux-user-fake-proc-self-auxv.patch | 2 +- 0008-XXX-dont-dump-core-on-sigabort.patch | 2 +- ...user-fix-wait-syscall-status-returns.patch | 2 +- ...user-fix-wait-syscall-status-returns.patch | 2 +- ...user-fix-wait-syscall-status-returns.patch | 2 +- ...x-user-fake-proc-self-maps-even-more.patch | 2 +- ...-SA_RESTART-race-with-boehm-gc-ARM-o.patch | 2 +- ...nary-lower-in-address-space-so-we-ha.patch | 2 +- ...inux-user-map-lower-in-address-space.patch | 2 +- ...proc-self-maps-also-fclose-real-file.patch | 2 +- ...igher-again-so-we-have-space-for-brk.patch | 2 +- 0018-qemu-0.9.0.cvs-binfmt.patch | 2 +- 0019-qemu-cvs-alsa_bitfield.patch | 2 +- 0020-qemu-cvs-alsa_ioctl.patch | 2 +- 0021-qemu-cvs-alsa_mmap.patch | 2 +- 0022-qemu-cvs-gettimeofday.patch | 2 +- 0023-qemu-cvs-ioctl_debug.patch | 2 +- 0024-qemu-cvs-ioctl_nodirection.patch | 2 +- 0025-qemu-img-vmdk-scsi.patch | 2 +- 0026-qemu-nonvoid_return.patch | 2 +- 0027-fix-mipsn32-linux-user-builds.patch | 2 +- ...ynamips-and-GNS3-UDP-tunnels-Patches.patch | 2 +- ...d-binfmt-wrapper-for-argv-0-handling.patch | 2 +- ...nux-user-Ignore-timer_create-syscall.patch | 2 +- ...user-be-silent-about-capget-failures.patch | 2 +- ...-PPC-Fix-linker-scripts-on-ppc-hosts.patch | 2 +- ...ser-reserve-4GB-of-vmem-for-32-on-64.patch | 2 +- 0034-PPC-KVM-Disable-mmu-notifier-check.patch | 2 +- ...mprove-fake-proc-self-stat-making-ps.patch | 2 +- ...arget_argv-is-placed-on-ts-bprm-argv.patch | 2 +- ...-PPC-KVM-Ignore-SET_ONE_REG-failures.patch | 2 +- ...e-ENABLE_PAPR-to-support-very-old-HV.patch | 29 +++++ ...fault-on-screendump-without-VGA-adap.patch | 39 ++++++ ...es-Fix-array-overrun-bug-in-PCI-code.patch | 33 +++++ ...halt-secondary-cpus-when-guest-reset.patch | 45 +++++++ ...-Emit-device-tree-nodes-in-reg-order.patch | 101 +++++++++++++++ ...-routine-to-find-a-stable-default-vt.patch | 97 ++++++++++++++ ...late-chosen-linux-stdout-path-in-the.patch | 119 ++++++++++++++++++ qemu.changes | 6 + qemu.spec | 14 +++ 46 files changed, 520 insertions(+), 37 deletions(-) create mode 100644 0038-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch create mode 100644 0039-console-Fix-segfault-on-screendump-without-VGA-adap.patch create mode 100644 0040-pseries-Fix-array-overrun-bug-in-PCI-code.patch create mode 100644 0041-kvm-ppc-halt-secondary-cpus-when-guest-reset.patch create mode 100644 0042-pseries-Emit-device-tree-nodes-in-reg-order.patch create mode 100644 0043-pseries-Add-a-routine-to-find-a-stable-default-vt.patch create mode 100644 0044-pseries-Populate-chosen-linux-stdout-path-in-the.patch diff --git a/0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch b/0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch index 5adf9689..6cecf42c 100644 --- a/0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch +++ b/0001-Handle-CPU-interrupts-by-inline-checking-of-a-flag.patch @@ -1,7 +1,7 @@ From 4cc09e9530fb08123594be6c72dfc381df5dcddc Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Wed, 5 Oct 2011 10:04:02 +0100 -Subject: [PATCH 01/37] Handle CPU interrupts by inline checking of a flag +Subject: [PATCH 01/44] Handle CPU interrupts by inline checking of a flag Fix the nasty TCG race conditions and crashes by implementing cpu_exit as setting a flag which is checked at the start of each TB. This is diff --git a/0002-linux-user-fix-QEMU_STRACE-1-segfault.patch b/0002-linux-user-fix-QEMU_STRACE-1-segfault.patch index 0f9ed54e..9191413f 100644 --- a/0002-linux-user-fix-QEMU_STRACE-1-segfault.patch +++ b/0002-linux-user-fix-QEMU_STRACE-1-segfault.patch @@ -1,7 +1,7 @@ From 0588bc446fd48bdb1965a6773d008c05a4ba16c1 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sun, 20 Nov 2011 13:02:54 +0100 -Subject: [PATCH 02/37] linux-user: fix QEMU_STRACE=1 segfault +Subject: [PATCH 02/44] linux-user: fix QEMU_STRACE=1 segfault While debugging some issues with QEMU_STRACE I stumbled over segmentation faults that were pretty reproducible. Turns out we tried to treat a diff --git a/0003-linux-user-save-auxv-length.patch b/0003-linux-user-save-auxv-length.patch index d00d9063..1f80a753 100644 --- a/0003-linux-user-save-auxv-length.patch +++ b/0003-linux-user-save-auxv-length.patch @@ -1,7 +1,7 @@ From 67c12998086c44ebef7f92a394154d6aba446178 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 2 Nov 2011 09:23:22 +0000 -Subject: [PATCH 03/37] linux-user: save auxv length +Subject: [PATCH 03/44] linux-user: save auxv length We create our own AUXV segment on stack and save a pointer to it. However we don't save the length of it, so any code that wants to diff --git a/0004-linux-user-add-open-hijack-infrastructure.patch b/0004-linux-user-add-open-hijack-infrastructure.patch index 97d663de..6dd005a1 100644 --- a/0004-linux-user-add-open-hijack-infrastructure.patch +++ b/0004-linux-user-add-open-hijack-infrastructure.patch @@ -1,7 +1,7 @@ From 99590488e94b6b7f10ecf9a99398fd24a69a7039 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 2 Nov 2011 09:23:23 +0000 -Subject: [PATCH 04/37] linux-user: add open() hijack infrastructure +Subject: [PATCH 04/44] linux-user: add open() hijack infrastructure There are a number of files in /proc that expose host information to the guest program. This patch adds infrastructure to override diff --git a/0005-linux-user-fake-proc-self-maps.patch b/0005-linux-user-fake-proc-self-maps.patch index 7c320854..280895a6 100644 --- a/0005-linux-user-fake-proc-self-maps.patch +++ b/0005-linux-user-fake-proc-self-maps.patch @@ -1,7 +1,7 @@ From 059e727a9a4be00de949769105e9e0ea876fc64b Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 2 Nov 2011 09:23:24 +0000 -Subject: [PATCH 05/37] linux-user: fake /proc/self/maps +Subject: [PATCH 05/44] linux-user: fake /proc/self/maps glibc's pthread_attr_getstack tries to find the stack range from /proc/self/maps. Unfortunately, /proc is usually the host's /proc diff --git a/0006-linux-user-fake-proc-self-stat.patch b/0006-linux-user-fake-proc-self-stat.patch index ef20ad40..14c8943c 100644 --- a/0006-linux-user-fake-proc-self-stat.patch +++ b/0006-linux-user-fake-proc-self-stat.patch @@ -1,7 +1,7 @@ From 7ee3fd47eed19e4dfa26a8d0176ed3550b8d0ccf Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 2 Nov 2011 09:23:25 +0000 -Subject: [PATCH 06/37] linux-user: fake /proc/self/stat +Subject: [PATCH 06/44] linux-user: fake /proc/self/stat The boehm gc finds the program's stack starting pointer by checking /proc/self/stat. Unfortunately, so far it reads diff --git a/0007-linux-user-fake-proc-self-auxv.patch b/0007-linux-user-fake-proc-self-auxv.patch index ea52ab35..781b9a33 100644 --- a/0007-linux-user-fake-proc-self-auxv.patch +++ b/0007-linux-user-fake-proc-self-auxv.patch @@ -1,7 +1,7 @@ From ddf0d4037b10c07d9e5b168f9f96e60a1601c75b Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 2 Nov 2011 09:23:26 +0000 -Subject: [PATCH 07/37] linux-user: fake /proc/self/auxv +Subject: [PATCH 07/44] linux-user: fake /proc/self/auxv Gtk tries to read /proc/self/auxv to find its auxv table instead of taking it from its own program memory space. diff --git a/0008-XXX-dont-dump-core-on-sigabort.patch b/0008-XXX-dont-dump-core-on-sigabort.patch index f9db3f5b..0e94354d 100644 --- a/0008-XXX-dont-dump-core-on-sigabort.patch +++ b/0008-XXX-dont-dump-core-on-sigabort.patch @@ -1,7 +1,7 @@ From 4bc96d88f91417aa2bb029da2e8343456fe86631 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 21 Nov 2011 23:50:36 +0100 -Subject: [PATCH 08/37] XXX dont dump core on sigabort +Subject: [PATCH 08/44] XXX dont dump core on sigabort --- linux-user/signal.c | 6 ++++++ diff --git a/0009-linux-user-fix-wait-syscall-status-returns.patch b/0009-linux-user-fix-wait-syscall-status-returns.patch index aa25563d..8ef89512 100644 --- a/0009-linux-user-fix-wait-syscall-status-returns.patch +++ b/0009-linux-user-fix-wait-syscall-status-returns.patch @@ -1,7 +1,7 @@ From ee5137d38109fdcb55a58be447c2c27be2b16eb0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 22 Nov 2011 17:53:40 +0100 -Subject: [PATCH 09/37] linux-user: fix wait* syscall status returns +Subject: [PATCH 09/44] linux-user: fix wait* syscall status returns When calling wait4 or waitpid with a status pointer and WNOHANG, the syscall can potentially not modify the status pointer input. Now if we diff --git a/0010-Revert-linux-user-fix-wait-syscall-status-returns.patch b/0010-Revert-linux-user-fix-wait-syscall-status-returns.patch index 283e56a8..088faab6 100644 --- a/0010-Revert-linux-user-fix-wait-syscall-status-returns.patch +++ b/0010-Revert-linux-user-fix-wait-syscall-status-returns.patch @@ -1,7 +1,7 @@ From 5cfce885dd1b3a229cd2ea7a94dfe2445ec29417 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 24 Nov 2011 00:38:22 +0100 -Subject: [PATCH 10/37] Revert "linux-user: fix wait* syscall status returns" +Subject: [PATCH 10/44] Revert "linux-user: fix wait* syscall status returns" This reverts commit 93092792064d880eb91679004b4761639d754081. --- diff --git a/0011-linux-user-fix-wait-syscall-status-returns.patch b/0011-linux-user-fix-wait-syscall-status-returns.patch index b8e4e4c0..28bb8081 100644 --- a/0011-linux-user-fix-wait-syscall-status-returns.patch +++ b/0011-linux-user-fix-wait-syscall-status-returns.patch @@ -1,7 +1,7 @@ From b71ee7a063f7cffdf8a2cf73fcbc1d461fbbb80e Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 24 Nov 2011 00:39:35 +0100 -Subject: [PATCH 11/37] linux-user: fix wait* syscall status returns +Subject: [PATCH 11/44] linux-user: fix wait* syscall status returns When calling wait4 or waitpid with a status pointer and WNOHANG, the syscall can potentially not modify the status pointer input. Now if we diff --git a/0012-XXX-linux-user-fake-proc-self-maps-even-more.patch b/0012-XXX-linux-user-fake-proc-self-maps-even-more.patch index 4e0898dc..5f06fc7f 100644 --- a/0012-XXX-linux-user-fake-proc-self-maps-even-more.patch +++ b/0012-XXX-linux-user-fake-proc-self-maps-even-more.patch @@ -1,7 +1,7 @@ From 146dddbec44c48417f776d54f823093b464e596c Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 28 Nov 2011 17:05:24 +0100 -Subject: [PATCH 12/37] XXX linux-user: fake /proc/self/maps even more +Subject: [PATCH 12/44] XXX linux-user: fake /proc/self/maps even more --- linux-user/syscall.c | 40 +++++++++++++++++++++++++++++++++++++++- diff --git a/0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch b/0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch index 78b38d5d..725636cf 100644 --- a/0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch +++ b/0013-XXX-work-around-SA_RESTART-race-with-boehm-gc-ARM-o.patch @@ -1,7 +1,7 @@ From 79a59902304b66e9270d11901a554e5b22042d6e Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 1 Dec 2011 19:00:01 +0100 -Subject: [PATCH 13/37] XXX work around SA_RESTART race with boehm-gc (ARM only) +Subject: [PATCH 13/44] XXX work around SA_RESTART race with boehm-gc (ARM only) --- linux-user/main.c | 25 ++++++++----- diff --git a/0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch b/0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch index b7a2588f..243a8ef2 100644 --- a/0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch +++ b/0014-XXX-move-qemu-binary-lower-in-address-space-so-we-ha.patch @@ -1,7 +1,7 @@ From e534a77a0e1f880d0f74514ac50de5de3dd4811a Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 5 Dec 2011 23:37:52 +0100 -Subject: [PATCH 14/37] XXX move qemu binary lower in address space so we have space for guest stuff +Subject: [PATCH 14/44] XXX move qemu binary lower in address space so we have space for guest stuff --- x86_64.ld | 2 +- diff --git a/0015-linux-user-map-lower-in-address-space.patch b/0015-linux-user-map-lower-in-address-space.patch index 4d550e09..e4afbba7 100644 --- a/0015-linux-user-map-lower-in-address-space.patch +++ b/0015-linux-user-map-lower-in-address-space.patch @@ -1,7 +1,7 @@ From edda5e8f49b7857379733d652d6b259488bd7b70 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 6 Dec 2011 00:39:50 +0100 -Subject: [PATCH 15/37] linux-user: map lower in address space +Subject: [PATCH 15/44] linux-user: map lower in address space While trying to compile Java I can into situations where there was simply no virtual address space left for a 32-bit guest to take. For example when diff --git a/0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch b/0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch index 4c9b4753..9bb358d7 100644 --- a/0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch +++ b/0016-XXX-fake-proc-self-maps-also-fclose-real-file.patch @@ -1,7 +1,7 @@ From 3580a90d40df10410b7268f89aae58ce05dd2bed Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 8 Dec 2011 23:19:32 +0100 -Subject: [PATCH 16/37] XXX fake /proc/self/maps: also fclose real file +Subject: [PATCH 16/44] XXX fake /proc/self/maps: also fclose real file --- linux-user/syscall.c | 1 + diff --git a/0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch b/0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch index a622e5d2..69b220c5 100644 --- a/0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch +++ b/0017-XXX-map-qemu-higher-again-so-we-have-space-for-brk.patch @@ -1,7 +1,7 @@ From 91f12fe177833e0112cd7f7cf5781b26377667a5 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sat, 10 Dec 2011 00:03:56 +0100 -Subject: [PATCH 17/37] XXX map qemu higher again so we have space for brk +Subject: [PATCH 17/44] XXX map qemu higher again so we have space for brk --- linux-user/mmap.c | 2 +- diff --git a/0018-qemu-0.9.0.cvs-binfmt.patch b/0018-qemu-0.9.0.cvs-binfmt.patch index 75734e7d..57f6ba6f 100644 --- a/0018-qemu-0.9.0.cvs-binfmt.patch +++ b/0018-qemu-0.9.0.cvs-binfmt.patch @@ -1,7 +1,7 @@ From 434801ec78b031170eb0762302b52062e6c27d0e Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Tue, 14 Apr 2009 16:18:44 +0200 -Subject: [PATCH 18/37] qemu-0.9.0.cvs-binfmt +Subject: [PATCH 18/44] qemu-0.9.0.cvs-binfmt Fixes binfmt_misc setup script: - x86_64 is i386-compatible diff --git a/0019-qemu-cvs-alsa_bitfield.patch b/0019-qemu-cvs-alsa_bitfield.patch index 497c6d87..0fa39bc7 100644 --- a/0019-qemu-cvs-alsa_bitfield.patch +++ b/0019-qemu-cvs-alsa_bitfield.patch @@ -1,7 +1,7 @@ From b41a72d0c29f97610dfdd5573b8be383823bc88f Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 14 Apr 2009 16:20:50 +0200 -Subject: [PATCH 19/37] qemu-cvs-alsa_bitfield +Subject: [PATCH 19/44] qemu-cvs-alsa_bitfield Implements TYPE_INTBITFIELD partially. (required for ALSA support) diff --git a/0020-qemu-cvs-alsa_ioctl.patch b/0020-qemu-cvs-alsa_ioctl.patch index aa267489..a9bf878b 100644 --- a/0020-qemu-cvs-alsa_ioctl.patch +++ b/0020-qemu-cvs-alsa_ioctl.patch @@ -1,7 +1,7 @@ From 33f065c217c1921759df12467954eb4638f84a72 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 14 Apr 2009 16:23:27 +0200 -Subject: [PATCH 20/37] qemu-cvs-alsa_ioctl +Subject: [PATCH 20/44] qemu-cvs-alsa_ioctl Implements ALSA ioctls on PPC hosts. diff --git a/0021-qemu-cvs-alsa_mmap.patch b/0021-qemu-cvs-alsa_mmap.patch index 0e84ecc8..930e39c5 100644 --- a/0021-qemu-cvs-alsa_mmap.patch +++ b/0021-qemu-cvs-alsa_mmap.patch @@ -1,7 +1,7 @@ From 8b67814c8ab4645ddd43664b1092e78ea6a743d8 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 14 Apr 2009 16:24:15 +0200 -Subject: [PATCH 21/37] qemu-cvs-alsa_mmap +Subject: [PATCH 21/44] qemu-cvs-alsa_mmap Hack to prevent ALSA from using mmap() interface to simplify emulation. diff --git a/0022-qemu-cvs-gettimeofday.patch b/0022-qemu-cvs-gettimeofday.patch index 49042de7..6d128e74 100644 --- a/0022-qemu-cvs-gettimeofday.patch +++ b/0022-qemu-cvs-gettimeofday.patch @@ -1,7 +1,7 @@ From c0ce4deb6c2ac843e337b7252fbefc190d625ca5 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Tue, 14 Apr 2009 16:25:41 +0200 -Subject: [PATCH 22/37] qemu-cvs-gettimeofday +Subject: [PATCH 22/44] qemu-cvs-gettimeofday No clue what this is for. --- diff --git a/0023-qemu-cvs-ioctl_debug.patch b/0023-qemu-cvs-ioctl_debug.patch index edf47a2d..47eec797 100644 --- a/0023-qemu-cvs-ioctl_debug.patch +++ b/0023-qemu-cvs-ioctl_debug.patch @@ -1,7 +1,7 @@ From 6232258009a4735d7f4f53b5589e7ebd90a9885d Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 14 Apr 2009 16:26:33 +0200 -Subject: [PATCH 23/37] qemu-cvs-ioctl_debug +Subject: [PATCH 23/44] qemu-cvs-ioctl_debug Extends unsupported ioctl debug output. diff --git a/0024-qemu-cvs-ioctl_nodirection.patch b/0024-qemu-cvs-ioctl_nodirection.patch index f2ee3e54..855b1127 100644 --- a/0024-qemu-cvs-ioctl_nodirection.patch +++ b/0024-qemu-cvs-ioctl_nodirection.patch @@ -1,7 +1,7 @@ From 926d75fa4b4b5d95d4b0111e3e0af4d983a9d46b Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 14 Apr 2009 16:27:36 +0200 -Subject: [PATCH 24/37] qemu-cvs-ioctl_nodirection +Subject: [PATCH 24/44] qemu-cvs-ioctl_nodirection the direction given in the ioctl should be correct so we can assume the communication is uni-directional. The alsa developers did not like this diff --git a/0025-qemu-img-vmdk-scsi.patch b/0025-qemu-img-vmdk-scsi.patch index 9cd89fd1..6ce257b2 100644 --- a/0025-qemu-img-vmdk-scsi.patch +++ b/0025-qemu-img-vmdk-scsi.patch @@ -1,7 +1,7 @@ From 90b3180677c5615bafc9a1f8252fbc4af1dc1ae4 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Tue, 14 Apr 2009 16:37:42 +0200 -Subject: [PATCH 25/37] qemu-img-vmdk-scsi +Subject: [PATCH 25/44] qemu-img-vmdk-scsi Support creation of SCSI VMDK images in qemu-img. diff --git a/0026-qemu-nonvoid_return.patch b/0026-qemu-nonvoid_return.patch index 0061ea4c..19acf463 100644 --- a/0026-qemu-nonvoid_return.patch +++ b/0026-qemu-nonvoid_return.patch @@ -1,7 +1,7 @@ From 7e6479e0d45e45e888cb79759fd44d6c14be19f4 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Tue, 14 Apr 2009 16:38:20 +0200 -Subject: [PATCH 26/37] qemu-nonvoid_return +Subject: [PATCH 26/44] qemu-nonvoid_return Squelches GCC warnings about undefined return values. diff --git a/0027-fix-mipsn32-linux-user-builds.patch b/0027-fix-mipsn32-linux-user-builds.patch index 33ca6f59..8b6f1696 100644 --- a/0027-fix-mipsn32-linux-user-builds.patch +++ b/0027-fix-mipsn32-linux-user-builds.patch @@ -1,7 +1,7 @@ From 164cf539481164978d9fa6ad69eb20cda7dc0e12 Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Wed, 25 Aug 2010 14:23:43 +0200 -Subject: [PATCH 27/37] fix mipsn32*-linux-user builds +Subject: [PATCH 27/44] fix mipsn32*-linux-user builds Signed-off-by: Ulrich Hecht --- diff --git a/0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch b/0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch index d69b39f1..0a30937a 100644 --- a/0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch +++ b/0028-Integrating-Dynamips-and-GNS3-UDP-tunnels-Patches.patch @@ -1,7 +1,7 @@ From 15d6a32b38abc6c2f8143ebccfcdd05d204f0fcd Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 8 Oct 2011 07:31:33 +0000 -Subject: [PATCH 28/37] Integrating Dynamips and GNS3 UDP tunnels (Patches) +Subject: [PATCH 28/44] Integrating Dynamips and GNS3 UDP tunnels (Patches) On 10/07/11 10:35, Jan Kiszka wrote: > diff --git a/0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch b/0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch index 525a18b1..3b0b07f5 100644 --- a/0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch +++ b/0029-linux-user-add-binfmt-wrapper-for-argv-0-handling.patch @@ -1,7 +1,7 @@ From 47ff084e9af71b217e6f842f720d12fe9e12f2fd Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 30 Sep 2011 19:40:36 +0200 -Subject: [PATCH 29/37] linux-user: add binfmt wrapper for argv[0] handling +Subject: [PATCH 29/44] linux-user: add binfmt wrapper for argv[0] handling When using qemu's linux-user binaries through binfmt, argv[0] gets lost along the execution because qemu only gets passed in the full file name diff --git a/0030-linux-user-Ignore-timer_create-syscall.patch b/0030-linux-user-Ignore-timer_create-syscall.patch index 2aa13526..b977520b 100644 --- a/0030-linux-user-Ignore-timer_create-syscall.patch +++ b/0030-linux-user-Ignore-timer_create-syscall.patch @@ -1,7 +1,7 @@ From 269d801698bf7640dd325cfb4b195c4a207a07ee Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sun, 11 Dec 2011 01:19:24 +0100 -Subject: [PATCH 30/37] linux-user: Ignore timer_create syscall +Subject: [PATCH 30/44] linux-user: Ignore timer_create syscall We don't implement the timer_create syscall, but shouting out loud about it breaks some %check tests in OBS, so better ignore it silently. diff --git a/0031-linux-user-be-silent-about-capget-failures.patch b/0031-linux-user-be-silent-about-capget-failures.patch index a357e649..4b11fc90 100644 --- a/0031-linux-user-be-silent-about-capget-failures.patch +++ b/0031-linux-user-be-silent-about-capget-failures.patch @@ -1,7 +1,7 @@ From 36f403e159ecb5fcaeda5346c2df762cc904a91b Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Sun, 11 Dec 2011 01:21:51 +0100 -Subject: [PATCH 31/37] linux-user: be silent about capget failures +Subject: [PATCH 31/44] linux-user: be silent about capget failures Complaining about capget doesn't buy us anything, but makes %check fail in certain builds. So better not complain about its missing diff --git a/0032-PPC-Fix-linker-scripts-on-ppc-hosts.patch b/0032-PPC-Fix-linker-scripts-on-ppc-hosts.patch index a6d84f35..91eea497 100644 --- a/0032-PPC-Fix-linker-scripts-on-ppc-hosts.patch +++ b/0032-PPC-Fix-linker-scripts-on-ppc-hosts.patch @@ -1,7 +1,7 @@ From 4fddaa4befeb3ddb1c14d9b2c882474ba4166940 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 12 Dec 2011 23:16:43 +0100 -Subject: [PATCH 32/37] PPC: Fix linker scripts on ppc hosts +Subject: [PATCH 32/44] PPC: Fix linker scripts on ppc hosts When compiling qemu statically with multilib on PPC, we hit the same issue that commit 845f2c2812d9ed24b36c02a3d06ee83aeafe8b49 diff --git a/0033-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch b/0033-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch index ce69360d..ce1e3c59 100644 --- a/0033-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch +++ b/0033-linux-user-reserve-4GB-of-vmem-for-32-on-64.patch @@ -1,7 +1,7 @@ From ac233b323ad7e498c665e8c74df7e44de4a542c0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 14 Dec 2011 00:33:28 +0100 -Subject: [PATCH 33/37] linux-user: reserve 4GB of vmem for 32-on-64 +Subject: [PATCH 33/44] linux-user: reserve 4GB of vmem for 32-on-64 When running 32-on-64 bit guests, we should always reserve as much virtual memory as we possibly can for the guest process, so it can diff --git a/0034-PPC-KVM-Disable-mmu-notifier-check.patch b/0034-PPC-KVM-Disable-mmu-notifier-check.patch index 6fa98b77..41a5ac57 100644 --- a/0034-PPC-KVM-Disable-mmu-notifier-check.patch +++ b/0034-PPC-KVM-Disable-mmu-notifier-check.patch @@ -1,7 +1,7 @@ From 96ac7aa8753cb2d79121c5a579a6e93160428a40 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 6 Jan 2012 01:05:55 +0100 -Subject: [PATCH 34/37] PPC: KVM: Disable mmu notifier check +Subject: [PATCH 34/44] PPC: KVM: Disable mmu notifier check When using hugetlbfs (which is required for HV mode KVM on 970), we check for MMU notifiers that on 970 can not be implemented properly. diff --git a/0035-linux-user-improve-fake-proc-self-stat-making-ps.patch b/0035-linux-user-improve-fake-proc-self-stat-making-ps.patch index a4ea4dac..d787ded7 100644 --- a/0035-linux-user-improve-fake-proc-self-stat-making-ps.patch +++ b/0035-linux-user-improve-fake-proc-self-stat-making-ps.patch @@ -1,7 +1,7 @@ From 872ebeaa24ed1c4b0c1596a7ad37f2bf2275efb0 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 3 Jan 2012 09:38:34 +0000 -Subject: [PATCH 35/37] linux-user: improve fake /proc/self/stat making `ps` not segfault. +Subject: [PATCH 35/44] linux-user: improve fake /proc/self/stat making `ps` not segfault. With the current fake /proc/self/stat implementation `ps` is segfaulting because it expects to read PID and argv[0] as first and diff --git a/0036-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch b/0036-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch index 79a19059..b0ca2eaa 100644 --- a/0036-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch +++ b/0036-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch @@ -1,7 +1,7 @@ From 7dc45b21c5ef8a9445463f8d3754e502621192a7 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 3 Jan 2012 09:38:35 +0000 -Subject: [PATCH 36/37] linux-user: target_argv is placed on ts->bprm->argv and can't be freed() +Subject: [PATCH 36/44] linux-user: target_argv is placed on ts->bprm->argv and can't be freed() TaskState contains linux_bprm struct which encapsulates argv among other things. diff --git a/0037-PPC-KVM-Ignore-SET_ONE_REG-failures.patch b/0037-PPC-KVM-Ignore-SET_ONE_REG-failures.patch index 2b66055a..ea6404df 100644 --- a/0037-PPC-KVM-Ignore-SET_ONE_REG-failures.patch +++ b/0037-PPC-KVM-Ignore-SET_ONE_REG-failures.patch @@ -1,7 +1,7 @@ From 0d04677df6aabf7404c7bbe454d7be973a773bb0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 10 Jan 2012 16:25:27 +0100 -Subject: [PATCH 37/37] PPC: KVM: Ignore SET_ONE_REG failures +Subject: [PATCH 37/44] PPC: KVM: Ignore SET_ONE_REG failures The SET_ONE_REG interface didn't make it upstream in the form that is used in qemu-1.0, so the code won't work. Make the error a warning, so we can diff --git a/0038-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch b/0038-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch new file mode 100644 index 00000000..f2c4c653 --- /dev/null +++ b/0038-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch @@ -0,0 +1,29 @@ +From 9ef61f2a197f9dbae104fc1d18634c29d91b4a4e Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 10 Jan 2012 17:03:02 +0100 +Subject: [PATCH 38/44] PPC: KVM: Ignore ENABLE_PAPR to support very old HV KVM kernels + +Very old kernels (3.1) didn't expose the PAPR capability yet, but still +did work with HV KVM. Make the error a warning so we can work on them. + +Signed-off-by: Alexander Graf +--- + target-ppc/kvm.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c +index a03e99c..923677c 100644 +--- a/target-ppc/kvm.c ++++ b/target-ppc/kvm.c +@@ -745,7 +745,7 @@ void kvmppc_set_papr(CPUState *env) + ret = kvm_vcpu_ioctl(env, KVM_ENABLE_CAP, &cap); + + if (ret) { +- goto fail; ++ fprintf(stderr, "You're running a very old kernel. Expect breakage!\n"); + } + + /* +-- +1.6.0.2 + diff --git a/0039-console-Fix-segfault-on-screendump-without-VGA-adap.patch b/0039-console-Fix-segfault-on-screendump-without-VGA-adap.patch new file mode 100644 index 00000000..04674fbc --- /dev/null +++ b/0039-console-Fix-segfault-on-screendump-without-VGA-adap.patch @@ -0,0 +1,39 @@ +From 2b0fc5def570362c27ce526b8a08529a6ae22362 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Fri, 18 Nov 2011 16:41:59 +0100 +Subject: [PATCH 39/44] console: Fix segfault on screendump without VGA adapter + +When trying to create a screen dump without having any VGA adapter +inside the guest, QEMU segfaults. + +This is because it's trying to switch back to the "previous" screen +it was on before dumping the VGA screen. Unfortunately, in my case +there simply is no previous screen so it accesses a NULL pointer. + +Fix it by checking if previous_active_console is actually available. + +This is 1.0 material. + +Signed-off-by: Alexander Graf +--- + console.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/console.c b/console.c +index f6fe441..ed6a653 100644 +--- a/console.c ++++ b/console.c +@@ -186,7 +186,9 @@ void vga_hw_screen_dump(const char *filename) + consoles[0]->hw_screen_dump(consoles[0]->hw, filename); + } + +- console_select(previous_active_console->index); ++ if (previous_active_console) { ++ console_select(previous_active_console->index); ++ } + } + + void vga_hw_text_update(console_ch_t *chardata) +-- +1.6.0.2 + diff --git a/0040-pseries-Fix-array-overrun-bug-in-PCI-code.patch b/0040-pseries-Fix-array-overrun-bug-in-PCI-code.patch new file mode 100644 index 00000000..8a98d2c4 --- /dev/null +++ b/0040-pseries-Fix-array-overrun-bug-in-PCI-code.patch @@ -0,0 +1,33 @@ +From 632e46dfa29a19ba656a5580b610fda0003cf3b0 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Mon, 28 Nov 2011 20:21:39 +0000 +Subject: [PATCH 40/44] pseries: Fix array overrun bug in PCI code + +spapr_populate_pci_devices() containd a loop with PCI_NUM_REGIONS (7) +iterations. However this overruns the 'bars' global array, which only has +6 elements. In fact we only want to run this loop for things listed in the +bars array, so this patch corrects the loop bounds to reflect that. + +Signed-off-by: David Gibson +Signed-off-by: Alexander Graf +(cherry picked from commit 135712de61dfa22368e98914d65b8b0860ec8505) +--- + hw/spapr_pci.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/hw/spapr_pci.c b/hw/spapr_pci.c +index 7162588..9b6a032 100644 +--- a/hw/spapr_pci.c ++++ b/hw/spapr_pci.c +@@ -454,7 +454,7 @@ int spapr_populate_pci_devices(sPAPRPHBState *phb, + reg[0].size = 0; + + n = 0; +- for (i = 0; i < PCI_NUM_REGIONS; ++i) { ++ for (i = 0; i < ARRAY_SIZE(bars); ++i) { + if (0 == dev->io_regions[i].size) { + continue; + } +-- +1.6.0.2 + diff --git a/0041-kvm-ppc-halt-secondary-cpus-when-guest-reset.patch b/0041-kvm-ppc-halt-secondary-cpus-when-guest-reset.patch new file mode 100644 index 00000000..e276a23d --- /dev/null +++ b/0041-kvm-ppc-halt-secondary-cpus-when-guest-reset.patch @@ -0,0 +1,45 @@ +From 0ae672e84c7f722aebdcca35f1573e7b6f83fddd Mon Sep 17 00:00:00 2001 +From: Liu Yu-B13201 +Date: Mon, 28 Nov 2011 20:41:18 +0000 +Subject: [PATCH 41/44] kvm-ppc: halt secondary cpus when guest reset + +When guest reset, we need to halt secondary cpus until guest kick them. +This already works for tcg. The patch add the support for kvm. + +Signed-off-by: Liu Yu +Signed-off-by: Alexander Graf +[agraf: remove in-kernel irqchip code] +(cherry picked from commit 157feeadbaec09fe4dca539a24f6f6d327d6eeb6) +--- + hw/ppce500_spin.c | 1 + + target-ppc/kvm.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/hw/ppce500_spin.c b/hw/ppce500_spin.c +index cccd940..2b52728 100644 +--- a/hw/ppce500_spin.c ++++ b/hw/ppce500_spin.c +@@ -112,6 +112,7 @@ static void spin_kick(void *data) + + env->halted = 0; + env->exception_index = -1; ++ env->stopped = 0; + qemu_cpu_kick(env); + } + +diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c +index 923677c..9541626 100644 +--- a/target-ppc/kvm.c ++++ b/target-ppc/kvm.c +@@ -504,7 +504,7 @@ void kvm_arch_post_run(CPUState *env, struct kvm_run *run) + + int kvm_arch_process_async_events(CPUState *env) + { +- return 0; ++ return env->halted; + } + + static int kvmppc_handle_halt(CPUState *env) +-- +1.6.0.2 + diff --git a/0042-pseries-Emit-device-tree-nodes-in-reg-order.patch b/0042-pseries-Emit-device-tree-nodes-in-reg-order.patch new file mode 100644 index 00000000..1bdae985 --- /dev/null +++ b/0042-pseries-Emit-device-tree-nodes-in-reg-order.patch @@ -0,0 +1,101 @@ +From 7fe6b9bf81290f708919ffb6065daa16e5dbe7e3 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Mon, 12 Dec 2011 18:24:32 +0000 +Subject: [PATCH 42/44] pseries: Emit device tree nodes in reg order + +Although in theory the device tree has no inherent ordering, in practice +the order of nodes in the device tree does effect the order that devices +are detected by software. + +Currently the ordering is determined by the order the devices appear on +the QEMU command line. Although that does give the user control over the +ordering, it is fragile, especially when the user does not generate the +command line manually - eg. when using libvirt etc. + +So order the device tree based on the reg value, ie. the address of on +the VIO bus of the devices. This gives us a sane and stable ordering. + +Signed-off-by: Michael Ellerman +Signed-off-by: David Gibson +Signed-off-by: Alexander Graf + +[agraf] add braces +(cherry picked from commit 05c194384f836240ea4c2da5fa3be43a54bff021) +--- + hw/spapr_vio.c | 50 +++++++++++++++++++++++++++++++++++++++++++++----- + 1 files changed, 45 insertions(+), 5 deletions(-) + +diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c +index 2dcc036..8bd00ca 100644 +--- a/hw/spapr_vio.c ++++ b/hw/spapr_vio.c +@@ -749,21 +749,61 @@ static void spapr_vio_register_devices(void) + device_init(spapr_vio_register_devices) + + #ifdef CONFIG_FDT ++static int compare_reg(const void *p1, const void *p2) ++{ ++ VIOsPAPRDevice const *dev1, *dev2; ++ ++ dev1 = (VIOsPAPRDevice *)*(DeviceState **)p1; ++ dev2 = (VIOsPAPRDevice *)*(DeviceState **)p2; ++ ++ if (dev1->reg < dev2->reg) { ++ return -1; ++ } ++ if (dev1->reg == dev2->reg) { ++ return 0; ++ } ++ ++ /* dev1->reg > dev2->reg */ ++ return 1; ++} ++ + int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt) + { +- DeviceState *qdev; +- int ret = 0; ++ DeviceState *qdev, **qdevs; ++ int i, num, ret = 0; + ++ /* Count qdevs on the bus list */ ++ num = 0; + QTAILQ_FOREACH(qdev, &bus->bus.children, sibling) { +- VIOsPAPRDevice *dev = (VIOsPAPRDevice *)qdev; ++ num++; ++ } ++ ++ /* Copy out into an array of pointers */ ++ qdevs = g_malloc(sizeof(qdev) * num); ++ num = 0; ++ QTAILQ_FOREACH(qdev, &bus->bus.children, sibling) { ++ qdevs[num++] = qdev; ++ } ++ ++ /* Sort the array */ ++ qsort(qdevs, num, sizeof(qdev), compare_reg); ++ ++ /* Hack alert. Give the devices to libfdt in reverse order, we happen ++ * to know that will mean they are in forward order in the tree. */ ++ for (i = num - 1; i >= 0; i--) { ++ VIOsPAPRDevice *dev = (VIOsPAPRDevice *)(qdevs[i]); + + ret = vio_make_devnode(dev, fdt); + + if (ret < 0) { +- return ret; ++ goto out; + } + } + +- return 0; ++ ret = 0; ++out: ++ free(qdevs); ++ ++ return ret; + } + #endif /* CONFIG_FDT */ +-- +1.6.0.2 + diff --git a/0043-pseries-Add-a-routine-to-find-a-stable-default-vt.patch b/0043-pseries-Add-a-routine-to-find-a-stable-default-vt.patch new file mode 100644 index 00000000..41c714b5 --- /dev/null +++ b/0043-pseries-Add-a-routine-to-find-a-stable-default-vt.patch @@ -0,0 +1,97 @@ +From 2f5760ec14a8f595c347f8a6ad2f8b6adfc20bc2 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Mon, 12 Dec 2011 18:24:33 +0000 +Subject: [PATCH 43/44] pseries: Add a routine to find a stable "default" vty and use it + +In vty_lookup() we have a special case for supporting early debug in +the kernel. This accepts reg == 0 as a special case to mean "any vty". + +We implement this by searching the vtys on the bus and returning the +first we find. This means that the vty we chose depends on the order +the vtys are specified on the QEMU command line - because that determines +the order of the vtys on the bus. + +We'd rather the command line order was irrelevant, so instead return +the vty with the lowest reg value. This is still a guess as to what the +user really means, but it is at least stable WRT command line ordering. + +Signed-off-by: Michael Ellerman +Signed-off-by: David Gibson +Signed-off-by: Alexander Graf + +[agraf] fix braces +(cherry picked from commit 98331f8ad6a3e2cfbb402d72e6be47eac7706251) +--- + hw/spapr_vty.c | 47 ++++++++++++++++++++++++++++++++++++++--------- + 1 files changed, 38 insertions(+), 9 deletions(-) + +diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c +index f23cc36..e2fec58 100644 +--- a/hw/spapr_vty.c ++++ b/hw/spapr_vty.c +@@ -156,24 +156,53 @@ static VIOsPAPRDeviceInfo spapr_vty = { + }, + }; + ++static VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus) ++{ ++ VIOsPAPRDevice *sdev, *selected; ++ DeviceState *iter; ++ ++ /* ++ * To avoid the console bouncing around we want one VTY to be ++ * the "default". We haven't really got anything to go on, so ++ * arbitrarily choose the one with the lowest reg value. ++ */ ++ ++ selected = NULL; ++ QTAILQ_FOREACH(iter, &bus->bus.children, sibling) { ++ /* Only look at VTY devices */ ++ if (iter->info != &spapr_vty.qdev) { ++ continue; ++ } ++ ++ sdev = DO_UPCAST(VIOsPAPRDevice, qdev, iter); ++ ++ /* First VTY we've found, so it is selected for now */ ++ if (!selected) { ++ selected = sdev; ++ continue; ++ } ++ ++ /* Choose VTY with lowest reg value */ ++ if (sdev->reg < selected->reg) { ++ selected = sdev; ++ } ++ } ++ ++ return selected; ++} ++ + static VIOsPAPRDevice *vty_lookup(sPAPREnvironment *spapr, target_ulong reg) + { + VIOsPAPRDevice *sdev; + + sdev = spapr_vio_find_by_reg(spapr->vio_bus, reg); + if (!sdev && reg == 0) { +- DeviceState *qdev; +- + /* Hack for kernel early debug, which always specifies reg==0. +- * We search all VIO devices, and grab the first available vty +- * device. This attempts to mimic existing PowerVM behaviour ++ * We search all VIO devices, and grab the vty with the lowest ++ * reg. This attempts to mimic existing PowerVM behaviour + * (early debug does work there, despite having no vty with + * reg==0. */ +- QTAILQ_FOREACH(qdev, &spapr->vio_bus->bus.children, sibling) { +- if (qdev->info == &spapr_vty.qdev) { +- return DO_UPCAST(VIOsPAPRDevice, qdev, qdev); +- } +- } ++ return spapr_vty_get_default(spapr->vio_bus); + } + + return sdev; +-- +1.6.0.2 + diff --git a/0044-pseries-Populate-chosen-linux-stdout-path-in-the.patch b/0044-pseries-Populate-chosen-linux-stdout-path-in-the.patch new file mode 100644 index 00000000..cc5ba372 --- /dev/null +++ b/0044-pseries-Populate-chosen-linux-stdout-path-in-the.patch @@ -0,0 +1,119 @@ +From cdec03dc7bb33b4ebf5bd286338e5c50be77a055 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Tue, 13 Dec 2011 15:24:34 +1100 +Subject: [PATCH 44/44] pseries: Populate "/chosen/linux,stdout-path" in the FDT + +There is a device tree property "/chosen/linux,stdout-path" which indicates +which device should be used as stdout - ie. "the console". + +Currently we don't specify anything, which means both firmware and Linux +choose something arbitrarily. Use the routine we added in the last patch +to pick a default vty and specify it as stdout. + +Currently SLOF doesn't use the property, but we are hoping to update it +to do so. + +Signed-off-by: Michael Ellerman +Signed-off-by: David Gibson +Signed-off-by: Alexander Graf +(cherry picked from commit 68f3a94c64bbaaf8c7f2daa70de1b5d87a432f86) +--- + hw/spapr.c | 2 ++ + hw/spapr_vio.c | 34 ++++++++++++++++++++++++++++++++++ + hw/spapr_vio.h | 3 +++ + hw/spapr_vty.c | 2 +- + 4 files changed, 40 insertions(+), 1 deletions(-) + +diff --git a/hw/spapr.c b/hw/spapr.c +index 2b901f1..5a98d86 100644 +--- a/hw/spapr.c ++++ b/hw/spapr.c +@@ -351,6 +351,8 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, + fprintf(stderr, "Couldn't set up RTAS device tree properties\n"); + } + ++ spapr_populate_chosen_stdout(fdt, spapr->vio_bus); ++ + _FDT((fdt_pack(fdt))); + + cpu_physical_memory_write(fdt_addr, fdt, fdt_totalsize(fdt)); +diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c +index 8bd00ca..464fe87 100644 +--- a/hw/spapr_vio.c ++++ b/hw/spapr_vio.c +@@ -806,4 +806,38 @@ out: + + return ret; + } ++ ++int spapr_populate_chosen_stdout(void *fdt, VIOsPAPRBus *bus) ++{ ++ VIOsPAPRDevice *dev; ++ char *name, *path; ++ int ret, offset; ++ ++ dev = spapr_vty_get_default(bus); ++ if (!dev) ++ return 0; ++ ++ offset = fdt_path_offset(fdt, "/chosen"); ++ if (offset < 0) { ++ return offset; ++ } ++ ++ name = vio_format_dev_name(dev); ++ if (!name) { ++ return -ENOMEM; ++ } ++ ++ if (asprintf(&path, "/vdevice/%s", name) < 0) { ++ path = NULL; ++ ret = -ENOMEM; ++ goto out; ++ } ++ ++ ret = fdt_setprop_string(fdt, offset, "linux,stdout-path", path); ++out: ++ free(name); ++ free(path); ++ ++ return ret; ++} + #endif /* CONFIG_FDT */ +diff --git a/hw/spapr_vio.h b/hw/spapr_vio.h +index a325a5f..9fcd304 100644 +--- a/hw/spapr_vio.h ++++ b/hw/spapr_vio.h +@@ -83,6 +83,7 @@ extern VIOsPAPRBus *spapr_vio_bus_init(void); + extern VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg); + extern void spapr_vio_bus_register_withprop(VIOsPAPRDeviceInfo *info); + extern int spapr_populate_vdevice(VIOsPAPRBus *bus, void *fdt); ++extern int spapr_populate_chosen_stdout(void *fdt, VIOsPAPRBus *bus); + + extern int spapr_vio_signal(VIOsPAPRDevice *dev, target_ulong mode); + +@@ -108,6 +109,8 @@ void spapr_vty_create(VIOsPAPRBus *bus, uint32_t reg, CharDriverState *chardev); + void spapr_vlan_create(VIOsPAPRBus *bus, uint32_t reg, NICInfo *nd); + void spapr_vscsi_create(VIOsPAPRBus *bus, uint32_t reg); + ++VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus); ++ + int spapr_tce_set_bypass(uint32_t unit, uint32_t enable); + void spapr_vio_quiesce(void); + +diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c +index e2fec58..386ccf7 100644 +--- a/hw/spapr_vty.c ++++ b/hw/spapr_vty.c +@@ -156,7 +156,7 @@ static VIOsPAPRDeviceInfo spapr_vty = { + }, + }; + +-static VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus) ++VIOsPAPRDevice *spapr_vty_get_default(VIOsPAPRBus *bus) + { + VIOsPAPRDevice *sdev, *selected; + DeviceState *iter; +-- +1.6.0.2 + diff --git a/qemu.changes b/qemu.changes index 5515dd5a..94f74f99 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jan 10 16:08:35 UTC 2012 - agraf@suse.de + +- backport all ppc-1.0 stable patches to our package +- add fix for PPC HV KVM on 3.1 + ------------------------------------------------------------------- Tue Jan 10 15:26:21 UTC 2012 - agraf@suse.de diff --git a/qemu.spec b/qemu.spec index 02683a50..b98b9cfb 100644 --- a/qemu.spec +++ b/qemu.spec @@ -63,6 +63,13 @@ Patch0034: 0034-PPC-KVM-Disable-mmu-notifier-check.patch Patch0035: 0035-linux-user-improve-fake-proc-self-stat-making-ps.patch Patch0036: 0036-linux-user-target_argv-is-placed-on-ts-bprm-argv.patch Patch0037: 0037-PPC-KVM-Ignore-SET_ONE_REG-failures.patch +Patch0038: 0038-PPC-KVM-Ignore-ENABLE_PAPR-to-support-very-old-HV.patch +Patch0039: 0039-console-Fix-segfault-on-screendump-without-VGA-adap.patch +Patch0040: 0040-pseries-Fix-array-overrun-bug-in-PCI-code.patch +Patch0041: 0041-kvm-ppc-halt-secondary-cpus-when-guest-reset.patch +Patch0042: 0042-pseries-Emit-device-tree-nodes-in-reg-order.patch +Patch0043: 0043-pseries-Add-a-routine-to-find-a-stable-default-vt.patch +Patch0044: 0044-pseries-Populate-chosen-linux-stdout-path-in-the.patch # this is to make lint happy Source300: rpmlintrc BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -159,6 +166,13 @@ run cross architectures builds %patch0035 -p1 %patch0036 -p1 %patch0037 -p1 +%patch0038 -p1 +%patch0039 -p1 +%patch0040 -p1 +%patch0041 -p1 +%patch0042 -p1 +%patch0043 -p1 +%patch0044 -p1 %build # build QEMU