Skip to content

Commit 3c45d75

Browse files
committed
Merge tag 'powerpc-5.5-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Some more powerpc fixes for 5.5: - Fix our hash MMU code to avoid having overlapping ids between user and kernel, which isn't as bad as it sounds but led to crashes on some machines. - A fix for the Power9 XIVE interrupt code, which could return the wrong interrupt state in obscure error conditions. - A minor Kconfig fix for the recently added CONFIG_PPC_UV code. Thanks to Aneesh Kumar K.V, Bharata B Rao, Cédric Le Goater, Frederic Barrat" * tag 'powerpc-5.5-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/mm/hash: Fix sharing context ids between kernel & userspace powerpc/xive: Discard ESB load value when interrupt is invalid powerpc: Ultravisor: Fix the dependencies for CONFIG_PPC_UV
2 parents 274adbf + 5d2e5dd commit 3c45d75

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

arch/powerpc/Kconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,7 @@ config PPC_TRANSACTIONAL_MEM
455455
config PPC_UV
456456
bool "Ultravisor support"
457457
depends on KVM_BOOK3S_HV_POSSIBLE
458-
select ZONE_DEVICE
459-
select DEV_PAGEMAP_OPS
460-
select DEVICE_PRIVATE
461-
select MEMORY_HOTPLUG
462-
select MEMORY_HOTREMOVE
458+
depends on DEVICE_PRIVATE
463459
default n
464460
help
465461
This option paravirtualizes the kernel to run in POWER platforms that

arch/powerpc/include/asm/book3s/64/mmu-hash.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,11 @@ extern void slb_set_size(u16 size);
600600
*
601601
*/
602602
#define MAX_USER_CONTEXT ((ASM_CONST(1) << CONTEXT_BITS) - 2)
603+
604+
// The + 2 accounts for INVALID_REGION and 1 more to avoid overlap with kernel
603605
#define MIN_USER_CONTEXT (MAX_KERNEL_CTX_CNT + MAX_VMALLOC_CTX_CNT + \
604-
MAX_IO_CTX_CNT + MAX_VMEMMAP_CTX_CNT)
606+
MAX_IO_CTX_CNT + MAX_VMEMMAP_CTX_CNT + 2)
607+
605608
/*
606609
* For platforms that support on 65bit VA we limit the context bits
607610
*/

arch/powerpc/include/asm/xive-regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#define XIVE_ESB_VAL_P 0x2
4141
#define XIVE_ESB_VAL_Q 0x1
42+
#define XIVE_ESB_INVALID 0xFF
4243

4344
/*
4445
* Thread Management (aka "TM") registers

arch/powerpc/sysdev/xive/common.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -972,12 +972,21 @@ static int xive_get_irqchip_state(struct irq_data *data,
972972
enum irqchip_irq_state which, bool *state)
973973
{
974974
struct xive_irq_data *xd = irq_data_get_irq_handler_data(data);
975+
u8 pq;
975976

976977
switch (which) {
977978
case IRQCHIP_STATE_ACTIVE:
978-
*state = !xd->stale_p &&
979-
(xd->saved_p ||
980-
!!(xive_esb_read(xd, XIVE_ESB_GET) & XIVE_ESB_VAL_P));
979+
pq = xive_esb_read(xd, XIVE_ESB_GET);
980+
981+
/*
982+
* The esb value being all 1's means we couldn't get
983+
* the PQ state of the interrupt through mmio. It may
984+
* happen, for example when querying a PHB interrupt
985+
* while the PHB is in an error state. We consider the
986+
* interrupt to be inactive in that case.
987+
*/
988+
*state = (pq != XIVE_ESB_INVALID) && !xd->stale_p &&
989+
(xd->saved_p || !!(pq & XIVE_ESB_VAL_P));
981990
return 0;
982991
default:
983992
return -EINVAL;

0 commit comments

Comments
 (0)