All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.6 v2 0/2] acpi: tpm: "Fix" TPM ACPI description
@ 2016-04-08 11:23 Igor Mammedov
  2016-04-08 11:23 ` [Qemu-devel] [PATCH for-2.6 v2 1/2] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS Igor Mammedov
  2016-04-08 11:23 ` [Qemu-devel] [PATCH for-2.6 v2 2/2] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict Igor Mammedov
  0 siblings, 2 replies; 3+ messages in thread
From: Igor Mammedov @ 2016-04-08 11:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, stefanb, crobinso

TPM used to 'work', since in commit:
  711b20b4 Add ACPI tables for TPM
as TPM device has been placed outside of PCI0 bus scope
with IRQ commented out, but since commit
  5cb18b3d TPM2 ACPI table support
with following fixup
  9e472263 acpi: add missing ssdt
it has been moved to correct ISA bus scope,
however no one added MMIO resource to parent bus
and IRQ(5) became uncommented which regressed
TPM as Windows fails to init it due to lack of resources
  'device cannot find enough free resources'

Series is a partialy fix and a partially hack to
temporary make TPM work on Windows.
 1/2 - fixes IO resource lack on parent bus
 2/2 - temporary comment out IRQ description
       to make Windows beleve that there isn't
       any possible conflict to force successful
       driver initialization

Tested with Windows 8.1x64

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

 hw/i386/acpi-build.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

-- 
1.8.3.1

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

* [Qemu-devel] [PATCH for-2.6 v2 1/2] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS
  2016-04-08 11:23 [Qemu-devel] [PATCH for-2.6 v2 0/2] acpi: tpm: "Fix" TPM ACPI description Igor Mammedov
@ 2016-04-08 11:23 ` Igor Mammedov
  2016-04-08 11:23 ` [Qemu-devel] [PATCH for-2.6 v2 2/2] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict Igor Mammedov
  1 sibling, 0 replies; 3+ messages in thread
From: Igor Mammedov @ 2016-04-08 11:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, stefanb, crobinso

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>
---
 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 */
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH for-2.6 v2 2/2] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict
  2016-04-08 11:23 [Qemu-devel] [PATCH for-2.6 v2 0/2] acpi: tpm: "Fix" TPM ACPI description Igor Mammedov
  2016-04-08 11:23 ` [Qemu-devel] [PATCH for-2.6 v2 1/2] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS Igor Mammedov
@ 2016-04-08 11:23 ` Igor Mammedov
  1 sibling, 0 replies; 3+ messages in thread
From: Igor Mammedov @ 2016-04-08 11:23 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, stefanb, crobinso

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>
---
 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);
                 }
-- 
1.8.3.1

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

end of thread, other threads:[~2016-04-08 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-08 11:23 [Qemu-devel] [PATCH for-2.6 v2 0/2] acpi: tpm: "Fix" TPM ACPI description Igor Mammedov
2016-04-08 11:23 ` [Qemu-devel] [PATCH for-2.6 v2 1/2] pc: acpi: tpm: add missing MMIO resource to PCI0._CRS Igor Mammedov
2016-04-08 11:23 ` [Qemu-devel] [PATCH for-2.6 v2 2/2] tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict Igor Mammedov

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.