Skip to content

Commit dc30340

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
Pull more powerpc updates from Michael Ellerman: "Here's some more updates for powerpc for 3.18. They are a bit late I know, though must are actually bug fixes. In my defence I nearly cut the top of my finger off last weekend in a gruesome bike maintenance accident, so I spent a good part of the week waiting around for doctors. True story, I can send photos if you like :) Probably the most interesting fix is the sys_call_table one, which enables syscall tracing for powerpc. There's a fix for HMI handling for old firmware, more endian fixes for firmware interfaces, more EEH fixes, Anton fixed our routine that gets the current stack pointer, and a few other misc bits" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (22 commits) powerpc: Only do dynamic DMA zone limits on platforms that need it powerpc: sync pseries_le_defconfig with pseries_defconfig powerpc: Add printk levels to setup_system output powerpc/vphn: NUMA node code expects big-endian powerpc/msi: Use WARN_ON() in msi bitmap selftests powerpc/msi: Fix the msi bitmap alignment tests powerpc/eeh: Block CFG upon frozen Shiner adapter powerpc/eeh: Don't collect logs on PE with blocked config space powerpc/eeh: Block PCI config access upon frozen PE powerpc/pseries: Drop config requests in EEH accessors powerpc/powernv: Drop config requests in EEH accessors powerpc/eeh: Rename flag EEH_PE_RESET to EEH_PE_CFG_BLOCKED powerpc/eeh: Fix condition for isolated state powerpc/pseries: Make CPU hotplug path endian safe powerpc/pseries: Use dump_stack instead of show_stack powerpc: Rename __get_SP() to current_stack_pointer() powerpc: Reimplement __get_SP() as a function not a define powerpc/numa: Add ability to disable and debug topology updates powerpc/numa: check error return from proc_create powerpc/powernv: Fallback to old HMI handling behavior for old firmware ...
2 parents c4301c3 + e89dafb commit dc30340

28 files changed

Lines changed: 261 additions & 119 deletions

‎Documentation/kernel-parameters.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,6 +3465,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
34653465
e.g. base its process migration decisions on it.
34663466
Default is on.
34673467

3468+
topology_updates= [KNL, PPC, NUMA]
3469+
Format: {off}
3470+
Specify if the kernel should ignore (off)
3471+
topology updates sent by the hypervisor to this
3472+
LPAR.
3473+
34683474
tp720= [HW,PS2]
34693475

34703476
tpm_suspend_pcr=[HW,TPM]

‎arch/powerpc/configs/pseries_le_defconfig‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ CONFIG_KEXEC=y
4848
CONFIG_IRQ_ALL_CPUS=y
4949
CONFIG_MEMORY_HOTPLUG=y
5050
CONFIG_MEMORY_HOTREMOVE=y
51-
CONFIG_CMA=y
5251
CONFIG_PPC_64K_PAGES=y
5352
CONFIG_PPC_SUBPAGE_PROT=y
5453
CONFIG_SCHED_SMT=y
@@ -138,6 +137,7 @@ CONFIG_NETCONSOLE=y
138137
CONFIG_NETPOLL_TRAP=y
139138
CONFIG_TUN=m
140139
CONFIG_VIRTIO_NET=m
140+
CONFIG_VHOST_NET=m
141141
CONFIG_VORTEX=y
142142
CONFIG_ACENIC=m
143143
CONFIG_ACENIC_OMIT_TIGON_I=y
@@ -303,4 +303,9 @@ CONFIG_CRYPTO_LZO=m
303303
# CONFIG_CRYPTO_ANSI_CPRNG is not set
304304
CONFIG_CRYPTO_DEV_NX=y
305305
CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
306+
CONFIG_VIRTUALIZATION=y
307+
CONFIG_KVM_BOOK3S_64=m
308+
CONFIG_KVM_BOOK3S_64_HV=y
309+
CONFIG_TRANSPARENT_HUGEPAGE=y
310+
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
306311
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

‎arch/powerpc/include/asm/eeh.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ struct device_node;
7171

7272
#define EEH_PE_ISOLATED (1 << 0) /* Isolated PE */
7373
#define EEH_PE_RECOVERING (1 << 1) /* Recovering PE */
74-
#define EEH_PE_RESET (1 << 2) /* PE reset in progress */
74+
#define EEH_PE_CFG_BLOCKED (1 << 2) /* Block config access */
7575

7676
#define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */
77+
#define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */
7778

7879
struct eeh_pe {
7980
int type; /* PE type: PHB/Bus/Device */

‎arch/powerpc/include/asm/perf_event.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
do { \
3535
(regs)->result = 0; \
3636
(regs)->nip = __ip; \
37-
(regs)->gpr[1] = *(unsigned long *)__get_SP(); \
37+
(regs)->gpr[1] = current_stack_pointer(); \
3838
asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
3939
} while (0)
4040
#endif

‎arch/powerpc/include/asm/reg.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,8 +1265,7 @@ static inline unsigned long mfvtb (void)
12651265

12661266
#define proc_trap() asm volatile("trap")
12671267

1268-
#define __get_SP() ({unsigned long sp; \
1269-
asm volatile("mr %0,1": "=r" (sp)); sp;})
1268+
extern unsigned long current_stack_pointer(void);
12701269

12711270
extern unsigned long scom970_read(unsigned int address);
12721271
extern void scom970_write(unsigned int address, unsigned long value);

‎arch/powerpc/include/asm/syscall.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/* ftrace syscalls requires exporting the sys_call_table */
2121
#ifdef CONFIG_FTRACE_SYSCALLS
22-
extern const unsigned long *sys_call_table;
22+
extern const unsigned long sys_call_table[];
2323
#endif /* CONFIG_FTRACE_SYSCALLS */
2424

2525
static inline long syscall_get_nr(struct task_struct *task,

‎arch/powerpc/kernel/dma.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
5353
#else
5454
struct page *page;
5555
int node = dev_to_node(dev);
56+
#ifdef CONFIG_FSL_SOC
5657
u64 pfn = get_pfn_limit(dev);
5758
int zone;
5859

60+
/*
61+
* This code should be OK on other platforms, but we have drivers that
62+
* don't set coherent_dma_mask. As a workaround we just ifdef it. This
63+
* whole routine needs some serious cleanup.
64+
*/
65+
5966
zone = dma_pfn_limit_to_zone(pfn);
6067
if (zone < 0) {
6168
dev_err(dev, "%s: No suitable zone for pfn %#llx\n",
@@ -73,6 +80,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
7380
break;
7481
#endif
7582
};
83+
#endif /* CONFIG_FSL_SOC */
7684

7785
/* ignore region specifiers */
7886
flag &= ~(__GFP_HIGHMEM);

‎arch/powerpc/kernel/eeh.c‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ static void *eeh_dump_pe_log(void *data, void *flag)
257257
struct eeh_dev *edev, *tmp;
258258
size_t *plen = flag;
259259

260+
/* If the PE's config space is blocked, 0xFF's will be
261+
* returned. It's pointless to collect the log in this
262+
* case.
263+
*/
264+
if (pe->state & EEH_PE_CFG_BLOCKED)
265+
return NULL;
266+
260267
eeh_pe_for_each_dev(pe, edev, tmp)
261268
*plen += eeh_dump_dev_log(edev, pci_regs_buf + *plen,
262269
EEH_PCI_REGS_LOG_LEN - *plen);
@@ -673,18 +680,18 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state stat
673680
switch (state) {
674681
case pcie_deassert_reset:
675682
eeh_ops->reset(pe, EEH_RESET_DEACTIVATE);
676-
eeh_pe_state_clear(pe, EEH_PE_RESET);
683+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
677684
break;
678685
case pcie_hot_reset:
679-
eeh_pe_state_mark(pe, EEH_PE_RESET);
686+
eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
680687
eeh_ops->reset(pe, EEH_RESET_HOT);
681688
break;
682689
case pcie_warm_reset:
683-
eeh_pe_state_mark(pe, EEH_PE_RESET);
690+
eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
684691
eeh_ops->reset(pe, EEH_RESET_FUNDAMENTAL);
685692
break;
686693
default:
687-
eeh_pe_state_clear(pe, EEH_PE_RESET);
694+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
688695
return -EINVAL;
689696
};
690697

@@ -1523,7 +1530,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option)
15231530
switch (option) {
15241531
case EEH_RESET_DEACTIVATE:
15251532
ret = eeh_ops->reset(pe, option);
1526-
eeh_pe_state_clear(pe, EEH_PE_RESET);
1533+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
15271534
if (ret)
15281535
break;
15291536

@@ -1538,7 +1545,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option)
15381545
*/
15391546
eeh_ops->set_option(pe, EEH_OPT_FREEZE_PE);
15401547

1541-
eeh_pe_state_mark(pe, EEH_PE_RESET);
1548+
eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
15421549
ret = eeh_ops->reset(pe, option);
15431550
break;
15441551
default:

‎arch/powerpc/kernel/eeh_driver.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,13 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe)
528528
eeh_pe_dev_traverse(pe, eeh_report_error, &result);
529529

530530
/* Issue reset */
531-
eeh_pe_state_mark(pe, EEH_PE_RESET);
531+
eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
532532
ret = eeh_reset_pe(pe);
533533
if (ret) {
534-
eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_RESET);
534+
eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_CFG_BLOCKED);
535535
return ret;
536536
}
537-
eeh_pe_state_clear(pe, EEH_PE_RESET);
537+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
538538

539539
/* Unfreeze the PE */
540540
ret = eeh_clear_pe_frozen_state(pe, true);
@@ -601,10 +601,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
601601
* config accesses. So we prefer to block them. However, controlled
602602
* PCI config accesses initiated from EEH itself are allowed.
603603
*/
604-
eeh_pe_state_mark(pe, EEH_PE_RESET);
604+
eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
605605
rc = eeh_reset_pe(pe);
606606
if (rc) {
607-
eeh_pe_state_clear(pe, EEH_PE_RESET);
607+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
608608
return rc;
609609
}
610610

@@ -613,7 +613,7 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
613613
/* Restore PE */
614614
eeh_ops->configure_bridge(pe);
615615
eeh_pe_restore_bars(pe);
616-
eeh_pe_state_clear(pe, EEH_PE_RESET);
616+
eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
617617

618618
/* Clear frozen state */
619619
rc = eeh_clear_pe_frozen_state(pe, false);

‎arch/powerpc/kernel/eeh_pe.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static void *__eeh_pe_state_mark(void *data, void *flag)
525525
pe->state |= state;
526526

527527
/* Offline PCI devices if applicable */
528-
if (state != EEH_PE_ISOLATED)
528+
if (!(state & EEH_PE_ISOLATED))
529529
return NULL;
530530

531531
eeh_pe_for_each_dev(pe, edev, tmp) {
@@ -534,6 +534,10 @@ static void *__eeh_pe_state_mark(void *data, void *flag)
534534
pdev->error_state = pci_channel_io_frozen;
535535
}
536536

537+
/* Block PCI config access if required */
538+
if (pe->state & EEH_PE_CFG_RESTRICTED)
539+
pe->state |= EEH_PE_CFG_BLOCKED;
540+
537541
return NULL;
538542
}
539543

@@ -611,6 +615,10 @@ static void *__eeh_pe_state_clear(void *data, void *flag)
611615
pdev->error_state = pci_channel_io_normal;
612616
}
613617

618+
/* Unblock PCI config access if required */
619+
if (pe->state & EEH_PE_CFG_RESTRICTED)
620+
pe->state &= ~EEH_PE_CFG_BLOCKED;
621+
614622
return NULL;
615623
}
616624

0 commit comments

Comments
 (0)