Re: [SeaBIOS] SeaBIOS Digest, Vol 72, Issue 33

2015-12-23 Thread Wim Vervoorn
Hello Kevin, Understood. Thanks. Best Regards, Wim Vervoorn Eltan B.V. Ambachtstraat 23 5481 SM Schijndel The Netherlands T : +31-(0)73-594 46 64 E : wvervo...@eltan.com W : http://www.eltan.com "THIS MESSAGE CONTAINS CONFIDENTIAL INFORMATION. UNLESS YOU ARE THE INTENDED RECIPIENT OF THIS ME

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
And with verbose logging (level 8). [...] |dfbf9000| USB MSC vendor='WD' product='Elements 10B8' rev='1012' type=0 removable=0 |dfbf9000| scsi_is_ready (drive=0x000f5c40) |dfbf9000| ehci_send_pipe qh=0x0009ed80 dir=0 data=0xdfbf9e45 size=31 |dfbfe000| ehci_send_pipe qh=0x0009ef00 dir=128 data=0xdf

[SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
Hi, I've attached a WD Elements 2TB drive to my pcengines APU1 as external storage and just found that with the disk attached SeaBIOS crashes on boot. :/ The controller is USB2, not USB3. Both the stock rom "Build 4/5/2014 (current production)" and a self-compiled coreboot rom with SeaBIOS master

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 04:27:55PM +0100, Tobias Diedrich wrote: > And with verbose logging (level 8). > > [...] > Wcall16 with invalid stack Strange. Can you report the output with the patch below? -Kevin --- a/src/stacks.c +++ b/src/stacks.c @@ -274,7 +274,8 @@ call16(u32 eax, u32 edx, void

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 12:51:30PM -0500, Kevin O'Connor wrote: > On Wed, Dec 23, 2015 at 04:27:55PM +0100, Tobias Diedrich wrote: > > And with verbose logging (level 8). > > > > [...] > > Wcall16 with invalid stack > > Strange. Can you report the output with the patch below? Using the patch be

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563 esp=dfbf3e50 .text._farcall16 0x9563 : { *(.text._farcall16) } On Wed, Dec 23, 2015 at 6:51 PM, Kevin O'Connor wrote: > On Wed, Dec 23, 2015 at 04:27:55PM +0100, Tobias Diedrich wrote: > > And with verbose logging (level 8). > > > >

Re: [SeaBIOS] [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 06:40:12AM +, Gonglei (Arei) wrote: > > From: Kevin O'Connor [mailto:ke...@koconnor.net] > > On Tue, Dec 22, 2015 at 02:14:12AM +, Gonglei (Arei) wrote: > > > Sorry, it doesn't work. What's worse is we cannot stop SeaBIOS stuck by > > > Setting "CONFIG_ENTRY_EXTRASTA

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 07:02:37PM +0100, Tobias Diedrich wrote: > Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563 esp=dfbf3e50 > > .text._farcall16 0x9563 : { *(.text._farcall16) } > Can you include the full log? It looks like the code tried to call a 16bit function while in a "

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563 esp=dfbf3e50 ret=0x000f2304 │.text:000F22C8 sub_F22C8 proc near ; CODE XREF: sub_F2309+2Cvp ▒ │.text:000F22C8 ; sub_F2309+35vj ▒ │.

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 07:13:27PM +0100, Tobias Diedrich wrote: > Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563 esp=dfbf3e50 > ret=0x000f2304 > > │.text:000F22C8 sub_F22C8 proc near ; CODE XREF: > sub_F2309+2Cvp > ▒ > │.text:000F22C8

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
On Wed, Dec 23, 2015 at 7:10 PM, Kevin O'Connor wrote: > On Wed, Dec 23, 2015 at 07:02:37PM +0100, Tobias Diedrich wrote: > > Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563 > esp=dfbf3e50 > > > > .text._farcall16 0x9563 : { *(.text._farcall16) } > > > > Can you include the full lo

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 07:39:56PM +0100, Tobias Diedrich wrote: > On Wed, Dec 23, 2015 at 7:10 PM, Kevin O'Connor wrote: > > > On Wed, Dec 23, 2015 at 07:02:37PM +0100, Tobias Diedrich wrote: > > > Wcall16 with invalid stack: eax=dfbf3e62 edx=0 func=0x000f9563 > > esp=dfbf3e50 > > > > > > .text.

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
I replaced the printf(...) with dprintf(1, ...) (since a dprintf earlier in the function was working fine). This appears to have fixed the issue (though PCHS seems to be wrong, maybe because sector count is negative when parsed as a signed int). Full log attached. |dfc02000| USB MSC vendor='WD'

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Tobias Diedrich
Final diff attached (without the src/stacks.c change, with %d->%u change for sector counts). Bootlog with debug_level 1 attached. On Wed, Dec 23, 2015 at 8:56 PM, Tobias Diedrich wrote: > I replaced the printf(...) with dprintf(1, ...) (since a dprintf earlier > in the function was working fin

Re: [SeaBIOS] [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform

2015-12-23 Thread Peter Stuge
Kevin O'Connor wrote: > SeaBIOS is careful to always disable IRQs while running C code to > prevent this issue, but disabling normal IRQs does not disable NMIs. > So, I believe this issue is specific to the nature of NMIs. Would a dedicated NMI handler stack be a good solution? //Peter

[SeaBIOS] [PATCH] nmi: Don't try to switch onto extra stack in NMI handler

2015-12-23 Thread Kevin O'Connor
The NMI could occur when already on the extra stack, which would corrupt it. Always use the current stack on an NMI to avoid this. Signed-off-by: Kevin O'Connor --- src/romlayout.S | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/romlayout.S b/src/romlayout.S index fe

[SeaBIOS] [PATCH 1/2] scsi: Do not call printf() from scsi_is_ready()

2015-12-23 Thread Kevin O'Connor
The scsi_is_ready() function may be called from a thread, and it is not valid to call printf() from a thread. Convert printf() to dprintf() to avoid this possibility. This does mean that cdrom detection (from cdrom_boot() ) may not give notification of slow cdrom drives to a user. However, the e

Re: [SeaBIOS] WD Elements hang SeaBIOS at boot with "call16 with invalid stack"

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 09:14:44PM +0100, Tobias Diedrich wrote: > Final diff attached (without the src/stacks.c change, with %d->%u change > for sector counts). > Bootlog with debug_level 1 attached. Great! Patches sent - if no further comments I'll commit in a few days. -Kevin ___

[SeaBIOS] [PATCH 2/2] block: Report drive->sectors using "%u" instead of "%d"

2015-12-23 Thread Kevin O'Connor
The sector count is a 64bit number that is often reported as a 32bit number (due to limitations in dprintf). Consistently use "%u" reporting to avoid confusing negative numbers. Reported-by: Tobias Diedrich Signed-off-by: Kevin O'Connor --- src/block.c | 2 +- src/hw/blockcmd.c | 2 +- 2

Re: [SeaBIOS] [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform

2015-12-23 Thread Kevin O'Connor
On Wed, Dec 23, 2015 at 09:27:25PM +0100, Peter Stuge wrote: > Kevin O'Connor wrote: > > SeaBIOS is careful to always disable IRQs while running C code to > > prevent this issue, but disabling normal IRQs does not disable NMIs. > > So, I believe this issue is specific to the nature of NMIs. > > Wo

Re: [SeaBIOS] [PATCH] xhci: Wait for port enable even for USB3 devices

2015-12-23 Thread Kevin O'Connor
On Sun, Dec 20, 2015 at 03:10:48PM -0500, Kevin O'Connor wrote: > Some USB3 controllers (and/or devices) need additional time after the > device is detected to place the port in an enabled state. Wait for > the controller to report enabled before proceeding. This fixes > several reports of device