All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v8 05/13] libxl: Load guest BIOS from file
Date: Mon, 22 Aug 2016 14:13:22 +0100	[thread overview]
Message-ID: <20160822131322.GX20641@citrix.com> (raw)
In-Reply-To: <a388f1c8-8b2c-5eac-7219-ea292509c82e@citrix.com>

On Fri, Aug 19, 2016 at 03:43:00PM +0100, Andrew Cooper wrote:
> On 18/08/16 15:13, Wei Liu wrote:
> > From: Anthony PERARD <anthony.perard@citrix.com>
> >
> > The path to the BIOS blob can be overriden by the xl's
> > bios_path_override option, or provided by u.hvm.bios_firmware in the
> > domain_build_info struct by other libxl user.
> >
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> > Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> This introduces a regression, but I am not sure how best to fix it.
> 
> [root@xrtuk-09-12 xen-test-framework]# xl -vvv create -p
> tests/selftest/test-hvm32-selftest.cfg
> Parsing config from tests/selftest/test-hvm32-selftest.cfg
> libxl: debug: libxl_create.c:1603:do_domain_create: ao 0xa6b9f0: create:
> how=(nil) callback=(nil) poller=0xa6c120
> libxl: debug: libxl_create.c:959:initiate_domain_create: running bootloader
> libxl: debug: libxl_bootloader.c:324:libxl__bootloader_run: not a PV
> domain, skipping bootloader
> libxl: debug: libxl_event.c:686:libxl__ev_xswatch_deregister: watch
> w=0xa6cc30: deregister unregistered
> libxl: debug: libxl_numa.c:483:libxl__get_numa_candidate: New best NUMA
> placement candidate found: nr_nodes=1, nr_cpus=12, nr_vcpus=17,
> free_memkb=30611
> libxl: detail: libxl_dom.c:182:numa_place_domain: NUMA placement
> candidate with 1 nodes, 12 cpus and 30611 KB free selected
> domainbuilder: detail: xc_dom_allocate: cmdline="(null)", features="(null)"
> domainbuilder: detail: xc_dom_kernel_file:
> filename="/opt/xen-test-framework/tests/selftest/test-hvm32-selftest"
> domainbuilder: detail: xc_dom_malloc_filemap    : 1090 kB
> libxl: debug: libxl_dom.c:874:libxl__load_hvm_firmware_module: Loading
> BIOS: /usr/libexec/xen/boot/bios.bin
> libxl: error: libxl_dom.c:882:libxl__load_hvm_firmware_module: failed to
> read BIOS file: No such file or directory
> 
> In this case, tools have been built with ./configure --disable-seabios
> 
> As a result, /usr/libexec/xen/boot/bios.bin (name altered a patch sent
> separately) isn't built or installed.
> 
> I think libxl needs to logic to determine which firmware to use based on
> the available CONFIG_* options it was built with.

I don' quite follow here.

Do you mean if user hasn't specified any bios= option, (s)he gets
whatever available?

I think we should stick with the seabios-default behaviour to avoid
surprising breakage.

If you don't want any bois, maybe we should provide a bios=none option?

> 
> > @@ -914,6 +951,30 @@ static int libxl__domain_firmware(libxl__gc *gc,
> >          goto out;
> >      }
> >  
> > +    if (info->device_model_version == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
> > +        if (info->u.hvm.system_firmware) {
> > +            bios_filename = info->u.hvm.system_firmware;
> > +        } else {
> > +            switch (info->u.hvm.bios) {
> > +            case LIBXL_BIOS_TYPE_SEABIOS:
> > +                bios_filename = libxl__seabios_path();
> > +                break;
> > +            case LIBXL_BIOS_TYPE_OVMF:
> > +                bios_filename = libxl__ovmf_path();
> > +                break;
> 
> At the very least, these need to be guarded by #ifdef
> CONFIG_{SEABIOS,OVMF}, as it is explicitly permitted for them not to be
> present in a build.
> 
> > +            case LIBXL_BIOS_TYPE_ROMBIOS:
> 
> ROMBIOS certainly does function correctly with QEMU_XEN, and is how
> XenServer is planning to start the migration from a qemu-trad world to a
> qemu-upstream world.  Even if libxl doesn't want to formally support
> such a configuration, it shouldn't be excluded.
> 

There is no written statement, but I would rather not support this
configuration.

I expect this is an impossible situation to get into, since verification
should have been done a few steps before -- hence the abort(3) here is
justified. But I would need to double-check if that's not the case and
will do something about it either here or at the place I see
appropriate.

> > +            default:
> > +                abort();
> 
> This is completely antisocial.  Under no circumstances is it ok for a
> library to call abort(); fail an assertion if necessary, but this is a
> configuration error and should pass an error back to its caller, not
> take the entire process with it.
> 

In general it is ok to call abort(3) in an internal function that only
expects valid input. And I don't see how switching to assert(3) help in
those cases, that ends up calling abort(3) anyway.

Wei.

> ~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-08-22 13:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18 14:13 [PATCH v8 00/13] Load BIOS via toolstack instead of been embedded in hvmloader Wei Liu
2016-08-18 14:13 ` [PATCH v8 01/13] libxc: Rework extra module initialisation Wei Liu
2016-08-18 14:13 ` [PATCH v8 02/13] libxc: Prepare a start info structure for hvmloader Wei Liu
2016-08-18 14:13 ` [PATCH v8 03/13] configure: #define SEABIOS_PATH and OVMF_PATH Wei Liu
2016-08-18 14:13 ` [PATCH v8 04/13] firmware/makefile: install BIOS blob Wei Liu
2016-08-18 14:13 ` [PATCH v8 05/13] libxl: Load guest BIOS from file Wei Liu
2016-08-19 14:43   ` Andrew Cooper
2016-08-22 13:13     ` Wei Liu [this message]
2016-08-22 13:26       ` Andrew Cooper
2016-08-22 14:26         ` Wei Liu
2016-08-22 15:05           ` [PATCH 0/2] Fix issue with {OVMF,SEABIOS}_PATH Wei Liu
2016-08-22 15:05             ` [PATCH 1/2] tools: only define {OVMF, SEABIOS}_PATH when they are enabled Wei Liu
2016-08-22 15:05             ` [PATCH 2/2] libxl: only return {OVMF, SEABIOS}_PATH if available Wei Liu
2016-08-23  9:37             ` [PATCH 0/2] Fix issue with {OVMF,SEABIOS}_PATH Andrew Cooper
2016-08-24 11:38             ` Ian Jackson
2016-08-24 11:59               ` Wei Liu
2016-08-22 15:09           ` [PATCH v8 05/13] libxl: Load guest BIOS from file Andrew Cooper
2016-08-22 15:13             ` Wei Liu
2016-08-23 20:00   ` Doug Goldstein
2016-08-24  9:16     ` Wei Liu
2016-08-18 14:13 ` [PATCH v8 06/13] hvmloader: Grab the hvm_start_info pointer Wei Liu
2016-08-18 14:13 ` [PATCH v8 07/13] hvmloader: Locate the BIOS blob Wei Liu
2016-08-18 15:39   ` Jan Beulich
2016-08-18 15:48     ` Andrew Cooper
2016-08-18 15:51       ` Wei Liu
2016-08-18 14:13 ` [PATCH v8 08/13] hvmloader: Load SeaBIOS from hvm_start_info modules Wei Liu
2016-08-18 14:13 ` [PATCH v8 09/13] hvmloader: Load OVMF from modules Wei Liu
2016-08-18 14:13 ` [PATCH v8 10/13] hvmloader: bios->bios_load() now needs to be defined Wei Liu
2016-08-18 14:13 ` [PATCH v8 11/13] hvmloader: Always build-in SeaBIOS and OVMF loader Wei Liu
2016-08-18 14:13 ` [PATCH v8 12/13] configure: do not depend on SEABIOS_PATH or OVMF_PATH Wei Liu
2016-08-18 14:13 ` [PATCH v8 13/13] docs/misc/hvmlite: Point to the canonical definition of hvm_start_info Wei Liu
2016-08-18 16:23 ` [PATCH v8 00/13] Load BIOS via toolstack instead of been embedded in hvmloader Wei Liu

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=20160822131322.GX20641@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.