Page MenuHomeFreeBSD

Use DEVICE memory instead of UNCACHEABLE on aarch64 in LinuxKPI ioremap
AcceptedPublic

Authored by greg_unrelenting.technology on Jun 28 2019, 12:31 AM.

Details

Reviewers
hselasky
Group Reviewers
Contributor Reviews (base)
arm64
Summary

This fixes system hangs on reading device registers in LinuxKPI drivers on aarch64.

VM_MEMATTR_DEVICE is also defined on RISC-V and 32-bit ARM, so I used ifdef VM_MEMATTR_DEVICE to make sure anyone trying to port LinuxKPI stuff to these architectures doesn't hit the same problem.

Test Plan

Tested on: Marvell MACCHIATObin (Armada8k) + mlx4en, amdgpu

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

hselasky added inline comments.Jun 28 2019, 8:48 AM
sys/compat/linuxkpi/common/include/linux/io.h
377

Can you use /**/ comment here instead of // ?

What about the other ioremap() functions?

hm, just looked at linux — regular, _nocache and _wt are all PROT_DEVICE_nGnRE. Let's change them all then.

hselasky accepted this revision.Jun 28 2019, 1:56 PM

Spell lkpi -> LinuxKPI in the commit message.

Looks OK.

This revision is now accepted and ready to land.Jun 28 2019, 1:56 PM
greg_unrelenting.technology edited the test plan for this revision. (Show Details)

Please stay tuned!