All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6
@ 2016-04-14 13:47 Michael S. Tsirkin
  2016-04-14 13:47 ` [Qemu-devel] [PULL 1/6] specs/vhost-user: improve VHOST_SET_VRING_NUM documentation Michael S. Tsirkin
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

The following changes since commit d44122ecd0fa62d20762bdd8f214f077cb8e011b:

  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-04-12 17:47:15 +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 01310e2aa7ad87f101d56feb8c06898084c9b542:

  hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE (2016-04-14 16:44:42 +0300)

----------------------------------------------------------------
tpm, vhost, virtio: fixes for 2.6

Minor fixes all over the place.

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

----------------------------------------------------------------
Igor Mammedov (2):
      pc: acpi: tpm: add missing MMIO resource to PCI0._CRS
      tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict

Marc-André Lureau (2):
      specs/vhost-user: improve VHOST_SET_VRING_NUM documentation
      specs/vhost-user: spelling fix

Stefan Berger (1):
      tpm: Fix write to file descriptor function

Thomas Huth (1):
      hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE

 hw/i386/acpi-build.c       | 12 +++++++++++-
 hw/tpm/tpm_passthrough.c   |  2 +-
 hw/virtio/virtio-balloon.c |  5 +++--
 docs/specs/vhost-user.txt  |  4 ++--
 4 files changed, 17 insertions(+), 6 deletions(-)

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

* [Qemu-devel] [PULL 1/6] specs/vhost-user: improve VHOST_SET_VRING_NUM documentation
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
@ 2016-04-14 13:47 ` Michael S. Tsirkin
  2016-04-14 13:48 ` [Qemu-devel] [PULL 2/6] specs/vhost-user: spelling fix Michael S. Tsirkin
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=,
	Yuanhan Liu, Changchun Ouyang, Nikolay Nikolaev

From: Marc-André Lureau <marcandre.lureau@redhat.com>

"number of vrings" doesn't help me understand the purpose of this
message. My understanding is that it is rather the size of the queue (in
modern terms).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 docs/specs/vhost-user.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
index 0312d40..4778241 100644
--- a/docs/specs/vhost-user.txt
+++ b/docs/specs/vhost-user.txt
@@ -364,7 +364,7 @@ Message types
       Equivalent ioctl: VHOST_SET_VRING_NUM
       Master payload: vring state description
 
-      Sets the number of vrings for this owner.
+      Set the size of the queue.
 
  * VHOST_USER_SET_VRING_ADDR
 
-- 
MST

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

* [Qemu-devel] [PULL 2/6] specs/vhost-user: spelling fix
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
  2016-04-14 13:47 ` [Qemu-devel] [PULL 1/6] specs/vhost-user: improve VHOST_SET_VRING_NUM documentation Michael S. Tsirkin
@ 2016-04-14 13:48 ` Michael S. Tsirkin
  2016-04-14 13:48 ` [Qemu-devel] [PULL 3/6] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS Michael S. Tsirkin
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=,
	Yuanhan Liu, Changchun Ouyang, Nikolay Nikolaev

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 docs/specs/vhost-user.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
index 4778241..777c49c 100644
--- a/docs/specs/vhost-user.txt
+++ b/docs/specs/vhost-user.txt
@@ -438,7 +438,7 @@ Message types
       Slave payload: u64
 
       Query how many queues the backend supports. This request should be
-      sent only when VHOST_USER_PROTOCOL_F_MQ is set in quried protocol
+      sent only when VHOST_USER_PROTOCOL_F_MQ is set in queried protocol
       features by VHOST_USER_GET_PROTOCOL_FEATURES.
 
  * VHOST_USER_SET_VRING_ENABLE
-- 
MST

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

* [Qemu-devel] [PULL 3/6] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
  2016-04-14 13:47 ` [Qemu-devel] [PULL 1/6] specs/vhost-user: improve VHOST_SET_VRING_NUM documentation Michael S. Tsirkin
  2016-04-14 13:48 ` [Qemu-devel] [PULL 2/6] specs/vhost-user: spelling fix Michael S. Tsirkin
@ 2016-04-14 13:48 ` Michael S. Tsirkin
  2016-04-14 13:48 ` [Qemu-devel] [PULL 4/6] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict Michael S. Tsirkin
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mammedov, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost

From: Igor Mammedov <imammedo@redhat.com>

Windows will fail initialize TMP driver with the reason:
  'device cannot find enough free resources'
That happens because parent BUS doesn't describe
MMIO resources used by TPM child device.
Fix it by describing it in top-most parent bus scope PCI0.

It was 'regressed' by commit
  5cb18b3d TPM2 ACPI table support
with following fixup
  9e472263 acpi: add missing ssdt
which did the right thing by moving TPM to BUS
it belongs to but lacked a proper resource declaration.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 35180ef..784870e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2167,6 +2167,11 @@ build_dsdt(GArray *table_data, GArray *linker,
                              0, pci->w64.begin, pci->w64.end - 1, 0,
                              pci->w64.end - pci->w64.begin));
     }
+
+    if (misc->tpm_version != TPM_VERSION_UNSPEC) {
+        aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE,
+                   TPM_TIS_ADDR_SIZE, AML_READ_WRITE));
+    }
     aml_append(scope, aml_name_decl("_CRS", crs));
 
     /* reserve GPE0 block resources */
-- 
MST

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

* [Qemu-devel] [PULL 4/6] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2016-04-14 13:48 ` [Qemu-devel] [PULL 3/6] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS Michael S. Tsirkin
@ 2016-04-14 13:48 ` Michael S. Tsirkin
  2016-04-14 13:48 ` [Qemu-devel] [PULL 5/6] tpm: Fix write to file descriptor function Michael S. Tsirkin
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Igor Mammedov, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost

From: Igor Mammedov <imammedo@redhat.com>

IRQ 5 used by TPM conflicts with PNP0C0F IRQs,
as result Windows fails driver initialization with reason
  'device cannot find enough free resources'
But if TPM._CRS.IRQ entry is commented out, Windows
seems to initialize driver without errors as it doesn't
notice possible conflict and it seems to work
probably due to a link with IRQ 5 being unused/disabled.

So temporary comment out TPM._CRS.IRQ to 'fix'
regression in TPM, with intent to fix it correctly
later i.e.:
  1. pick unused IRQ as default one for TPM
  2. fetch IRQ value from device model so that user
     could override default one if it conflicts with
     some other device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 784870e..6477003 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2348,7 +2348,12 @@ build_dsdt(GArray *table_data, GArray *linker,
                     crs = aml_resource_template();
                     aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE,
                                TPM_TIS_ADDR_SIZE, AML_READ_WRITE));
-                    aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ));
+                    /*
+                        FIXME: TPM_TIS_IRQ=5 conflicts with PNP0C0F irqs,
+                        Rewrite to take IRQ from TPM device model and
+                        fix default IRQ value there to use some unused IRQ
+                     */
+                    /* aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ)); */
                     aml_append(dev, aml_name_decl("_CRS", crs));
                     aml_append(scope, dev);
                 }
-- 
MST

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

* [Qemu-devel] [PULL 5/6] tpm: Fix write to file descriptor function
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
                   ` (3 preceding siblings ...)
  2016-04-14 13:48 ` [Qemu-devel] [PULL 4/6] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict Michael S. Tsirkin
@ 2016-04-14 13:48 ` Michael S. Tsirkin
  2016-04-14 13:48 ` [Qemu-devel] [PULL 6/6] hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE Michael S. Tsirkin
  2016-04-14 14:43 ` [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Stefan Berger, Stefan Berger, Daniel P. Berrange,
	Michael Tokarev, Eric Blake

From: Stefan Berger <stefanb@us.ibm.com>

Fix a bug introduced in commit 46f296c while moving send_all to the
tpm_passthrough code. Fix the name of the variable used in the loop.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/tpm/tpm_passthrough.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index e98efb7..e88c0d2 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -86,7 +86,7 @@ static int tpm_passthrough_unix_write(int fd, const uint8_t *buf, uint32_t len)
     int ret, remain;
 
     remain = len;
-    while (len > 0) {
+    while (remain > 0) {
         ret = write(fd, buf, remain);
         if (ret < 0) {
             if (errno != EINTR && errno != EAGAIN) {
-- 
MST

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

* [Qemu-devel] [PULL 6/6] hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
                   ` (4 preceding siblings ...)
  2016-04-14 13:48 ` [Qemu-devel] [PULL 5/6] tpm: Fix write to file descriptor function Michael S. Tsirkin
@ 2016-04-14 13:48 ` Michael S. Tsirkin
  2016-04-14 14:43 ` [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Michael S. Tsirkin @ 2016-04-14 13:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Thomas Huth

From: Thomas Huth <thuth@redhat.com>

The balloon code currently calls madvise() with TARGET_PAGE_SIZE as
length parameter. Since the virtio-balloon protocol is always based
on 4k pages, no matter what the host and guest are using as page size,
this could cause problems: If TARGET_PAGE_SIZE is bigger than 4k, the
madvise call also destroys the 4k areas after the current one - which
might be wrong since the guest did not want free that area yet (in
case the guest used as smaller MMU page size than the hard-coded
TARGET_PAGE_SIZE). So to fix this issue, introduce a proper define
called BALLOON_PAGE_SIZE (which is 4096) to use this as the size
parameter for the madvise() call instead.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-balloon.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index c74101e..9dbe681 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -19,7 +19,6 @@
 #include "qemu-common.h"
 #include "hw/virtio/virtio.h"
 #include "hw/i386/pc.h"
-#include "cpu.h"
 #include "sysemu/balloon.h"
 #include "hw/virtio/virtio-balloon.h"
 #include "sysemu/kvm.h"
@@ -35,12 +34,14 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 
+#define BALLOON_PAGE_SIZE  (1 << VIRTIO_BALLOON_PFN_SHIFT)
+
 static void balloon_page(void *addr, int deflate)
 {
 #if defined(__linux__)
     if (!qemu_balloon_is_inhibited() && (!kvm_enabled() ||
                                          kvm_has_sync_mmu())) {
-        qemu_madvise(addr, TARGET_PAGE_SIZE,
+        qemu_madvise(addr, BALLOON_PAGE_SIZE,
                 deflate ? QEMU_MADV_WILLNEED : QEMU_MADV_DONTNEED);
     }
 #endif
-- 
MST

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

* Re: [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6
  2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
                   ` (5 preceding siblings ...)
  2016-04-14 13:48 ` [Qemu-devel] [PULL 6/6] hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE Michael S. Tsirkin
@ 2016-04-14 14:43 ` Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2016-04-14 14:43 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: QEMU Developers

On 14 April 2016 at 14:47, Michael S. Tsirkin <mst@redhat.com> wrote:
> The following changes since commit d44122ecd0fa62d20762bdd8f214f077cb8e011b:
>
>   Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-04-12 17:47:15 +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 01310e2aa7ad87f101d56feb8c06898084c9b542:
>
>   hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE (2016-04-14 16:44:42 +0300)
>
> ----------------------------------------------------------------
> tpm, vhost, virtio: fixes for 2.6
>
> Minor fixes all over the place.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2016-04-14 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 13:47 [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 Michael S. Tsirkin
2016-04-14 13:47 ` [Qemu-devel] [PULL 1/6] specs/vhost-user: improve VHOST_SET_VRING_NUM documentation Michael S. Tsirkin
2016-04-14 13:48 ` [Qemu-devel] [PULL 2/6] specs/vhost-user: spelling fix Michael S. Tsirkin
2016-04-14 13:48 ` [Qemu-devel] [PULL 3/6] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS Michael S. Tsirkin
2016-04-14 13:48 ` [Qemu-devel] [PULL 4/6] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict Michael S. Tsirkin
2016-04-14 13:48 ` [Qemu-devel] [PULL 5/6] tpm: Fix write to file descriptor function Michael S. Tsirkin
2016-04-14 13:48 ` [Qemu-devel] [PULL 6/6] hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE Michael S. Tsirkin
2016-04-14 14:43 ` [Qemu-devel] [PULL 0/6] tpm, vhost, virtio: fixes for 2.6 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.