Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161382
b: refs/heads/master
c: a59b50e
h: refs/heads/master
v: v3
  • Loading branch information
Joseph Cihula authored and H. Peter Anvin committed Jul 21, 2009
1 parent 40e2811 commit 64a4f25
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86886e55b273f565935491816c7c96b82469d4f8
refs/heads/master: a59b50e995465911ba580df0bd10cf64aa81fc43
7 changes: 7 additions & 0 deletions trunk/drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/timer.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <asm/tboot.h>

#undef PREFIX
#define PREFIX "DMAR:"
Expand Down Expand Up @@ -413,6 +414,12 @@ parse_dmar_table(void)
*/
dmar_table_detect();

/*
* ACPI tables may not be DMA protected by tboot, so use DMAR copy
* SINIT saved in SinitMleData in TXT heap (which is DMA protected)
*/
dmar_tbl = tboot_get_dmar_table(dmar_tbl);

dmar = (struct acpi_table_dmar *)dmar_tbl;
if (!dmar)
return -ENODEV;
Expand Down
17 changes: 15 additions & 2 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/intel-iommu.h>
#include <linux/sysdev.h>
#include <asm/cacheflush.h>
#include <asm/tboot.h>
#include <asm/iommu.h>
#include "pci.h"

Expand Down Expand Up @@ -3183,12 +3184,22 @@ static int __init init_iommu_sysfs(void)
int __init intel_iommu_init(void)
{
int ret = 0;
int force_on = 0;

if (dmar_table_init())
/* VT-d is required for a TXT/tboot launch, so enforce that */
force_on = tboot_force_iommu();

if (dmar_table_init()) {
if (force_on)
panic("tboot: Failed to initialize DMAR table\n");
return -ENODEV;
}

if (dmar_dev_scope_init())
if (dmar_dev_scope_init()) {
if (force_on)
panic("tboot: Failed to initialize DMAR device scope\n");
return -ENODEV;
}

/*
* Check the need for DMA-remapping initialization now.
Expand All @@ -3204,6 +3215,8 @@ int __init intel_iommu_init(void)

ret = init_dmars();
if (ret) {
if (force_on)
panic("tboot: Failed to initialize DMARs\n");
printk(KERN_ERR "IOMMU: dmar init failed\n");
put_iova_domain(&reserved_iova_list);
iommu_exit_mempool();
Expand Down

0 comments on commit 64a4f25

Please sign in to comment.