rust: pl011: fix device id matching
PATCH 1/1 rust: pl011: fix device id matching
The offset that is compared against 0x3f8..0x400 is not shifted right. Adjust the pattern matching.
Cc Pierrick Bouvier <[email protected]>
Cc Manos Pitsidianakis <[email protected]>
Signed-off-by Paolo Bonzini <[email protected]>
--- rust/hw/char/pl011/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/hw/char/pl011/src/device.rs +1 -1
@@ -182,7 +182,7 @@ pub fn read(&mut self, offset: hwaddr, _size: c_uint) -> std::ops::ControlFlow<uuse RegisterOffset ::*; std::ops::ControlFlow ::Break (match RegisterOffset ::try_from (offset) { -Err (v)if (0x3f8 ..0x400 ).contains (&v) => { +Err (v)if (0xfe0 ..=0xffc ).contains (&v) => { u64::from (self.device_id[(offset -0xfe0 ) >>2 ]) }Err (_) => {
Signature · 1 line
2.47.0
Quoted 9 lines · Paolo Bonzini
The offset that is compared against 0x3f8..0x400 is not shifted right. Adjust the pattern matching.
Cc Pierrick Bouvier <[email protected]>Cc Manos Pitsidianakis <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- rust/hw/char/pl011/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 4 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Paolo Bonzini
The offset that is compared against 0x3f8..0x400 is not shifted right. Adjust the pattern matching.
Quoted 9 lines
Quoted 6 lines
Cc Pierrick Bouvier <[email protected]>Cc Manos Pitsidianakis <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- rust/hw/char/pl011/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Philippe Mathieu-Daudé <[email protected]>
The device id reporting is still buggy even with this patch. I will send a proper fix within the day.
Quoted 12 lines · Manos Pitsidianakis
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Paolo Bonzini
The offset that is compared against 0x3f8..0x400 is not shifted right. Adjust the pattern matching.
Cc Pierrick Bouvier <[email protected]>Cc Manos Pitsidianakis <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- rust/hw/char/pl011/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line
Reviewed-by Philippe Mathieu-Daudé <[email protected]>The device id reporting is still buggy even with this patch. I will send a proper fix within the day.
Sure, but can you expand on what's the breakage?
Paolo