* [PATCH] rust: pl011: fix device id matching
@ 2024-11-06 18:51 Paolo Bonzini
2024-11-06 22:56 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2024-11-06 18:51 UTC (permalink / raw)
To: qemu-devel; +Cc: Pierrick Bouvier, Manos Pitsidianakis
The offset that is compared against 0x3f8..0x400 is not shifted right.
Adjust the pattern matching.
Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
rust/hw/char/pl011/src/device.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/hw/char/pl011/src/device.rs b/rust/hw/char/pl011/src/device.rs
index 2a85960b81f..6556865fc22 100644
--- a/rust/hw/char/pl011/src/device.rs
+++ b/rust/hw/char/pl011/src/device.rs
@@ -182,7 +182,7 @@ pub fn read(&mut self, offset: hwaddr, _size: c_uint) -> std::ops::ControlFlow<u
use 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(_) => {
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] rust: pl011: fix device id matching
2024-11-06 18:51 [PATCH] rust: pl011: fix device id matching Paolo Bonzini
@ 2024-11-06 22:56 ` Philippe Mathieu-Daudé
2024-11-07 13:09 ` Manos Pitsidianakis
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-11-06 22:56 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Pierrick Bouvier, Manos Pitsidianakis
On 6/11/24 18:51, Paolo Bonzini wrote:
> The offset that is compared against 0x3f8..0x400 is not shifted right.
> Adjust the pattern matching.
>
> Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> rust/hw/char/pl011/src/device.rs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: pl011: fix device id matching
2024-11-06 22:56 ` Philippe Mathieu-Daudé
@ 2024-11-07 13:09 ` Manos Pitsidianakis
2024-11-07 13:33 ` Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Manos Pitsidianakis @ 2024-11-07 13:09 UTC (permalink / raw)
To: Philippe Mathieu-Daudé , Paolo Bonzini, qemu-devel
Cc: Pierrick Bouvier, Manos Pitsidianakis
On Wed, 06 Nov 2024 22:56, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>On 6/11/24 18:51, Paolo Bonzini wrote:
>> The offset that is compared against 0x3f8..0x400 is not shifted right.
>> Adjust the pattern matching.
>>
>> Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> rust/hw/char/pl011/src/device.rs | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
The device id reporting is still buggy even with this patch. I will send
a proper fix within the day.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: pl011: fix device id matching
2024-11-07 13:09 ` Manos Pitsidianakis
@ 2024-11-07 13:33 ` Paolo Bonzini
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2024-11-07 13:33 UTC (permalink / raw)
To: Manos Pitsidianakis
Cc: Philippe Mathieu-Daudé, qemu-devel, Pierrick Bouvier
On Thu, Nov 7, 2024 at 2:10 PM Manos Pitsidianakis
<manos.pitsidianakis@linaro.org> wrote:
> On Wed, 06 Nov 2024 22:56, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> >On 6/11/24 18:51, Paolo Bonzini wrote:
> >> The offset that is compared against 0x3f8..0x400 is not shifted right.
> >> Adjust the pattern matching.
> >>
> >> Cc: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> >> Cc: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >> ---
> >> rust/hw/char/pl011/src/device.rs | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-07 13:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-06 18:51 [PATCH] rust: pl011: fix device id matching Paolo Bonzini
2024-11-06 22:56 ` Philippe Mathieu-Daudé
2024-11-07 13:09 ` Manos Pitsidianakis
2024-11-07 13:33 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).