Re: [SeaBIOS] [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization

2016-09-12 Thread Peter Stuge
Gerd Hoffmann wrote:
>  * Initializing all pci devices (placing bars in address space and
>programming them) can probably be skipped and left to the linux
>kernel to handle.

When the coreboot project started out, in 1999, that turned out not
to be the case. I don't know if the situation has improved since then.


//Peter

___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios


[SeaBIOS] [PATCH] kbd: Move extended and release events out of special key detection switch

2016-09-12 Thread Kevin O'Connor
Move checking for release and extended scancodes to the top of
__process_key().

Signed-off-by: Kevin O'Connor 
---
 src/kbd.c | 70 +++
 1 file changed, 30 insertions(+), 40 deletions(-)

diff --git a/src/kbd.c b/src/kbd.c
index 5945e99..31e47e3 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -439,73 +439,65 @@ kbd_prtscr(int key_release)
 static void
 __process_key(u8 scancode)
 {
-// Check for multi-key sequences
+// Check for multi-scancode key sequences
 u8 flags1 = GET_BDA(kbd_flag1);
-if (flags1 & KF1_LAST_E1) {
-// Part of "pause" key (sequence is e1 1d 45 e1 9d c5)
-if ((scancode & ~0x80) == 0x1d)
-// Second key of sequence - ignore
+int key_release = scancode & 0x80;
+if (key_release) {
+if (scancode == 0xe0) {
+// Extended key
+SET_BDA(kbd_flag1, flags1 | KF1_LAST_E0);
+return;
+} else if (scancode == 0xe1) {
+// Start of pause key sequence
+SET_BDA(kbd_flag1, flags1 | KF1_LAST_E1);
+return;
+}
+scancode &= ~0x80;
+}
+if (flags1 & (KF1_LAST_E0|KF1_LAST_E1)) {
+if (flags1 & KF1_LAST_E1 && scancode == 0x1d)
+// Ignore second scancode of pause key (e1 1d 45 e1 9d c5)
 return;
-// Third key of sequence - clear flag for next key
-SET_BDA(kbd_flag1, flags1 & ~KF1_LAST_E1);
+// Clear E0/E1 flag in memory for next key event
+SET_BDA(kbd_flag1, flags1 & ~(KF1_LAST_E0|KF1_LAST_E1));
 }
-if (flags1 & KF1_LAST_E0)
-// Clear E0 flag in memory for next key event
-SET_BDA(kbd_flag1, flags1 & ~KF1_LAST_E0);
 
 // Check for special keys
-int key_release = scancode & 0x80;
 switch (scancode) {
-case 0xe0:
-// Extended key
-SET_BDA(kbd_flag1, flags1 | KF1_LAST_E0);
-return;
-case 0xe1:
-// Start of pause key sequence
-SET_BDA(kbd_flag1, flags1 | KF1_LAST_E1);
-return;
-
-case 0x3a: /* Caps Lock press */
-case 0xba: /* Caps Lock release */
+case 0x3a: /* Caps Lock */
 kbd_set_flag(key_release, KF0_CAPS, 0, KF0_CAPSACTIVE);
 return;
-case 0x2a: /* L Shift press */
-case 0xaa: /* L Shift release */
+case 0x2a: /* L Shift */
 if (flags1 & KF1_LAST_E0)
 // Ignore fake shifts
 return;
 kbd_set_flag(key_release, KF0_LSHIFT, 0, 0);
 return;
-case 0x36: /* R Shift press */
-case 0xb6: /* R Shift release */
+case 0x36: /* R Shift */
 if (flags1 & KF1_LAST_E0)
 // Ignore fake shifts
 return;
 kbd_set_flag(key_release, KF0_RSHIFT, 0, 0);
 return;
-case 0x1d: /* Ctrl press */
-case 0x9d: /* Ctrl release */
+case 0x1d: /* Ctrl */
 if (flags1 & KF1_LAST_E0)
 kbd_set_flag(key_release, KF0_CTRLACTIVE, KF1_RCTRL, 0);
 else
 kbd_set_flag(key_release, KF0_CTRLACTIVE | KF0_LCTRL, 0, 0);
 return;
-case 0x38: /* Alt press */
-case 0xb8: /* Alt release */
+case 0x38: /* Alt */
 if (flags1 & KF1_LAST_E0)
 kbd_set_flag(key_release, KF0_ALTACTIVE, KF1_RALT, 0);
 else
 kbd_set_flag(key_release, KF0_ALTACTIVE | KF0_LALT, 0, 0);
 return;
-case 0x45: /* Num Lock press */
-case 0xc5: /* Num Lock release */
+case 0x45: /* Num Lock */
 if (flags1 & KF1_LAST_E1)
 // XXX - pause key.
 return;
 kbd_set_flag(key_release, KF0_NUM, 0, KF0_NUMACTIVE);
 return;
-case 0x46: /* Scroll Lock press */
-case 0xc6: /* Scroll Lock release */
+case 0x46: /* Scroll Lock */
 if (flags1 & KF1_LAST_E0) {
 kbd_ctrl_break(key_release);
 return;
@@ -513,20 +505,18 @@ __process_key(u8 scancode)
 kbd_set_flag(key_release, KF0_SCROLL, 0, KF0_SCROLLACTIVE);
 return;
 
-case 0x37:
-case 0xb7:
+case 0x37: /* * */
 if (flags1 & KF1_LAST_E0) {
 kbd_prtscr(key_release);
 return;
 }
 break;
-case 0x54:
-case 0xd4:
+case 0x54: /* SysReq */
 kbd_sysreq(key_release);
 return;
-case 0x53:
+case 0x53: /* Del */
 if ((GET_BDA(kbd_flag0) & (KF0_CTRLACTIVE|KF0_ALTACTIVE))
-== (KF0_CTRLACTIVE|KF0_ALTACTIVE)) {
+== (KF0_CTRLACTIVE|KF0_ALTACTIVE) && !key_release) {
 // Ctrl+alt+del - reset machine.
 SET_BDA(soft_reset_flag, 0x1234);
 reset();
-- 
2.5.5


___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios


Re: [SeaBIOS] Next release

2016-09-12 Thread Gerd Hoffmann

> > So, maybe it is time to plan a 1.10 release?  There are also a number of
> > other improvements and cleanups in the master branch.  Kevin?
> 
> Makes sense.  Freeze at end of month and release mid-October?

Looks good to me.

cheers,
  Gerd


___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios


Re: [SeaBIOS] [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization

2016-09-12 Thread Gerd Hoffmann
  Hi,

> > AFAIK latest seabios already supports DMA.
> > It's easy to add more config options for seabios
> > if you are so inclined.
> 
> Yes, I tried that, the fw_cfg overhead in SeaBios/linuxboot optrom is
> already not a big issue for us. However, there are still some other
> code in SeaBIOS needs to be investigated.

What exactly?

Also a few suggestions:
 * Try the seabios master branch.  There have been some improvements
   recently which are not in the 1.9 release.
 * Use a stripped down config.  When booting a kernel directly you
   don't need storage and usb drivers, also no keyboard.  That all
   reduces init time.
 * Initializing all pci devices (placing bars in address space and
   programming them) can probably be skipped and left to the linux
   kernel to handle.  But when trying take care that the effect might
   be that we shift just startup time from seabios to linux kernel,
   the placement needs to happen somewhere after all.
 * When discussing these things add the seabios list
   (seabios@seabios.org) to cc:  Added the list now.

cheers,
  Gerd


___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios


[SeaBIOS] Next release

2016-09-12 Thread Kevin O'Connor
On Mon, Sep 12, 2016 at 10:01:18AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > Virtio 1.0 block devices (virtio-blk/virtio-scsi) use a 64-bit BAR
> > unusable by SeaBIOS if mapped over 4G space, preventing the system
> > to boot.
> 
> Not needed, works fine in master (see commit
> 0e21548b15e25e010c362ea13d170c61a3fcc899).
> 
> Is not a clean cherry-pick for 1.9-stable though, so this isn't yet in
> any seabios release.
> 
> So, maybe it is time to plan a 1.10 release?  There are also a number of
> other improvements and cleanups in the master branch.  Kevin?

Makes sense.  Freeze at end of month and release mid-October?

-Kevin

___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios


Re: [SeaBIOS] [PATCH 00/10] Improved keyboard key mappings

2016-09-12 Thread Kevin O'Connor
On Mon, Sep 05, 2016 at 02:36:01PM -0400, Kevin O'Connor wrote:
> There were several keys not mapped in the keyboard scancode to
> "keycode" mapping functions.  This series adds in a number of
> additional keyboard mappings.  I used the Phoenix "System BIOS for IBM
> PC/XT/AT Computers and Compatibles" book as a reference for the
> mappings.
> 
> Albert - can you test if this series fixes your issue with the SysReq
> key?
> 
> I've also uploaded the series to:
>   https://github.com/KevinOConnor/seabios/tree/testing
> 
> FYI, I've found on my Linux/X-Windows setup that QEMU doesn't always
> pass the correct keycodes for SysReq and Break to the guest.  But,
> I've tested on real hardware to confirm that the keyboard mappings are
> correct.

FYI, I committed this series.

-Kevin

___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios


Re: [SeaBIOS] [PATCH] pci: don't map virtio 1.0 storage devices above 4G

2016-09-12 Thread Gerd Hoffmann
  Hi,

> Virtio 1.0 block devices (virtio-blk/virtio-scsi) use a 64-bit BAR
> unusable by SeaBIOS if mapped over 4G space, preventing the system
> to boot.

Not needed, works fine in master (see commit
0e21548b15e25e010c362ea13d170c61a3fcc899).

Is not a clean cherry-pick for 1.9-stable though, so this isn't yet in
any seabios release.

So, maybe it is time to plan a 1.10 release?  There are also a number of
other improvements and cleanups in the master branch.  Kevin?

cheers,
  Gerd


___
SeaBIOS mailing list
SeaBIOS@seabios.org
https://www.coreboot.org/mailman/listinfo/seabios