Commit 721db9df authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'powerpc-5.8-7' of...

Merge tag 'powerpc-5.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux into master

Pull powerpc fixes from Michael Ellerman:
 "Some more powerpc fixes for 5.8:

   - A fix to the VAS code we merged this cycle, to report the proper
     error code to userspace for address translation failures. And a
     selftest update to match.

   - Another fix for our pkey handling of PROT_EXEC mappings.

   - A fix for a crash when booting a "secure VM" under an ultravisor
     with certain numbers of CPUs.

  Thanks to: Aneesh Kumar K.V, Haren Myneni, Laurent Dufour, Sandipan
  Das, Satheesh Rajendran, Thiago Jung Bauermann"

* tag 'powerpc-5.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  selftests/powerpc: Use proper error code to check fault address
  powerpc/vas: Report proper error code for address translation failure
  powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size
  powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey
parents 6a70f89c f0479c4b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ request buffers are not in memory. The operating system handles the fault by
updating CSB with the following data:

	csb.flags = CSB_V;
	csb.cc = CSB_CC_TRANSLATION;
	csb.cc = CSB_CC_FAULT_ADDRESS;
	csb.ce = CSB_CE_TERMINATION;
	csb.address = fault_address;

+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ struct coprocessor_completion_block {
#define CSB_CC_CHAIN		(37)
#define CSB_CC_SEQUENCE		(38)
#define CSB_CC_HW		(39)
/* P9 DD2 NX Workbook 3.2 (Table 4-36): Address translation fault */
#define	CSB_CC_FAULT_ADDRESS	(250)

#define CSB_SIZE		(0x10)
#define CSB_ALIGN		CSB_SIZE
+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align,
	 * This is very early in boot, so no harm done if the kernel crashes at
	 * this point.
	 */
	BUG_ON(shared_lppaca_size >= shared_lppaca_total_size);
	BUG_ON(shared_lppaca_size > shared_lppaca_total_size);

	return ptr;
}
+7 −5
Original line number Diff line number Diff line
@@ -354,12 +354,14 @@ static bool pkey_access_permitted(int pkey, bool write, bool execute)
	u64 amr;

	pkey_shift = pkeyshift(pkey);
	if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift)))
		return true;
	if (execute)
		return !(read_iamr() & (IAMR_EX_BIT << pkey_shift));

	amr = read_amr();
	if (write)
		return !(amr & (AMR_WR_BIT << pkey_shift));

	amr = read_amr(); /* Delay reading amr until absolutely needed */
	return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) ||
		(write &&  !(amr & (AMR_WR_BIT << pkey_shift))));
	return !(amr & (AMR_RD_BIT << pkey_shift));
}

bool arch_pte_access_permitted(u64 pte, bool write, bool execute)
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static void update_csb(struct vas_window *window,
	csb_addr = (void __user *)be64_to_cpu(crb->csb_addr);

	memset(&csb, 0, sizeof(csb));
	csb.cc = CSB_CC_TRANSLATION;
	csb.cc = CSB_CC_FAULT_ADDRESS;
	csb.ce = CSB_CE_TERMINATION;
	csb.cs = 0;
	csb.count = 0;
Loading