Thread (1 message) 1 message, 1 author, 2017-03-02
STALE3388d
Revisions (16)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v2 current
  4. v2 [diff vs current]
  5. v3 [diff vs current]
  6. v3 [diff vs current]
  7. v4 [diff vs current]
  8. v4 [diff vs current]
  9. v5 [diff vs current]
  10. v5 [diff vs current]
  11. v6 [diff vs current]
  12. v6 [diff vs current]
  13. v7 [diff vs current]
  14. v7 [diff vs current]
  15. v8 [diff vs current]
  16. v9 [diff vs current]

[RFC PATCH v2 06/32] x86/pci: Use memremap when walking setup data

From: Brijesh Singh <hidden>
Date: 2017-03-02 15:29:51
Subsystem: pci subsystem, the rest, x86 architecture (32-bit and 64-bit) · Maintainers: Bjorn Helgaas, Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen

Possibly related (same subject, not in this thread)

From: Tom Lendacky <thomas.lendacky@amd.com>

The use of ioremap will force the setup data to be mapped decrypted even
though setup data is encrypted.  Switch to using memremap which will be
able to perform the proper mapping.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 arch/x86/pci/common.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index a4fdfa7..0b06670 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -691,7 +691,7 @@ int pcibios_add_device(struct pci_dev *dev)
 
 	pa_data = boot_params.hdr.setup_data;
 	while (pa_data) {
-		data = ioremap(pa_data, sizeof(*rom));
+		data = memremap(pa_data, sizeof(*rom), MEMREMAP_WB);
 		if (!data)
 			return -ENOMEM;
 
@@ -710,7 +710,7 @@ int pcibios_add_device(struct pci_dev *dev)
 			}
 		}
 		pa_data = data->next;
-		iounmap(data);
+		memunmap(data);
 	}
 	set_dma_domain_ops(dev);
 	set_dev_domain_options(dev);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help