Skip to contentSkip to conversation

lsi: Handle removal of selected devices

Qemu-devel In review Aurelien Jarno 2 participants 9 messages May 21, 2010 – May 22, 2010

lore
Share & tools
lore
#0 lore raw

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

breaks the versatile machine. qemu-system-arm segfaults during the boot.

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#1 lore raw
Quoted 9 lines · Aurelien Jarno

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

Quoted 8 lines

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

breaks the versatile machie. qemu-system-arm segfaults during the boot.

Do you have an image for me? Or some gdb backtrace?

Thanks,
Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#2 lore raw
In reply to Aurelien Jarno
Quoted 9 lines · Aurelien Jarno

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

Quoted 8 lines

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

breaks the versatile machine. qemu-system-arm segfaults during the boot.

Actually it only seems to be the case with old kernels. I have put the material to reproduce the bug here:

http://temp.aurel32.net/qemu-versatile/

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#3 lore raw
Quoted 17 lines · Aurelien Jarno
Quoted 16 lines · Aurelien Jarno

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

Quoted 7 lines
Quoted 1 line

breaks the versatile machine. qemu-system-arm segfaults during the boot.

Actually it only seems to be the case with old kernels. I have put the material to reproduce the bug here:

http://temp.aurel32.net/qemu-versatile/

Ah, perfect. Will have a look.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#4 lore raw
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Aurelien Jarno
Quoted 16 lines · Aurelien Jarno

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

breaks the versatile machine. qemu-system-arm segfaults during the boot.

Actually it only seems to be the case with old kernels. I have put the material to reproduce the bug here:

http://temp.aurel32.net/qemu-versatile/

Ah, perfect. Will have a look.

Boots fine up to "Waiting for root file system". That's on a 64-bit host. Are you on 32 bits?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#5 lore raw
Quoted 23 lines · Jan Kiszka
Quoted 22 lines · Jan Kiszka
Quoted 21 lines · Aurelien Jarno
Quoted 9 lines · Aurelien Jarno

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

Quoted 8 lines

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

breaks the versatile machine. qemu-system-arm segfaults during the boot.

Actually it only seems to be the case with old kernels. I have put the material to reproduce the bug here:

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

http://temp.aurel32.net/qemu-versatile/

Ah, perfect. Will have a look.

Boots fine up to "Waiting for root file system". That's on a 64-bit host. Are you on 32 bits?

Forget it - shouldn't blindly run the suggested command line. With the right qemu is crashes properly.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#6 lore raw
In reply to Jan Kiszka
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Aurelien Jarno
Quoted 16 lines · Aurelien Jarno

This patch:

64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit commit 64d564094cac5f72eeaeb950c442b773a00d3586

Author: Jan Kiszka <[email protected]>
Date:   Tue May 4 14:21:03 2010 +0200

lsi: Handle removal of selected devices

We must not store references to selected devices as they may be hot-removed. Instead, look up the device based on its tag right before using it. If the device disappeared, throw an interrupt and disconnect.

Quoted 9 lines
Quoted 6 lines
Quoted 1 line

breaks the versatile machine. qemu-system-arm segfaults during the boot.

Actually it only seems to be the case with old kernels. I have put the material to reproduce the bug here:

http://temp.aurel32.net/qemu-versatile/

Ah, perfect. Will have a look.

Thanks.

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#7 lore raw

PATCH 1/1 lsi: Fix value overflow in request tag processing

This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong patch version): We need to mask the tag value properly to obtain its device ID.

---
 hw/lsi53c895a.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/lsi53c895a.c +2 -2
index 9d3c44d..f5a91ba 100644
@@ -543,7 +543,7 @@ static void lsi_do_dma(LSIState *s, int out)
         return;
     }
 
-    id = s->current->tag >> 8;
+    id = (s->current->tag >> 8) & 0xf;
     dev = s->bus.devs[id];
     if (!dev) {
         lsi_bad_selection(s, id);
@@ -745,7 +745,7 @@ static void lsi_do_command(LSIState *s)
     s->sfbr = buf[0];
     s->command_complete = 0;
 
-    id = s->select_tag >> 8;
+    id = (s->select_tag >> 8) & 0xf;
     dev = s->bus.devs[id];
     if (!dev) {
         lsi_bad_selection(s, id);
Signature · 1 line
1.6.0.2
#8 lore raw

Re: [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing

Quoted 5 lines · Jan Kiszka

This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong patch version): We need to mask the tag value properly to obtain its device ID.

Thanks for the quick patch, I have applied it.

Quoted 30 lines
---
 hw/lsi53c895a.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/lsi53c895a.c +2 -2
index 9d3c44d..f5a91ba 100644
@@ -543,7 +543,7 @@ static void lsi_do_dma(LSIState *s, int out)
         return;
     }
 
-    id = s->current->tag >> 8;
+    id = (s->current->tag >> 8) & 0xf;
     dev = s->bus.devs[id];
     if (!dev) {
         lsi_bad_selection(s, id);
@@ -745,7 +745,7 @@ static void lsi_do_command(LSIState *s)
     s->sfbr = buf[0];
     s->command_complete = 0;
 
-    id = s->select_tag >> 8;
+    id = (s->select_tag >> 8) & 0xf;
     dev = s->bus.devs[id];
     if (!dev) {
         lsi_bad_selection(s, id);
Signature · 1 line
1.6.0.2
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net