[tlinux-users:08133] Re: New release of omnibook module soon: testing welcome
Mathieu Bérard <[email protected]>
| Newsgroups | gmane.linux.hardware.toshiba |
|---|---|
| Message-ID | <[email protected]> |
Holger Nelson a écrit : > I get a null-pointer-dereference in nbsmi_smi_command on my Toshiba Tecra > S1 and narrowed it down to these lines: > save_all_regs_flag(); > intel_do_smi_call(&retval,function,sci_en); > restore_all_regs_flag(); > > I will try to debug this after I slept. Well I have two theories: -There is an obvious bug that I don't see (quite possible) -The spec I have say that writing to port b2 or b0 trigger a System Management Interrupt which may mangle all the registers* an flags of the processor , hence the 'pusha pushf' and 'popa popf' which save an then restore them. "save_all_regs_flag(); intel_do_smi_call(&retval,function,sci_en); restore_all_regs_flag(); " Generate this code for me: d8: 60 pusha d9: 9c pushf da: 8d 44 24 0c lea 0xc(%esp),%eax de: 8b 54 24 10 mov 0x10(%esp),%edx e2: 89 44 24 08 mov %eax,0x8(%esp) e6: ed in (%dx),%eax e7: 89 c1 mov %eax,%ecx e9: 31 c0 xor %eax,%eax eb: ef out %eax,(%dx) ec: 89 f0 mov %esi,%eax ee: 66 e7 b2 out %ax,$0xb2 <--- Trigger SMI f1: 89 44 24 08 mov %eax,0x8(%esp) f5: 89 c8 mov %ecx,%eax f7: ef out %eax,(%dx) <--- If dx has been cleared we are doomed f8: 9d popf f9: 61 popa Which mean that I will have to recode the whole block in asm to control precisely what is going on. This might also explain the failures reported by Renato S. Yamane * While not precised anywhere in the doc I have assumed it does not include esp or I fail to see how we can recover. -- Mathieu