All of lore.kernel.org
 help / color / mirror / Atom feed
* Xen Compilation Error on Ubuntu 20.04
@ 2020-04-29 17:17 Ayush Dosaj
  2020-04-29 17:25 ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Ayush Dosaj @ 2020-04-29 17:17 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Hi Xen development team,

I am Ayush. I compiled Xen Hypervisor from source on Ubuntu 20.04 machine
running on an intel-i9 CPU.
I am getting compilation error due to the following two flags.
Error: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible.

Complete Error logs can be found at https://paste.ubuntu.com/p/xvvyPnhW5c/

And when I compiled Xen commenting the two flags in Rules.mk file, it
compiles and installs properly but on boot-up i see a blank black screen
and i am stuck there.


Best,
Ayush Dosaj

[-- Attachment #2: Type: text/html, Size: 2501 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xen Compilation Error on Ubuntu 20.04
  2020-04-29 17:17 Xen Compilation Error on Ubuntu 20.04 Ayush Dosaj
@ 2020-04-29 17:25 ` Andrew Cooper
  2020-04-29 17:28   ` Ayush Dosaj
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2020-04-29 17:25 UTC (permalink / raw)
  To: Ayush Dosaj, xen-devel

On 29/04/2020 18:17, Ayush Dosaj wrote:
> Hi Xen development team,
> 
> I am Ayush. I compiled Xen Hypervisor from source on Ubuntu 20.04
> machine running on an intel-i9 CPU.
> I am getting compilation error due to the following two flags.
> Error: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible.
> 
> Complete Error logs can be found at https://paste.ubuntu.com/p/xvvyPnhW5c/
> 
> And when I compiled Xen commenting the two flags in Rules.mk file, it
> compiles and installs properly but on boot-up i see a blank black screen
> and i am stuck there.

That is a GCC bug (these options are actually fine in combination).  It
got fixed earlier today in master, and backported for GCC 9.4

You can work around it by appending -fcf-protection=none to CFLAGS

I wouldn't try editing the logic around -mindirect-branch, as that is
related to retpoline safety for Spectre v2, and probably relies on the
build matching the code.

~Andrew


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xen Compilation Error on Ubuntu 20.04
  2020-04-29 17:25 ` Andrew Cooper
@ 2020-04-29 17:28   ` Ayush Dosaj
  2020-04-30  8:16     ` Ayush Dosaj
  0 siblings, 1 reply; 6+ messages in thread
From: Ayush Dosaj @ 2020-04-29 17:28 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]

Awesome, thanks!

On Wed, Apr 29, 2020 at 10:55 PM Andrew Cooper <andrew.cooper3@citrix.com>
wrote:

> On 29/04/2020 18:17, Ayush Dosaj wrote:
> > Hi Xen development team,
> >
> > I am Ayush. I compiled Xen Hypervisor from source on Ubuntu 20.04
> > machine running on an intel-i9 CPU.
> > I am getting compilation error due to the following two flags.
> > Error: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not
> compatible.
> >
> > Complete Error logs can be found at
> https://paste.ubuntu.com/p/xvvyPnhW5c/
> >
> > And when I compiled Xen commenting the two flags in Rules.mk file, it
> > compiles and installs properly but on boot-up i see a blank black screen
> > and i am stuck there.
>
> That is a GCC bug (these options are actually fine in combination).  It
> got fixed earlier today in master, and backported for GCC 9.4
>
> You can work around it by appending -fcf-protection=none to CFLAGS
>
> I wouldn't try editing the logic around -mindirect-branch, as that is
> related to retpoline safety for Spectre v2, and probably relies on the
> build matching the code.
>
> ~Andrew
>


-- 
Ayush Dosaj
VIT Vellore

[-- Attachment #2: Type: text/html, Size: 2007 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xen Compilation Error on Ubuntu 20.04
  2020-04-29 17:28   ` Ayush Dosaj
@ 2020-04-30  8:16     ` Ayush Dosaj
  2020-04-30 20:53       ` Jason Andryuk
  0 siblings, 1 reply; 6+ messages in thread
From: Ayush Dosaj @ 2020-04-30  8:16 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]

Hi Andrew, Xen Development team.

I compiled and installed Xen by appending -fcf-protection=none to CFLAGS on
Ubuntu 20.04 but it still crashes on startup.

On Wed, Apr 29, 2020 at 10:58 PM Ayush Dosaj <ayushdosaj2313@gmail.com>
wrote:

> Awesome, thanks!
>
> On Wed, Apr 29, 2020 at 10:55 PM Andrew Cooper <andrew.cooper3@citrix.com>
> wrote:
>
>> On 29/04/2020 18:17, Ayush Dosaj wrote:
>> > Hi Xen development team,
>> >
>> > I am Ayush. I compiled Xen Hypervisor from source on Ubuntu 20.04
>> > machine running on an intel-i9 CPU.
>> > I am getting compilation error due to the following two flags.
>> > Error: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not
>> compatible.
>> >
>> > Complete Error logs can be found at
>> https://paste.ubuntu.com/p/xvvyPnhW5c/
>> >
>> > And when I compiled Xen commenting the two flags in Rules.mk file, it
>> > compiles and installs properly but on boot-up i see a blank black screen
>> > and i am stuck there.
>>
>> That is a GCC bug (these options are actually fine in combination).  It
>> got fixed earlier today in master, and backported for GCC 9.4
>>
>> You can work around it by appending -fcf-protection=none to CFLAGS
>>
>> I wouldn't try editing the logic around -mindirect-branch, as that is
>> related to retpoline safety for Spectre v2, and probably relies on the
>> build matching the code.
>>
>> ~Andrew
>>
>
>
> --
> Ayush Dosaj
> VIT Vellore
>
>

-- 
Ayush Dosaj

[-- Attachment #2: Type: text/html, Size: 2961 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Xen Compilation Error on Ubuntu 20.04
  2020-04-30  8:16     ` Ayush Dosaj
@ 2020-04-30 20:53       ` Jason Andryuk
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Andryuk @ 2020-04-30 20:53 UTC (permalink / raw)
  To: Ayush Dosaj; +Cc: Andrew Cooper, xen-devel

On Thu, Apr 30, 2020 at 4:18 AM Ayush Dosaj <ayushdosaj2313@gmail.com> wrote:
>
> Hi Andrew, Xen Development team.
>
> I compiled and installed Xen by appending -fcf-protection=none to CFLAGS on Ubuntu 20.04 but it still crashes on startup.

Ayush, try the patch below.  EMBEDDED_EXTRA_CFLAGS ensures it is set
down in xen/arch/x86/boot/build32.mk

-Jason

diff --git a/Config.mk b/Config.mk
index 0f303c79b2..efb3d42bc4 100644
--- a/Config.mk
+++ b/Config.mk
@@ -205,6 +205,7 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))

 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
+EMBEDDED_EXTRA_CFLAGS += -fcf-protection=none

 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
index 4b7ab78467..c3cbae69d2 100644
--- a/xen/arch/x86/Rules.mk
+++ b/xen/arch/x86/Rules.mk
@@ -69,6 +69,7 @@ CFLAGS += -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
 ifeq ($(CONFIG_INDIRECT_THUNK),y)
 CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register
 CFLAGS += -fno-jump-tables
+$(call cc-option-add,CFLAGS,CC,-fcf-protection=none)
 endif

 # If supported by the compiler, reduce stack alignment to 8 bytes. But allow


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Xen Compilation Error on Ubuntu 20.04
@ 2020-05-01  0:14 Pry Mar
  0 siblings, 0 replies; 6+ messages in thread
From: Pry Mar @ 2020-05-01  0:14 UTC (permalink / raw)
  To: xen-devel

Hello Ayush Dosaj,

https://bugs.launchpad.net/ubuntu/+source/xen/+bug/1851091

see the bug report above ^.

As soon as Ubuntu 19.10 went to LZ4 kernel compression this bug
appeared. As Stefan Bader reports in his testing, the hypervisor not
only crashes, but resets the machine.

The same trouble continued with 20.04. Their solution was to forward
package the Disco hypervisor. You could also hybridize with the Buster
hypervisor - I've done both with perfect results.

Whatever this bug ends up to be, it goes back to 2015 when the lz4
decompression code was first introduced:
[xen.git] / xen / common / lz4 /

I reported trouble too back in Oct 2019:
https://lists.xenproject.org/archives/html/xen-devel/2019-10/msg01637.html

cheers,
PryMar56
##xen-packaging on Freenode IRC


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-01  0:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 17:17 Xen Compilation Error on Ubuntu 20.04 Ayush Dosaj
2020-04-29 17:25 ` Andrew Cooper
2020-04-29 17:28   ` Ayush Dosaj
2020-04-30  8:16     ` Ayush Dosaj
2020-04-30 20:53       ` Jason Andryuk
2020-05-01  0:14 Pry Mar

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.