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)
Sun, Mar 3, 11:32 PM
Unknown Object (File)
Jan 29 2024, 4:44 AM
Unknown Object (File)
Jan 2 2024, 6:55 PM
Unknown Object (File)
Dec 23 2023, 3:23 AM
Unknown Object (File)
Dec 20 2023, 11:13 PM
Unknown Object (File)
Dec 18 2023, 1:52 PM
Unknown Object (File)
Dec 18 2023, 1:35 PM
Unknown Object (File)
Nov 12 2023, 2:52 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.