mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
amd-iommu: print ivmd information to dmesg when requested
Add information about device memory mapping requirements for the IOMMU as described in the IVRS ACPI table to the kernel log if amd_iommu_dump was specified on the kernel command line. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
parent
42a698f40a
commit
02acc43a29
1 changed files with 11 additions and 0 deletions
|
@ -983,6 +983,7 @@ static int __init init_exclusion_range(struct ivmd_header *m)
|
||||||
static int __init init_unity_map_range(struct ivmd_header *m)
|
static int __init init_unity_map_range(struct ivmd_header *m)
|
||||||
{
|
{
|
||||||
struct unity_map_entry *e = 0;
|
struct unity_map_entry *e = 0;
|
||||||
|
char *s;
|
||||||
|
|
||||||
e = kzalloc(sizeof(*e), GFP_KERNEL);
|
e = kzalloc(sizeof(*e), GFP_KERNEL);
|
||||||
if (e == NULL)
|
if (e == NULL)
|
||||||
|
@ -991,13 +992,16 @@ static int __init init_unity_map_range(struct ivmd_header *m)
|
||||||
switch (m->type) {
|
switch (m->type) {
|
||||||
default:
|
default:
|
||||||
case ACPI_IVMD_TYPE:
|
case ACPI_IVMD_TYPE:
|
||||||
|
s = "IVMD_TYPEi\t\t\t";
|
||||||
e->devid_start = e->devid_end = m->devid;
|
e->devid_start = e->devid_end = m->devid;
|
||||||
break;
|
break;
|
||||||
case ACPI_IVMD_TYPE_ALL:
|
case ACPI_IVMD_TYPE_ALL:
|
||||||
|
s = "IVMD_TYPE_ALL\t\t";
|
||||||
e->devid_start = 0;
|
e->devid_start = 0;
|
||||||
e->devid_end = amd_iommu_last_bdf;
|
e->devid_end = amd_iommu_last_bdf;
|
||||||
break;
|
break;
|
||||||
case ACPI_IVMD_TYPE_RANGE:
|
case ACPI_IVMD_TYPE_RANGE:
|
||||||
|
s = "IVMD_TYPE_RANGE\t\t";
|
||||||
e->devid_start = m->devid;
|
e->devid_start = m->devid;
|
||||||
e->devid_end = m->aux;
|
e->devid_end = m->aux;
|
||||||
break;
|
break;
|
||||||
|
@ -1006,6 +1010,13 @@ static int __init init_unity_map_range(struct ivmd_header *m)
|
||||||
e->address_end = e->address_start + PAGE_ALIGN(m->range_length);
|
e->address_end = e->address_start + PAGE_ALIGN(m->range_length);
|
||||||
e->prot = m->flags >> 1;
|
e->prot = m->flags >> 1;
|
||||||
|
|
||||||
|
DUMP_printk("%s devid_start: %02x:%02x.%x devid_end: %02x:%02x.%x"
|
||||||
|
" range_start: %016llx range_end: %016llx flags: %x\n", s,
|
||||||
|
PCI_BUS(e->devid_start), PCI_SLOT(e->devid_start),
|
||||||
|
PCI_FUNC(e->devid_start), PCI_BUS(e->devid_end),
|
||||||
|
PCI_SLOT(e->devid_end), PCI_FUNC(e->devid_end),
|
||||||
|
e->address_start, e->address_end, m->flags);
|
||||||
|
|
||||||
list_add_tail(&e->list, &amd_iommu_unity_map);
|
list_add_tail(&e->list, &amd_iommu_unity_map);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue