Skip to contentSkip to conversation

x86/dmar: zap DMAR signature for dom0 once in TBOOT case

PATCH Superseded Zhenzhong Duan 3 participants 3 messages Aug 21, 2018 – Aug 22, 2018

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 2/2 x86/dmar: zap DMAR signature for dom0 once in TBOOT case

When TBOOT enabled, acpi_parse_dmar() called acpi_dmar_zap() to zap DMAR table, then tboot_parse_dmar_table() called acpi_dmar_zap() to zap it again. This is unnecessory, remove the second call.

Some stale comments not right for current code are also removed. No functional change.

---
v3: fixup patch and description.

 xen/arch/x86/tboot.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
xen/arch/x86/tboot.c +0 -6
index d5a5292..1006f95 100644
@@ -461,8 +461,6 @@ int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler)
     if ( txt_heap_base == 0 )
         return 1;
 
-    /* map TXT heap into Xen addr space */
-
     /* walk heap to SinitMleData */
     pa = txt_heap_base;
     /* skip BiosData */
@@ -490,10 +488,6 @@ int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler)
     rc = dmar_handler(dmar_table);
     xfree(dmar_table);
 
-    /* acpi_parse_dmar() zaps APCI DMAR signature in TXT heap table */
-    /* but dom0 will read real table, so must zap it there too */
-    acpi_dmar_zap();
-
     return rc;
 }
 
Signature · 6 lines
1.7.3

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

xen/arch/x86/tboot.c int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler) · line 495

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 21.08.18 at 11:11, <[email protected]> wrote:
xen/arch/x86/tboot.c +0 -3
@@ -490,10 +488,6 @@ int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler)
     rc = dmar_handler(dmar_table);
     xfree(dmar_table);
 
-    /* acpi_parse_dmar() zaps APCI DMAR signature in TXT heap table */
-    /* but dom0 will read real table, so must zap it there too */
-    acpi_dmar_zap();

Interesting - now you remove the other one. I think this is actually correct, but understanding why could _again_ have been a lot easier with a better description. Afaict commit 6c298ecc1f ("vtd: Reinstate ACPI DMAR on system shutdown or S3/S4/S5") did everything for this call to be unnecessary, except for invoking the function from acpi_parse_dmar(), which 123c779379 ("VTd/dmar: Tweak how the DMAR table is clobbered") added several years later.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 13 lines

From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, August 21, 2018 8:32 PM

Review int __init

Quoted 2 lines
Quoted 1 line
Quoted 1 line · On 21.08.18 at 11:11, <[email protected]> wrote:
(quoted diff) +0 -0
@@ -490,10 +488,6 @@ int __init

tboot_parse_dmar_table(acpi_table_handler dmar_handler)

xen/arch/x86/tboot.c int __init tboot_parse_dmar_table(acpi_table_handler dmar_handler) · line 495

Quoted 6 lines
xen/arch/x86/tboot.c +0 -3
     rc = dmar_handler(dmar_table);
     xfree(dmar_table);
 
-    /* acpi_parse_dmar() zaps APCI DMAR signature in TXT heap table */
-    /* but dom0 will read real table, so must zap it there too */
-    acpi_dmar_zap();
Quoted 8 lines

Interesting - now you remove the other one. I think this is actually correct, but understanding why could _again_ have been a lot easier with a better description. Afaict commit 6c298ecc1f ("vtd: Reinstate ACPI DMAR on system shutdown or S3/S4/S5") did everything for this call to be unnecessary, except for invoking the function from acpi_parse_dmar(), which 123c779379 ("VTd/dmar: Tweak how the DMAR table is clobbered") added several years later.

yes, a better description is expected here.

Thanks
Kevin

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel