Skip to contentSkip to conversation

3/5: Bugfix needed for FreeBSD/amd64 guests

PATCH In review Juergen Lock 3 participants 6 messages Oct 1, 2008 – Oct 18, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 3/5: Bugfix needed for FreeBSD/amd64 guests

This was originally posted as:

	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

Index: qemu/cpu-exec.c
@@ -394,16 +394,18 @@

                                      (env->eflags & IF_MASK && 
                                       !(env->hflags & HF_INHIBIT_IRQ_MASK))))) {
                             int intno;
-                            svm_check_intercept(SVM_EXIT_INTR);
                             env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ);
                             intno = cpu_get_pic_interrupt(env);

- if (loglevel & CPU_LOG_TB_IN_ASM) {
- fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno);
+ if (intno>=0) {
+ svm_check_intercept(SVM_EXIT_INTR);
+ if (loglevel & CPU_LOG_TB_IN_ASM) {
+ fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno);

+                                }
+                                do_interrupt(intno, 0, 0, 0, 1);
+                                /* ensure that no TB jump will be modified as
+                                   the program flow was changed */
+                                next_tb = 0;
                             }

- do_interrupt(intno, 0, 0, 0, 1);
- /* ensure that no TB jump will be modified as
- the program flow was changed */
- next_tb = 0;

 #if !defined(CONFIG_USER_ONLY)
                         } else if ((interrupt_request & CPU_INTERRUPT_VIRQ) &&
                                    (env->eflags & IF_MASK) && 
#1 lore raw
Quoted 2 lines · Juergen Lock

This was originally posted as:

	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

If I understand correctly, the problem appears when running FreeBSD/amd64 as a guest. Could you please give more details about that? (FreeBSD version, how to reproduce the problem, symptoms).

Thanks.

Quoted 32 lines

Index: qemu/cpu-exec.c

(quoted diff) +9 -7
@@ -394,16 +394,18 @@
                                      (env->eflags & IF_MASK && 
                                       !(env->hflags & HF_INHIBIT_IRQ_MASK))))) {
                             int intno;
-                            svm_check_intercept(SVM_EXIT_INTR);
                             env->interrupt_request &= ~(CPU_INTERRUPT_HARD | CPU_INTERRUPT_VIRQ);
                             intno = cpu_get_pic_interrupt(env);
-                            if (loglevel & CPU_LOG_TB_IN_ASM) {
-                                fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno);
+                            if (intno>=0) {
+                                svm_check_intercept(SVM_EXIT_INTR);
+                                if (loglevel & CPU_LOG_TB_IN_ASM) {
+                                    fprintf(logfile, "Servicing hardware INT=0x%02x\n", intno);
+                                }
+                                do_interrupt(intno, 0, 0, 0, 1);
+                                /* ensure that no TB jump will be modified as
+                                   the program flow was changed */
+                                next_tb = 0;
                             }
-                            do_interrupt(intno, 0, 0, 0, 1);
-                            /* ensure that no TB jump will be modified as
-                               the program flow was changed */
-                            next_tb = 0;
 #if !defined(CONFIG_USER_ONLY)
                         } else if ((interrupt_request & CPU_INTERRUPT_VIRQ) &&
                                    (env->eflags & IF_MASK) && 
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#2 lore raw
Quoted 7 lines · Aurelien Jarno
Quoted 2 lines · Juergen Lock

This was originally posted as:

	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

If I understand correctly, the problem appears when running FreeBSD/amd64 as a guest. Could you please give more details about that? (FreeBSD version, how to reproduce the problem, symptoms).

Hmm. Actually I seem to be unable to reproduce this using the latest svn snapshot I built (r5457,

	http://people.freebsd.org/~nox/qemu/qemu-devel-20081011.patch

) with that patch (files/patch-cpu-exec.c) taken out.

Kostik, can you still reproduce it using this snapshot with the patch
taken out? I just tried 7.0-RELEASE-amd64-livefs.iso, 6.2-RELEASE-amd64-disc1.iso and an older 8.0 guest I had, both with and without kqemu and the first two on i386 too... (-kernel-kqemu is still broken but thats a different bug.)

Kostik's original posting with explanation of the bug (and original patch)
is here:

	http://docs.freebsd.org/cgi/mid.cgi?20080216164331.GJ57756

TeLeMan's followup to my post about Kostik's patch on the qemu list is here:

	http://lists.gnu.org/archive/html/qemu-devel/2008-02/msg00334.html
(which links to the mentioned
	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

)

Thanx,
Juergen

#3 lore raw
Quoted 11 lines · Juergen Lock
Quoted 7 lines · Aurelien Jarno
Quoted 2 lines · Juergen Lock

This was originally posted as:

	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

If I understand correctly, the problem appears when running FreeBSD/amd64 as a guest. Could you please give more details about that? (FreeBSD version, how to reproduce the problem, symptoms).

Hmm. Actually I seem to be unable to reproduce this using the latest svn snapshot I built (r5457,

Quoted 8 lines
	http://people.freebsd.org/~nox/qemu/qemu-devel-20081011.patch

) with that patch (files/patch-cpu-exec.c) taken out.

Kostik, can you still reproduce it using this snapshot with the patch
taken out? I just tried 7.0-RELEASE-amd64-livefs.iso, 6.2-RELEASE-amd64-disc1.iso and an older 8.0 guest I had, both with and without kqemu and the first two on i386 too... (-kernel-kqemu is still broken but thats a different bug.)

I am not set up for testing qemu snapshots.
I do still use the patch with freebsd qemu port for booting 8-CURRENT.

Quoted 13 lines

Kostik's original posting with explanation of the bug (and original patch)
is here:

	http://docs.freebsd.org/cgi/mid.cgi?20080216164331.GJ57756

TeLeMan's followup to my post about Kostik's patch on the qemu list is here:

	http://lists.gnu.org/archive/html/qemu-devel/2008-02/msg00334.html
(which links to the mentioned
	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

)

Thanx,
Juergen

#4 lore raw
Quoted 15 lines · Konstantin Belousov
Quoted 14 lines · Juergen Lock
Quoted 7 lines · Aurelien Jarno
Quoted 2 lines · Juergen Lock

This was originally posted as:

	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

If I understand correctly, the problem appears when running FreeBSD/amd64 as a guest. Could you please give more details about that? (FreeBSD version, how to reproduce the problem, symptoms).

Hmm. Actually I seem to be unable to reproduce this using the latest svn snapshot I built (r5457,

	http://people.freebsd.org/~nox/qemu/qemu-devel-20081011.patch

) with that patch (files/patch-cpu-exec.c) taken out.

Quoted 8 lines
Quoted 5 lines

Kostik, can you still reproduce it using this snapshot with the patch
taken out? I just tried 7.0-RELEASE-amd64-livefs.iso, 6.2-RELEASE-amd64-disc1.iso and an older 8.0 guest I had, both with and without kqemu and the first two on i386 too... (-kernel-kqemu is still broken but thats a different bug.)

I am not set up for testing qemu snapshots.
I do still use the patch with freebsd qemu port for booting 8-CURRENT.

Oh, you should be able to apply the qemu-devel-20081011.patch to a copy of the qemu-devel port dir, build that, and run the qemu executable from below the work/ dir with the pc-bios dir passed as -L:

	work/qemu-snapshot-2008-10-11_18/x86_64-softmmu/qemu-system-x86_64 -L work/qemu-snapshot-2008-10-11_18/pc-bios -hda ...

Just thought I'd mention...
Juergen :)

#5 lore raw
Quoted 21 lines · On Thu, Oct 16, 2008 at 10:47:54PM +0200, I wrote:
Quoted 20 lines · Konstantin Belousov
Quoted 19 lines · Juergen Lock
Quoted 7 lines · Aurelien Jarno
Quoted 2 lines · Juergen Lock

This was originally posted as:

	http://www.nabble.com/-PATCH--i386-hard-interrupt-generation-bug-fix-p14921171.html

If I understand correctly, the problem appears when running FreeBSD/amd64 as a guest. Could you please give more details about that? (FreeBSD version, how to reproduce the problem, symptoms).

Hmm. Actually I seem to be unable to reproduce this using the latest svn snapshot I built (r5457,

	http://people.freebsd.org/~nox/qemu/qemu-devel-20081011.patch

) with that patch (files/patch-cpu-exec.c) taken out.

Kostik, can you still reproduce it using this snapshot with the patch
taken out? I just tried 7.0-RELEASE-amd64-livefs.iso, 6.2-RELEASE-amd64-disc1.iso and an older 8.0 guest I had, both with and without kqemu and the first two on i386 too... (-kernel-kqemu is still broken but thats a different bug.)

Quoted 5 lines
Quoted 3 lines

I am not set up for testing qemu snapshots.
I do still use the patch with freebsd qemu port for booting 8-CURRENT.

Oh, you should be able to apply the qemu-devel-20081011.patch to a copy of the qemu-devel port dir, build that,

...and by build that' i mean run make' by itself in the patched port dir so the port is only built but not installed.

Quoted 3 lines

and run the qemu executable from
below the work/ dir with the pc-bios dir passed as -L:

	work/qemu-snapshot-2008-10-11_18/x86_64-softmmu/qemu-system-x86_64 -L work/qemu-snapshot-2008-10-11_18/pc-bios -hda ...

Just thought I'd clarify, :)
Juergen