All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v2 2/7] x86: don't build with EFI support in shim-exclusive mode
Date: Fri, 7 Aug 2020 13:32:38 +0200	[thread overview]
Message-ID: <1a501ca8-8cf0-6fd0-547e-30b709fec6fc@suse.com> (raw)
In-Reply-To: <3a8356a9-313c-6de8-f409-977eae1fbfa5@suse.com>

There's no need for xen.efi at all, and there's also no need for EFI
support in xen.gz since the shim runs in PVH mode, i.e. without any
firmware (and hence by implication also without EFI one).

The slightly odd looking use of $(space) is to ensure the new ifneq()
evaluates consistently between "build" and "install" invocations of
make.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
There are further anomalies associated with the need to use $(space)
here:
- xen.efi rebuilding gets suppressed when installing (typically as
  root) from a non-root-owned tree. I think we should similarly suppress
  re-building of xen.gz as well in this case, as tool chains available
  may vary (and hence a partial or full re-build may mistakenly occur).
- xen.lds (re-)generation has a dependency issue: The value of
  XEN_BUILD_EFI changing between builds (like would happen on a pre-
  built tree with a shim-exclusive config, on which then this patch
  would be applied) does not cause it to be re-built. Anthony's
  switching to Linux'es build system will address this afaict, so I
  didn't see a need to supply a separate patch.

--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -80,7 +80,9 @@ x86_emulate.o: x86_emulate/x86_emulate.c
 
 efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \
                       -O $(BASEDIR)/include/xen/compile.h ]; then \
-                         echo '$(TARGET).efi'; fi)
+                         echo '$(TARGET).efi'; fi) \
+         $(space)
+efi-$(CONFIG_PV_SHIM_EXCLUSIVE) :=
 
 ifneq ($(build_id_linker),)
 notes_phdrs = --notes
@@ -113,11 +115,13 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/
 		{ echo "No Multiboot2 header found" >&2; false; }
 	mv $(TMP) $(TARGET)
 
+ifneq ($(efi-y),)
 # Check if the compiler supports the MS ABI.
 export XEN_BUILD_EFI := $(shell $(CC) $(XEN_CFLAGS) -c efi/check.c -o efi/check.o 2>/dev/null && echo y)
 # Check if the linker supports PE.
 XEN_BUILD_PE := $(if $(XEN_BUILD_EFI),$(shell $(LD) -mi386pep --subsystem=10 -o efi/check.efi efi/check.o 2>/dev/null && echo y))
 CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
+endif
 
 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
 EFI_OBJS-$(XEN_BUILD_EFI) := efi/relocs-dummy.o



  parent reply	other threads:[~2020-08-07 11:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:30 [PATCH v2 0/7] x86: build adjustments Jan Beulich
2020-08-07 11:32 ` [PATCH v2 1/7] x86/EFI: sanitize build logic Jan Beulich
2020-08-07 16:33   ` Andrew Cooper
2020-08-10 14:38     ` Andrew Cooper
2020-08-17 15:20       ` Jan Beulich
2020-08-07 11:32 ` Jan Beulich [this message]
2020-08-18 13:00   ` [PATCH v2 2/7] x86: don't build with EFI support in shim-exclusive mode Roger Pau Monné
2020-08-19  7:33     ` Jan Beulich
2020-08-19  7:59       ` Roger Pau Monné
2020-08-07 11:33 ` [PATCH v2 3/7] x86: shrink struct arch_{vcpu,domain} when !HVM Jan Beulich
2020-08-07 17:14   ` Andrew Cooper
2020-08-19  8:35     ` Jan Beulich
2020-08-07 11:33 ` [PATCH v2 4/7] bitmap: move to/from xenctl_bitmap conversion helpers Jan Beulich
2020-08-07 17:50   ` Andrew Cooper
2020-08-19  8:45     ` Jan Beulich
2020-08-10 15:44   ` Julien Grall
2020-08-07 11:34 ` [PATCH v2 5/7] x86: move domain_cpu_policy_changed() Jan Beulich
2020-08-07 17:53   ` Andrew Cooper
2020-08-07 11:34 ` [PATCH v2 6/7] x86: move cpu_{up,down}_helper() Jan Beulich
2020-08-07 17:55   ` Andrew Cooper
2020-08-07 11:35 ` [PATCH v2 7/7] x86: don't include domctl and alike in shim-exclusive builds Jan Beulich
2020-08-18 13:08   ` Roger Pau Monné
2020-08-19  7:37     ` Jan Beulich

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=1a501ca8-8cf0-6fd0-547e-30b709fec6fc@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --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.