grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: USB controller hand-back (original thread: Missing USB devices.)
Date: Tue, 03 Sep 2013 00:52:38 +0200	[thread overview]
Message-ID: <522516B6.20900@gmail.com> (raw)
In-Reply-To: <5225042F.50906@volny.cz>

[-- Attachment #1: Type: text/plain, Size: 3013 bytes --]

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
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 291 bytes --]

  reply	other threads:[~2013-09-02 22:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07  8:16 Missing USB devices Melki Christian (consultant)
2013-08-07 16:11 ` Andrey Borzenkov
2013-08-08  7:22   ` Melki Christian (consultant)
2013-08-09 18:27     ` Aleš Nesrsta
2013-08-09 22:24       ` Aleš Nesrsta
2013-08-27 11:37         ` Melki Christian (consultant)
2013-08-27 20:21           ` Aleš Nesrsta
2013-08-27 21:38             ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-08-30 22:07               ` Aleš Nesrsta
2013-09-02  7:01                 ` Melki Christian (consultant)
2013-09-02 21:33                   ` USB controller hand-back (original thread: Missing USB devices.) Aleš Nesrsta
2013-09-02 22:52                     ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2013-09-03  6:52                     ` Melki Christian (consultant)
2013-08-28  6:59             ` Missing USB devices Melki Christian (consultant)
2013-08-31 18:10               ` Aleš Nesrsta
2013-08-31 18:14                 ` [PATCH] " Aleš Nesrsta
2013-08-31 21:12                   ` Aleš Nesrsta
2013-09-02  7:17                     ` Melki Christian (consultant)
2013-09-23 12:47                     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-23 18:38                       ` Aleš Nesrsta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522516B6.20900@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).