Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 841fe953 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Michael Ellerman:
 "Fixes for recently merged code:
   - a fix for the _PAGE_DEVMAP support, which was breaking KVM on
     Power9 radix
   - avoid a (harmless) lockdep warning in the early SMP code
   - return failure for some uses of dma_set_mask() rather than falling
     back to 32-bits
   - fix stack setup in watchdog soft_nmi_common() to use emergency
     stack
   - fix of_irq_to_resource() error check in of_fsl_spi_probe()

  Two fixes going to stable:
   - fix saving of Transactional Memory SPRs in core dump
   - fix __check_irq_replay missing decrementer interrupt

  And two misc:
   - fix 64-bit boot wrapper build with non-biarch compiler
   - work around a POWER9 PMU hang after state-loss idle

  Thanks to: Alistair Popple, Aneesh Kumar K.V, Cyril Bur, Gustavo
  Romero, Jose Ricardo Ziviani, Laurent Vivier, Nicholas Piggin, Oliver
  O'Halloran, Sergei Shtylyov, Suraj Jitindar Singh, Thomas Gleixner"

* tag 'powerpc-4.13-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/64: Fix __check_irq_replay missing decrementer interrupt
  powerpc/perf: POWER9 PMU stops after idle workaround
  powerpc/83xx/mpc832x_rdb: fix of_irq_to_resource() error check
  powerpc/64s: Fix stack setup in watchdog soft_nmi_common()
  powerpc/powernv/pci: Return failure for some uses of dma_set_mask()
  powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler
  powerpc/smp: Call smp_ops->setup_cpu() directly on the boot CPU
  powerpc/tm: Fix saving of TM SPRs in core dump
  powerpc/mm: Fix pmd/pte_devmap() on non-leaf entries
parents 869c058f 3db40c31
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -25,12 +25,20 @@ compress-$(CONFIG_KERNEL_XZ) := CONFIG_KERNEL_XZ
BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
		 -fno-strict-aliasing -Os -msoft-float -pipe \
		 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
		 -isystem $(shell $(CROSS32CC) -print-file-name=include) \
		 -D$(compress-y)

BOOTCC := $(CC)
ifdef CONFIG_PPC64_BOOT_WRAPPER
BOOTCFLAGS	+= -m64
else
BOOTCFLAGS	+= -m32
ifdef CROSS32_COMPILE
    BOOTCC := $(CROSS32_COMPILE)gcc
endif
endif

BOOTCFLAGS	+= -isystem $(shell $(BOOTCC) -print-file-name=include)

ifdef CONFIG_CPU_BIG_ENDIAN
BOOTCFLAGS	+= -mbig-endian
else
@@ -183,10 +191,10 @@ clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \
		empty.c zImage.coff.lds zImage.ps3.lds zImage.lds

quiet_cmd_bootcc = BOOTCC  $@
      cmd_bootcc = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
      cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<

quiet_cmd_bootas = BOOTAS  $@
      cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
      cmd_bootas = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<

quiet_cmd_bootar = BOOTAR  $@
      cmd_bootar = $(CROSS32AR) -cr$(KBUILD_ARFLAGS) $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
+9 −1
Original line number Diff line number Diff line
@@ -608,9 +608,17 @@ static inline pte_t pte_mkdevmap(pte_t pte)
	return __pte(pte_val(pte) | _PAGE_SPECIAL|_PAGE_DEVMAP);
}

/*
 * This is potentially called with a pmd as the argument, in which case it's not
 * safe to check _PAGE_DEVMAP unless we also confirm that _PAGE_PTE is set.
 * That's because the bit we use for _PAGE_DEVMAP is not reserved for software
 * use in page directory entries (ie. non-ptes).
 */
static inline int pte_devmap(pte_t pte)
{
	return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DEVMAP));
	u64 mask = cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE);

	return (pte_raw(pte) & mask) == mask;
}

static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+9 −1
Original line number Diff line number Diff line
@@ -1325,10 +1325,18 @@ EXC_VIRT_NONE(0x5800, 0x100)
	std	r10,PACA_EXGEN+EX_R13(r13);		\
	EXCEPTION_PROLOG_PSERIES_1(soft_nmi_common, _H)

/*
 * Branch to soft_nmi_interrupt using the emergency stack. The emergency
 * stack is one that is usable by maskable interrupts so long as MSR_EE
 * remains off. It is used for recovery when something has corrupted the
 * normal kernel stack, for example. The "soft NMI" must not use the process
 * stack because we want irq disabled sections to avoid touching the stack
 * at all (other than PMU interrupts), so use the emergency stack for this,
 * and run it entirely with interrupts hard disabled.
 */
EXC_COMMON_BEGIN(soft_nmi_common)
	mr	r10,r1
	ld	r1,PACAEMERGSP(r13)
	ld	r1,PACA_NMI_EMERG_SP(r13)
	subi	r1,r1,INT_FRAME_SIZE
	EXCEPTION_COMMON_NORET_STACK(PACA_EXGEN, 0x900,
			system_reset, soft_nmi_interrupt,
+7 −1
Original line number Diff line number Diff line
@@ -460,11 +460,17 @@ pnv_restore_hyp_resource_arch300:
	/*
	 * Workaround for POWER9, if we lost resources, the ERAT
	 * might have been mixed up and needs flushing. We also need
	 * to reload MMCR0 (see comment above).
	 * to reload MMCR0 (see comment above). We also need to set
	 * then clear bit 60 in MMCRA to ensure the PMU starts running.
	 */
	blt	cr3,1f
	PPC_INVALIDATE_ERAT
	ld	r1,PACAR1(r13)
	mfspr	r4,SPRN_MMCRA
	ori	r4,r4,(1 << (63-60))
	mtspr	SPRN_MMCRA,r4
	xori	r4,r4,(1 << (63-60))
	mtspr	SPRN_MMCRA,r4
	ld	r4,_MMCR0(r1)
	mtspr	SPRN_MMCR0,r4
1:
+14 −1
Original line number Diff line number Diff line
@@ -145,6 +145,19 @@ notrace unsigned int __check_irq_replay(void)

	/* Clear bit 0 which we wouldn't clear otherwise */
	local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS;
	if (happened & PACA_IRQ_HARD_DIS) {
		/*
		 * We may have missed a decrementer interrupt if hard disabled.
		 * Check the decrementer register in case we had a rollover
		 * while hard disabled.
		 */
		if (!(happened & PACA_IRQ_DEC)) {
			if (decrementer_check_overflow()) {
				local_paca->irq_happened |= PACA_IRQ_DEC;
				happened |= PACA_IRQ_DEC;
			}
		}
	}

	/*
	 * Force the delivery of pending soft-disabled interrupts on PS3.
@@ -170,7 +183,7 @@ notrace unsigned int __check_irq_replay(void)
	 * in case we also had a rollover while hard disabled
	 */
	local_paca->irq_happened &= ~PACA_IRQ_DEC;
	if ((happened & PACA_IRQ_DEC) || decrementer_check_overflow())
	if (happened & PACA_IRQ_DEC)
		return 0x900;

	/* Finally check if an external interrupt happened */
Loading