Bug 927582

Summary: Disable SeaBIOS features that we do not use or support
Product: Red Hat Enterprise Linux 7 Reporter: Paolo Bonzini <pbonzini>
Component: seabiosAssignee: Laszlo Ersek <lersek>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: flang, juzhang, lersek, mrezanin, qzhang, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: seabios-1.7.2.2-2.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:43:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 967777    
Attachments:
Description Flags
proposed dist-git patch for RHEL-7
none
Another possible solution none

Description Paolo Bonzini 2013-03-26 09:29:53 UTC
These options have to be disabled:

CONFIG_XEN=n
CONFIG_ESP_SCSI=n
CONFIG_LSI_SCSI=n
CONFIG_USB_OHCI=n
CONFIG_BOOTSPLASH=n
CONFIG_MEGASAS=n

All in all, this frees ~17k of ROM.

Comment 2 Paolo Bonzini 2013-03-26 09:51:59 UTC
If available at the time of the last rebase, CONFIG_ACPI_DSDT=n will free 5k more.

Comment 3 Laszlo Ersek 2013-06-11 13:34:26 UTC
Created attachment 759631 [details]
proposed dist-git patch for RHEL-7

Comment 4 Miroslav Rezanina 2013-06-11 13:58:24 UTC
(In reply to Laszlo Ersek from comment #3)
> Created attachment 759631 [details]
> proposed dist-git patch for RHEL-7

Not much helping patch - you need to provide config file. I will attach my proposed version - I have not verified it builds correctly yet.

Comment 5 Miroslav Rezanina 2013-06-11 13:59:17 UTC
Created attachment 759644 [details]
Another possible solution

Comment 6 Laszlo Ersek 2013-06-11 14:19:40 UTC
(In reply to Miroslav Rezanina from comment #4)
> (In reply to Laszlo Ersek from comment #3)
> > Created attachment 759631 [details]
> > proposed dist-git patch for RHEL-7
> 
> Not much helping patch - you need to provide config file.

I did provide a config file, it's called config.base.

> I will attach my
> proposed version - I have not verified it builds correctly yet.

Your solution creates a default config file ("make .config" invokes the defconfig rule), and modifies the result. The result may or may not be something that the seabios build system itself could otherwise produce.

My proposal creates an initial .config file (from "config.base") with just the options as suggested by Paolo in comment 0. Then it invokes "oldnoconfig" on it. 

According to "tools/kconfig/Makefile":

oldnoconfig     - Same as silentoldconfig but set new symbols to n (unset)
silentoldconfig - Same as oldconfig, but quietly, additionally update deps
oldconfig       - Update current config utilising a provided .config as base

which is exactly what's needed (dependencies updated, plus any future features/settings not mentioned in the input .config are set to N -- this will automatically deal with CONFIG_ACPI_DSDT too, see comment 2.).

The "oldnoconfig" target is already used (in precisely the same way) in the SPEC file -- see the "seavgabios" section.

Also, I did compare the output of defconfig (ie. the .config prepared by the current spec file) against the output prepared by my proposal, and their difference is exactly comment #0.


I don't care either way; I just wanted to work on bug 967777 without either waiting for your update here or urging you. For that reason I changed the options myself and then decided to upload the patch here as well. Again, I don't care whichever goes in.

Comment 7 Miroslav Rezanina 2013-06-11 14:52:22 UTC
(In reply to Laszlo Ersek from comment #6)
> (In reply to Miroslav Rezanina from comment #4)
> > (In reply to Laszlo Ersek from comment #3)
> > > Created attachment 759631 [details]
> > > proposed dist-git patch for RHEL-7
> > 
> > Not much helping patch - you need to provide config file.
> 
> I did provide a config file, it's called config.base.
> 

It's not part of the attachement so I do not know exact content of the config.base.

> > I will attach my
> > proposed version - I have not verified it builds correctly yet.
> 
> Your solution creates a default config file ("make .config" invokes the
> defconfig rule), and modifies the result. The result may or may not be
> something that the seabios build system itself could otherwise produce.
> 
> My proposal creates an initial .config file (from "config.base") with just
> the options as suggested by Paolo in comment 0. Then it invokes
> "oldnoconfig" on it. 
> 
> According to "tools/kconfig/Makefile":
> 
> oldnoconfig     - Same as silentoldconfig but set new symbols to n (unset)
> silentoldconfig - Same as oldconfig, but quietly, additionally update deps
> oldconfig       - Update current config utilising a provided .config as base
> 
> which is exactly what's needed (dependencies updated, plus any future
> features/settings not mentioned in the input .config are set to N -- this
> will automatically deal with CONFIG_ACPI_DSDT too, see comment 2.).
> 

This is good point I did not realize it.

> The "oldnoconfig" target is already used (in precisely the same way) in the
> SPEC file -- see the "seavgabios" section.
> 
> Also, I did compare the output of defconfig (ie. the .config prepared by the
> current spec file) against the output prepared by my proposal, and their
> difference is exactly comment #0.
> 
> 
> I don't care either way; I just wanted to work on bug 967777 without either
> waiting for your update here or urging you. For that reason I changed the
> options myself and then decided to upload the patch here as well. Again, I
> don't care whichever goes in.

Your solution is better. If you have already prepared patch for review, you can sent it for proper review to rhvirt-patches (please ensure that the config.base is included).

Comment 8 Laszlo Ersek 2013-06-11 17:16:38 UTC
(In reply to Miroslav Rezanina from comment #7)
> (In reply to Laszlo Ersek from comment #6)

> > I did provide a config file, it's called config.base.
> > 
> 
> It's not part of the attachement so I do not know exact content of the
> config.base.

I don't understand. It *is* part of attachment 759631 [details].

$ diffstat -p1 <0001-disable-config-options-not-needed-for-RHEL-7.patch 
 config.base  |    6 ++++++
 seabios.spec |    9 +++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

The patch is not for the exploded SeaBIOS git tree <git://git.app.eng.bos.redhat.com/virt/rhel7/seabios.git> but for the "rhel-7.0" branch of the dist-git SeaBIOS tree, <git://pkgs.devel.redhat.com/rpms/seabios>.

Since the "config.vga.*" files too are only present in the dist-git tree (and absent from the exploded tree), I wrote my patch for the dist-git tree too.

I can take this bug and submit the patch to rhvirt-patches if you think the above is appropriate. Thanks!

Comment 10 Miroslav Rezanina 2013-06-26 11:50:24 UTC
Fixed in seabios-1.7.2.2-2.el7

Comment 11 Miroslav Rezanina 2014-02-13 07:46:15 UTC
Changed to modified to fullfil errata process

Comment 13 langfang 2014-02-26 01:55:12 UTC
Reproduce this bug as the follow version:
Host:
# uname -r
3.10.0-88.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.3-48.el7.x86_64
# rpm -q seabios
seabios-1.7.2-1.el7.x86_64

Steps:
# /usr/libexec/qemu-kvm   -bios /usr/share/seabios/bios.bin  -chardev stdio,id=log -device isa-debugcon,iobase=0x402,chardev=logVNC server running on `::1:5900'
Start bios (version 1.7.2-20130516_032531-)
No Xen hypervisor found.
Ram Size=0x08000000 (0x0000000000000000 high)
Relocating low data from 0x000e1a40 to 0x000ef780 (size 2161)
Relocating init from 0x000e22b1 to 0x07fe0c50 (size 62095)--->62095
CPU Mhz=3393
=== PCI bus & bridge init ===
...

Verify this bug as follow version:( Two senarios)
Senario 1)

Host:
# uname -r
3.10.0-88.el7.x86_64
# rpm -q qemu-kvm
qemu-kvm-1.5.3-48.el7.x86_64
# rpm -q seabios
seabios-1.7.2-11.el7.x86_64

Steps:
[root@localhost seabios1.7.2-11]# /usr/libexec/qemu-kvm   -bios /usr/share/seabios/bios.bin  -chardev stdio,id=log -device isa-debugcon,iobase=0x402,chardev=log
VNC server running on `::1:5900'
Start bios (version seabios-1.7.2.2-11.el7)
Ram Size=0x08000000 (0x0000000000000000 high)
Relocating low data from 0x000e3f10 to 0x000ef780 (size 2161)
Relocating init from 0x000e4781 to 0x07fe2ce0 (size 53759)--->53759
CPU Mhz=3397
=== PCI bus & bridge init ===
...

Results:The relocating init  size changed from 62095 to 53759,about 10K

Senarios 2)
 	 
Install rpm seabios-1.7.2.2-11.el7.src.rpm
#cd /root/
#wget ...
#rpm -ivh ...
#cd /root/rpmbuild/SOURCES
# cat config.base
CONFIG_XEN=n
CONFIG_ESP_SCSI=n
CONFIG_LSI_SCSI=n
CONFIG_USB_OHCI=n
CONFIG_BOOTSPLASH=n
CONFIG_MEGASAS=n
CONFIG_ROM_SIZE=128


Results:These options have been disabled.

Hi Laszlo
    please help me to see whether my verification is correct?

thanks 
fang lang

Comment 14 Laszlo Ersek 2014-02-26 02:43:21 UTC
Yes, it is.

In addition to the srpm check and the decrease in size, this boot message also disappeared:

  No Xen hypervisor found.

meaning that SeaBIOS doesn't even check for Xen any longer (thanks to CONFIG_XEN=n).

So it's fine. Thanks!

Comment 16 Ludek Smid 2014-06-13 11:43:34 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.