Re: [PATCH] rust/pl011: Fix range checks for device ID accesses

2024-11-21 Thread Alex Bennée
Junjie Mao writes: > The peripheral and PrimeCell identification registers of pl011 are located at > offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C > implementation checks if the offset-shifted-by-2 (not the offset itself) is in > the range 0x3F8 - 0x3FF. > > Use the same

Re: [PATCH] rust/pl011: Fix range checks for device ID accesses

2024-11-18 Thread Alex Bennée
Junjie Mao writes: > Alex Bennée writes: > >> Junjie Mao writes: >> >>> The peripheral and PrimeCell identification registers of pl011 are located >>> at >>> offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C >>> implementation checks if the offset-shifted-by-2 (not the of

Re: [PATCH] rust/pl011: Fix range checks for device ID accesses

2024-11-18 Thread Junjie Mao
Alex Bennée writes: > Junjie Mao writes: > >> The peripheral and PrimeCell identification registers of pl011 are located at >> offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C >> implementation checks if the offset-shifted-by-2 (not the offset itself) is >> in >> the ra

Re: [PATCH] rust/pl011: Fix range checks for device ID accesses

2024-11-18 Thread Alex Bennée
Junjie Mao writes: > The peripheral and PrimeCell identification registers of pl011 are located at > offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C > implementation checks if the offset-shifted-by-2 (not the offset itself) is in > the range 0x3F8 - 0x3FF. > > Use the same

[PATCH] rust/pl011: Fix range checks for device ID accesses

2024-11-06 Thread Junjie Mao
The peripheral and PrimeCell identification registers of pl011 are located at offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C implementation checks if the offset-shifted-by-2 (not the offset itself) is in the range 0x3F8 - 0x3FF. Use the same check in the Rust implementatio