1
0
Fork 0
alistair23-linux/drivers/gpu/drm/radeon
Mikel Rychliski 535943c46d PCI: Use ioremap(), not phys_to_virt() for platform ROM
[ Upstream commit 72e0ef0e5f ]

On some EFI systems, the video BIOS is provided by the EFI firmware.  The
boot stub code stores the physical address of the ROM image in pdev->rom.
Currently we attempt to access this pointer using phys_to_virt(), which
doesn't work with CONFIG_HIGHMEM.

On these systems, attempting to load the radeon module on a x86_32 kernel
can result in the following:

  BUG: unable to handle page fault for address: 3e8ed03c
  #PF: supervisor read access in kernel mode
  #PF: error_code(0x0000) - not-present page
  *pde = 00000000
  Oops: 0000 [#1] PREEMPT SMP
  CPU: 0 PID: 317 Comm: systemd-udevd Not tainted 5.6.0-rc3-next-20200228 #2
  Hardware name: Apple Computer, Inc. MacPro1,1/Mac-F4208DC8, BIOS     MP11.88Z.005C.B08.0707021221 07/02/07
  EIP: radeon_get_bios+0x5ed/0xe50 [radeon]
  Code: 00 00 84 c0 0f 85 12 fd ff ff c7 87 64 01 00 00 00 00 00 00 8b 47 08 8b 55 b0 e8 1e 83 e1 d6 85 c0 74 1a 8b 55 c0 85 d2 74 13 <80> 38 55 75 0e 80 78 01 aa 0f 84 a4 03 00 00 8d 74 26 00 68 dc 06
  EAX: 3e8ed03c EBX: 00000000 ECX: 3e8ed03c EDX: 00010000
  ESI: 00040000 EDI: eec04000 EBP: eef3fc60 ESP: eef3fbe0
  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010206
  CR0: 80050033 CR2: 3e8ed03c CR3: 2ec77000 CR4: 000006d0
  Call Trace:
   r520_init+0x26/0x240 [radeon]
   radeon_device_init+0x533/0xa50 [radeon]
   radeon_driver_load_kms+0x80/0x220 [radeon]
   drm_dev_register+0xa7/0x180 [drm]
   radeon_pci_probe+0x10f/0x1a0 [radeon]
   pci_device_probe+0xd4/0x140

Fix the issue by updating all drivers which can access a platform provided
ROM. Instead of calling the helper function pci_platform_rom() which uses
phys_to_virt(), call ioremap() directly on the pdev->rom.

radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().

pci_platform_rom() now has no remaining callers, so remove it.

Link: https://lore.kernel.org/r/20200319021623.5426-1-mikel@mikelr.com
Signed-off-by: Mikel Rychliski <mikel@mikelr.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:17:51 +02:00
..
reg_srcs drm/radeon: allow geom rings to be setup on r600/r700 (v2) 2014-02-06 12:13:52 +10:00
.gitignore
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile main drm pull request for v4.15 2017-11-15 20:42:10 -08:00
ObjectID.h
atom-bits.h
atom-names.h
atom-types.h
atom.c drm/radeon: drop drmP.h from header files 2019-06-10 22:30:24 +02:00
atom.h drm/radeon: drop drmP.h from header files 2019-06-10 22:30:24 +02:00
atombios.h scripts/spelling.txt: add "aligment" pattern and fix typo instances 2017-02-27 18:43:46 -08:00
atombios_crtc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
atombios_dp.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
atombios_encoders.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
atombios_i2c.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
avivod.h
btc_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
btc_dpm.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
btcd.h drm/radeon/dpm: use the driver state for dpm debugfs 2014-02-06 12:22:46 -05:00
cayman_blit_shaders.c drm: fix trivial typos 2015-10-21 11:35:11 -04:00
cayman_blit_shaders.h
ci_dpm.c drm/radeon: fix array out-of-bounds read and write issues 2020-08-19 08:16:09 +02:00
ci_dpm.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
ci_smc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
cik.c drm/radeon: fix bad DMA from INTERRUPT_CNTL2 2020-01-26 10:01:08 +01:00
cik_blit_shaders.c
cik_blit_shaders.h
cik_reg.h drm/radeon: Remove KFD_CIK_SDMA_QUEUE_OFFSET 2017-12-20 12:00:22 -05:00
cik_sdma.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
cikd.h drm/radeon: deprecate and remove KFD interface 2017-10-30 14:16:21 +01:00
clearstate_cayman.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
clearstate_ci.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
clearstate_defs.h
clearstate_evergreen.h
clearstate_si.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
cypress_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
cypress_dpm.h
dce3_1_afmt.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
dce6_afmt.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
evergreen.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
evergreen_blit_shaders.c drm: fix trivial typos 2015-10-21 11:35:11 -04:00
evergreen_blit_shaders.h
evergreen_cs.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
evergreen_dma.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
evergreen_hdmi.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
evergreen_reg.h drm/radeon: fix vertical bars appear on monitor (v2) 2016-04-27 12:27:08 -04:00
evergreen_smc.h drm/radeon/dpm: fix typo in EVERGREEN_SMC_FIRMWARE_HEADER_softRegisters 2014-03-06 16:46:58 -05:00
evergreend.h drm/radeon: switch UVD code to use UVD_NO_OP for padding 2016-08-24 16:25:05 -04:00
kv_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
kv_dpm.h drm/radeon/dpm: handle bapm on kb/kv 2013-09-11 11:44:38 -04:00
kv_smc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
mkregtable.c drm/radeon: change SPDX identifier to MIT 2018-10-15 16:16:12 -05:00
ni.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
ni_dma.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
ni_dpm.c drm/radeon: fix fb_div check in ni_init_smc_spll_table() 2020-06-30 15:37:11 -04:00
ni_dpm.h
ni_reg.h drm/radeon/mst: port some MST setup code from DAL. 2016-04-06 14:57:46 -04:00
nid.h drm/radeon: switch UVD code to use UVD_NO_OP for padding 2016-08-24 16:25:05 -04:00
nislands_smc.h
ppsmc.h drm/radeon/dpm: add thermal dpm support for CI 2014-11-20 13:00:10 -05:00
pptable.h drm/radeon/dpm: add smc fan control for CI (v2) 2014-11-20 13:00:10 -05:00
r100.c drm/radeon: fix r1xx/r2xx register checker for POT textures 2019-12-21 11:05:14 +01:00
r100_track.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
r100d.h
r200.c drm/radeon: fix r1xx/r2xx register checker for POT textures 2019-12-21 11:05:14 +01:00
r300.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
r300_reg.h
r300d.h
r420.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
r420d.h
r500_reg.h drm/radeon: Bypass hw lut's for > 8 bpc framebuffer scanout. 2014-06-13 12:22:30 -04:00
r520.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
r520d.h
r600.c drm/radeon: fix bad DMA from INTERRUPT_CNTL2 2020-01-26 10:01:08 +01:00
r600_blit_shaders.c drm: fix trivial typos 2015-10-21 11:35:11 -04:00
r600_blit_shaders.h
r600_cs.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
r600_dma.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
r600_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
r600_dpm.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
r600_hdmi.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
r600_reg.h drm/radeon: enable ABGR and XBGR formats (v2) 2018-08-27 11:10:19 -05:00
r600d.h drm/radeon: add support for UVD_NO_OP register 2016-08-24 16:25:04 -04:00
radeon.h hmm related patches for 5.4 2019-09-21 10:07:42 -07:00
radeon_acpi.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_acpi.h drm/radeon: Make radeon_atif_handler static 2017-08-15 14:46:07 -04:00
radeon_agp.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_asic.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_asic.h dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_atombios.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_atpx_handler.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 191 2019-05-30 11:29:21 -07:00
radeon_audio.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_audio.h drm/radeon: Add a common function for DFS handling 2016-01-27 12:48:32 -05:00
radeon_benchmark.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_bios.c PCI: Use ioremap(), not phys_to_virt() for platform ROM 2020-10-01 13:17:51 +02:00
radeon_clocks.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_combios.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_connectors.c drm/radeon: fix multiple reference count leak 2020-09-03 11:26:43 +02:00
radeon_cs.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_cursor.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_device.c hmm related patches for 5.4 2019-09-21 10:07:42 -07:00
radeon_display.c drm/radeon: Fix reference count leaks caused by pm_runtime_get_sync 2020-08-19 08:16:00 +02:00
radeon_dp_auxch.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_dp_mst.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_drv.c drm/radeon: disable AGP by default 2020-08-19 08:16:02 +02:00
radeon_drv.h drm/radeon: drop unused ati pcigart include. 2019-04-24 12:32:14 +10:00
radeon_encoders.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_family.h drm/radeon: add Mullins chip family 2014-05-06 12:19:57 +02:00
radeon_fb.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_fence.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_gart.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_gem.c drm/radeon: untag user pointers in radeon_gem_userptr_ioctl 2019-09-25 17:51:41 -07:00
radeon_i2c.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_ib.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_irq_kms.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_kms.c drm/radeon: Fix reference count leaks caused by pm_runtime_get_sync 2020-08-19 08:16:00 +02:00
radeon_legacy_crtc.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_legacy_encoders.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_legacy_tv.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_mn.c hmm related patches for 5.4 2019-09-21 10:07:42 -07:00
radeon_mode.h drm/radeon: radeon_framebuffer -> drm_framebuffer 2018-04-11 13:07:56 -05:00
radeon_object.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_object.h dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_pm.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_prime.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_reg.h
radeon_ring.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_sa.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_semaphore.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_sync.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_test.c drm/radeon: switch driver from bo->resv to bo->base.resv 2019-08-06 08:21:54 +02:00
radeon_trace.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
radeon_trace_points.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_ttm.c drm/radeon: handle PCIe root ports with addressing limitations 2019-08-15 10:51:00 -05:00
radeon_ucode.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_ucode.h drm/radeon: add new firmware header definitions (v3) 2014-08-05 08:53:22 -04:00
radeon_uvd.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
radeon_vce.c drm/radeon: drop use of drmP.h (1/2) 2019-06-10 22:30:24 +02:00
radeon_vm.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
rs100d.h
rs400.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rs400d.h
rs600.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rs600d.h
rs690.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rs690d.h
rs780_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rs780_dpm.h
rs780d.h
rv6xx_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv6xx_dpm.h
rv6xxd.h
rv200d.h
rv250d.h
rv350d.h
rv515.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv515d.h
rv730_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv730d.h
rv740_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv740d.h
rv770.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv770_dma.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
rv770_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv770_dpm.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
rv770_smc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
rv770_smc.h drm/radeon: protect concurrent smc register access with a spinlock 2013-09-11 11:44:28 -04:00
rv770d.h drm/radeon: switch UVD code to use UVD_NO_OP for padding 2016-08-24 16:25:05 -04:00
si.c drm/radeon: fix bad DMA from INTERRUPT_CNTL2 2020-01-26 10:01:08 +01:00
si_blit_shaders.c
si_blit_shaders.h
si_dma.c dma-buf: rename reservation_object to dma_resv 2019-08-13 09:09:30 +02:00
si_dpm.c drm/radeon: fix si_enable_smc_cac() failed issue 2019-11-06 22:06:23 -05:00
si_dpm.h drm/radeon: bind fan control on SI cards to hwmon interface 2015-01-22 10:38:48 -05:00
si_reg.h
si_smc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
sid.h drm/radeon: allow TA_CS_BC_BASE_ADDR on SI 2016-10-12 15:44:15 -04:00
sislands_smc.h drm/radeon/si/dpm: fix phase shedding setup 2016-09-28 16:13:16 -04:00
smu7.h
smu7_discrete.h drm/radeon/dpm: add smc fan control for CI (v2) 2014-11-20 13:00:10 -05:00
smu7_fusion.h
sumo_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
sumo_dpm.h drm/radeon: prepare header files for drmP.h removal 2019-06-10 22:30:24 +02:00
sumo_smc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
sumod.h
trinity_dpm.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
trinity_dpm.h drm/radeon/dpm: add bapm callback for trinity 2013-09-11 11:44:39 -04:00
trinity_smc.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
trinityd.h
uvd_v1_0.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
uvd_v2_2.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
uvd_v3_1.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
uvd_v4_2.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
vce_v1_0.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00
vce_v2_0.c drm/radeon: drop use of drmP.h (2/2) 2019-06-10 22:30:24 +02:00