aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHon Ching \(Vicky\) Lo <honclo@linux.vnet.ibm.com>2015-10-07 20:11:54 -0400
committerPeter Huewe <peterhuewe@gmx.de>2015-10-18 19:01:23 -0400
commit9e5d4af458057344e8cc35b09b2f7a9c9e95d81f (patch)
treedee27407d14394ff2aa2759b953a39273bb223d9
parentb4ed0469d00ad7ad051e5acbdb3e7587fd0221e2 (diff)
vTPM: get the buffer allocated for event log instead of the actual log
The OS should ask Power Firmware (PFW) for the size of the buffer allocated for the event log, instead of the size of the actual event log. It then passes the buffer adddress and size to PFW in the handover process, into which PFW copies the log. Signed-off-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
-rw-r--r--arch/powerpc/kernel/prom_init.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 7b2e452be19d..92dea8df6b26 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1450,13 +1450,20 @@ static void __init prom_instantiate_sml(void)
1450 prom_printf("Reformat SML to EFI alignment failed\n"); 1450 prom_printf("Reformat SML to EFI alignment failed\n");
1451 return; 1451 return;
1452 } 1452 }
1453 }
1454 1453
1455 if (call_prom_ret("call-method", 2, 2, &size, 1454 if (call_prom_ret("call-method", 2, 2, &size,
1456 ADDR("sml-get-handover-size"), 1455 ADDR("sml-get-allocated-size"),
1457 ibmvtpm_inst) != 0 || size == 0) { 1456 ibmvtpm_inst) != 0 || size == 0) {
1458 prom_printf("SML get handover size failed\n"); 1457 prom_printf("SML get allocated size failed\n");
1459 return; 1458 return;
1459 }
1460 } else {
1461 if (call_prom_ret("call-method", 2, 2, &size,
1462 ADDR("sml-get-handover-size"),
1463 ibmvtpm_inst) != 0 || size == 0) {
1464 prom_printf("SML get handover size failed\n");
1465 return;
1466 }
1460 } 1467 }
1461 1468
1462 base = alloc_down(size, PAGE_SIZE, 0); 1469 base = alloc_down(size, PAGE_SIZE, 0);
@@ -1465,6 +1472,8 @@ static void __init prom_instantiate_sml(void)
1465 1472
1466 prom_printf("instantiating sml at 0x%x...", base); 1473 prom_printf("instantiating sml at 0x%x...", base);
1467 1474
1475 memset((void *)base, 0, size);
1476
1468 if (call_prom_ret("call-method", 4, 2, &entry, 1477 if (call_prom_ret("call-method", 4, 2, &entry,
1469 ADDR("sml-handover"), 1478 ADDR("sml-handover"),
1470 ibmvtpm_inst, size, base) != 0 || entry == 0) { 1479 ibmvtpm_inst, size, base) != 0 || entry == 0) {