[Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-15 Thread Michael S. Tsirkin
Allowing arbitary file names on command line is setting us up for failure: future guests will look for a specific QEMU-specified name and will get confused finding a user file there. We do warn but people are conditioned to ignore warnings by now, so at best that will help users debug problem, not

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-18 Thread Michael S. Tsirkin
On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: > OVMF uses this feature for a few flags. They are all called > "opt/ovmf/...". I followed the advice in "docs/specs/fw_cfg.txt" (which > shouldn't be surprising since I seem to have reviewed every patch for > that file): Wait a second.

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-18 Thread Paolo Bonzini
I frankly think it's overengineered, but it's already much better and if it helps converging to a compromise why not. Alternatives to your proposals follow: On 17/03/2016 14:13, Michael S. Tsirkin wrote: > > QEMU command line: > A. -fw-cfg RFQDN/PATH prepends usr/. So users will not get co

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-18 Thread Laszlo Ersek
On 03/16/16 19:43, Michael S. Tsirkin wrote: > On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: >> On 03/16/16 19:15, Gabriel L. Somlo wrote: >>> On Wed, 16 Mar 2016 at 18:50:57 +0200, Michael S. Tsirkin wrote: On Wed, Mar 16, 2016 at 05:29:45PM +0100, Markus Armbruster wrote: >>>

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: > On 03/16/16 19:15, Gabriel L. Somlo wrote: > > On Wed, 16 Mar 2016 at 18:50:57 +0200, Michael S. Tsirkin wrote: > >> On Wed, Mar 16, 2016 at 05:29:45PM +0100, Markus Armbruster wrote: > >>> "Michael S. Tsirkin" writes: > >>> > Al

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Wed, Mar 16, 2016 at 08:15:07PM +0100, Laszlo Ersek wrote: > >> I liked (and like) the "mechanism, not > >> policy" thing. Letting developers pass in whatever they want, for > >> development / debugging / testing purposes, is a plus to me. > >> > >> Thanks > >> Laszlo > > > > Could you flesh ou

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Paolo Bonzini
On 17/03/2016 14:49, Michael S. Tsirkin wrote: >> On 17/03/2016 14:13, Michael S. Tsirkin wrote: >>> >>> QEMU command line: >>> A. -fw-cfg RFQDN/PATH prepends usr/. So users will not get conflicts >>>with QEMU hardware >> >> Alternative: no need to prepend usr/, I think. > > I person

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Paolo Bonzini
On 17/03/2016 09:49, Laszlo Ersek wrote: > On 03/16/16 21:31, Michael S. Tsirkin wrote: >> On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: >>> OVMF uses this feature for a few flags. They are all called >>> "opt/ovmf/...". I followed the advice in "docs/specs/fw_cfg.txt" (which >>>

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Laszlo Ersek
On 03/16/16 21:31, Michael S. Tsirkin wrote: > On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: >> OVMF uses this feature for a few flags. They are all called >> "opt/ovmf/...". I followed the advice in "docs/specs/fw_cfg.txt" (which >> shouldn't be surprising since I seem to have revi

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 02:30:34PM +0100, Paolo Bonzini wrote: > I frankly think it's overengineered, but it's already much better and if > it helps converging to a compromise why not. Thanks, I'll think of your suggestions over the weekend. We might be able to simplify things a bit. > Alternativ

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Laszlo Ersek
On 03/17/16 09:42, Gerd Hoffmann wrote: > Hi, > >>> Having a mis-use of this feature become "institutionalized" over time was >>> seen as a low/negligible risk at the time. Do we have any new reasons >>> to worry about it ? >> >> OVMF uses this feature for a few flags. They are all called >> "op

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Gerd Hoffmann
Hi, > Alternative: fail on: > > - a blacklist of etc/* files including etc/system-states, > etc/smbios/smbios-tables, etc/smbios/smbios-anchor, > etc/reserved-memory-end, etc/pvpanic-port, etc/e820, and possibly > etc/boot-menu-wait I think that fails already because qemu throws an error on du

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Gerd Hoffmann
Hi, > > Having a mis-use of this feature become "institutionalized" over time was > > seen as a low/negligible risk at the time. Do we have any new reasons > > to worry about it ? > > OVMF uses this feature for a few flags. They are all called > "opt/ovmf/...". I followed the advice in "docs/sp

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Paolo Bonzini
On 17/03/2016 18:17, Gerd Hoffmann wrote: > Hi, > >> Alternative: fail on: >> >> - a blacklist of etc/* files including etc/system-states, >> etc/smbios/smbios-tables, etc/smbios/smbios-anchor, >> etc/reserved-memory-end, etc/pvpanic-port, etc/e820, and possibly >> etc/boot-menu-wait > > I th

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Laszlo Ersek
On 03/17/16 09:42, Gerd Hoffmann wrote: > Hi, > >>> Having a mis-use of this feature become "institutionalized" over time was >>> seen as a low/negligible risk at the time. Do we have any new reasons >>> to worry about it ? >> >> OVMF uses this feature for a few flags. They are all called >> "op

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Wed, Mar 16, 2016 at 05:29:45PM +0100, Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > > > Allowing arbitary file names on command line is setting us up for > > failure: future guests will look for a specific QEMU-specified name and > > will get confused finding a user file there. >

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 10:40:24AM +0100, Paolo Bonzini wrote: > > > On 17/03/2016 09:49, Laszlo Ersek wrote: > > On 03/16/16 21:31, Michael S. Tsirkin wrote: > >> On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: > >>> OVMF uses this feature for a few flags. They are all called > >>>

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Paolo Bonzini
On 17/03/2016 15:17, Michael S. Tsirkin wrote: > On Thu, Mar 17, 2016 at 02:55:52PM +0100, Paolo Bonzini wrote: >> >> >> On 17/03/2016 14:49, Michael S. Tsirkin wrote: On 17/03/2016 14:13, Michael S. Tsirkin wrote: > > QEMU command line: > A. -fw-cfg RFQDN/PATH prepends usr/. S

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 02:28:38PM +0100, Laszlo Ersek wrote: > On 03/17/16 11:22, Gerd Hoffmann wrote: > > Hi, > > > >> Occasionally, yes. > >> > >> - "opt/ovmf/PcdPropertiesTableEnable" controls whether the "properties > > > >> - "opt/ovmf/PcdSetNxForStack" controls whether the stack is made

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 02:12:56PM +0100, Paolo Bonzini wrote: > > > On 17/03/2016 12:32, Michael S. Tsirkin wrote: > > > 1) files should actually be named etc/ovmf/foo. OVMF could optionally > > > accept both the old and the new names for a while, you would decide > > > whether this is useful.

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > Allowing arbitary file names on command line is setting us up for > failure: future guests will look for a specific QEMU-specified name and > will get confused finding a user file there. > > We do warn but people are conditioned to ignore warnings by now, > so at be

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 08:35:25PM +0100, Paolo Bonzini wrote: > > > On 17/03/2016 18:17, Gerd Hoffmann wrote: > > Hi, > > > >> Alternative: fail on: > >> > >> - a blacklist of etc/* files including etc/system-states, > >> etc/smbios/smbios-tables, etc/smbios/smbios-anchor, > >> etc/reserved-m

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Laszlo Ersek
On 03/17/16 14:30, Paolo Bonzini wrote: > On 17/03/2016 14:13, Michael S. Tsirkin wrote: >> OVMF: >> Can use the compatible opt/ovmf/ for now. [snip] >> Long term: Gradually transition OVMF to look up paths in usr/org.uefi/: >> if nothing is found there, look up in opt/ovmf/ for ba

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Markus Armbruster
Top level reply, because this isn't in reply to any specific message in the thread, more like in reply to all of them. FW CFG's primary user is QEMU, which uses it to expose configuration information (in the widest sense) to Firmware. Thus the name FW CFG. FW CFG can also be used by others for t

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Gabriel L. Somlo
On Wed, 16 Mar 2016 at 18:50:57 +0200, Michael S. Tsirkin wrote: > On Wed, Mar 16, 2016 at 05:29:45PM +0100, Markus Armbruster wrote: > > "Michael S. Tsirkin" writes: > > > > > Allowing arbitary file names on command line is setting us up for > > > failure: future guests will look for a specific

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Gerd Hoffmann
Hi, > Occasionally, yes. > > - "opt/ovmf/PcdPropertiesTableEnable" controls whether the "properties > - "opt/ovmf/PcdSetNxForStack" controls whether the stack is made > - "opt/ovmf/X-PciMmio64Mb" controls the size of the range from which the > In downstream, we have two more (same purpose bu

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Laszlo Ersek
On 03/17/16 11:22, Gerd Hoffmann wrote: > Hi, > >> Occasionally, yes. >> >> - "opt/ovmf/PcdPropertiesTableEnable" controls whether the "properties > >> - "opt/ovmf/PcdSetNxForStack" controls whether the stack is made > >> - "opt/ovmf/X-PciMmio64Mb" controls the size of the range from which the

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Paolo Bonzini
On 17/03/2016 12:32, Michael S. Tsirkin wrote: > > 1) files should actually be named etc/ovmf/foo. OVMF could optionally > > accept both the old and the new names for a while, you would decide > > whether this is useful. > > IOW if etc/ovmf exists, then ignore opt/ovmf? OK. > > > 2) in turn, b

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 10:43:08AM +0100, Laszlo Ersek wrote: > And, obviously, exposing this kind of knob with dedicated QEMU options > is out of question. We are moving away from dedicated options anyway. But these could easily be machine properties, with the benefit that there is actual valida

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 02:55:52PM +0100, Paolo Bonzini wrote: > > > On 17/03/2016 14:49, Michael S. Tsirkin wrote: > >> On 17/03/2016 14:13, Michael S. Tsirkin wrote: > >>> > >>> QEMU command line: > >>> A. -fw-cfg RFQDN/PATH prepends usr/. So users will not get conflicts > >>> with QEMU

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-19 Thread Paolo Bonzini
On 17/03/2016 14:35, Michael S. Tsirkin wrote: > > We meant just two partitions of the namespace. "opt/" and non-"opt/". > > The latter belongs to QEMU, the former belongs to everything else, and > > the subdivision of everything else doesn't belong into QEMU. OVMF is > > part of everything else.

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-20 Thread Michael S. Tsirkin
On Wed, Mar 16, 2016 at 08:15:07PM +0100, Laszlo Ersek wrote: > On 03/16/16 19:43, Michael S. Tsirkin wrote: > > On Wed, Mar 16, 2016 at 07:35:09PM +0100, Laszlo Ersek wrote: > >> On 03/16/16 19:15, Gabriel L. Somlo wrote: > >>> On Wed, 16 Mar 2016 at 18:50:57 +0200, Michael S. Tsirkin wrote: > >>>

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-20 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 03:50:08PM +0100, Paolo Bonzini wrote: > > > On 17/03/2016 15:17, Michael S. Tsirkin wrote: > > On Thu, Mar 17, 2016 at 02:55:52PM +0100, Paolo Bonzini wrote: > >> > >> > >> On 17/03/2016 14:49, Michael S. Tsirkin wrote: > On 17/03/2016 14:13, Michael S. Tsirkin wrote

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-20 Thread Gerd Hoffmann
Hi, > So, "user defined files" exist so that users can control "stuff" with > them, without QEMU's knowledge. OVMF is "stuff". Just because it's > firmware, it remains "stuff". Whatever Gabriel wants to control with > such fw_cfg files in the guest, is also "stuff". Well, non-firmware stuff was

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-20 Thread Laszlo Ersek
On 03/16/16 19:15, Gabriel L. Somlo wrote: > On Wed, 16 Mar 2016 at 18:50:57 +0200, Michael S. Tsirkin wrote: >> On Wed, Mar 16, 2016 at 05:29:45PM +0100, Markus Armbruster wrote: >>> "Michael S. Tsirkin" writes: >>> Allowing arbitary file names on command line is setting us up for failu

Re: [Qemu-devel] [PATCH v2] vl.c: disallow command line fw cfg without opt/

2016-03-20 Thread Michael S. Tsirkin
On Thu, Mar 17, 2016 at 11:09:24AM +0100, Markus Armbruster wrote: > Top level reply, because this isn't in reply to any specific message in > the thread, more like in reply to all of them. > > FW CFG's primary user is QEMU, which uses it to expose configuration > information (in the widest sense)