diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-24 19:05:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-24 19:05:50 -0500 |
commit | 3664ce2d930983966d2aac0e167f1332988c4e25 (patch) | |
tree | 8ee75014926692e5901e2e66037719a19770ada5 | |
parent | 9cb9c07d6b0c5fd97d83b8ab14d7e308ba4b612f (diff) | |
parent | eb0a2d2620ae431c543963c8c7f08f597366fc60 (diff) |
Merge tag 'powerpc-4.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman:
- Add handling for a missing instruction in our 32-bit BPF JIT so that
it can be used for seccomp filtering.
- Add a missing NULL pointer check before a function call in new EEH
code.
- Fix an error path in the new ocxl driver to correctly return EFAULT.
- The support for the new ibm,drc-info device tree property turns out
to need several fixes, so for now we just stop advertising to
firmware that we support it until the bugs can be ironed out.
- One fix for the new drmem code which was incorrectly modifying the
device tree in place.
- Finally two fixes for the RFI flush support, so that firmware can
advertise to us that it should be disabled entirely so as not to
affect performance.
Thanks to: Bharata B Rao, Frederic Barrat, Juan J. Alvarez, Mark Lord,
Michael Bringmann.
* tag 'powerpc-4.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/powernv: Support firmware disable of RFI flush
powerpc/pseries: Support firmware disable of RFI flush
powerpc/mm/drmem: Fix unexpected flag value in ibm,dynamic-memory-v2
powerpc/bpf/jit: Fix 32-bit JIT for seccomp_data access
powerpc/pseries: Revert support for ibm,drc-info devtree property
powerpc/pseries: Fix duplicate firmware feature for DRC_INFO
ocxl: Fix potential bad errno on irq allocation
powerpc/eeh: Fix crashes in eeh_report_resume()
-rw-r--r-- | arch/powerpc/include/asm/firmware.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/eeh_driver.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 2 | ||||
-rw-r--r-- | arch/powerpc/mm/drmem.c | 6 | ||||
-rw-r--r-- | arch/powerpc/net/bpf_jit_comp.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/setup.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 3 | ||||
-rw-r--r-- | drivers/misc/ocxl/file.c | 6 |
8 files changed, 20 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index 511acfd7ab0d..535add3f7791 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h | |||
@@ -52,7 +52,7 @@ | |||
52 | #define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000) | 52 | #define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000) |
53 | #define FW_FEATURE_PRRN ASM_CONST(0x0000000200000000) | 53 | #define FW_FEATURE_PRRN ASM_CONST(0x0000000200000000) |
54 | #define FW_FEATURE_DRMEM_V2 ASM_CONST(0x0000000400000000) | 54 | #define FW_FEATURE_DRMEM_V2 ASM_CONST(0x0000000400000000) |
55 | #define FW_FEATURE_DRC_INFO ASM_CONST(0x0000000400000000) | 55 | #define FW_FEATURE_DRC_INFO ASM_CONST(0x0000000800000000) |
56 | 56 | ||
57 | #ifndef __ASSEMBLY__ | 57 | #ifndef __ASSEMBLY__ |
58 | 58 | ||
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index beea2182d754..0c0b66fc5bfb 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c | |||
@@ -384,7 +384,8 @@ static void *eeh_report_resume(void *data, void *userdata) | |||
384 | eeh_pcid_put(dev); | 384 | eeh_pcid_put(dev); |
385 | pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED); | 385 | pci_uevent_ers(dev, PCI_ERS_RESULT_RECOVERED); |
386 | #ifdef CONFIG_PCI_IOV | 386 | #ifdef CONFIG_PCI_IOV |
387 | eeh_ops->notify_resume(eeh_dev_to_pdn(edev)); | 387 | if (eeh_ops->notify_resume && eeh_dev_to_pdn(edev)) |
388 | eeh_ops->notify_resume(eeh_dev_to_pdn(edev)); | ||
388 | #endif | 389 | #endif |
389 | return NULL; | 390 | return NULL; |
390 | } | 391 | } |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index adf044daafd7..d22c41c26bb3 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -874,7 +874,7 @@ struct ibm_arch_vec __cacheline_aligned ibm_architecture_vec = { | |||
874 | .mmu = 0, | 874 | .mmu = 0, |
875 | .hash_ext = 0, | 875 | .hash_ext = 0, |
876 | .radix_ext = 0, | 876 | .radix_ext = 0, |
877 | .byte22 = OV5_FEAT(OV5_DRC_INFO), | 877 | .byte22 = 0, |
878 | }, | 878 | }, |
879 | 879 | ||
880 | /* option vector 6: IBM PAPR hints */ | 880 | /* option vector 6: IBM PAPR hints */ |
diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c index 916844f99c64..3f1803672c9b 100644 --- a/arch/powerpc/mm/drmem.c +++ b/arch/powerpc/mm/drmem.c | |||
@@ -98,7 +98,7 @@ static void init_drconf_v2_cell(struct of_drconf_cell_v2 *dr_cell, | |||
98 | dr_cell->base_addr = cpu_to_be64(lmb->base_addr); | 98 | dr_cell->base_addr = cpu_to_be64(lmb->base_addr); |
99 | dr_cell->drc_index = cpu_to_be32(lmb->drc_index); | 99 | dr_cell->drc_index = cpu_to_be32(lmb->drc_index); |
100 | dr_cell->aa_index = cpu_to_be32(lmb->aa_index); | 100 | dr_cell->aa_index = cpu_to_be32(lmb->aa_index); |
101 | dr_cell->flags = cpu_to_be32(lmb->flags); | 101 | dr_cell->flags = cpu_to_be32(drmem_lmb_flags(lmb)); |
102 | } | 102 | } |
103 | 103 | ||
104 | static int drmem_update_dt_v2(struct device_node *memory, | 104 | static int drmem_update_dt_v2(struct device_node *memory, |
@@ -121,7 +121,7 @@ static int drmem_update_dt_v2(struct device_node *memory, | |||
121 | } | 121 | } |
122 | 122 | ||
123 | if (prev_lmb->aa_index != lmb->aa_index || | 123 | if (prev_lmb->aa_index != lmb->aa_index || |
124 | prev_lmb->flags != lmb->flags) | 124 | drmem_lmb_flags(prev_lmb) != drmem_lmb_flags(lmb)) |
125 | lmb_sets++; | 125 | lmb_sets++; |
126 | 126 | ||
127 | prev_lmb = lmb; | 127 | prev_lmb = lmb; |
@@ -150,7 +150,7 @@ static int drmem_update_dt_v2(struct device_node *memory, | |||
150 | } | 150 | } |
151 | 151 | ||
152 | if (prev_lmb->aa_index != lmb->aa_index || | 152 | if (prev_lmb->aa_index != lmb->aa_index || |
153 | prev_lmb->flags != lmb->flags) { | 153 | drmem_lmb_flags(prev_lmb) != drmem_lmb_flags(lmb)) { |
154 | /* end of one set, start of another */ | 154 | /* end of one set, start of another */ |
155 | dr_cell->seq_lmbs = cpu_to_be32(seq_lmbs); | 155 | dr_cell->seq_lmbs = cpu_to_be32(seq_lmbs); |
156 | dr_cell++; | 156 | dr_cell++; |
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index 872d1f6dd11e..a9636d8cba15 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c | |||
@@ -327,6 +327,9 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, | |||
327 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4); | 327 | BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4); |
328 | PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, len)); | 328 | PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, len)); |
329 | break; | 329 | break; |
330 | case BPF_LDX | BPF_W | BPF_ABS: /* A = *((u32 *)(seccomp_data + K)); */ | ||
331 | PPC_LWZ_OFFS(r_A, r_skb, K); | ||
332 | break; | ||
330 | case BPF_LDX | BPF_W | BPF_LEN: /* X = skb->len; */ | 333 | case BPF_LDX | BPF_W | BPF_LEN: /* X = skb->len; */ |
331 | PPC_LWZ_OFFS(r_X, r_skb, offsetof(struct sk_buff, len)); | 334 | PPC_LWZ_OFFS(r_X, r_skb, offsetof(struct sk_buff, len)); |
332 | break; | 335 | break; |
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 4fb21e17504a..092715b9674b 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c | |||
@@ -80,6 +80,10 @@ static void pnv_setup_rfi_flush(void) | |||
80 | if (np && of_property_read_bool(np, "disabled")) | 80 | if (np && of_property_read_bool(np, "disabled")) |
81 | enable--; | 81 | enable--; |
82 | 82 | ||
83 | np = of_get_child_by_name(fw_features, "speculation-policy-favor-security"); | ||
84 | if (np && of_property_read_bool(np, "disabled")) | ||
85 | enable = 0; | ||
86 | |||
83 | of_node_put(np); | 87 | of_node_put(np); |
84 | of_node_put(fw_features); | 88 | of_node_put(fw_features); |
85 | } | 89 | } |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 372d7ada1a0c..1a527625acf7 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -482,7 +482,8 @@ static void pseries_setup_rfi_flush(void) | |||
482 | if (types == L1D_FLUSH_NONE) | 482 | if (types == L1D_FLUSH_NONE) |
483 | types = L1D_FLUSH_FALLBACK; | 483 | types = L1D_FLUSH_FALLBACK; |
484 | 484 | ||
485 | if (!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) | 485 | if ((!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) || |
486 | (!(result.behaviour & H_CPU_BEHAV_FAVOUR_SECURITY))) | ||
486 | enable = false; | 487 | enable = false; |
487 | } else { | 488 | } else { |
488 | /* Default to fallback if case hcall is not available */ | 489 | /* Default to fallback if case hcall is not available */ |
diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 2dd2db9bc1c9..337462e1569f 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c | |||
@@ -133,8 +133,10 @@ static long afu_ioctl(struct file *file, unsigned int cmd, | |||
133 | if (!rc) { | 133 | if (!rc) { |
134 | rc = copy_to_user((u64 __user *) args, &irq_offset, | 134 | rc = copy_to_user((u64 __user *) args, &irq_offset, |
135 | sizeof(irq_offset)); | 135 | sizeof(irq_offset)); |
136 | if (rc) | 136 | if (rc) { |
137 | ocxl_afu_irq_free(ctx, irq_offset); | 137 | ocxl_afu_irq_free(ctx, irq_offset); |
138 | return -EFAULT; | ||
139 | } | ||
138 | } | 140 | } |
139 | break; | 141 | break; |
140 | 142 | ||
@@ -329,7 +331,7 @@ static ssize_t afu_read(struct file *file, char __user *buf, size_t count, | |||
329 | 331 | ||
330 | used += sizeof(header); | 332 | used += sizeof(header); |
331 | 333 | ||
332 | rc = (ssize_t) used; | 334 | rc = used; |
333 | return rc; | 335 | return rc; |
334 | } | 336 | } |
335 | 337 | ||