From: Greg Kroah-Hartman Date: Thu, 13 Feb 2020 04:31:35 +0000 (-0800) Subject: 4.14-stable patches X-Git-Tag: v4.4.214~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed54ca9305b77b1a17070a6580a0dafb93713ada;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: arm-8949-1-mm-mark-free_memmap-as-__init.patch arm64-cpufeature-fix-the-type-of-no-fp-simd-capability.patch crypto-artpec6-return-correct-error-code-for-failed-setkey.patch crypto-atmel-sha-fix-error-handling-when-setting-hmac-key.patch kvm-arm-arm64-fix-young-bit-from-mmu-notifier.patch kvm-arm-arm64-vgic-its-fix-restoration-of-unmapped-collections.patch media-i2c-adv748x-fix-unsafe-macros.patch pinctrl-sh-pfc-r8a7778-fix-duplicate-sdself_b-and-sd1_clk_b.patch --- diff --git a/queue-4.14/arm-8949-1-mm-mark-free_memmap-as-__init.patch b/queue-4.14/arm-8949-1-mm-mark-free_memmap-as-__init.patch new file mode 100644 index 00000000000..f49112b3952 --- /dev/null +++ b/queue-4.14/arm-8949-1-mm-mark-free_memmap-as-__init.patch @@ -0,0 +1,37 @@ +From 31f3010e60522ede237fb145a63b4af5a41718c2 Mon Sep 17 00:00:00 2001 +From: Olof Johansson +Date: Wed, 18 Dec 2019 01:18:49 +0100 +Subject: ARM: 8949/1: mm: mark free_memmap as __init + +From: Olof Johansson + +commit 31f3010e60522ede237fb145a63b4af5a41718c2 upstream. + +As of commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING +forcibly"), free_memmap() might not always be inlined, and thus is +triggering a section warning: + +WARNING: vmlinux.o(.text.unlikely+0x904): Section mismatch in reference from the function free_memmap() to the function .meminit.text:memblock_free() + +Mark it as __init, since the faller (free_unused_memmap) already is. + +Fixes: ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") +Signed-off-by: Olof Johansson +Signed-off-by: Russell King +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mm/init.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/mm/init.c ++++ b/arch/arm/mm/init.c +@@ -356,7 +356,7 @@ static inline void poison_init_mem(void + *p++ = 0xe7fddef0; + } + +-static inline void ++static inline void __init + free_memmap(unsigned long start_pfn, unsigned long end_pfn) + { + struct page *start_pg, *end_pg; diff --git a/queue-4.14/arm64-cpufeature-fix-the-type-of-no-fp-simd-capability.patch b/queue-4.14/arm64-cpufeature-fix-the-type-of-no-fp-simd-capability.patch new file mode 100644 index 00000000000..1485265dad2 --- /dev/null +++ b/queue-4.14/arm64-cpufeature-fix-the-type-of-no-fp-simd-capability.patch @@ -0,0 +1,45 @@ +From 449443c03d8cfdacf7313e17779a2594ebf87e6d Mon Sep 17 00:00:00 2001 +From: Suzuki K Poulose +Date: Mon, 13 Jan 2020 23:30:19 +0000 +Subject: arm64: cpufeature: Fix the type of no FP/SIMD capability + +From: Suzuki K Poulose + +commit 449443c03d8cfdacf7313e17779a2594ebf87e6d upstream. + +The NO_FPSIMD capability is defined with scope SYSTEM, which implies +that the "absence" of FP/SIMD on at least one CPU is detected only +after all the SMP CPUs are brought up. However, we use the status +of this capability for every context switch. So, let us change +the scope to LOCAL_CPU to allow the detection of this capability +as and when the first CPU without FP is brought up. + +Also, the current type allows hotplugged CPU to be brought up without +FP/SIMD when all the current CPUs have FP/SIMD and we have the userspace +up. Fix both of these issues by changing the capability to +BOOT_RESTRICTED_LOCAL_CPU_FEATURE. + +Fixes: 82e0191a1aa11abf ("arm64: Support systems without FP/ASIMD") +Cc: Will Deacon +Cc: Mark Rutland +Reviewed-by: Ard Biesheuvel +Reviewed-by: Catalin Marinas +Signed-off-by: Suzuki K Poulose +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/kernel/cpufeature.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/kernel/cpufeature.c ++++ b/arch/arm64/kernel/cpufeature.c +@@ -1103,7 +1103,7 @@ static const struct arm64_cpu_capabiliti + { + /* FP/SIMD is not implemented */ + .capability = ARM64_HAS_NO_FPSIMD, +- .type = ARM64_CPUCAP_SYSTEM_FEATURE, ++ .type = ARM64_CPUCAP_BOOT_RESTRICTED_CPU_LOCAL_FEATURE, + .min_field_value = 0, + .matches = has_no_fpsimd, + }, diff --git a/queue-4.14/crypto-artpec6-return-correct-error-code-for-failed-setkey.patch b/queue-4.14/crypto-artpec6-return-correct-error-code-for-failed-setkey.patch new file mode 100644 index 00000000000..1b4d6eceac4 --- /dev/null +++ b/queue-4.14/crypto-artpec6-return-correct-error-code-for-failed-setkey.patch @@ -0,0 +1,34 @@ +From b828f905904cd76424230c69741a4cabb0174168 Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Mon, 30 Dec 2019 21:19:32 -0600 +Subject: crypto: artpec6 - return correct error code for failed setkey() + +From: Eric Biggers + +commit b828f905904cd76424230c69741a4cabb0174168 upstream. + +->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1. + +Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver") +Cc: Jesper Nilsson +Cc: Lars Persson +Signed-off-by: Eric Biggers +Acked-by: Lars Persson +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/crypto/axis/artpec6_crypto.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/axis/artpec6_crypto.c ++++ b/drivers/crypto/axis/artpec6_crypto.c +@@ -1256,7 +1256,7 @@ static int artpec6_crypto_aead_set_key(s + + if (len != 16 && len != 24 && len != 32) { + crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); +- return -1; ++ return -EINVAL; + } + + ctx->key_length = len; diff --git a/queue-4.14/crypto-atmel-sha-fix-error-handling-when-setting-hmac-key.patch b/queue-4.14/crypto-atmel-sha-fix-error-handling-when-setting-hmac-key.patch new file mode 100644 index 00000000000..913c09db133 --- /dev/null +++ b/queue-4.14/crypto-atmel-sha-fix-error-handling-when-setting-hmac-key.patch @@ -0,0 +1,43 @@ +From b529f1983b2dcc46354f311feda92e07b6e9e2da Mon Sep 17 00:00:00 2001 +From: Eric Biggers +Date: Mon, 30 Dec 2019 21:19:33 -0600 +Subject: crypto: atmel-sha - fix error handling when setting hmac key + +From: Eric Biggers + +commit b529f1983b2dcc46354f311feda92e07b6e9e2da upstream. + +HMAC keys can be of any length, and atmel_sha_hmac_key_set() can only +fail due to -ENOMEM. But atmel_sha_hmac_setkey() incorrectly treated +any error as a "bad key length" error. Fix it to correctly propagate +the -ENOMEM error code and not set any tfm result flags. + +Fixes: 81d8750b2b59 ("crypto: atmel-sha - add support to hmac(shaX)") +Cc: Nicolas Ferre +Cc: Alexandre Belloni +Cc: Ludovic Desroches +Signed-off-by: Eric Biggers +Reviewed-by: Tudor Ambarus +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/crypto/atmel-sha.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/drivers/crypto/atmel-sha.c ++++ b/drivers/crypto/atmel-sha.c +@@ -1921,12 +1921,7 @@ static int atmel_sha_hmac_setkey(struct + { + struct atmel_sha_hmac_ctx *hmac = crypto_ahash_ctx(tfm); + +- if (atmel_sha_hmac_key_set(&hmac->hkey, key, keylen)) { +- crypto_ahash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); +- return -EINVAL; +- } +- +- return 0; ++ return atmel_sha_hmac_key_set(&hmac->hkey, key, keylen); + } + + static int atmel_sha_hmac_init(struct ahash_request *req) diff --git a/queue-4.14/kvm-arm-arm64-fix-young-bit-from-mmu-notifier.patch b/queue-4.14/kvm-arm-arm64-fix-young-bit-from-mmu-notifier.patch new file mode 100644 index 00000000000..72e5b32ffe9 --- /dev/null +++ b/queue-4.14/kvm-arm-arm64-fix-young-bit-from-mmu-notifier.patch @@ -0,0 +1,40 @@ +From cf2d23e0bac9f6b5cd1cba8898f5f05ead40e530 Mon Sep 17 00:00:00 2001 +From: Gavin Shan +Date: Tue, 21 Jan 2020 16:56:59 +1100 +Subject: KVM: arm/arm64: Fix young bit from mmu notifier + +From: Gavin Shan + +commit cf2d23e0bac9f6b5cd1cba8898f5f05ead40e530 upstream. + +kvm_test_age_hva() is called upon mmu_notifier_test_young(), but wrong +address range has been passed to handle_hva_to_gpa(). With the wrong +address range, no young bits will be checked in handle_hva_to_gpa(). +It means zero is always returned from mmu_notifier_test_young(). + +This fixes the issue by passing correct address range to the underly +function handle_hva_to_gpa(), so that the hardware young (access) bit +will be visited. + +Fixes: 35307b9a5f7e ("arm/arm64: KVM: Implement Stage-2 page aging") +Signed-off-by: Gavin Shan +Signed-off-by: Marc Zyngier +Link: https://lore.kernel.org/r/20200121055659.19560-1-gshan@redhat.com +Signed-off-by: Greg Kroah-Hartman + +--- + virt/kvm/arm/mmu.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/virt/kvm/arm/mmu.c ++++ b/virt/kvm/arm/mmu.c +@@ -1736,7 +1736,8 @@ int kvm_test_age_hva(struct kvm *kvm, un + if (!kvm->arch.pgd) + return 0; + trace_kvm_test_age_hva(hva); +- return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL); ++ return handle_hva_to_gpa(kvm, hva, hva + PAGE_SIZE, ++ kvm_test_age_hva_handler, NULL); + } + + void kvm_mmu_free_memory_caches(struct kvm_vcpu *vcpu) diff --git a/queue-4.14/kvm-arm-arm64-vgic-its-fix-restoration-of-unmapped-collections.patch b/queue-4.14/kvm-arm-arm64-vgic-its-fix-restoration-of-unmapped-collections.patch new file mode 100644 index 00000000000..dbd6a429761 --- /dev/null +++ b/queue-4.14/kvm-arm-arm64-vgic-its-fix-restoration-of-unmapped-collections.patch @@ -0,0 +1,38 @@ +From 8c58be34494b7f1b2adb446e2d8beeb90e5de65b Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Fri, 13 Dec 2019 10:42:37 +0100 +Subject: KVM: arm/arm64: vgic-its: Fix restoration of unmapped collections + +From: Eric Auger + +commit 8c58be34494b7f1b2adb446e2d8beeb90e5de65b upstream. + +Saving/restoring an unmapped collection is a valid scenario. For +example this happens if a MAPTI command was sent, featuring an +unmapped collection. At the moment the CTE fails to be restored. +Only compare against the number of online vcpus if the rdist +base is set. + +Fixes: ea1ad53e1e31a ("KVM: arm64: vgic-its: Collection table save/restore") +Signed-off-by: Eric Auger +Signed-off-by: Marc Zyngier +Reviewed-by: Zenghui Yu +Link: https://lore.kernel.org/r/20191213094237.19627-1-eric.auger@redhat.com +Signed-off-by: Greg Kroah-Hartman + +--- + virt/kvm/arm/vgic/vgic-its.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/virt/kvm/arm/vgic/vgic-its.c ++++ b/virt/kvm/arm/vgic/vgic-its.c +@@ -2210,7 +2210,8 @@ static int vgic_its_restore_cte(struct v + target_addr = (u32)(val >> KVM_ITS_CTE_RDBASE_SHIFT); + coll_id = val & KVM_ITS_CTE_ICID_MASK; + +- if (target_addr >= atomic_read(&kvm->online_vcpus)) ++ if (target_addr != COLLECTION_NOT_MAPPED && ++ target_addr >= atomic_read(&kvm->online_vcpus)) + return -EINVAL; + + collection = find_collection(its, coll_id); diff --git a/queue-4.14/media-i2c-adv748x-fix-unsafe-macros.patch b/queue-4.14/media-i2c-adv748x-fix-unsafe-macros.patch new file mode 100644 index 00000000000..3a15766af49 --- /dev/null +++ b/queue-4.14/media-i2c-adv748x-fix-unsafe-macros.patch @@ -0,0 +1,60 @@ +From 0d962e061abcf1b9105f88fb850158b5887fbca3 Mon Sep 17 00:00:00 2001 +From: "Gustavo A. R. Silva" +Date: Tue, 22 Oct 2019 15:25:22 +0200 +Subject: media: i2c: adv748x: Fix unsafe macros + +From: Gustavo A. R. Silva + +commit 0d962e061abcf1b9105f88fb850158b5887fbca3 upstream. + +Enclose multiple macro parameters in parentheses in order to +make such macros safer and fix the Clang warning below: + +drivers/media/i2c/adv748x/adv748x-afe.c:452:12: warning: operator '?:' +has lower precedence than '|'; '|' will be evaluated first +[-Wbitwise-conditional-parentheses] + +ret = sdp_clrset(state, ADV748X_SDP_FRP, ADV748X_SDP_FRP_MASK, enable +? ctrl->val - 1 : 0); + +Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver") +Reported-by: Dmitry Vyukov +Signed-off-by: Gustavo A. R. Silva +Reviewed-by: Kieran Bingham +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/i2c/adv748x/adv748x.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/media/i2c/adv748x/adv748x.h ++++ b/drivers/media/i2c/adv748x/adv748x.h +@@ -372,10 +372,10 @@ int adv748x_write_block(struct adv748x_s + + #define io_read(s, r) adv748x_read(s, ADV748X_PAGE_IO, r) + #define io_write(s, r, v) adv748x_write(s, ADV748X_PAGE_IO, r, v) +-#define io_clrset(s, r, m, v) io_write(s, r, (io_read(s, r) & ~m) | v) ++#define io_clrset(s, r, m, v) io_write(s, r, (io_read(s, r) & ~(m)) | (v)) + + #define hdmi_read(s, r) adv748x_read(s, ADV748X_PAGE_HDMI, r) +-#define hdmi_read16(s, r, m) (((hdmi_read(s, r) << 8) | hdmi_read(s, r+1)) & m) ++#define hdmi_read16(s, r, m) (((hdmi_read(s, r) << 8) | hdmi_read(s, (r)+1)) & (m)) + #define hdmi_write(s, r, v) adv748x_write(s, ADV748X_PAGE_HDMI, r, v) + + #define repeater_read(s, r) adv748x_read(s, ADV748X_PAGE_REPEATER, r) +@@ -383,11 +383,11 @@ int adv748x_write_block(struct adv748x_s + + #define sdp_read(s, r) adv748x_read(s, ADV748X_PAGE_SDP, r) + #define sdp_write(s, r, v) adv748x_write(s, ADV748X_PAGE_SDP, r, v) +-#define sdp_clrset(s, r, m, v) sdp_write(s, r, (sdp_read(s, r) & ~m) | v) ++#define sdp_clrset(s, r, m, v) sdp_write(s, r, (sdp_read(s, r) & ~(m)) | (v)) + + #define cp_read(s, r) adv748x_read(s, ADV748X_PAGE_CP, r) + #define cp_write(s, r, v) adv748x_write(s, ADV748X_PAGE_CP, r, v) +-#define cp_clrset(s, r, m, v) cp_write(s, r, (cp_read(s, r) & ~m) | v) ++#define cp_clrset(s, r, m, v) cp_write(s, r, (cp_read(s, r) & ~(m)) | (v)) + + #define txa_read(s, r) adv748x_read(s, ADV748X_PAGE_TXA, r) + #define txb_read(s, r) adv748x_read(s, ADV748X_PAGE_TXB, r) diff --git a/queue-4.14/pinctrl-sh-pfc-r8a7778-fix-duplicate-sdself_b-and-sd1_clk_b.patch b/queue-4.14/pinctrl-sh-pfc-r8a7778-fix-duplicate-sdself_b-and-sd1_clk_b.patch new file mode 100644 index 00000000000..476c287d10e --- /dev/null +++ b/queue-4.14/pinctrl-sh-pfc-r8a7778-fix-duplicate-sdself_b-and-sd1_clk_b.patch @@ -0,0 +1,41 @@ +From 805f635703b2562b5ddd822c62fc9124087e5dd5 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Wed, 18 Dec 2019 20:48:07 +0100 +Subject: pinctrl: sh-pfc: r8a7778: Fix duplicate SDSELF_B and SD1_CLK_B + +From: Geert Uytterhoeven + +commit 805f635703b2562b5ddd822c62fc9124087e5dd5 upstream. + +The FN_SDSELF_B and FN_SD1_CLK_B enum IDs are used twice, which means +one set of users must be wrong. Replace them by the correct enum IDs. + +Fixes: 87f8c988636db0d4 ("sh-pfc: Add r8a7778 pinmux support") +Signed-off-by: Geert Uytterhoeven +Link: https://lore.kernel.org/r/20191218194812.12741-2-geert+renesas@glider.be +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pinctrl/sh-pfc/pfc-r8a7778.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/pinctrl/sh-pfc/pfc-r8a7778.c ++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7778.c +@@ -2325,7 +2325,7 @@ static const struct pinmux_cfg_reg pinmu + FN_ATAG0_A, 0, FN_REMOCON_B, 0, + /* IP0_11_8 [4] */ + FN_SD1_DAT2_A, FN_MMC_D2, 0, FN_BS, +- FN_ATADIR0_A, 0, FN_SDSELF_B, 0, ++ FN_ATADIR0_A, 0, FN_SDSELF_A, 0, + FN_PWM4_B, 0, 0, 0, + 0, 0, 0, 0, + /* IP0_7_5 [3] */ +@@ -2367,7 +2367,7 @@ static const struct pinmux_cfg_reg pinmu + FN_TS_SDAT0_A, 0, 0, 0, + 0, 0, 0, 0, + /* IP1_10_8 [3] */ +- FN_SD1_CLK_B, FN_MMC_D6, 0, FN_A24, ++ FN_SD1_CD_A, FN_MMC_D6, 0, FN_A24, + FN_DREQ1_A, 0, FN_HRX0_B, FN_TS_SPSYNC0_A, + /* IP1_7_5 [3] */ + FN_A23, FN_HTX0_B, FN_TX2_B, FN_DACK2_A, diff --git a/queue-4.14/series b/queue-4.14/series index d04e49c2c6b..6846d7cdad3 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -157,3 +157,11 @@ arm-dts-at91-sama5d3-define-clock-rate-range-for-tcb1.patch tools-power-acpi-fix-compilation-error.patch powerpc-pseries-vio-fix-iommu_table-use-after-free-refcount-warning.patch powerpc-pseries-allow-not-having-ibm-hypertas-functions-hcall-multi-tce-for-ddw.patch +kvm-arm-arm64-vgic-its-fix-restoration-of-unmapped-collections.patch +arm-8949-1-mm-mark-free_memmap-as-__init.patch +arm64-cpufeature-fix-the-type-of-no-fp-simd-capability.patch +kvm-arm-arm64-fix-young-bit-from-mmu-notifier.patch +crypto-artpec6-return-correct-error-code-for-failed-setkey.patch +crypto-atmel-sha-fix-error-handling-when-setting-hmac-key.patch +media-i2c-adv748x-fix-unsafe-macros.patch +pinctrl-sh-pfc-r8a7778-fix-duplicate-sdself_b-and-sd1_clk_b.patch