Page MenuHomeFreeBSD

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

Authored by hselasky on Jun 28 2019, 12:31 AM.
Tags
Referenced Files
Unknown Object (File)
Fri, Oct 4, 10:06 AM
Unknown Object (File)
Thu, Sep 19, 4:31 PM
Unknown Object (File)
Tue, Sep 17, 10:37 AM
Unknown Object (File)
Sep 7 2024, 1:02 AM
Unknown Object (File)
Sep 6 2024, 9:57 PM
Unknown Object (File)
Sep 1 2024, 12:27 PM
Unknown Object (File)
Aug 31 2024, 6:56 PM
Unknown Object (File)
Aug 24 2024, 1:54 PM
Subscribers

Details

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/compat/linuxkpi/common/include/linux/io.h
368 ↗(On Diff #59141)

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.

Spell lkpi -> LinuxKPI in the commit message.

Looks OK.

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

Pong :-) I'll have a look at the patch again.

hselasky edited reviewers, added: val_packett.cool; removed: hselasky.
This revision now requires review to proceed.Aug 28 2019, 8:14 AM
This revision is now accepted and ready to land.Aug 28 2019, 8:16 AM

panic: vm_fault_hold: fault on nofault entry, addr: 0xffff00006e1ff000 in gfx_v8_0_kiq_resume

so no, looks like wc/wb are not meant to be device memory

Can you update my patch and test an again? Thank you!

Can you update my patch and test an again? Thank you!

https://reviews.freebsd.org/differential/diff/61437/ is what I edited it to. Looks like I'm not allowed to update this revision after you took it.

Just select commander revision in the action menu.

This revision now requires review to proceed.Aug 29 2019, 7:13 AM
This revision is now accepted and ready to land.Aug 29 2019, 7:13 AM

I'll try to get the patch in on Monday. I'm currently busy. Thank you for the patience.