* [Qemu-devel] Re: lsi: Handle removal of selected devices
@ 2010-05-21 15:49 Aurelien Jarno
2010-05-21 16:17 ` Aurelien Jarno
2010-05-21 16:17 ` Jan Kiszka
0 siblings, 2 replies; 9+ messages in thread
From: Aurelien Jarno @ 2010-05-21 15:49 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel
This patch:
64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
commit 64d564094cac5f72eeaeb950c442b773a00d3586
Author: Jan Kiszka <jan.kiszka@siemens.com>
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.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
breaks the versatile machine. qemu-system-arm segfaults during the boot.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Re: lsi: Handle removal of selected devices
2010-05-21 15:49 [Qemu-devel] Re: lsi: Handle removal of selected devices Aurelien Jarno
@ 2010-05-21 16:17 ` Aurelien Jarno
2010-05-21 16:18 ` Jan Kiszka
2010-05-21 16:17 ` Jan Kiszka
1 sibling, 1 reply; 9+ messages in thread
From: Aurelien Jarno @ 2010-05-21 16:17 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel
On Fri, May 21, 2010 at 05:49:26PM +0200, Aurelien Jarno wrote:
> This patch:
>
> 64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
> commit 64d564094cac5f72eeaeb950c442b773a00d3586
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> 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.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
> 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/
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] Re: lsi: Handle removal of selected devices
2010-05-21 15:49 [Qemu-devel] Re: lsi: Handle removal of selected devices Aurelien Jarno
2010-05-21 16:17 ` Aurelien Jarno
@ 2010-05-21 16:17 ` Jan Kiszka
1 sibling, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2010-05-21 16:17 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel@nongnu.org
Aurelien Jarno wrote:
> This patch:
>
> 64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
> commit 64d564094cac5f72eeaeb950c442b773a00d3586
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> 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.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
> breaks the versatile machie. qemu-system-arm segfaults during the boot.
Do you have an image for me? Or some gdb backtrace?
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Re: lsi: Handle removal of selected devices
2010-05-21 16:17 ` Aurelien Jarno
@ 2010-05-21 16:18 ` Jan Kiszka
2010-05-21 16:23 ` Aurelien Jarno
2010-05-21 16:23 ` [Qemu-devel] Re: lsi: Handle removal of selected devices Jan Kiszka
0 siblings, 2 replies; 9+ messages in thread
From: Jan Kiszka @ 2010-05-21 16:18 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel@nongnu.org
Aurelien Jarno wrote:
> On Fri, May 21, 2010 at 05:49:26PM +0200, Aurelien Jarno wrote:
>> This patch:
>>
>> 64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
>> commit 64d564094cac5f72eeaeb950c442b773a00d3586
>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>> 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.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>
>> 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
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Re: lsi: Handle removal of selected devices
2010-05-21 16:18 ` Jan Kiszka
@ 2010-05-21 16:23 ` Aurelien Jarno
2010-05-21 16:44 ` [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing Jan Kiszka
2010-05-21 16:23 ` [Qemu-devel] Re: lsi: Handle removal of selected devices Jan Kiszka
1 sibling, 1 reply; 9+ messages in thread
From: Aurelien Jarno @ 2010-05-21 16:23 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel@nongnu.org
Jan Kiszka a écrit :
> Aurelien Jarno wrote:
>> On Fri, May 21, 2010 at 05:49:26PM +0200, Aurelien Jarno wrote:
>>> This patch:
>>>
>>> 64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
>>> commit 64d564094cac5f72eeaeb950c442b773a00d3586
>>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>>> 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.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>
>>> 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.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Re: lsi: Handle removal of selected devices
2010-05-21 16:18 ` Jan Kiszka
2010-05-21 16:23 ` Aurelien Jarno
@ 2010-05-21 16:23 ` Jan Kiszka
2010-05-21 16:25 ` Jan Kiszka
1 sibling, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2010-05-21 16:23 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel@nongnu.org
Jan Kiszka wrote:
> Aurelien Jarno wrote:
>> On Fri, May 21, 2010 at 05:49:26PM +0200, Aurelien Jarno wrote:
>>> This patch:
>>>
>>> 64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
>>> commit 64d564094cac5f72eeaeb950c442b773a00d3586
>>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>>> 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.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>
>>> 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
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Re: lsi: Handle removal of selected devices
2010-05-21 16:23 ` [Qemu-devel] Re: lsi: Handle removal of selected devices Jan Kiszka
@ 2010-05-21 16:25 ` Jan Kiszka
0 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2010-05-21 16:25 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel@nongnu.org
Jan Kiszka wrote:
> Jan Kiszka wrote:
>> Aurelien Jarno wrote:
>>> On Fri, May 21, 2010 at 05:49:26PM +0200, Aurelien Jarno wrote:
>>>> This patch:
>>>>
>>>> 64d564094cac5f72eeaeb950c442b773a00d3586 is the first bad commit
>>>> commit 64d564094cac5f72eeaeb950c442b773a00d3586
>>>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>>>> 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.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>>>
>>>> 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?
Forget it - shouldn't blindly run the suggested command line. With the
right qemu is crashes properly.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing
2010-05-21 16:23 ` Aurelien Jarno
@ 2010-05-21 16:44 ` Jan Kiszka
2010-05-22 14:05 ` Aurelien Jarno
0 siblings, 1 reply; 9+ messages in thread
From: Jan Kiszka @ 2010-05-21 16:44 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel@nongnu.org
This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong
patch version): We need to mask the tag value properly to obtain its
device ID.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/lsi53c895a.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 9d3c44d..f5a91ba 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -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);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing
2010-05-21 16:44 ` [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing Jan Kiszka
@ 2010-05-22 14:05 ` Aurelien Jarno
0 siblings, 0 replies; 9+ messages in thread
From: Aurelien Jarno @ 2010-05-22 14:05 UTC (permalink / raw)
To: Jan Kiszka; +Cc: qemu-devel@nongnu.org
On Fri, May 21, 2010 at 06:44:59PM +0200, Jan Kiszka wrote:
> This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong
> patch version): We need to mask the tag value properly to obtain its
> device ID.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Thanks for the quick patch, I have applied it.
> ---
> hw/lsi53c895a.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
> index 9d3c44d..f5a91ba 100644
> --- a/hw/lsi53c895a.c
> +++ b/hw/lsi53c895a.c
> @@ -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);
> --
> 1.6.0.2
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-05-22 14:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-21 15:49 [Qemu-devel] Re: lsi: Handle removal of selected devices Aurelien Jarno
2010-05-21 16:17 ` Aurelien Jarno
2010-05-21 16:18 ` Jan Kiszka
2010-05-21 16:23 ` Aurelien Jarno
2010-05-21 16:44 ` [Qemu-devel] [PATCH] lsi: Fix value overflow in request tag processing Jan Kiszka
2010-05-22 14:05 ` Aurelien Jarno
2010-05-21 16:23 ` [Qemu-devel] Re: lsi: Handle removal of selected devices Jan Kiszka
2010-05-21 16:25 ` Jan Kiszka
2010-05-21 16:17 ` Jan Kiszka
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).