diff --git a/.gitignore b/.gitignore index 93aa862ec..2b65c79ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ clog *.xz *.bz2 +*.gz *.rpm *.orig *.sign -kernel-[234].*/ +kernel-[45].*/ perf-man-*.tar.gz +kernel-headers/ +kernel-tools/ diff --git a/0001-Drop-that-for-now.patch b/0001-Drop-that-for-now.patch new file mode 100644 index 000000000..1d1850944 --- /dev/null +++ b/0001-Drop-that-for-now.patch @@ -0,0 +1,25 @@ +From 12cec6680e67d6b4fed9e30cd8c1f13871996cc1 Mon Sep 17 00:00:00 2001 +From: Laura Abbott +Date: Wed, 23 Jan 2019 14:36:37 +0100 +Subject: [PATCH] Drop that for now + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index f5b1d0d168e0..5f31107b22d1 100644 +--- a/Makefile ++++ b/Makefile +@@ -430,7 +430,7 @@ KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE + KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ + -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ + -Werror=implicit-function-declaration -Werror=implicit-int \ +- -Wno-format-security \ ++ -Wno-format-security -Wno-address-of-packed-member \ + -std=gnu89 + KBUILD_CPPFLAGS := -D__KERNEL__ + KBUILD_AFLAGS_KERNEL := +-- +2.20.1 + diff --git a/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch b/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch index 6e8a2e039..34934a970 100644 --- a/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch +++ b/0001-Make-get_cert_list-not-complain-about-cert-lists-tha.patch @@ -6,27 +6,27 @@ Subject: [PATCH 1/3] Make get_cert_list() not complain about cert lists that Signed-off-by: Peter Jones --- - certs/load_uefi.c | 37 ++++++++++++++++++++++--------------- + security/integrity/platform_certs/load_uefi.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) -diff --git a/certs/load_uefi.c b/certs/load_uefi.c -index 3d884598601..9ef34c44fd1 100644 ---- a/certs/load_uefi.c -+++ b/certs/load_uefi.c -@@ -35,8 +35,8 @@ static __init bool uefi_check_ignore_db(void) +diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c +index 81b19c52832b..e188f3ecbce3 100644 +--- a/security/integrity/platform_certs/load_uefi.c ++++ b/security/integrity/platform_certs/load_uefi.c +@@ -38,8 +38,8 @@ static __init bool uefi_check_ignore_db(void) /* * Get a certificate list blob from the named EFI variable. */ -static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, - unsigned long *size) +static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid, -+ unsigned long *size, void **cert_list) ++ unsigned long *size , void **cert_list) { efi_status_t status; unsigned long lsize = 4; -@@ -44,26 +44,33 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, +@@ -47,24 +47,31 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid, void *db; - + status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb); + if (status == EFI_NOT_FOUND) { + *size = 0; @@ -39,14 +39,12 @@ index 3d884598601..9ef34c44fd1 100644 - return NULL; + return efi_status_to_err(status); } - + db = kmalloc(lsize, GFP_KERNEL); - if (!db) { - pr_err("Couldn't allocate memory for uefi cert list\n"); + if (!db) - return NULL; + return -ENOMEM; - } - + status = efi.get_variable(name, guid, NULL, &lsize, db); if (status != EFI_SUCCESS) { kfree(db); @@ -54,15 +52,15 @@ index 3d884598601..9ef34c44fd1 100644 - return NULL; + return efi_status_to_err(status); } - + *size = lsize; - return db; + *cert_list = db; + return 0; } - + /* -@@ -152,10 +159,10 @@ static int __init load_uefi_certs(void) +@@ -153,10 +160,10 @@ static int __init load_uefi_certs(void) * an error if we can't get them. */ if (!uefi_check_ignore_db()) { @@ -74,36 +72,33 @@ index 3d884598601..9ef34c44fd1 100644 - } else { + } else if (dbsize != 0) { rc = parse_efi_signature_list("UEFI:db", - db, dbsize, get_handler_for_db); + db, dbsize, get_handler_for_db); if (rc) -@@ -164,10 +171,10 @@ static int __init load_uefi_certs(void) +@@ -166,10 +173,10 @@ static int __init load_uefi_certs(void) } } - + - mok = get_cert_list(L"MokListRT", &mok_var, &moksize); - if (!mok) { + rc = get_cert_list(L"MokListRT", &mok_var, &moksize, &mok); + if (rc < 0) { - pr_info("MODSIGN: Couldn't get UEFI MokListRT\n"); + pr_info("Couldn't get UEFI MokListRT\n"); - } else { + } else if (moksize != 0) { rc = parse_efi_signature_list("UEFI:MokListRT", mok, moksize, get_handler_for_db); if (rc) -@@ -175,10 +182,10 @@ static int __init load_uefi_certs(void) +@@ -177,10 +184,10 @@ static int __init load_uefi_certs(void) kfree(mok); } - + - dbx = get_cert_list(L"dbx", &secure_var, &dbxsize); - if (!dbx) { + rc = get_cert_list(L"dbx", &secure_var, &dbxsize, &dbx); + if (rc < 0) { - pr_info("MODSIGN: Couldn't get UEFI dbx list\n"); + pr_info("Couldn't get UEFI dbx list\n"); - } else { + } else if (dbxsize != 0) { rc = parse_efi_signature_list("UEFI:dbx", dbx, dbxsize, get_handler_for_dbx); --- -2.15.0 - diff --git a/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch b/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch new file mode 100644 index 000000000..87f4b4db7 --- /dev/null +++ b/0001-RDMA-Fix-goto-target-to-release-the-allocated-memory.patch @@ -0,0 +1,33 @@ +From 4a9d46a9fe14401f21df69cea97c62396d5fb053 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Tue, 10 Sep 2019 17:21:19 -0500 +Subject: [PATCH] RDMA: Fix goto target to release the allocated memory + +In bnxt_re_create_srq(), when ib_copy_to_udata() fails allocated memory +should be released by goto fail. + +Fixes: 37cb11acf1f7 ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") +Link: https://lore.kernel.org/r/20190910222120.16517-1-navid.emamdoost@gmail.com +Signed-off-by: Navid Emamdoost +Reviewed-by: Jason Gunthorpe +Signed-off-by: Jason Gunthorpe +--- + drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c +index f9e97d0cc459..b4149dc9e824 100644 +--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c ++++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c +@@ -1398,7 +1398,7 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq, + dev_err(rdev_to_dev(rdev), "SRQ copy to udata failed!"); + bnxt_qplib_destroy_srq(&rdev->qplib_res, + &srq->qplib_srq); +- goto exit; ++ goto fail; + } + } + if (nq) +-- +2.23.0 + diff --git a/0001-ath9k-release-allocated-buffer-if-timed-out.patch b/0001-ath9k-release-allocated-buffer-if-timed-out.patch new file mode 100644 index 000000000..db71192a3 --- /dev/null +++ b/0001-ath9k-release-allocated-buffer-if-timed-out.patch @@ -0,0 +1,29 @@ +From 728c1e2a05e4b5fc52fab3421dce772a806612a2 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 6 Sep 2019 13:59:30 -0500 +Subject: [PATCH] ath9k: release allocated buffer if timed out + +In ath9k_wmi_cmd, the allocated network buffer needs to be released +if timeout happens. Otherwise memory will be leaked. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath9k/wmi.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c +index d1f6710ca63b..cdc146091194 100644 +--- a/drivers/net/wireless/ath/ath9k/wmi.c ++++ b/drivers/net/wireless/ath/ath9k/wmi.c +@@ -336,6 +336,7 @@ int ath9k_wmi_cmd(struct wmi *wmi, enum wmi_cmd_id cmd_id, + ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n", + wmi_cmd_to_name(cmd_id)); + mutex_unlock(&wmi->op_mutex); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +-- +2.23.0 + diff --git a/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch b/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch new file mode 100644 index 000000000..0d21d61c7 --- /dev/null +++ b/0001-ath9k_htc-release-allocated-buffer-if-timed-out.patch @@ -0,0 +1,46 @@ +From 853acf7caf10b828102d92d05b5c101666a6142b Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 6 Sep 2019 13:26:03 -0500 +Subject: [PATCH] ath9k_htc: release allocated buffer if timed out + +In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service +if time out happens, the allocated buffer needs to be released. +Otherwise there will be memory leak. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath9k/htc_hst.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c +index 1bf63a4efb4c..d091c8ebdcf0 100644 +--- a/drivers/net/wireless/ath/ath9k/htc_hst.c ++++ b/drivers/net/wireless/ath/ath9k/htc_hst.c +@@ -170,6 +170,7 @@ static int htc_config_pipe_credits(struct htc_target *target) + time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); + if (!time_left) { + dev_err(target->dev, "HTC credit config timeout\n"); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +@@ -205,6 +206,7 @@ static int htc_setup_complete(struct htc_target *target) + time_left = wait_for_completion_timeout(&target->cmd_wait, HZ); + if (!time_left) { + dev_err(target->dev, "HTC start timeout\n"); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +@@ -277,6 +279,7 @@ int htc_connect_service(struct htc_target *target, + if (!time_left) { + dev_err(target->dev, "Service connection timeout for: %d\n", + service_connreq->service_id); ++ kfree_skb(skb); + return -ETIMEDOUT; + } + +-- +2.23.0 + diff --git a/0001-drm-nouveau-register-backlight-on-pascal-and-newer.patch b/0001-drm-nouveau-register-backlight-on-pascal-and-newer.patch new file mode 100644 index 000000000..6fa486952 --- /dev/null +++ b/0001-drm-nouveau-register-backlight-on-pascal-and-newer.patch @@ -0,0 +1,26 @@ +From 15f77c4ade3364106a3a397f0a8d6fce9d6a6326 Mon Sep 17 00:00:00 2001 +From: Ben Skeggs +Date: Fri, 11 Jan 2019 16:08:20 +1000 +Subject: [PATCH] drm/nouveau: register backlight on pascal and newer + +Signed-off-by: Ben Skeggs +--- + drivers/gpu/drm/nouveau/nouveau_backlight.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c +index 5f5be6368aed..c7a94c94dbf3 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c ++++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c +@@ -253,6 +253,8 @@ nouveau_backlight_init(struct drm_connector *connector) + case NV_DEVICE_INFO_V0_FERMI: + case NV_DEVICE_INFO_V0_KEPLER: + case NV_DEVICE_INFO_V0_MAXWELL: ++ case NV_DEVICE_INFO_V0_PASCAL: ++ case NV_DEVICE_INFO_V0_VOLTA: + ret = nv50_backlight_init(nv_encoder, &props, &ops); + break; + default: +-- +2.20.1 + diff --git a/0001-iio-Use-event-header-from-kernel-tree.patch b/0001-iio-Use-event-header-from-kernel-tree.patch deleted file mode 100644 index 1724db3fd..000000000 --- a/0001-iio-Use-event-header-from-kernel-tree.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0eadbb65c0026fb4eec89c54f6b48a0febd87f92 Mon Sep 17 00:00:00 2001 -From: Laura Abbott -Date: Fri, 9 Sep 2016 08:19:17 -0700 -Subject: [PATCH] iio: Use type header from kernel tree -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit -To: Jonathan Cameron -To: Hartmut Knaack -To: Lars-Peter Clausen -To: Peter Meerwald-Stadler -Cc: linux-iio@vger.kernel.org -Cc: linux-kernel@vger.kernel.org - - -The iio tools have been updated as new event types have been added to -the kernel. The tools currently use the standard system headers which -means that the system may not have the newest defintitions. This leads -to build failures when building newer tools on older hosts: - -gcc -Wall -g -D_GNU_SOURCE -c -o iio_event_monitor.o -iio_event_monitor.c -iio_event_monitor.c:59:3: error: ‘IIO_UVINDEX’ undeclared here (not in a -function) - [IIO_UVINDEX] = "uvindex", - ^~~~~~~~~~~ -iio_event_monitor.c:59:3: error: array index in initializer not of -integer type -iio_event_monitor.c:59:3: note: (near initialization for -‘iio_chan_type_name_spec’) -iio_event_monitor.c:97:3: error: ‘IIO_MOD_LIGHT_UV’ undeclared here (not -in a function) - [IIO_MOD_LIGHT_UV] = "uv", - ^~~~~~~~~~~~~~~~ -iio_event_monitor.c:97:3: error: array index in initializer not of -integer type -iio_event_monitor.c:97:3: note: (near initialization for -‘iio_modifier_names’) -: recipe for target 'iio_event_monitor.o' failed - -Switch to using the header from the kernel tree to ensure the newest -defintions are always picked up. - -Signed-off-by: Laura Abbott ---- - tools/iio/iio_event_monitor.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c -index d9b7e0f..f02523d 100644 ---- a/tools/iio/iio_event_monitor.c -+++ b/tools/iio/iio_event_monitor.c -@@ -26,7 +26,7 @@ - #include - #include "iio_utils.h" - #include --#include -+#include "../../include/uapi/linux/iio/types.h" - - static const char * const iio_chan_type_name_spec[] = { - [IIO_VOLTAGE] = "voltage", --- -2.7.4 - diff --git a/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch b/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch new file mode 100644 index 000000000..d82c3f254 --- /dev/null +++ b/0001-iwlwifi-dbg_ini-fix-memory-leak-in-alloc_sgtable.patch @@ -0,0 +1,29 @@ +From b4b814fec1a5a849383f7b3886b654a13abbda7d Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Thu, 12 Sep 2019 23:23:27 -0500 +Subject: [PATCH] iwlwifi: dbg_ini: fix memory leak in alloc_sgtable + +In alloc_sgtable if alloc_page fails, the alocated table should be +released. + +Signed-off-by: Navid Emamdoost +Signed-off-by: Luca Coelho +--- + drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +index 5c8602de9168..87421807e040 100644 +--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c ++++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +@@ -646,6 +646,7 @@ static struct scatterlist *alloc_sgtable(int size) + if (new_page) + __free_page(new_page); + } ++ kfree(table); + return NULL; + } + alloc_size = min_t(int, size, PAGE_SIZE); +-- +2.23.0 + diff --git a/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch b/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch new file mode 100644 index 000000000..a72e920bd --- /dev/null +++ b/0001-iwlwifi-pcie-fix-memory-leaks-in-iwl_pcie_ctxt_info_.patch @@ -0,0 +1,99 @@ +From 0f4f199443faca715523b0659aa536251d8b978f Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 27 Sep 2019 15:56:04 -0500 +Subject: [PATCH] iwlwifi: pcie: fix memory leaks in + iwl_pcie_ctxt_info_gen3_init + +In iwl_pcie_ctxt_info_gen3_init there are cases that the allocated dma +memory is leaked in case of error. + +DMA memories prph_scratch, prph_info, and ctxt_info_gen3 are allocated +and initialized to be later assigned to trans_pcie. But in any error case +before such assignment the allocated memories should be released. + +First of such error cases happens when iwl_pcie_init_fw_sec fails. +Current implementation correctly releases prph_scratch. But in two +sunsequent error cases where dma_alloc_coherent may fail, such +releases are missing. + +This commit adds release for prph_scratch when allocation for +prph_info fails, and adds releases for prph_scratch and prph_info when +allocation for ctxt_info_gen3 fails. + +Fixes: 2ee824026288 ("iwlwifi: pcie: support context information for 22560 devices") +Signed-off-by: Navid Emamdoost +Signed-off-by: Luca Coelho +--- + .../intel/iwlwifi/pcie/ctxt-info-gen3.c | 36 +++++++++++++------ + 1 file changed, 25 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +index 75fa8a6aafee..74980382e64c 100644 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +@@ -107,13 +107,9 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, + + /* allocate ucode sections in dram and set addresses */ + ret = iwl_pcie_init_fw_sec(trans, fw, &prph_scratch->dram); +- if (ret) { +- dma_free_coherent(trans->dev, +- sizeof(*prph_scratch), +- prph_scratch, +- trans_pcie->prph_scratch_dma_addr); +- return ret; +- } ++ if (ret) ++ goto err_free_prph_scratch; ++ + + /* Allocate prph information + * currently we don't assign to the prph info anything, but it would get +@@ -121,16 +117,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, + prph_info = dma_alloc_coherent(trans->dev, sizeof(*prph_info), + &trans_pcie->prph_info_dma_addr, + GFP_KERNEL); +- if (!prph_info) +- return -ENOMEM; ++ if (!prph_info) { ++ ret = -ENOMEM; ++ goto err_free_prph_scratch; ++ } + + /* Allocate context info */ + ctxt_info_gen3 = dma_alloc_coherent(trans->dev, + sizeof(*ctxt_info_gen3), + &trans_pcie->ctxt_info_dma_addr, + GFP_KERNEL); +- if (!ctxt_info_gen3) +- return -ENOMEM; ++ if (!ctxt_info_gen3) { ++ ret = -ENOMEM; ++ goto err_free_prph_info; ++ } + + ctxt_info_gen3->prph_info_base_addr = + cpu_to_le64(trans_pcie->prph_info_dma_addr); +@@ -186,6 +186,20 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, + iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT); + + return 0; ++ ++err_free_prph_info: ++ dma_free_coherent(trans->dev, ++ sizeof(*prph_info), ++ prph_info, ++ trans_pcie->prph_info_dma_addr); ++ ++err_free_prph_scratch: ++ dma_free_coherent(trans->dev, ++ sizeof(*prph_scratch), ++ prph_scratch, ++ trans_pcie->prph_scratch_dma_addr); ++ return ret; ++ + } + + void iwl_pcie_ctxt_info_gen3_free(struct iwl_trans *trans) +-- +2.23.0 + 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 deleted file mode 100644 index 1c0b1ab2e..000000000 --- a/0001-kbuild-Add-build-salt-to-the-kernel-and-modules.patch +++ /dev/null @@ -1,134 +0,0 @@ -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-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch b/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch new file mode 100644 index 000000000..e72e53ebd --- /dev/null +++ b/0001-nl80211-fix-memory-leak-in-nl80211_get_ftm_responder.patch @@ -0,0 +1,33 @@ +From 1399c59fa92984836db90538cf92397fe7caaa57 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 4 Oct 2019 14:42:19 -0500 +Subject: [PATCH] nl80211: fix memory leak in nl80211_get_ftm_responder_stats + +In nl80211_get_ftm_responder_stats, a new skb is created via nlmsg_new +named msg. If nl80211hdr_put() fails, then msg should be released. The +return statement should be replace by goto to error handling code. + +Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics") +Signed-off-by: Navid Emamdoost +Link: https://lore.kernel.org/r/20191004194220.19412-1-navid.emamdoost@gmail.com +Signed-off-by: Johannes Berg +--- + net/wireless/nl80211.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index 141cdb171665..4453dd375de9 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -13682,7 +13682,7 @@ static int nl80211_get_ftm_responder_stats(struct sk_buff *skb, + hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0, + NL80211_CMD_GET_FTM_RESPONDER_STATS); + if (!hdr) +- return -ENOBUFS; ++ goto nla_put_failure; + + if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) + goto nla_put_failure; +-- +2.23.0 + diff --git a/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch b/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch deleted file mode 100644 index 926487b3d..000000000 --- a/0001-platform-x86-dell-laptop-Filter-out-spurious-keyboar.patch +++ /dev/null @@ -1,99 +0,0 @@ -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 deleted file mode 100644 index 548bd4bbb..000000000 --- a/0001-printk-Make-CONSOLE_LOGLEVEL_QUIET-configurable.patch +++ /dev/null @@ -1,79 +0,0 @@ -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-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch b/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch deleted file mode 100644 index 37c0f041e..000000000 --- a/0001-tools-lib-subcmd-pager.c-do-not-alias-select-params.patch +++ /dev/null @@ -1,44 +0,0 @@ -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/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch b/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch new file mode 100644 index 000000000..42d4e176a --- /dev/null +++ b/0001-tracing-Have-error-path-in-predicate_parse-free-its-.patch @@ -0,0 +1,37 @@ +From 96c5c6e6a5b6db592acae039fed54b5c8844cd35 Mon Sep 17 00:00:00 2001 +From: Navid Emamdoost +Date: Fri, 20 Sep 2019 17:57:59 -0500 +Subject: [PATCH] tracing: Have error path in predicate_parse() free its + allocated memory + +In predicate_parse, there is an error path that is not going to +out_free instead it returns directly which leads to a memory leak. + +Link: http://lkml.kernel.org/r/20190920225800.3870-1-navid.emamdoost@gmail.com + +Signed-off-by: Navid Emamdoost +Signed-off-by: Steven Rostedt (VMware) +--- + kernel/trace/trace_events_filter.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c +index c773b8fb270c..c9a74f82b14a 100644 +--- a/kernel/trace/trace_events_filter.c ++++ b/kernel/trace/trace_events_filter.c +@@ -452,8 +452,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, + + switch (*next) { + case '(': /* #2 */ +- if (top - op_stack > nr_parens) +- return ERR_PTR(-EINVAL); ++ if (top - op_stack > nr_parens) { ++ ret = -EINVAL; ++ goto out_free; ++ } + *(++top) = invert; + continue; + case '!': /* #3 */ +-- +2.23.0 + diff --git a/0002-printk-Export-is_console_locked.patch b/0002-printk-Export-is_console_locked.patch deleted file mode 100644 index aad37308d..000000000 --- a/0002-printk-Export-is_console_locked.patch +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 2b8a8f2a0..000000000 --- a/0002-x86-Add-build-salt-to-the-vDSO.patch +++ /dev/null @@ -1,75 +0,0 @@ -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-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch b/0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch index abb313a29..ec107ba09 100644 --- a/0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch +++ b/0003-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch @@ -6,13 +6,13 @@ Subject: [PATCH 3/3] Make get_cert_list() use efi_status_to_str() to print Signed-off-by: Peter Jones --- - certs/load_uefi.c | 6 ++++-- + security/integrity/platform_certs/load_uefi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -diff --git a/certs/load_uefi.c b/certs/load_uefi.c +diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c index 9ef34c44fd1..13a2826715d 100644 ---- a/certs/load_uefi.c -+++ b/certs/load_uefi.c +--- a/security/integrity/platform_certs/load_uefi.c ++++ b/security/integrity/platform_certs/load_uefi.c @@ -51,7 +51,8 @@ static __init int get_cert_list(efi_char16_t *name, efi_guid_t *guid, } diff --git a/0003-fbcon-Call-WARN_CONSOLE_UNLOCKED-where-applicable.patch b/0003-fbcon-Call-WARN_CONSOLE_UNLOCKED-where-applicable.patch deleted file mode 100644 index fef33c118..000000000 --- a/0003-fbcon-Call-WARN_CONSOLE_UNLOCKED-where-applicable.patch +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100644 index c31176854..000000000 --- a/0003-powerpc-Add-build-salt-to-the-vDSO.patch +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100644 index 504be373d..000000000 --- a/0003-treewide-Rename-HOSTCFLAGS-KBUILD_HOSTCFLAGS.patch +++ /dev/null @@ -1,150 +0,0 @@ -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 deleted file mode 100644 index 48367e79b..000000000 --- a/0004-arm64-Add-build-salt-to-the-vDSO.patch +++ /dev/null @@ -1,49 +0,0 @@ -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 deleted file mode 100644 index 36d625ef3..000000000 --- a/0004-console-fbcon-Add-support-for-deferred-console-takeo.patch +++ /dev/null @@ -1,322 +0,0 @@ -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 deleted file mode 100644 index f9d5febd7..000000000 --- a/0004-treewide-Rename-HOSTCXXFLAGS-to-KBUILD_HOSTCXXFLAGS.patch +++ /dev/null @@ -1,61 +0,0 @@ -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 deleted file mode 100644 index ec1ff7fbc..000000000 --- a/0005-efi-bgrt-Drop-__initdata-from-bgrt_image_size.patch +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index e40695033..000000000 --- a/0005-treewide-Rename-HOSTLDFLAGS-to-KBUILD_HOSTLDFLAGS.patch +++ /dev/null @@ -1,139 +0,0 @@ -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 deleted file mode 100644 index 248b34335..000000000 --- a/0006-efifb-Copy-the-ACPI-BGRT-boot-graphics-to-the-frameb.patch +++ /dev/null @@ -1,201 +0,0 @@ -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 c6f78d27947b..67684412ba8a 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