grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: USB controller hand-back (original thread: Missing USB devices.)


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: USB controller hand-back (original thread: Missing USB devices.)
Date: Tue, 03 Sep 2013 00:52:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8

On 02.09.2013 23:33, Aleš Nesrsta wrote:
> 2.9.2013 09:01, Melki Christian (consultant) wrote:
>> Exactly.
>> The EHCI handback is provided by the EHCI spec handover state machine.
>> Problem is, most BIOS:es don't implement it, or just screw it up trying.
>> The scenario is like this:
>> Load grub2 with EHCI usb.
>> Grub2 loads windows 7 or something.
>> Windows 7 goes b0rk and requests input (diskcheck etc).
>> User only has USB-keyboard.
>> Eeep, can't enter anything because windows 7 has not loaded usb-stuff
>> yet.
> 
> It is surprising for me that Windows does not load USB drivers in such
> case and the above described situation can happen.
> I never saw such situation in Linux, but in fact it can probably also
> happen in some (badly) customized kernels/images etc.
> 
>> I've played with setting the correct smi-bits and then just flip the
>> OS_OWNED flag. This should make the BIOS take over control again. I
>> did it in the fini-hook and that function gets run when the loader
>> starts running. Patch attach. It is just for toying, not final work or
>> anything. :)
>> The patch works for some BIOS:es. Most of the time it does nothing to
>> help. Some BIOS:es screw it up when trying to reclaim ownership
>> however. :(
> 
> Interesting. According to results of your experiments it looks like
> really black magic... But maybe it is correct even if we will possibly
> don't like it - see next...
> - As I don't know details about BIOSes and SMM etc., I am little bit
> afraid of one thing: couldn't happen something wrong with loaded OS
> kernel when BIOS takes ownership of USB controller? I mean e.g. if in
> the case of hand-back cannot happen some memory collision between BIOS
> and loaded/booted kernel/image etc.
> 
Linux or any other natively supported payload should handle the problem
correctly
As for chainloading targets, the only way to make sure that they work is
to stick to BIOS drivers and not load native drivers at all.
Do you have a scenario when loading native drivers is necessary when
loading chainloaded target?
> Additionally, EHCI specification doesn't say that BIOS (SMM) really must
> implement hand-back and immediately start again legacy support - EHCI
> specifies only handover mechanism. So, in fact, BIOS which does nothing
> in the hand-back case is probably correct - at least according to EHCI
> specification...
> 
You're correct. Hand-back should never be attempted both for
specification and practical reasons.
> If hand-back could be dangerous in some way or could have some
> unexpected/unwanted behavior in some cases, I expect it will be better
> to don't implement it (or implement it only as some very special option
> for experts - but I have no idea in which way...).
> 
> What is Vladimir's opinion?
> 
> BR,
> Ales
> 
> _______________________________________________
> Grub-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]