diff --git a/.gitignore b/.gitignore index 2a888b23d..0139918a6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,8 @@ clog *.bz2 *.rpm *.orig +*.sign kernel-[234].*/ perf-man-*.tar.gz +kernel-headers/ +kernel-tools/ diff --git a/0001-kbuild-Add-build-salt-to-the-kernel-and-modules.patch b/0001-kbuild-Add-build-salt-to-the-kernel-and-modules.patch new file mode 100644 index 000000000..1c0b1ab2e --- /dev/null +++ b/0001-kbuild-Add-build-salt-to-the-kernel-and-modules.patch @@ -0,0 +1,134 @@ +From 25d3cf21987c752240df03c050593621ed2bd3a3 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Tue, 3 Jul 2018 15:50:14 -0700 +Subject: [PATCHv6 1/4] kbuild: Add build salt to the kernel and modules +To: Andy Lutomirski +To: mjw@fedoraproject.org +Cc: Linus Torvalds +To: H. J. Lu +Cc: X86 ML +Cc: linux-kernel@vger.kernel.org +To: Masahiro Yamada +Cc: Nick Clifton +Cc: Cary Coutant +Cc: linux-kbuild@vger.kernel.org +Cc: linuxppc-dev@lists.ozlabs.org +To: Michael Ellerman +To: Catalin Marinas +To: Will Deacon +Cc: linux-arm-kernel@lists.infradead.org + + +In Fedora, the debug information is packaged separately (foo-debuginfo) and +can be installed separately. There's been a long standing issue where only +one version of a debuginfo info package can be installed at a time. There's +been an effort for Fedora for parallel debuginfo to rectify this problem. + +Part of the requirement to allow parallel debuginfo to work is that build ids +are unique between builds. The existing upstream rpm implementation ensures +this by re-calculating the build-id using the version and release as a +seed. This doesn't work 100% for the kernel because of the vDSO which is +its own binary and doesn't get updated when embedded. + +Fix this by adding some data in an ELF note for both the kernel and modules. +The data is controlled via a Kconfig option so distributions can set it +to an appropriate value to ensure uniqueness between builds. + +Suggested-by: Masahiro Yamada +Signed-off-by: Laura Abbott +--- +v6: Added more detail to the commit text about why exactly this feature +is useful. Default string now "" +--- + include/linux/build-salt.h | 20 ++++++++++++++++++++ + init/Kconfig | 9 +++++++++ + init/version.c | 3 +++ + scripts/mod/modpost.c | 3 +++ + 4 files changed, 35 insertions(+) + create mode 100644 include/linux/build-salt.h + +diff --git a/include/linux/build-salt.h b/include/linux/build-salt.h +new file mode 100644 +index 000000000000..bb007bd05e7a +--- /dev/null ++++ b/include/linux/build-salt.h +@@ -0,0 +1,20 @@ ++#ifndef __BUILD_SALT_H ++#define __BUILD_SALT_H ++ ++#include ++ ++#define LINUX_ELFNOTE_BUILD_SALT 0x100 ++ ++#ifdef __ASSEMBLER__ ++ ++#define BUILD_SALT \ ++ ELFNOTE(Linux, LINUX_ELFNOTE_BUILD_SALT, .asciz CONFIG_BUILD_SALT) ++ ++#else ++ ++#define BUILD_SALT \ ++ ELFNOTE32("Linux", LINUX_ELFNOTE_BUILD_SALT, CONFIG_BUILD_SALT) ++ ++#endif ++ ++#endif /* __BUILD_SALT_H */ +diff --git a/init/Kconfig b/init/Kconfig +index 041f3a022122..d39b31484c52 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -107,6 +107,15 @@ config LOCALVERSION_AUTO + + which is done within the script "scripts/setlocalversion".) + ++config BUILD_SALT ++ string "Build ID Salt" ++ default "" ++ help ++ The build ID is used to link binaries and their debug info. Setting ++ this option will use the value in the calculation of the build id. ++ This is mostly useful for distributions which want to ensure the ++ build is unique between builds. It's safe to leave the default. ++ + config HAVE_KERNEL_GZIP + bool + +diff --git a/init/version.c b/init/version.c +index bfb4e3f4955e..ef4012ec4375 100644 +--- a/init/version.c ++++ b/init/version.c +@@ -7,6 +7,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -49,3 +50,5 @@ const char linux_proc_banner[] = + "%s version %s" + " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" + " (" LINUX_COMPILER ") %s\n"; ++ ++BUILD_SALT; +diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c +index 1663fb19343a..dc6d714e4dcb 100644 +--- a/scripts/mod/modpost.c ++++ b/scripts/mod/modpost.c +@@ -2125,10 +2125,13 @@ static int check_modname_len(struct module *mod) + **/ + static void add_header(struct buffer *b, struct module *mod) + { ++ buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); + buf_printf(b, "\n"); ++ buf_printf(b, "BUILD_SALT;\n"); ++ buf_printf(b, "\n"); + buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); + buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); + buf_printf(b, "\n"); +-- +2.17.1 + diff --git a/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch b/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch new file mode 100644 index 000000000..926487b3d --- /dev/null +++ b/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch @@ -0,0 +1,99 @@ +From 714fe15daa07e7691c9731c88de71aa57f84b6c2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 3 Jan 2018 11:13:54 +0100 +Subject: [PATCH] platform/x86: dell-laptop: Filter out spurious keyboard + backlight change events + +On some Dell XPS models WMI events of type 0x0000 reporting a keycode of +0xe00c get reported when the brightness of the LCD panel changes. + +This leads to us reporting false-positive kbd_led change events to +userspace which in turn leads to the kbd backlight OSD showing when it +should not. + +We already read the current keyboard backlight brightness value when +reporting events because the led_classdev_notify_brightness_hw_changed +API requires this. Compare this value to the last known value and filter +out duplicate events, fixing this. + +Note the fixed issue is esp. a problem on XPS models with an ambient light +sensor and automatic brightness adjustments turned on, this causes the kbd +backlight OSD to show all the time there. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514969 +Signed-off-by: Hans de Goede +--- + drivers/platform/x86/dell-laptop.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c +index cd4725e7e0b5..2ef3297a9efc 100644 +--- a/drivers/platform/x86/dell-laptop.c ++++ b/drivers/platform/x86/dell-laptop.c +@@ -1133,6 +1133,7 @@ static u8 kbd_previous_mode_bit; + + static bool kbd_led_present; + static DEFINE_MUTEX(kbd_led_mutex); ++static enum led_brightness kbd_led_level; + + /* + * NOTE: there are three ways to set the keyboard backlight level. +@@ -1947,6 +1948,7 @@ static enum led_brightness kbd_led_level_get(struct led_classdev *led_cdev) + static int kbd_led_level_set(struct led_classdev *led_cdev, + enum led_brightness value) + { ++ enum led_brightness new_value = value; + struct kbd_state state; + struct kbd_state new_state; + u16 num; +@@ -1976,6 +1978,9 @@ static int kbd_led_level_set(struct led_classdev *led_cdev, + } + + out: ++ if (ret == 0) ++ kbd_led_level = new_value; ++ + mutex_unlock(&kbd_led_mutex); + return ret; + } +@@ -2003,6 +2008,9 @@ static int __init kbd_led_init(struct device *dev) + if (kbd_led.max_brightness) + kbd_led.max_brightness--; + } ++ ++ kbd_led_level = kbd_led_level_get(NULL); ++ + ret = led_classdev_register(dev, &kbd_led); + if (ret) + kbd_led_present = false; +@@ -2027,13 +2035,25 @@ static void kbd_led_exit(void) + static int dell_laptop_notifier_call(struct notifier_block *nb, + unsigned long action, void *data) + { ++ bool changed = false; ++ enum led_brightness new_kbd_led_level; ++ + switch (action) { + case DELL_LAPTOP_KBD_BACKLIGHT_BRIGHTNESS_CHANGED: + if (!kbd_led_present) + break; + +- led_classdev_notify_brightness_hw_changed(&kbd_led, +- kbd_led_level_get(&kbd_led)); ++ mutex_lock(&kbd_led_mutex); ++ new_kbd_led_level = kbd_led_level_get(&kbd_led); ++ if (kbd_led_level != new_kbd_led_level) { ++ kbd_led_level = new_kbd_led_level; ++ changed = true; ++ } ++ mutex_unlock(&kbd_led_mutex); ++ ++ if (changed) ++ led_classdev_notify_brightness_hw_changed(&kbd_led, ++ kbd_led_level); + break; + } + +-- +2.14.3 + diff --git a/0001-printk-Make-CONSOLE_LOGLEVEL_QUIET-configurable.patch b/0001-printk-Make-CONSOLE_LOGLEVEL_QUIET-configurable.patch new file mode 100644 index 000000000..548bd4bbb --- /dev/null +++ b/0001-printk-Make-CONSOLE_LOGLEVEL_QUIET-configurable.patch @@ -0,0 +1,79 @@ +From 79bfd044ed82290603093be1a3759672176f3e6f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 19 Jun 2018 13:30:04 +0200 +Subject: [PATCH] printk: Make CONSOLE_LOGLEVEL_QUIET configurable + +The goal of passing the "quiet" option to the kernel is for the kernel +to be quiet unless something really is wrong. + +Sofar passing quiet has been (mostly) equivalent to passing +loglevel=4 on the kernel commandline. Which means to show any messages +with a level of KERN_ERR or higher severity on the console. + +In practice this often does not result in a quiet boot though, since +there are many false-positive or otherwise harmless error messages printed, +defeating the purpose of the quiet option. Esp. the ACPICA code is really +bad wrt this, but there are plenty of others too. + +This commit makes CONSOLE_LOGLEVEL_QUIET configurable. + +This for example will allow distros which want quiet to really mean quiet +to set CONSOLE_LOGLEVEL_QUIET so that only messages with a higher severity +then KERN_ERR (CRIT, ALERT, EMERG) get printed, avoiding an endless game +of whack-a-mole silencing harmless error messages. + +Acked-by: Steven Rostedt (VMware) +Signed-off-by: Hans de Goede +--- + include/linux/printk.h | 6 +++--- + lib/Kconfig.debug | 11 +++++++++++ + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/include/linux/printk.h b/include/linux/printk.h +index 6d7e800affd8..18602bb3eca8 100644 +--- a/include/linux/printk.h ++++ b/include/linux/printk.h +@@ -50,15 +50,15 @@ static inline const char *printk_skip_headers(const char *buffer) + /* We show everything that is MORE important than this.. */ + #define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */ + #define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */ +-#define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with "quiet" */ + #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */ + #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ + + /* +- * Default used to be hard-coded at 7, we're now allowing it to be set from +- * kernel config. ++ * Default used to be hard-coded at 7, quiet used to be hardcoded at 4, ++ * we're now allowing both to be set from kernel config. + */ + #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT ++#define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET + + extern int console_printk[]; + +diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug +index 8838d1158d19..0d1c48dd22a9 100644 +--- a/lib/Kconfig.debug ++++ b/lib/Kconfig.debug +@@ -30,6 +30,17 @@ config CONSOLE_LOGLEVEL_DEFAULT + usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT + option. + ++config CONSOLE_LOGLEVEL_QUIET ++ int "quiet console loglevel (1-15)" ++ range 1 15 ++ default "4" ++ help ++ loglevel to use when "quiet" is passed on the kernel commandline. ++ ++ When "quiet" is passed on the kernel commandline this loglevel ++ will be used as the loglevel. IOW passing "quiet" will be the ++ equivalent of passing "loglevel=" ++ + config MESSAGE_LOGLEVEL_DEFAULT + int "Default message log level (1-7)" + range 1 7 +-- +2.18.0 + diff --git a/0001-random-add-a-config-option-to-trust-the-CPU-s-hwrng.patch b/0001-random-add-a-config-option-to-trust-the-CPU-s-hwrng.patch new file mode 100644 index 000000000..8a2f68f82 --- /dev/null +++ b/0001-random-add-a-config-option-to-trust-the-CPU-s-hwrng.patch @@ -0,0 +1,78 @@ +From 39a8883a2b989d1d21bd8dd99f5557f0c5e89694 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Tue, 17 Jul 2018 18:24:27 -0400 +Subject: [PATCH] random: add a config option to trust the CPU's hwrng + +This gives the user building their own kernel (or a Linux +distribution) the option of deciding whether or not to trust the CPU's +hardware random number generator (e.g., RDRAND for x86 CPU's) as being +correctly implemented and not having a back door introduced (perhaps +courtesy of a Nation State's law enforcement or intelligence +agencies). + +This will prevent getrandom(2) from blocking, if there is a +willingness to trust the CPU manufacturer. + +Signed-off-by: Theodore Ts'o +--- + drivers/char/Kconfig | 14 ++++++++++++++ + drivers/char/random.c | 11 ++++++++++- + 2 files changed, 24 insertions(+), 1 deletion(-) + +diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig +index 212f447938ae..ce277ee0a28a 100644 +--- a/drivers/char/Kconfig ++++ b/drivers/char/Kconfig +@@ -554,3 +554,17 @@ config ADI + + endmenu + ++config RANDOM_TRUST_CPU ++ bool "Trust the CPU manufacturer to initialize Linux's CRNG" ++ depends on X86 || S390 || PPC ++ default n ++ help ++ Assume that CPU manufacturer (e.g., Intel or AMD for RDSEED or ++ RDRAND, IBM for the S390 and Power PC architectures) is trustworthy ++ for the purposes of initializing Linux's CRNG. Since this is not ++ something that can be independently audited, this amounts to trusting ++ that CPU manufacturer (perhaps with the insistence or mandate ++ of a Nation State's intelligence or law enforcement agencies) ++ has not installed a hidden back door to compromise the CPU's ++ random number generation facilities. ++ +diff --git a/drivers/char/random.c b/drivers/char/random.c +index 34ddfd57419b..f4013b8a711b 100644 +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -782,6 +782,7 @@ static void invalidate_batched_entropy(void); + static void crng_initialize(struct crng_state *crng) + { + int i; ++ int arch_init = 1; + unsigned long rv; + + memcpy(&crng->state[0], "expand 32-byte k", 16); +@@ -792,10 +793,18 @@ static void crng_initialize(struct crng_state *crng) + _get_random_bytes(&crng->state[4], sizeof(__u32) * 12); + for (i = 4; i < 16; i++) { + if (!arch_get_random_seed_long(&rv) && +- !arch_get_random_long(&rv)) ++ !arch_get_random_long(&rv)) { + rv = random_get_entropy(); ++ arch_init = 0; ++ } + crng->state[i] ^= rv; + } ++#ifdef CONFIG_RANDOM_TRUST_CPU ++ if (arch_init) { ++ crng_init = 2; ++ pr_notice("random: crng done (trusting CPU's manufacturer)\n"); ++ } ++#endif + crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1; + } + +-- +2.17.1 + diff --git a/0001-random-make-CPU-trust-a-boot-parameter.patch b/0001-random-make-CPU-trust-a-boot-parameter.patch new file mode 100644 index 000000000..33695fcb4 --- /dev/null +++ b/0001-random-make-CPU-trust-a-boot-parameter.patch @@ -0,0 +1,82 @@ +From 9b25436662d5fb4c66eb527ead53cab15f596ee0 Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Mon, 27 Aug 2018 14:51:54 -0700 +Subject: [PATCH] random: make CPU trust a boot parameter + +Instead of forcing a distro or other system builder to choose +at build time whether the CPU is trusted for CRNG seeding via +CONFIG_RANDOM_TRUST_CPU, provide a boot-time parameter for end users to +control the choice. The CONFIG will set the default state instead. + +Signed-off-by: Kees Cook +Signed-off-by: Theodore Ts'o +--- + Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ + drivers/char/Kconfig | 4 ++-- + drivers/char/random.c | 11 ++++++++--- + 3 files changed, 16 insertions(+), 5 deletions(-) + +diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt +index 0c8f7889efa1..227c5c6fa4c1 100644 +--- a/Documentation/admin-guide/kernel-parameters.txt ++++ b/Documentation/admin-guide/kernel-parameters.txt +@@ -3390,6 +3390,12 @@ + ramdisk_size= [RAM] Sizes of RAM disks in kilobytes + See Documentation/blockdev/ramdisk.txt. + ++ random.trust_cpu={on,off} ++ [KNL] Enable or disable trusting the use of the ++ CPU's random number generator (if available) to ++ fully seed the kernel's CRNG. Default is controlled ++ by CONFIG_RANDOM_TRUST_CPU. ++ + ras=option[,option,...] [KNL] RAS-specific options + + cec_disable [X86] +diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig +index ce277ee0a28a..40728491f37b 100644 +--- a/drivers/char/Kconfig ++++ b/drivers/char/Kconfig +@@ -566,5 +566,5 @@ config RANDOM_TRUST_CPU + that CPU manufacturer (perhaps with the insistence or mandate + of a Nation State's intelligence or law enforcement agencies) + has not installed a hidden back door to compromise the CPU's +- random number generation facilities. +- ++ random number generation facilities. This can also be configured ++ at boot with "random.trust_cpu=on/off". +diff --git a/drivers/char/random.c b/drivers/char/random.c +index bf5f99fc36f1..c75b6cdf0053 100644 +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -779,6 +779,13 @@ static struct crng_state **crng_node_pool __read_mostly; + + static void invalidate_batched_entropy(void); + ++static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU); ++static int __init parse_trust_cpu(char *arg) ++{ ++ return kstrtobool(arg, &trust_cpu); ++} ++early_param("random.trust_cpu", parse_trust_cpu); ++ + static void crng_initialize(struct crng_state *crng) + { + int i; +@@ -799,12 +806,10 @@ static void crng_initialize(struct crng_state *crng) + } + crng->state[i] ^= rv; + } +-#ifdef CONFIG_RANDOM_TRUST_CPU +- if (arch_init) { ++ if (trust_cpu && arch_init) { + crng_init = 2; + pr_notice("random: crng done (trusting CPU's manufacturer)\n"); + } +-#endif + crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1; + } + +-- +2.17.1 + diff --git a/0001-socket-close-race-condition-between-sock_close-and-s.patch b/0001-socket-close-race-condition-between-sock_close-and-s.patch deleted file mode 100644 index 90f52fc3f..000000000 --- a/0001-socket-close-race-condition-between-sock_close-and-s.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 6d8c50dcb029872b298eea68cc6209c866fd3e14 Mon Sep 17 00:00:00 2001 -From: Cong Wang -Date: Thu, 7 Jun 2018 13:39:49 -0700 -Subject: [PATCH] socket: close race condition between sock_close() and - sockfs_setattr() - -fchownat() doesn't even hold refcnt of fd until it figures out -fd is really needed (otherwise is ignored) and releases it after -it resolves the path. This means sock_close() could race with -sockfs_setattr(), which leads to a NULL pointer dereference -since typically we set sock->sk to NULL in ->release(). - -As pointed out by Al, this is unique to sockfs. So we can fix this -in socket layer by acquiring inode_lock in sock_close() and -checking against NULL in sockfs_setattr(). - -sock_release() is called in many places, only the sock_close() -path matters here. And fortunately, this should not affect normal -sock_close() as it is only called when the last fd refcnt is gone. -It only affects sock_close() with a parallel sockfs_setattr() in -progress, which is not common. - -Fixes: 86741ec25462 ("net: core: Add a UID field to struct sock.") -Reported-by: shankarapailoor -Cc: Tetsuo Handa -Cc: Lorenzo Colitti -Cc: Al Viro -Signed-off-by: Cong Wang -Signed-off-by: David S. Miller ---- - net/socket.c | 18 +++++++++++++++--- - 1 file changed, 15 insertions(+), 3 deletions(-) - -diff --git a/net/socket.c b/net/socket.c -index af57d85bcb48..8a109012608a 100644 ---- a/net/socket.c -+++ b/net/socket.c -@@ -541,7 +541,10 @@ static int sockfs_setattr(struct dentry *dentry, struct iattr *iattr) - if (!err && (iattr->ia_valid & ATTR_UID)) { - struct socket *sock = SOCKET_I(d_inode(dentry)); - -- sock->sk->sk_uid = iattr->ia_uid; -+ if (sock->sk) -+ sock->sk->sk_uid = iattr->ia_uid; -+ else -+ err = -ENOENT; - } - - return err; -@@ -590,12 +593,16 @@ EXPORT_SYMBOL(sock_alloc); - * an inode not a file. - */ - --void sock_release(struct socket *sock) -+static void __sock_release(struct socket *sock, struct inode *inode) - { - if (sock->ops) { - struct module *owner = sock->ops->owner; - -+ if (inode) -+ inode_lock(inode); - sock->ops->release(sock); -+ if (inode) -+ inode_unlock(inode); - sock->ops = NULL; - module_put(owner); - } -@@ -609,6 +616,11 @@ void sock_release(struct socket *sock) - } - sock->file = NULL; - } -+ -+void sock_release(struct socket *sock) -+{ -+ __sock_release(sock, NULL); -+} - EXPORT_SYMBOL(sock_release); - - void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags) -@@ -1171,7 +1183,7 @@ static int sock_mmap(struct file *file, struct vm_area_struct *vma) - - static int sock_close(struct inode *inode, struct file *filp) - { -- sock_release(SOCKET_I(inode)); -+ __sock_release(SOCKET_I(inode), inode); - return 0; - } - --- -2.17.1 - diff --git a/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch b/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch new file mode 100644 index 000000000..37c0f041e --- /dev/null +++ b/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch @@ -0,0 +1,44 @@ +From 85721e6bfc5da3c8f7971c4acb1a0ad16fb2c16a Mon Sep 17 00:00:00 2001 +From: Sergey Senozhatsky +Date: Thu, 1 Feb 2018 13:29:38 +1100 +Subject: [PATCH] tools/lib/subcmd/pager.c: do not alias select() params + +Use a separate fd set for select()-s exception fds param to fix the +following gcc warning: + +pager.c:36:12: error: passing argument 2 to restrict-qualified + parameter aliases with argument 4 [-Werror=restrict] + select(1, &in, NULL, &in, NULL); + ^~~ ~~~ + +Link: http://lkml.kernel.org/r/20180101105626.7168-1-sergey.senozhatsky@gmail.com +Signed-off-by: Sergey Senozhatsky +Cc: Arnaldo Carvalho de Melo +Signed-off-by: Andrew Morton +Signed-off-by: Stephen Rothwell +--- + tools/lib/subcmd/pager.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c +index 5ba754d17952..9997a8805a82 100644 +--- a/tools/lib/subcmd/pager.c ++++ b/tools/lib/subcmd/pager.c +@@ -30,10 +30,13 @@ static void pager_preexec(void) + * have real input + */ + fd_set in; ++ fd_set exception; + + FD_ZERO(&in); ++ FD_ZERO(&exception); + FD_SET(0, &in); +- select(1, &in, NULL, &in, NULL); ++ FD_SET(0, &exception); ++ select(1, &in, NULL, &exception, NULL); + + setenv("LESS", "FRSX", 0); + } +-- +2.14.3 + diff --git a/0002-printk-Export-is_console_locked.patch b/0002-printk-Export-is_console_locked.patch new file mode 100644 index 000000000..aad37308d --- /dev/null +++ b/0002-printk-Export-is_console_locked.patch @@ -0,0 +1,34 @@ +From d48de54a9dab5370edd2e991f78cc7996cf5483e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 28 Jun 2018 15:20:27 +0200 +Subject: [PATCH 2/7] printk: Export is_console_locked + +This is a preparation patch for adding a number of WARN_CONSOLE_UNLOCKED() +calls to the fbcon code, which may be built as a module (event though +usually it is not). + +Acked-by: Steven Rostedt (VMware) +Acked-by: Sergey Senozhatsky +Acked-by: Petr Mladek +Reviewed-by: Daniel Vetter +Signed-off-by: Hans de Goede +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + kernel/printk/printk.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 247808333ba4..3f041e7cbfc9 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -2243,6 +2243,7 @@ int is_console_locked(void) + { + return console_locked; + } ++EXPORT_SYMBOL(is_console_locked); + + /* + * Check if we have any console that is capable of printing while cpu is +-- +2.18.0 + diff --git a/0002-x86-Add-build-salt-to-the-vDSO.patch b/0002-x86-Add-build-salt-to-the-vDSO.patch new file mode 100644 index 000000000..2b8a8f2a0 --- /dev/null +++ b/0002-x86-Add-build-salt-to-the-vDSO.patch @@ -0,0 +1,75 @@ +From 2199e4e9f81bd90ba82fcb8641a1a5911ac9c96b Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Tue, 3 Jul 2018 15:56:14 -0700 +Subject: [PATCHv6 2/4] x86: Add build salt to the vDSO +To: Andy Lutomirski +To: mjw@fedoraproject.org +Cc: Linus Torvalds +To: H. J. Lu +Cc: X86 ML +Cc: linux-kernel@vger.kernel.org +To: Masahiro Yamada +Cc: Nick Clifton +Cc: Cary Coutant +Cc: linux-kbuild@vger.kernel.org +Cc: linuxppc-dev@lists.ozlabs.org +Cc: Michael Ellerman +Cc: Catalin Marinas +Cc: Will Deacon +Cc: linux-arm-kernel@lists.infradead.org + + +The vDSO needs to have a unique build id in a similar manner +to the kernel and modules. Use the build salt macro. + +Acked-by: Andy Lutomirski +Signed-off-by: Laura Abbott +--- +v6: Ack from Andy +--- + arch/x86/entry/vdso/vdso-note.S | 3 +++ + arch/x86/entry/vdso/vdso32/note.S | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/arch/x86/entry/vdso/vdso-note.S b/arch/x86/entry/vdso/vdso-note.S +index 79a071e4357e..79423170118f 100644 +--- a/arch/x86/entry/vdso/vdso-note.S ++++ b/arch/x86/entry/vdso/vdso-note.S +@@ -3,6 +3,7 @@ + * Here we can supply some information useful to userland. + */ + ++#include + #include + #include + #include +@@ -10,3 +11,5 @@ + ELFNOTE_START(Linux, 0, "a") + .long LINUX_VERSION_CODE + ELFNOTE_END ++ ++BUILD_SALT +diff --git a/arch/x86/entry/vdso/vdso32/note.S b/arch/x86/entry/vdso/vdso32/note.S +index 9fd51f206314..e78047d119f6 100644 +--- a/arch/x86/entry/vdso/vdso32/note.S ++++ b/arch/x86/entry/vdso/vdso32/note.S +@@ -4,6 +4,7 @@ + * Here we can supply some information useful to userland. + */ + ++#include + #include + #include + +@@ -14,6 +15,8 @@ ELFNOTE_START(Linux, 0, "a") + .long LINUX_VERSION_CODE + ELFNOTE_END + ++BUILD_SALT ++ + #ifdef CONFIG_XEN + /* + * Add a special note telling glibc's dynamic linker a fake hardware +-- +2.17.1 + diff --git a/0003-fbcon-Call-WARN_CONSOLE_UNLOCKED-where-applicable.patch b/0003-fbcon-Call-WARN_CONSOLE_UNLOCKED-where-applicable.patch new file mode 100644 index 000000000..fef33c118 --- /dev/null +++ b/0003-fbcon-Call-WARN_CONSOLE_UNLOCKED-where-applicable.patch @@ -0,0 +1,70 @@ +From 3bd3a0e330aae4fffa8028aba2407ef615ab040b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 28 Jun 2018 15:20:28 +0200 +Subject: [PATCH 3/7] fbcon: Call WARN_CONSOLE_UNLOCKED() where applicable + +Replace comments about places where the console lock should be held with +calls to WARN_CONSOLE_UNLOCKED() to assert that it is actually held. + +Acked-by: Steven Rostedt (VMware) +Reviewed-by: Daniel Vetter +Reviewed-by: Sergey Senozhatsky +Signed-off-by: Hans de Goede +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/video/fbdev/core/fbcon.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c +index c910e74d46ff..cd8d52a967aa 100644 +--- a/drivers/video/fbdev/core/fbcon.c ++++ b/drivers/video/fbdev/core/fbcon.c +@@ -828,6 +828,8 @@ static int set_con2fb_map(int unit, int newidx, int user) + struct fb_info *oldinfo = NULL; + int found, err = 0; + ++ WARN_CONSOLE_UNLOCKED(); ++ + if (oldidx == newidx) + return 0; + +@@ -3044,6 +3046,8 @@ static int fbcon_fb_unbind(int idx) + { + int i, new_idx = -1, ret = 0; + ++ WARN_CONSOLE_UNLOCKED(); ++ + if (!fbcon_has_console_bind) + return 0; + +@@ -3094,6 +3098,8 @@ static int fbcon_fb_unregistered(struct fb_info *info) + { + int i, idx; + ++ WARN_CONSOLE_UNLOCKED(); ++ + idx = info->node; + for (i = first_fb_vc; i <= last_fb_vc; i++) { + if (con2fb_map[i] == idx) +@@ -3131,6 +3137,9 @@ static int fbcon_fb_unregistered(struct fb_info *info) + static void fbcon_remap_all(int idx) + { + int i; ++ ++ WARN_CONSOLE_UNLOCKED(); ++ + for (i = first_fb_vc; i <= last_fb_vc; i++) + set_con2fb_map(i, idx, 0); + +@@ -3177,6 +3186,8 @@ static int fbcon_fb_registered(struct fb_info *info) + { + int ret = 0, i, idx; + ++ WARN_CONSOLE_UNLOCKED(); ++ + idx = info->node; + fbcon_select_primary(info); + +-- +2.18.0 + diff --git a/0003-powerpc-Add-build-salt-to-the-vDSO.patch b/0003-powerpc-Add-build-salt-to-the-vDSO.patch new file mode 100644 index 000000000..c31176854 --- /dev/null +++ b/0003-powerpc-Add-build-salt-to-the-vDSO.patch @@ -0,0 +1,51 @@ +From e9bb20873f9dff73fc6f381e32b43f198974ed71 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Tue, 3 Jul 2018 15:59:53 -0700 +Subject: [PATCHv6 3/4] powerpc: Add build salt to the vDSO +Cc: Andy Lutomirski +To: mjw@fedoraproject.org +Cc: Linus Torvalds +To: H. J. Lu +Cc: X86 ML +Cc: linux-kernel@vger.kernel.org +To: Masahiro Yamada +Cc: Nick Clifton +Cc: Cary Coutant +Cc: linux-kbuild@vger.kernel.org +Cc: linuxppc-dev@lists.ozlabs.org +To: Michael Ellerman +Cc: Catalin Marinas +Cc: Will Deacon +Cc: linux-arm-kernel@lists.infradead.org + +The vDSO needs to have a unique build id in a similar manner +to the kernel and modules. Use the build salt macro. + +Signed-off-by: Laura Abbott +--- +v6: Remove semi-colon +--- + arch/powerpc/kernel/vdso32/note.S | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/powerpc/kernel/vdso32/note.S b/arch/powerpc/kernel/vdso32/note.S +index d4b5be4f3d5f..227a7327399e 100644 +--- a/arch/powerpc/kernel/vdso32/note.S ++++ b/arch/powerpc/kernel/vdso32/note.S +@@ -5,6 +5,7 @@ + + #include + #include ++#include + + #define ASM_ELF_NOTE_BEGIN(name, flags, vendor, type) \ + .section name, flags; \ +@@ -23,3 +24,5 @@ + ASM_ELF_NOTE_BEGIN(".note.kernel-version", "a", UTS_SYSNAME, 0) + .long LINUX_VERSION_CODE + ASM_ELF_NOTE_END ++ ++BUILD_SALT +-- +2.17.1 + diff --git a/0003-treewide-Rename-HOSTCFLAGS-KBUILD_HOSTCFLAGS.patch b/0003-treewide-Rename-HOSTCFLAGS-KBUILD_HOSTCFLAGS.patch new file mode 100644 index 000000000..504be373d --- /dev/null +++ b/0003-treewide-Rename-HOSTCFLAGS-KBUILD_HOSTCFLAGS.patch @@ -0,0 +1,150 @@ +From af0b06e726242516da9df5071e4e058f949f2240 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Thu, 5 Jul 2018 14:39:20 -0700 +Subject: [PATCHv2] treewide: Rename HOSTCFLAGS -> KBUILD_HOSTCFLAGS +To: Masahiro Yamada +To: Josh Poimboeuf +To: Jiri Olsa +Cc: linux-kbuild@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Robin Jarry + +In preparation for enabling command line CFLAGS, re-name HOSTCFLAGS to +KBUILD_HOSTCFLAGS as the internal use only flags. This should not have any +visible effects. + +Signed-off-by: Laura Abbott +--- +v2: Dropped name change for individual files (still CHOSTFLAGS_foo) +--- + Makefile | 4 ++-- + arch/alpha/boot/Makefile | 2 +- + net/bpfilter/Makefile | 2 +- + samples/bpf/Makefile | 10 +++++----- + scripts/Kbuild.include | 2 +- + scripts/Makefile.host | 2 +- + tools/build/Build.include | 2 +- + tools/objtool/Makefile | 2 +- + 8 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index 925c55f2524f..1feec222f3c1 100644 +--- a/Makefile ++++ b/Makefile +@@ -359,7 +359,7 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS) + + HOSTCC = gcc + HOSTCXX = g++ +-HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ ++KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ + -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) + HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) + HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) +@@ -429,7 +429,7 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds + LDFLAGS := + GCC_PLUGINS_CFLAGS := + +-export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC ++export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC + export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES + export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE + export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS +diff --git a/arch/alpha/boot/Makefile b/arch/alpha/boot/Makefile +index 0cbe4c59d3ce..dfccf0195306 100644 +--- a/arch/alpha/boot/Makefile ++++ b/arch/alpha/boot/Makefile +@@ -14,7 +14,7 @@ targets := vmlinux.gz vmlinux \ + tools/bootpzh bootloader bootpheader bootpzheader + OBJSTRIP := $(obj)/tools/objstrip + +-HOSTCFLAGS := -Wall -I$(objtree)/usr/include ++KBUILD_HOSTCFLAGS := -Wall -I$(objtree)/usr/include + BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) + + # SRM bootable image. Copy to offset 512 of a partition. +diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile +index 39c6980b5d99..70beeb4ad806 100644 +--- a/net/bpfilter/Makefile ++++ b/net/bpfilter/Makefile +@@ -5,7 +5,7 @@ + + hostprogs-y := bpfilter_umh + bpfilter_umh-objs := main.o +-HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi ++KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi + HOSTCC := $(CC) + + ifeq ($(CONFIG_BPFILTER_UMH), y) +diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile +index 1303af10e54d..494ef04c56cc 100644 +--- a/samples/bpf/Makefile ++++ b/samples/bpf/Makefile +@@ -164,11 +164,11 @@ always += xdpsock_kern.o + always += xdp_fwd_kern.o + always += task_fd_query_kern.o + +-HOSTCFLAGS += -I$(objtree)/usr/include +-HOSTCFLAGS += -I$(srctree)/tools/lib/ +-HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ +-HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include +-HOSTCFLAGS += -I$(srctree)/tools/perf ++KBUILD_HOSTCFLAGS += -I$(objtree)/usr/include ++KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ ++KBUILD_HOSTCFLAGS += -I$(srctree)/tools/testing/selftests/bpf/ ++KBUILD_HOSTCFLAGS += -I$(srctree)/tools/lib/ -I$(srctree)/tools/include ++KBUILD_HOSTCFLAGS += -I$(srctree)/tools/perf + + HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable + HOSTCFLAGS_trace_helpers.o += -I$(srctree)/tools/lib/bpf/ +diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include +index c8156d61678c..827344dfb185 100644 +--- a/scripts/Kbuild.include ++++ b/scripts/Kbuild.include +@@ -126,7 +126,7 @@ cc-option = $(call __cc-option, $(CC),\ + # hostcc-option + # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586) + hostcc-option = $(call __cc-option, $(HOSTCC),\ +- $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) ++ $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2)) + + # cc-option-yn + # Usage: flag := $(call cc-option-yn,-march=winchip-c6) +diff --git a/scripts/Makefile.host b/scripts/Makefile.host +index aa971cc3f339..09f00dae21fe 100644 +--- a/scripts/Makefile.host ++++ b/scripts/Makefile.host +@@ -62,7 +62,7 @@ host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) + ##### + # Handle options to gcc. Support building with separate output directory + +-_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ ++_hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ + $(HOSTCFLAGS_$(basetarget).o) + _hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ + $(HOSTCXXFLAGS_$(basetarget).o) +diff --git a/tools/build/Build.include b/tools/build/Build.include +index b5c679cd441c..a75fa0b6ffc0 100644 +--- a/tools/build/Build.include ++++ b/tools/build/Build.include +@@ -98,4 +98,4 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXX + ### + ## HOSTCC C flags + +-host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) ++host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(KBUILD_HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj)) +diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile +index f76d9914686a..b5d8c2964b52 100644 +--- a/tools/objtool/Makefile ++++ b/tools/objtool/Makefile +@@ -31,7 +31,7 @@ INCLUDES := -I$(srctree)/tools/include \ + -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ + -I$(srctree)/tools/objtool/arch/$(ARCH)/include + WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed +-CFLAGS += -Werror $(WARNINGS) $(HOSTCFLAGS) -g $(INCLUDES) ++CFLAGS += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) + LDFLAGS += -lelf $(LIBSUBCMD) $(HOSTLDFLAGS) + + # Allow old libelf to be used: +-- +2.17.1 + diff --git a/0004-arm64-Add-build-salt-to-the-vDSO.patch b/0004-arm64-Add-build-salt-to-the-vDSO.patch new file mode 100644 index 000000000..48367e79b --- /dev/null +++ b/0004-arm64-Add-build-salt-to-the-vDSO.patch @@ -0,0 +1,49 @@ +From de9537aca25d53d9b44e7ec9a9952ebd77d69cd1 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Tue, 3 Jul 2018 16:01:24 -0700 +Subject: [PATCHv6 4/4] arm64: Add build salt to the vDSO +Cc: Andy Lutomirski +To: mjw@fedoraproject.org +Cc: Linus Torvalds +To: H. J. Lu +Cc: X86 ML +Cc: linux-kernel@vger.kernel.org +To: Masahiro Yamada +Cc: Nick Clifton +Cc: Cary Coutant +Cc: linux-kbuild@vger.kernel.org +Cc: linuxppc-dev@lists.ozlabs.org +Cc: Michael Ellerman +To: Catalin Marinas +To: Will Deacon +Cc: linux-arm-kernel@lists.infradead.org + +The vDSO needs to have a unique build id in a similar manner +to the kernel and modules. Use the build salt macro. + +Acked-by: Will Deacon +Signed-off-by: Laura Abbott +--- +v6: Remove the semi-colon, Ack from Will +--- + arch/arm64/kernel/vdso/note.S | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm64/kernel/vdso/note.S b/arch/arm64/kernel/vdso/note.S +index b82c85e5d972..e20483b104d9 100644 +--- a/arch/arm64/kernel/vdso/note.S ++++ b/arch/arm64/kernel/vdso/note.S +@@ -22,7 +22,10 @@ + #include + #include + #include ++#include + + ELFNOTE_START(Linux, 0, "a") + .long LINUX_VERSION_CODE + ELFNOTE_END ++ ++BUILD_SALT +-- +2.17.1 + diff --git a/0004-console-fbcon-Add-support-for-deferred-console-takeo.patch b/0004-console-fbcon-Add-support-for-deferred-console-takeo.patch new file mode 100644 index 000000000..36d625ef3 --- /dev/null +++ b/0004-console-fbcon-Add-support-for-deferred-console-takeo.patch @@ -0,0 +1,322 @@ +From 83d83bebf40132e2d55ec58af666713cc76f9764 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 28 Jun 2018 15:20:30 +0200 +Subject: [PATCH 4/7] console/fbcon: Add support for deferred console takeover + +Currently fbcon claims fbdevs as soon as they are registered and takes over +the console as soon as the first fbdev gets registered. + +This behavior is undesirable in cases where a smooth graphical bootup is +desired, in such cases we typically want the contents of the framebuffer +(typically a vendor logo) to stay in place as is. + +The current solution for this problem (on embedded systems) is to not +enable fbcon. + +This commit adds a new FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER config option, +which when enabled defers fbcon taking over the console from the dummy +console until the first text is displayed on the console. Together with the +"quiet" kernel commandline option, this allows fbcon to still be used +together with a smooth graphical bootup, having it take over the console as +soon as e.g. an error message is logged. + +Note the choice to detect the first console output in the dummycon driver, +rather then handling this entirely inside the fbcon code, was made after +2 failed attempts to handle this entirely inside the fbcon code. The fbcon +code is woven quite tightly into the console code, making this to only +feasible option. + +Reviewed-by: Daniel Vetter +Signed-off-by: Hans de Goede +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + Documentation/fb/fbcon.txt | 7 ++++ + drivers/video/console/Kconfig | 11 +++++ + drivers/video/console/dummycon.c | 67 +++++++++++++++++++++++++---- + drivers/video/fbdev/core/fbcon.c | 72 ++++++++++++++++++++++++++++++++ + include/linux/console.h | 5 +++ + 5 files changed, 154 insertions(+), 8 deletions(-) + +diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt +index 79c22d096bbc..d4d642e1ce9c 100644 +--- a/Documentation/fb/fbcon.txt ++++ b/Documentation/fb/fbcon.txt +@@ -155,6 +155,13 @@ C. Boot options + used by text. By default, this area will be black. The 'color' value + is an integer number that depends on the framebuffer driver being used. + ++6. fbcon=nodefer ++ ++ If the kernel is compiled with deferred fbcon takeover support, normally ++ the framebuffer contents, left in place by the firmware/bootloader, will ++ be preserved until there actually is some text is output to the console. ++ This option causes fbcon to bind immediately to the fbdev device. ++ + C. Attaching, Detaching and Unloading + + Before going on how to attach, detach and unload the framebuffer console, an +diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig +index 4110ba7d7ca9..e91edef98633 100644 +--- a/drivers/video/console/Kconfig ++++ b/drivers/video/console/Kconfig +@@ -150,6 +150,17 @@ config FRAMEBUFFER_CONSOLE_ROTATION + such that other users of the framebuffer will remain normally + oriented. + ++config FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER ++ bool "Framebuffer Console Deferred Takeover" ++ depends on FRAMEBUFFER_CONSOLE=y && DUMMY_CONSOLE=y ++ help ++ If enabled this defers the framebuffer console taking over the ++ console from the dummy console until the first text is displayed on ++ the console. This is useful in combination with the "quiet" kernel ++ commandline option to keep the framebuffer contents initially put up ++ by the firmware in place, rather then replacing the contents with a ++ black screen as soon as fbcon loads. ++ + config STI_CONSOLE + bool "STI text console" + depends on PARISC && HAS_IOMEM +diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c +index f2eafe2ed980..45ad925ad5f8 100644 +--- a/drivers/video/console/dummycon.c ++++ b/drivers/video/console/dummycon.c +@@ -26,6 +26,65 @@ + #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS + #endif + ++#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER ++/* These are both protected by the console_lock */ ++static RAW_NOTIFIER_HEAD(dummycon_output_nh); ++static bool dummycon_putc_called; ++ ++void dummycon_register_output_notifier(struct notifier_block *nb) ++{ ++ raw_notifier_chain_register(&dummycon_output_nh, nb); ++ ++ if (dummycon_putc_called) ++ nb->notifier_call(nb, 0, NULL); ++} ++ ++void dummycon_unregister_output_notifier(struct notifier_block *nb) ++{ ++ raw_notifier_chain_unregister(&dummycon_output_nh, nb); ++} ++ ++static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) ++{ ++ dummycon_putc_called = true; ++ raw_notifier_call_chain(&dummycon_output_nh, 0, NULL); ++} ++ ++static void dummycon_putcs(struct vc_data *vc, const unsigned short *s, ++ int count, int ypos, int xpos) ++{ ++ int i; ++ ++ if (!dummycon_putc_called) { ++ /* Ignore erases */ ++ for (i = 0 ; i < count; i++) { ++ if (s[i] != vc->vc_video_erase_char) ++ break; ++ } ++ if (i == count) ++ return; ++ ++ dummycon_putc_called = true; ++ } ++ ++ raw_notifier_call_chain(&dummycon_output_nh, 0, NULL); ++} ++ ++static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch) ++{ ++ /* Redraw, so that we get putc(s) for output done while blanked */ ++ return 1; ++} ++#else ++static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { } ++static void dummycon_putcs(struct vc_data *vc, const unsigned short *s, ++ int count, int ypos, int xpos) { } ++static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch) ++{ ++ return 0; ++} ++#endif ++ + static const char *dummycon_startup(void) + { + return "dummy device"; +@@ -44,9 +103,6 @@ static void dummycon_init(struct vc_data *vc, int init) + static void dummycon_deinit(struct vc_data *vc) { } + static void dummycon_clear(struct vc_data *vc, int sy, int sx, int height, + int width) { } +-static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { } +-static void dummycon_putcs(struct vc_data *vc, const unsigned short *s, +- int count, int ypos, int xpos) { } + static void dummycon_cursor(struct vc_data *vc, int mode) { } + + static bool dummycon_scroll(struct vc_data *vc, unsigned int top, +@@ -61,11 +117,6 @@ static int dummycon_switch(struct vc_data *vc) + return 0; + } + +-static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch) +-{ +- return 0; +-} +- + static int dummycon_font_set(struct vc_data *vc, struct console_font *font, + unsigned int flags) + { +diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c +index cd8d52a967aa..5fb156bdcf4e 100644 +--- a/drivers/video/fbdev/core/fbcon.c ++++ b/drivers/video/fbdev/core/fbcon.c +@@ -129,6 +129,12 @@ static inline void fbcon_map_override(void) + } + #endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */ + ++#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER ++static bool deferred_takeover = true; ++#else ++#define deferred_takeover false ++#endif ++ + /* font data */ + static char fontname[40]; + +@@ -499,6 +505,12 @@ static int __init fb_console_setup(char *this_opt) + margin_color = simple_strtoul(options, &options, 0); + continue; + } ++#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER ++ if (!strcmp(options, "nodefer")) { ++ deferred_takeover = false; ++ continue; ++ } ++#endif + } + return 1; + } +@@ -3100,6 +3112,9 @@ static int fbcon_fb_unregistered(struct fb_info *info) + + WARN_CONSOLE_UNLOCKED(); + ++ if (deferred_takeover) ++ return 0; ++ + idx = info->node; + for (i = first_fb_vc; i <= last_fb_vc; i++) { + if (con2fb_map[i] == idx) +@@ -3140,6 +3155,13 @@ static void fbcon_remap_all(int idx) + + WARN_CONSOLE_UNLOCKED(); + ++ if (deferred_takeover) { ++ for (i = first_fb_vc; i <= last_fb_vc; i++) ++ con2fb_map_boot[i] = idx; ++ fbcon_map_override(); ++ return; ++ } ++ + for (i = first_fb_vc; i <= last_fb_vc; i++) + set_con2fb_map(i, idx, 0); + +@@ -3191,6 +3213,11 @@ static int fbcon_fb_registered(struct fb_info *info) + idx = info->node; + fbcon_select_primary(info); + ++ if (deferred_takeover) { ++ pr_info("fbcon: Deferring console take-over\n"); ++ return 0; ++ } ++ + if (info_idx == -1) { + for (i = first_fb_vc; i <= last_fb_vc; i++) { + if (con2fb_map_boot[i] == idx) { +@@ -3566,8 +3593,46 @@ static int fbcon_init_device(void) + return 0; + } + ++#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER ++static struct notifier_block fbcon_output_nb; ++ ++static int fbcon_output_notifier(struct notifier_block *nb, ++ unsigned long action, void *data) ++{ ++ int i; ++ ++ WARN_CONSOLE_UNLOCKED(); ++ ++ pr_info("fbcon: Taking over console\n"); ++ ++ dummycon_unregister_output_notifier(&fbcon_output_nb); ++ deferred_takeover = false; ++ logo_shown = FBCON_LOGO_DONTSHOW; ++ ++ for (i = 0; i < FB_MAX; i++) { ++ if (registered_fb[i]) ++ fbcon_fb_registered(registered_fb[i]); ++ } ++ ++ return NOTIFY_OK; ++} ++ ++static void fbcon_register_output_notifier(void) ++{ ++ fbcon_output_nb.notifier_call = fbcon_output_notifier; ++ dummycon_register_output_notifier(&fbcon_output_nb); ++} ++#else ++static inline void fbcon_register_output_notifier(void) {} ++#endif ++ + static void fbcon_start(void) + { ++ if (deferred_takeover) { ++ fbcon_register_output_notifier(); ++ return; ++ } ++ + if (num_registered_fb) { + int i; + +@@ -3594,6 +3659,13 @@ static void fbcon_exit(void) + if (fbcon_has_exited) + return; + ++#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER ++ if (deferred_takeover) { ++ dummycon_unregister_output_notifier(&fbcon_output_nb); ++ deferred_takeover = false; ++ } ++#endif ++ + kfree((void *)softback_buf); + softback_buf = 0UL; + +diff --git a/include/linux/console.h b/include/linux/console.h +index dfd6b0e97855..f59f3dbca65c 100644 +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -21,6 +21,7 @@ struct console_font_op; + struct console_font; + struct module; + struct tty_struct; ++struct notifier_block; + + /* + * this is what the terminal answers to a ESC-Z or csi0c query. +@@ -220,4 +221,8 @@ static inline bool vgacon_text_force(void) { return false; } + + extern void console_init(void); + ++/* For deferred console takeover */ ++void dummycon_register_output_notifier(struct notifier_block *nb); ++void dummycon_unregister_output_notifier(struct notifier_block *nb); ++ + #endif /* _LINUX_CONSOLE_H */ +-- +2.18.0 + diff --git a/0004-treewide-Rename-HOSTCXXFLAGS-to-KBUILD_HOSTCXXFLAGS.patch b/0004-treewide-Rename-HOSTCXXFLAGS-to-KBUILD_HOSTCXXFLAGS.patch new file mode 100644 index 000000000..f9d5febd7 --- /dev/null +++ b/0004-treewide-Rename-HOSTCXXFLAGS-to-KBUILD_HOSTCXXFLAGS.patch @@ -0,0 +1,61 @@ +From a6faf06c7da9ea06ca23c3a50215860f5d83b3bd Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Thu, 5 Jul 2018 14:43:37 -0700 +Subject: [PATCHv2 4/7] treewide: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS +To: Masahiro Yamada +To: Josh Poimboeuf +To: Jiri Olsa +Cc: linux-kbuild@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Robin Jarry + +In preparation for enabling command line CXXFLAGS, re-name HOSTCXXFLAGS to +KBUILD_HOSTCXXFLAGS as the internal use only flags. This should not have any +visible effects. + +Signed-off-by: Laura Abbott +--- +v2: Dropped name change for individual files (still HOSTCXXFLAGS_foo) +--- + Makefile | 4 ++-- + scripts/Makefile.host | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 1feec222f3c1..857ccd28dc36 100644 +--- a/Makefile ++++ b/Makefile +@@ -361,7 +361,7 @@ HOSTCC = gcc + HOSTCXX = g++ + KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ + -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) +-HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) ++KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) + HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) + HOST_LOADLIBES := $(HOST_LFS_LIBS) + +@@ -432,7 +432,7 @@ GCC_PLUGINS_CFLAGS := + export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC + export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES + export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE +-export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS ++export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS + + export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS + export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE +diff --git a/scripts/Makefile.host b/scripts/Makefile.host +index 09f00dae21fe..455d85aa1d37 100644 +--- a/scripts/Makefile.host ++++ b/scripts/Makefile.host +@@ -64,7 +64,7 @@ host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs)) + + _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \ + $(HOSTCFLAGS_$(basetarget).o) +-_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ ++_hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \ + $(HOSTCXXFLAGS_$(basetarget).o) + + ifeq ($(KBUILD_SRC),) +-- +2.17.1 + diff --git a/0005-efi-bgrt-Drop-__initdata-from-bgrt_image_size.patch b/0005-efi-bgrt-Drop-__initdata-from-bgrt_image_size.patch new file mode 100644 index 000000000..ec1ff7fbc --- /dev/null +++ b/0005-efi-bgrt-Drop-__initdata-from-bgrt_image_size.patch @@ -0,0 +1,33 @@ +From 421b8aef3902426c4c3ebd23218c0ad282786e1d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 3 Jul 2018 17:43:10 +0200 +Subject: [PATCH 5/7] efi/bgrt: Drop __initdata from bgrt_image_size + +bgrt_image_size is necessary to (optionally) show the boot graphics from +the efifb code. The efifb driver is a platform driver, using a normal +driver probe() driver callback. So even though it is always builtin it +cannot reference __initdata. + +Acked-by: Ard Biesheuvel +Signed-off-by: Hans de Goede +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/firmware/efi/efi-bgrt.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgrt.c +index 50793fda7819..b22ccfb0c991 100644 +--- a/drivers/firmware/efi/efi-bgrt.c ++++ b/drivers/firmware/efi/efi-bgrt.c +@@ -20,7 +20,7 @@ + #include + + struct acpi_table_bgrt bgrt_tab; +-size_t __initdata bgrt_image_size; ++size_t bgrt_image_size; + + struct bmp_header { + u16 id; +-- +2.18.0 + diff --git a/0005-treewide-Rename-HOSTLDFLAGS-to-KBUILD_HOSTLDFLAGS.patch b/0005-treewide-Rename-HOSTLDFLAGS-to-KBUILD_HOSTLDFLAGS.patch new file mode 100644 index 000000000..e40695033 --- /dev/null +++ b/0005-treewide-Rename-HOSTLDFLAGS-to-KBUILD_HOSTLDFLAGS.patch @@ -0,0 +1,139 @@ +From 017d1ce33501da9e3e438066d853a874df64f1a5 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Thu, 5 Jul 2018 14:45:52 -0700 +Subject: [PATCHv2 5/7] treewide: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS +To: Masahiro Yamada +To: Josh Poimboeuf +To: Jiri Olsa +Cc: linux-kbuild@vger.kernel.org +Cc: linux-kernel@vger.kernel.org +Cc: Robin Jarry + +In preparation for enabling command line LDFLAGS, re-name HOSTLDFLAGS to +KBUILD_HOSTLDFLAGS as the internal use only flags. This should not have any +visible effects. + +Signed-off-by: Laura Abbott +--- +v2: No change +--- + Makefile | 4 ++-- + net/bpfilter/Makefile | 2 +- + scripts/Makefile.host | 10 +++++----- + tools/build/Makefile | 2 +- + tools/objtool/Makefile | 2 +- + 5 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Makefile b/Makefile +index 857ccd28dc36..bd2d64b89463 100644 +--- a/Makefile ++++ b/Makefile +@@ -362,7 +362,7 @@ HOSTCXX = g++ + KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ + -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) + KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) +-HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) ++KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) + HOST_LOADLIBES := $(HOST_LFS_LIBS) + + # Make variables (CC, etc...) +@@ -430,7 +430,7 @@ LDFLAGS := + GCC_PLUGINS_CFLAGS := + + export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC +-export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES ++export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS HOST_LOADLIBES + export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE + export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS + +diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile +index 70beeb4ad806..0947ee7f70d5 100644 +--- a/net/bpfilter/Makefile ++++ b/net/bpfilter/Makefile +@@ -12,7 +12,7 @@ ifeq ($(CONFIG_BPFILTER_UMH), y) + # builtin bpfilter_umh should be compiled with -static + # since rootfs isn't mounted at the time of __init + # function is called and do_execv won't find elf interpreter +-HOSTLDFLAGS += -static ++KBUILD_HOSTLDFLAGS += -static + endif + + $(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh +diff --git a/scripts/Makefile.host b/scripts/Makefile.host +index 455d85aa1d37..c019d781b2c9 100644 +--- a/scripts/Makefile.host ++++ b/scripts/Makefile.host +@@ -84,7 +84,7 @@ hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags) + # Create executable from a single .c file + # host-csingle -> Executable + quiet_cmd_host-csingle = HOSTCC $@ +- cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(HOSTLDFLAGS) -o $@ $< \ ++ cmd_host-csingle = $(HOSTCC) $(hostc_flags) $(KBUILD_HOSTLDFLAGS) -o $@ $< \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) + $(host-csingle): $(obj)/%: $(src)/%.c FORCE + $(call if_changed_dep,host-csingle) +@@ -92,7 +92,7 @@ $(host-csingle): $(obj)/%: $(src)/%.c FORCE + # Link an executable based on list of .o files, all plain c + # host-cmulti -> executable + quiet_cmd_host-cmulti = HOSTLD $@ +- cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \ ++ cmd_host-cmulti = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ \ + $(addprefix $(obj)/,$($(@F)-objs)) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) + $(host-cmulti): FORCE +@@ -109,7 +109,7 @@ $(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE + # Link an executable based on list of .o files, a mixture of .c and .cc + # host-cxxmulti -> executable + quiet_cmd_host-cxxmulti = HOSTLD $@ +- cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \ ++ cmd_host-cxxmulti = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -o $@ \ + $(foreach o,objs cxxobjs,\ + $(addprefix $(obj)/,$($(@F)-$(o)))) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) +@@ -143,7 +143,7 @@ $(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE + # Link a shared library, based on position independent .o files + # *.o -> .so shared library (host-cshlib) + quiet_cmd_host-cshlib = HOSTLLD -shared $@ +- cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \ ++ cmd_host-cshlib = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ + $(addprefix $(obj)/,$($(@F:.so=-objs))) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) + $(host-cshlib): FORCE +@@ -153,7 +153,7 @@ $(call multi_depend, $(host-cshlib), .so, -objs) + # Link a shared library, based on position independent .o files + # *.o -> .so shared library (host-cxxshlib) + quiet_cmd_host-cxxshlib = HOSTLLD -shared $@ +- cmd_host-cxxshlib = $(HOSTCXX) $(HOSTLDFLAGS) -shared -o $@ \ ++ cmd_host-cxxshlib = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -shared -o $@ \ + $(addprefix $(obj)/,$($(@F:.so=-objs))) \ + $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) + $(host-cxxshlib): FORCE +diff --git a/tools/build/Makefile b/tools/build/Makefile +index 5edf65e684ab..727050c40f09 100644 +--- a/tools/build/Makefile ++++ b/tools/build/Makefile +@@ -43,7 +43,7 @@ $(OUTPUT)fixdep-in.o: FORCE + $(Q)$(MAKE) $(build)=fixdep + + $(OUTPUT)fixdep: $(OUTPUT)fixdep-in.o +- $(QUIET_LINK)$(HOSTCC) $(HOSTLDFLAGS) -o $@ $< ++ $(QUIET_LINK)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $< + + FORCE: + +diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile +index b5d8c2964b52..c9d038f91af6 100644 +--- a/tools/objtool/Makefile ++++ b/tools/objtool/Makefile +@@ -32,7 +32,7 @@ INCLUDES := -I$(srctree)/tools/include \ + -I$(srctree)/tools/objtool/arch/$(ARCH)/include + WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed + CFLAGS += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) +-LDFLAGS += -lelf $(LIBSUBCMD) $(HOSTLDFLAGS) ++LDFLAGS += -lelf $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS) + + # Allow old libelf to be used: + elfshdr := $(shell echo '$(pound)include ' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) +-- +2.17.1 + diff --git a/0006-efifb-Copy-the-ACPI-BGRT-boot-graphics-to-the-frameb.patch b/0006-efifb-Copy-the-ACPI-BGRT-boot-graphics-to-the-frameb.patch new file mode 100644 index 000000000..706c2f3c8 --- /dev/null +++ b/0006-efifb-Copy-the-ACPI-BGRT-boot-graphics-to-the-frameb.patch @@ -0,0 +1,201 @@ +From a5f742d7ba70c702bcf67dd1fd8d5dde3f5042fc Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 3 Jul 2018 17:43:10 +0200 +Subject: [PATCH 6/7] efifb: Copy the ACPI BGRT boot graphics to the + framebuffer + +On systems where fbcon is configured for deferred console takeover, the +intend is for the framebuffer to show the boot graphics (e.g a vendor +logo) until some message (e.g. an error) is printed or a graphical +session takes over. + +Some firmware relies on the OS to show the boot graphics. + +This patch adds support to efifb to show the boot graphics and +automatically enables this when fbcon is configured for deferred +console takeover. + +Signed-off-by: Hans de Goede +Signed-off-by: Bartlomiej Zolnierkiewicz +--- + drivers/video/fbdev/efifb.c | 140 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 140 insertions(+) + +diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c +index 46a4484e3da7..fa01eecc0a55 100644 +--- a/drivers/video/fbdev/efifb.c ++++ b/drivers/video/fbdev/efifb.c +@@ -9,16 +9,39 @@ + + #include + #include ++#include + #include + #include + #include + #include ++#include + #include + #include