Skip to contentSkip to conversation

arm64: mm: use pgprot_device for device in phys_mem_access_prot

RFC Jisheng Zhang 2 participants 3 messages Jul 21, 2016 – Jul 22, 2016

lore
Share & tools
lore
#0 lore raw

Hi all,

Normally, in arm64, kernel driver maps register space as device nGnRE. But if we access the register space via. /dev/mem, then the mapping is device nGnRnE, is there a mismatch here?

the fix is s/pgprot_noncached/pgprot_device in phys_mem_access_prot().

Quoted 1 line

From armv8 ARM, this mismatch seems not the so called mismatched memory

attributes?

Thanks,
Jisheng

#1 lore raw
Quoted 3 lines · Jisheng Zhang

Normally, in arm64, kernel driver maps register space as device nGnRE. But if we access the register space via. /dev/mem, then the mapping is device nGnRnE, is there a mismatch here?

Possibly, but the behaviour is not undefined. The nGnRnE may lose the nE behaviour (which is a hint anyway, it may not be honoured).

/dev/mem is a pretty bad idea in general.

Signature · 1 line
Catalin
#2 lore raw
Quoted 7 lines · On Thu, 21 Jul 2016 17:03:00 +0100 Catalin Marinas wrote:
Quoted 3 lines · Jisheng Zhang

Normally, in arm64, kernel driver maps register space as device nGnRE. But if we access the register space via. /dev/mem, then the mapping is device nGnRnE, is there a mismatch here?

Possibly, but the behaviour is not undefined. The nGnRnE may lose the nE behaviour (which is a hint anyway, it may not be honoured).

Got it. Thanks for confirmation.