qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Fwd: QEMU AVR Patch - Correct handling of AVR interrupts
       [not found] <CAB295yB5cFSZpGE74EW5hDMSNGnZfw06UC5ydepUL0sdT96WGg@mail.gmail.com>
@ 2023-06-08 21:03 ` Adecy
  2023-06-09 12:10   ` Michael Rolnik
  2023-06-12 12:53   ` Fwd: " Philippe Mathieu-Daudé
  0 siblings, 2 replies; 5+ messages in thread
From: Adecy @ 2023-06-08 21:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: mrolnik, qemu-trivial


[-- Attachment #1.1: Type: text/plain, Size: 273 bytes --]

---------- Forwarded message ---------
De : Adecy <ld.adecy@gmail.com>
Date: jeu. 1 juin 2023 à 21:34
Subject: QEMU AVR Patch - Correct handling of AVR interrupts
To: <qemu-trivial@nongnu.org>


Hello,

I would like to submit the attached patch.

Best regards

[-- Attachment #1.2: Type: text/html, Size: 653 bytes --]

[-- Attachment #2: 0001-Fix-handling-of-AVR-interrupts-above-33-by-switching.patch --]
[-- Type: application/x-patch, Size: 1575 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: QEMU AVR Patch - Correct handling of AVR interrupts
  2023-06-08 21:03 ` Fwd: QEMU AVR Patch - Correct handling of AVR interrupts Adecy
@ 2023-06-09 12:10   ` Michael Rolnik
  2023-06-12 12:53   ` Fwd: " Philippe Mathieu-Daudé
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Rolnik @ 2023-06-09 12:10 UTC (permalink / raw)
  To: Adecy; +Cc: qemu-devel, qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]

Reviewed-by: Michael Rolnik <mrolnik@gmail.com>

On Fri, Jun 9, 2023 at 12:04 AM Adecy <ld.adecy@gmail.com> wrote:

>
>
> ---------- Forwarded message ---------
> De : Adecy <ld.adecy@gmail.com>
> Date: jeu. 1 juin 2023 à 21:34
> Subject: QEMU AVR Patch - Correct handling of AVR interrupts
> To: <qemu-trivial@nongnu.org>
>
>
> Hello,
>
> I would like to submit the attached patch.
>
> Best regards
>


-- 
Best Regards,
Michael Rolnik

[-- Attachment #2: Type: text/html, Size: 1284 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: QEMU AVR Patch - Correct handling of AVR interrupts
  2023-06-08 21:03 ` Fwd: QEMU AVR Patch - Correct handling of AVR interrupts Adecy
  2023-06-09 12:10   ` Michael Rolnik
@ 2023-06-12 12:53   ` Philippe Mathieu-Daudé
  2023-06-12 17:08     ` Adecy
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-12 12:53 UTC (permalink / raw)
  To: Adecy, qemu-devel; +Cc: mrolnik, qemu-trivial

Hi Lucas,

On 8/6/23 23:03, Adecy wrote:
> ---------- Forwarded message ---------
> De : *Adecy* <ld.adecy@gmail.com <mailto:ld.adecy@gmail.com>>
> Date: jeu. 1 juin 2023 à 21:34
> Subject: QEMU AVR Patch - Correct handling of AVR interrupts
> To: <qemu-trivial@nongnu.org <mailto:qemu-trivial@nongnu.org>>
> 
> 
> Hello,
> 
> I would like to submit the attached patch.

Unfortunately your patch doesn't apply cleanly:

Applying: Fix handling of AVR interrupts above 33 by switching ctz32 to 
ctz64
error: patch failed: target/avr/helper.c:45
error: target/avr/helper.c: patch does not apply
Patch failed at 0001 Fix handling of AVR interrupts above 33 by 
switching ctz32 to ctz64
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

You can find help on how to send your patch here:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#submitting-your-patches

Thanks,

Phil.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: QEMU AVR Patch - Correct handling of AVR interrupts
  2023-06-12 12:53   ` Fwd: " Philippe Mathieu-Daudé
@ 2023-06-12 17:08     ` Adecy
  2023-06-13  9:42       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Adecy @ 2023-06-12 17:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-devel, mrolnik, qemu-trivial


[-- Attachment #1.1: Type: text/plain, Size: 1462 bytes --]

Hello Phil,

I believe I have resolved the problem.

However, I didn't managed to make git send-email work yet. So please find
the patch attached.

Best regards,

Le lun. 12 juin 2023 à 14:53, Philippe Mathieu-Daudé <philmd@linaro.org> a
écrit :

> Hi Lucas,
>
> On 8/6/23 23:03, Adecy wrote:
> > ---------- Forwarded message ---------
> > De : *Adecy* <ld.adecy@gmail.com <mailto:ld.adecy@gmail.com>>
> > Date: jeu. 1 juin 2023 à 21:34
> > Subject: QEMU AVR Patch - Correct handling of AVR interrupts
> > To: <qemu-trivial@nongnu.org <mailto:qemu-trivial@nongnu.org>>
> >
> >
> > Hello,
> >
> > I would like to submit the attached patch.
>
> Unfortunately your patch doesn't apply cleanly:
>
> Applying: Fix handling of AVR interrupts above 33 by switching ctz32 to
> ctz64
> error: patch failed: target/avr/helper.c:45
> error: target/avr/helper.c: patch does not apply
> Patch failed at 0001 Fix handling of AVR interrupts above 33 by
> switching ctz32 to ctz64
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>
> You can find help on how to send your patch here:
>
> https://www.qemu.org/docs/master/devel/submitting-a-patch.html#submitting-your-patches
>
> Thanks,
>
> Phil.
>
>

[-- Attachment #1.2: Type: text/html, Size: 2492 bytes --]

[-- Attachment #2: 0001-Fix-handling-of-AVR-interrupts-above-33.patch --]
[-- Type: application/octet-stream, Size: 3854 bytes --]

From 39b7525635560cf3cea3bdefd53220c1274c23bb Mon Sep 17 00:00:00 2001
From: Lucas Dietrich <ld.adecy@gmail.com>
Date: Mon, 12 Jun 2023 19:43:59 +0200
Subject: [PATCH] Fix handling of AVR interrupts above 33.

This commit addresses a bug in the AVR interrupt handling code.
The modification involves replacing the usage of the ctz32 function
with ctz64 to ensure proper handling of interrupts above 33 in the AVR
target.

Previously, timers 3, 4, and 5 interrupts were not functioning correctly
because most of their interrupt vectors are numbered above 33.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
---
 capstone                      | 1 +
 dtc                           | 1 +
 meson                         | 1 +
 roms/sgabios                  | 1 +
 slirp                         | 1 +
 target/avr/helper.c           | 4 ++--
 tests/fp/berkeley-softfloat-3 | 1 +
 tests/fp/berkeley-testfloat-3 | 1 +
 ui/keycodemapdb               | 1 +
 9 files changed, 10 insertions(+), 2 deletions(-)
 create mode 160000 capstone
 create mode 160000 dtc
 create mode 160000 meson
 create mode 160000 roms/sgabios
 create mode 160000 slirp
 create mode 160000 tests/fp/berkeley-softfloat-3
 create mode 160000 tests/fp/berkeley-testfloat-3
 create mode 160000 ui/keycodemapdb

diff --git a/capstone b/capstone
new file mode 160000
index 0000000000..f8b1b83301
--- /dev/null
+++ b/capstone
@@ -0,0 +1 @@
+Subproject commit f8b1b833015a4ae47110ed068e0deb7106ced66d
diff --git a/dtc b/dtc
new file mode 160000
index 0000000000..b6910bec11
--- /dev/null
+++ b/dtc
@@ -0,0 +1 @@
+Subproject commit b6910bec11614980a21e46fbccc35934b671bd81
diff --git a/meson b/meson
new file mode 160000
index 0000000000..12f9f04ba0
--- /dev/null
+++ b/meson
@@ -0,0 +1 @@
+Subproject commit 12f9f04ba0decfda425dbbf9a501084c153a2d18
diff --git a/roms/sgabios b/roms/sgabios
new file mode 160000
index 0000000000..cbaee52287
--- /dev/null
+++ b/roms/sgabios
@@ -0,0 +1 @@
+Subproject commit cbaee52287e5f32373181cff50a00b6c4ac9015a
diff --git a/slirp b/slirp
new file mode 160000
index 0000000000..a88d9ace23
--- /dev/null
+++ b/slirp
@@ -0,0 +1 @@
+Subproject commit a88d9ace234a24ce1c17189642ef9104799425e0
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 2bad242a66..e6e7d51487 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -52,7 +52,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
     }
     if (interrupt_request & CPU_INTERRUPT_HARD) {
         if (cpu_interrupts_enabled(env) && env->intsrc != 0) {
-            int index = ctz32(env->intsrc);
+            int index = ctz64(env->intsrc);
             cs->exception_index = EXCP_INT(index);
             avr_cpu_do_interrupt(cs);
 
@@ -79,7 +79,7 @@ void avr_cpu_do_interrupt(CPUState *cs)
     if (cs->exception_index == EXCP_RESET) {
         vector = 0;
     } else if (env->intsrc != 0) {
-        vector = ctz32(env->intsrc) + 1;
+        vector = ctz64(env->intsrc) + 1;
     }
 
     if (avr_feature(env, AVR_FEATURE_3_BYTE_PC)) {
diff --git a/tests/fp/berkeley-softfloat-3 b/tests/fp/berkeley-softfloat-3
new file mode 160000
index 0000000000..b64af41c32
--- /dev/null
+++ b/tests/fp/berkeley-softfloat-3
@@ -0,0 +1 @@
+Subproject commit b64af41c3276f97f0e181920400ee056b9c88037
diff --git a/tests/fp/berkeley-testfloat-3 b/tests/fp/berkeley-testfloat-3
new file mode 160000
index 0000000000..5a59dcec19
--- /dev/null
+++ b/tests/fp/berkeley-testfloat-3
@@ -0,0 +1 @@
+Subproject commit 5a59dcec19327396a011a17fd924aed4fec416b3
diff --git a/ui/keycodemapdb b/ui/keycodemapdb
new file mode 160000
index 0000000000..d21009b1c9
--- /dev/null
+++ b/ui/keycodemapdb
@@ -0,0 +1 @@
+Subproject commit d21009b1c9f94b740ea66be8e48a1d8ad8124023
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: Fwd: QEMU AVR Patch - Correct handling of AVR interrupts
  2023-06-12 17:08     ` Adecy
@ 2023-06-13  9:42       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-13  9:42 UTC (permalink / raw)
  To: Adecy; +Cc: qemu-devel, mrolnik, qemu-trivial

On 12/6/23 19:08, Adecy wrote:
> Hello Phil,
> 
> I believe I have resolved the problem.
> 
> However, I didn't managed to make git send-email work yet. So please 
> find the patch attached.

Maybe sourcehut will be easier, its setup is well documented, see:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#if-you-cannot-send-patch-emails



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-13 11:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAB295yB5cFSZpGE74EW5hDMSNGnZfw06UC5ydepUL0sdT96WGg@mail.gmail.com>
2023-06-08 21:03 ` Fwd: QEMU AVR Patch - Correct handling of AVR interrupts Adecy
2023-06-09 12:10   ` Michael Rolnik
2023-06-12 12:53   ` Fwd: " Philippe Mathieu-Daudé
2023-06-12 17:08     ` Adecy
2023-06-13  9:42       ` Philippe Mathieu-Daudé

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).