linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: tpm: Remove a busy bit of the NVS area for supporting AMD's fTPM
@ 2019-08-26  8:17 Seunghun Han
  2019-08-26 17:40 ` Matthew Garrett
  0 siblings, 1 reply; 13+ messages in thread
From: Seunghun Han @ 2019-08-26  8:17 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: mjg59, Peter Huewe, open list:TPM DEVICE DRIVER, linux-kernel,
	Seunghun Han

I'm Seunghun Han and work at the Affiliated Institute of ETRI. I got
an AMD system which had a Ryzen Threadripper 1950X and MSI mainboard, and
I had a problem with AMD's fTPM. My machine showed an error message below,
and the fTPM didn't work because of it.

[  5.732084] tpm_crb MSFT0101:00: can't request region for resource
             [mem 0x79b4f000-0x79b4ffff]
[  5.732089] tpm_crb: probe of MSFT0101:00 failed with error -16

When I saw the e820 map and iomem, I found two fTPM regions were in
the ACPI NVS area. The regions are below.

79a39000-79b6afff : ACPI Non-volatile Storage
  79b4b000-79b4bfff : MSFT0101:00
  79b4f000-79b4ffff : MSFT0101:00

After analyzing this issue, I found out that a busy bit was set to
the ACPI NVS area, and the Linux kernel didn't allow the TPM CRB driver
to assign CRB regions in it.

To support AMD's fTPM, I removed the busy bit from the ACPI NVS area like
the reserved area so that AMD's fTPM regions could be assigned in it.

Signed-off-by: Seunghun Han <kkamagui@gmail.com>
---
 arch/x86/kernel/e820.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 7da2bcd2b8eb..0d721df8900e 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1085,11 +1085,12 @@ static bool __init do_mark_busy(enum e820_type type, struct resource *res)
 	case E820_TYPE_RESERVED:
 	case E820_TYPE_PRAM:
 	case E820_TYPE_PMEM:
+	/* AMD's fTPM regions are in the ACPI NVS area */
+	case E820_TYPE_NVS:
 		return false;
 	case E820_TYPE_RESERVED_KERN:
 	case E820_TYPE_RAM:
 	case E820_TYPE_ACPI:
-	case E820_TYPE_NVS:
 	case E820_TYPE_UNUSABLE:
 	default:
 		return true;
-- 
2.21.0


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

end of thread, other threads:[~2019-08-30 10:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26  8:17 [PATCH] x86: tpm: Remove a busy bit of the NVS area for supporting AMD's fTPM Seunghun Han
2019-08-26 17:40 ` Matthew Garrett
2019-08-27  8:23   ` Seunghun Han
2019-08-27 16:10     ` Matthew Garrett
2019-08-27 16:36       ` Seunghun Han
2019-08-27 17:11         ` Matthew Garrett
2019-08-28  9:36           ` Seunghun Han
2019-08-29 15:34             ` Jarkko Sakkinen
2019-08-29 15:39               ` Jarkko Sakkinen
2019-08-29 16:12                 ` Seunghun Han
2019-08-30 10:01                   ` Seunghun Han
2019-08-27 12:47   ` Jarkko Sakkinen
2019-08-27 15:49     ` Seunghun Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).