All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes
@ 2014-03-28 12:13 Michael S. Tsirkin
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 1/3] Detect pthread_setname_np at configure time Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-03-28 12:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori

The following changes since commit 7f6613cedc59fa849105668ae971dc31004bca1c:

  target-mips: fix MTHC1 and MFHC1 when FPU in FR=0 mode (2014-03-25 23:36:35 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to b89834f4d79070a26536cb73fe5216a2364551eb:

  acpi: fix ACPI generation for pci bridges (2014-03-28 13:59:48 +0200)

----------------------------------------------------------------
acpi,pc,build bug fixes

Here are some bugfixes for 2.0.

A bugfix for acpi for pci bridges, and a build fix for
old systems without pthread_setname_np: both fix regressions
so we definitely want to include them.
HPET fix is not for a regression but looks very safe,
fixes a nasty bug and has been on list for a while.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Amos Kong (1):
      virtio-net: add vlan receive state to RxFilterInfo

Dr. David Alan Gilbert (1):
      Detect pthread_setname_np at configure time

Marcel Apfelbaum (1):
      acpi: fix ACPI generation for pci bridges

Matt Lupfer (1):
      Don't enable a HPET timer if HPET is disabled

Michael S. Tsirkin (2):
      acpi: make SSDT 1.0 spec compliant when possible
      Revert "acpi-test: rebuild SSDT"

Stefan Fritsch (1):
      virtio-net: Do not filter VLANs without F_CTRL_VLAN

 configure                     |  28 ++++++++++++++++++++++++
 qapi-schema.json              |   3 +++
 hw/i386/acpi-build.c          |  20 ++++++++++++++----
 hw/net/virtio-net.c           |  48 ++++++++++++++++++++++++++++++------------
 hw/timer/hpet.c               |   3 ++-
 util/qemu-thread-posix.c      |  21 +++++++++++++++---
 util/qemu-thread-win32.c      |   2 ++
 qmp-commands.hx               |   2 ++
 tests/acpi-test-data/pc/SSDT  | Bin 2261 -> 2261 bytes
 tests/acpi-test-data/q35/SSDT | Bin 550 -> 550 bytes
 10 files changed, 106 insertions(+), 21 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL for-2.0 1/3] Detect pthread_setname_np at configure time
  2014-03-28 12:13 [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Michael S. Tsirkin
@ 2014-03-28 12:13 ` Michael S. Tsirkin
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 2/3] Don't enable a HPET timer if HPET is disabled Michael S. Tsirkin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-03-28 12:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Dr. David Alan Gilbert, Anthony Liguori

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Warn if no way of setting thread name is available.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 configure                | 28 ++++++++++++++++++++++++++++
 util/qemu-thread-posix.c | 21 ++++++++++++++++++---
 util/qemu-thread-win32.c |  2 ++
 3 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index aae617e..01e637f 100755
--- a/configure
+++ b/configure
@@ -2696,6 +2696,24 @@ if test "$mingw32" != yes -a "$pthread" = no; then
       "Make sure to have the pthread libs and headers installed."
 fi
 
+# check for pthread_setname_np
+pthread_setname_np=no
+cat > $TMPC << EOF
+#include <pthread.h>
+
+static void *f(void *p) { return NULL; }
+int main(void)
+{
+    pthread_t thread;
+    pthread_create(&thread, 0, f, 0);
+    pthread_setname_np(thread, "QEMU");
+    return 0;
+}
+EOF
+if compile_prog "" "$pthread_lib" ; then
+  pthread_setname_np=yes
+fi
+
 ##########################################
 # rbd probe
 if test "$rbd" != "no" ; then
@@ -4628,6 +4646,16 @@ if test "$rdma" = "yes" ; then
   echo "CONFIG_RDMA=y" >> $config_host_mak
 fi
 
+# Hold two types of flag:
+#   CONFIG_THREAD_SETNAME_BYTHREAD  - we've got a way of setting the name on
+#                                     a thread we have a handle to
+#   CONFIG_PTHREAD_SETNAME_NP       - A way of doing it on a particular
+#                                     platform
+if test "$pthread_setname_np" = "yes" ; then
+  echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak
+  echo "CONFIG_PTHREAD_SETNAME_NP=y" >> $config_host_mak
+fi
+
 if test "$tcg_interpreter" = "yes"; then
   QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
 elif test "$ARCH" = "sparc64" ; then
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index 960d7f5..d05a649 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -32,6 +32,13 @@ static bool name_threads;
 void qemu_thread_naming(bool enable)
 {
     name_threads = enable;
+
+#ifndef CONFIG_THREAD_SETNAME_BYTHREAD
+    /* This is a debugging option, not fatal */
+    if (enable) {
+        fprintf(stderr, "qemu: thread naming not supported on this host\n");
+    }
+#endif
 }
 
 static void error_exit(int err, const char *msg)
@@ -394,6 +401,16 @@ void qemu_event_wait(QemuEvent *ev)
     }
 }
 
+/* Attempt to set the threads name; note that this is for debug, so
+ * we're not going to fail if we can't set it.
+ */
+static void qemu_thread_set_name(QemuThread *thread, const char *name)
+{
+#ifdef CONFIG_PTHREAD_SETNAME_NP
+    pthread_setname_np(thread->thread, name);
+#endif
+}
+
 void qemu_thread_create(QemuThread *thread, const char *name,
                        void *(*start_routine)(void*),
                        void *arg, int mode)
@@ -420,11 +437,9 @@ void qemu_thread_create(QemuThread *thread, const char *name,
     if (err)
         error_exit(err, __func__);
 
-#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
     if (name_threads) {
-        pthread_setname_np(thread->thread, name);
+        qemu_thread_set_name(thread, name);
     }
-#endif
 
     pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index b9c957b..c405c9b 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -22,6 +22,8 @@ void qemu_thread_naming(bool enable)
 {
     /* But note we don't actually name them on Windows yet */
     name_threads = enable;
+
+    fprintf(stderr, "qemu: thread naming not supported on this host\n");
 }
 
 static void error_exit(int err, const char *msg)
-- 
MST

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL for-2.0 2/3] Don't enable a HPET timer if HPET is disabled
  2014-03-28 12:13 [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Michael S. Tsirkin
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 1/3] Detect pthread_setname_np at configure time Michael S. Tsirkin
@ 2014-03-28 12:13 ` Michael S. Tsirkin
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 3/3] acpi: fix ACPI generation for pci bridges Michael S. Tsirkin
  2014-03-28 14:54 ` [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-03-28 12:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Paolo Bonzini, Anthony Liguori, Matt Lupfer

From: Matt Lupfer <mlupfer@ddn.com>

A HPET timer can be started when HPET is not yet
enabled. This will not generate an interrupt
to the guest, but causes problems when HPET is later
enabled.

A timer that is created and expires at least once before
HPET is enabled will have an initialized comparator based
on a hpet_offset of 0 (uninitialized). When HPET is
enabled, hpet_set_timer() is called a second time, which
modifies the timer expiry to a time based on the
difference between current ticks (measured with the
newly initialized hpet_offset) and the timer's
comparator (which was generated before hpet_offset was
initialized). This results in a long period of no HPET
timer ticks.

When this occurs with a CentOS 5.x guest, the guest
may not receive timer interrupts during its narrow
timer check window and panic on boot.

Signed-off-by: Matt Lupfer <mlupfer@ddn.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/timer/hpet.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 1264dfd..e15d6bc 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -506,7 +506,8 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
                 timer->cmp = (uint32_t)timer->cmp;
                 timer->period = (uint32_t)timer->period;
             }
-            if (activating_bit(old_val, new_val, HPET_TN_ENABLE)) {
+            if (activating_bit(old_val, new_val, HPET_TN_ENABLE) &&
+                hpet_enabled(s)) {
                 hpet_set_timer(timer);
             } else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE)) {
                 hpet_del_timer(timer);
-- 
MST

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL for-2.0 3/3] acpi: fix ACPI generation for pci bridges
  2014-03-28 12:13 [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Michael S. Tsirkin
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 1/3] Detect pthread_setname_np at configure time Michael S. Tsirkin
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 2/3] Don't enable a HPET timer if HPET is disabled Michael S. Tsirkin
@ 2014-03-28 12:13 ` Michael S. Tsirkin
  2014-03-28 14:54 ` [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-03-28 12:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori, Marcel Apfelbaum

From: Marcel Apfelbaum <marcel.a@redhat.com>

Commit 8dcf525abc5dff785251a881f9764dd961065c0d
    acpi-build: append description for non-hotplug
appended description for all occupied non hotpluggable PCI slots.
However the bridge devices are already added to SSDT,
adding them again will create an incorrect SSDT table.

Fixed by skipping the pci bridge devices, marking them as 'system'.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 7597517..90ef95c 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -841,7 +841,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
         pc = PCI_DEVICE_GET_CLASS(pdev);
         dc = DEVICE_GET_CLASS(pdev);
 
-        if (pc->class_id == PCI_CLASS_BRIDGE_ISA) {
+        if (pc->class_id == PCI_CLASS_BRIDGE_ISA || pc->is_bridge) {
             set_bit(slot, slot_device_system);
         }
 
@@ -882,7 +882,7 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state)
             memcpy(pcihp, ACPI_PCIVGA_AML, ACPI_PCIVGA_SIZEOF);
             patch_pcivga(i, pcihp);
         } else if (system) {
-            /* Nothing to do: system devices are in DSDT. */
+            /* Nothing to do: system devices are in DSDT or in SSDT above. */
         } else if (present) {
             void *pcihp = acpi_data_push(bus_table,
                                          ACPI_PCINOHP_SIZEOF);
-- 
MST

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes
  2014-03-28 12:13 [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 3/3] acpi: fix ACPI generation for pci bridges Michael S. Tsirkin
@ 2014-03-28 14:54 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-03-28 14:54 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: QEMU Developers, Anthony Liguori

On 28 March 2014 12:13, Michael S. Tsirkin <mst@redhat.com> wrote:
> The following changes since commit 7f6613cedc59fa849105668ae971dc31004bca1c:
>
>   target-mips: fix MTHC1 and MFHC1 when FPU in FR=0 mode (2014-03-25 23:36:35 +0100)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to b89834f4d79070a26536cb73fe5216a2364551eb:
>
>   acpi: fix ACPI generation for pci bridges (2014-03-28 13:59:48 +0200)
>
Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-28 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-28 12:13 [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Michael S. Tsirkin
2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 1/3] Detect pthread_setname_np at configure time Michael S. Tsirkin
2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 2/3] Don't enable a HPET timer if HPET is disabled Michael S. Tsirkin
2014-03-28 12:13 ` [Qemu-devel] [PULL for-2.0 3/3] acpi: fix ACPI generation for pci bridges Michael S. Tsirkin
2014-03-28 14:54 ` [Qemu-devel] [PULL for-2.0 0/3] acpi,pc,build bug fixes Peter Maydell

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.