Skip to content

Commit

Permalink
Automatic merge of 'next-test' into merge-test (2023-12-11 23:30)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Dec 11, 2023
2 parents 3c0fd43 + 69d32fd commit d0325f7
Show file tree
Hide file tree
Showing 23 changed files with 1,595 additions and 75 deletions.
4 changes: 4 additions & 0 deletions Documentation/userspace-api/ioctl/ioctl-number.rst
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ Code Seq# Include File Comments
<mailto:[email protected]>
0xB1 00-1F PPPoX
<mailto:[email protected]>
0xB2 00 arch/powerpc/include/uapi/asm/papr-vpd.h powerpc/pseries VPD API
<mailto:linuxppc-dev>
0xB2 01-02 arch/powerpc/include/uapi/asm/papr-sysparm.h powerpc/pseries system parameter API
<mailto:linuxppc-dev>
0xB3 00 linux/mmc/ioctl.h
0xB4 00-0F linux/gpio.h <mailto:[email protected]>
0xB5 00-0F uapi/linux/rpmsg.h <mailto:[email protected]>
Expand Down
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -12234,21 +12234,21 @@ S: Orphan
F: arch/powerpc/platforms/40x/
F: arch/powerpc/platforms/44x/

LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
LINUX FOR POWERPC EMBEDDED PPC85XX
M: Scott Wood <[email protected]>
L: [email protected]
S: Odd fixes
T: git git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
F: Documentation/devicetree/bindings/cache/freescale-l2cache.txt
F: Documentation/devicetree/bindings/powerpc/fsl/
F: arch/powerpc/platforms/83xx/
F: arch/powerpc/platforms/85xx/

LINUX FOR POWERPC EMBEDDED PPC8XX
LINUX FOR POWERPC EMBEDDED PPC8XX AND PPC83XX
M: Christophe Leroy <[email protected]>
L: [email protected]
S: Maintained
F: arch/powerpc/platforms/8xx/
F: arch/powerpc/platforms/83xx/

LINUX KERNEL DUMP TEST MODULE (LKDTM)
M: Kees Cook <[email protected]>
Expand Down
25 changes: 18 additions & 7 deletions arch/powerpc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,26 @@
# Rewritten by Cort Dougan and Paul Mackerras
#

ifdef cross_compiling
ifeq ($(CROSS_COMPILE),)
# Auto detect cross compiler prefix.
# Look for: (powerpc(64(le)?)?)(-unknown)?-linux(-gnu)?-
CC_ARCHES := powerpc powerpc64 powerpc64le
CC_SUFFIXES := linux linux-gnu unknown-linux-gnu
CROSS_COMPILE := $(call cc-cross-prefix, $(foreach a,$(CC_ARCHES), \
$(foreach s,$(CC_SUFFIXES),$(a)-$(s)-)))
endif
endif

HAS_BIARCH := $(call cc-option-yn, -m32)

# Set default 32 bits cross compilers for vdso and boot wrapper
CROSS32_COMPILE ?=

# If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
# ppc64_defconfig because we have nothing better to go on.
# ppc64le_defconfig because we have nothing better to go on.
uname := $(shell uname -m)
KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64le)_defconfig

new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)

Expand Down Expand Up @@ -161,7 +172,7 @@ CFLAGS-y += $(CONFIG_TUNE_CPU)

asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1)

KBUILD_CPPFLAGS += -I $(srctree)/arch/$(ARCH) $(asinstr)
KBUILD_CPPFLAGS += -I $(srctree)/arch/powerpc $(asinstr)
KBUILD_AFLAGS += $(AFLAGS-y)
KBUILD_CFLAGS += $(call cc-option,-msoft-float)
KBUILD_CFLAGS += $(CFLAGS-y)
Expand Down Expand Up @@ -232,7 +243,7 @@ BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%

PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)

boot := arch/$(ARCH)/boot
boot := arch/powerpc/boot

$(BOOT_TARGETS1): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
Expand Down Expand Up @@ -336,7 +347,7 @@ PHONY += $(generated_configs)

define archhelp
echo '* zImage - Build default images selected by kernel config'
echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
echo ' zImage.* - Compressed kernel image (arch/powerpc/boot/zImage.*)'
echo ' uImage - U-Boot native image format'
echo ' cuImage.<dt> - Backwards compatible U-Boot image for older'
echo ' versions which do not support device trees'
Expand All @@ -347,12 +358,12 @@ define archhelp
echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH) and run lilo'
echo ' *_defconfig - Select default config from arch/$(ARCH)/configs'
echo ' *_defconfig - Select default config from arch/powerpc/configs'
echo ''
echo ' Targets with <dt> embed a device tree blob inside the image'
echo ' These targets support board with firmware that does not'
echo ' support passing a device tree directly. Replace <dt> with the'
echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory'
echo ' name of a dts file from the arch/powerpc/boot/dts/ directory'
echo ' (minus the .dts extension).'
echo
$(foreach cfg,$(generated_configs),
Expand Down
10 changes: 2 additions & 8 deletions arch/powerpc/include/asm/book3s/64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
#define _PAGE_EXEC 0x00001 /* execute permission */
#define _PAGE_WRITE 0x00002 /* write access allowed */
#define _PAGE_READ 0x00004 /* read access allowed */
#define _PAGE_NA _PAGE_PRIVILEGED
#define _PAGE_NAX _PAGE_EXEC
#define _PAGE_RO _PAGE_READ
#define _PAGE_ROX (_PAGE_READ | _PAGE_EXEC)
#define _PAGE_RW (_PAGE_READ | _PAGE_WRITE)
#define _PAGE_RWX (_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC)
#define _PAGE_PRIVILEGED 0x00008 /* kernel access only */
#define _PAGE_SAO 0x00010 /* Strong access order */
#define _PAGE_NON_IDEMPOTENT 0x00020 /* non idempotent memory */
Expand Down Expand Up @@ -532,8 +526,8 @@ static inline bool pte_user(pte_t pte)
static inline bool pte_access_permitted(pte_t pte, bool write)
{
/*
* _PAGE_READ is needed for any access and will be
* cleared for PROT_NONE
* _PAGE_READ is needed for any access and will be cleared for
* PROT_NONE. Execute-only mapping via PROT_EXEC also returns false.
*/
if (!pte_present(pte) || !pte_user(pte) || !pte_read(pte))
return false;
Expand Down
9 changes: 2 additions & 7 deletions arch/powerpc/include/asm/book3s/64/tlbflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ static inline void flush_tlb_fix_spurious_fault(struct vm_area_struct *vma,
*/
}

static inline bool __pte_protnone(unsigned long pte)
{
return (pte & (pgprot_val(PAGE_NONE) | _PAGE_RWX)) == pgprot_val(PAGE_NONE);
}

static inline bool __pte_flags_need_flush(unsigned long oldval,
unsigned long newval)
{
Expand All @@ -179,8 +174,8 @@ static inline bool __pte_flags_need_flush(unsigned long oldval,
/*
* We do not expect kernel mappings or non-PTEs or not-present PTEs.
*/
VM_WARN_ON_ONCE(!__pte_protnone(oldval) && oldval & _PAGE_PRIVILEGED);
VM_WARN_ON_ONCE(!__pte_protnone(newval) && newval & _PAGE_PRIVILEGED);
VM_WARN_ON_ONCE(oldval & _PAGE_PRIVILEGED);
VM_WARN_ON_ONCE(newval & _PAGE_PRIVILEGED);
VM_WARN_ON_ONCE(!(oldval & _PAGE_PTE));
VM_WARN_ON_ONCE(!(newval & _PAGE_PTE));
VM_WARN_ON_ONCE(!(oldval & _PAGE_PRESENT));
Expand Down
17 changes: 11 additions & 6 deletions arch/powerpc/include/asm/papr-sysparm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
#ifndef _ASM_POWERPC_PAPR_SYSPARM_H
#define _ASM_POWERPC_PAPR_SYSPARM_H

#include <uapi/asm/papr-sysparm.h>

typedef struct {
const u32 token;
u32 token;
} papr_sysparm_t;

#define mk_papr_sysparm(x_) ((papr_sysparm_t){ .token = x_, })
Expand All @@ -20,11 +22,14 @@ typedef struct {
#define PAPR_SYSPARM_TLB_BLOCK_INVALIDATE_ATTRS mk_papr_sysparm(50)
#define PAPR_SYSPARM_LPAR_NAME mk_papr_sysparm(55)

enum {
PAPR_SYSPARM_MAX_INPUT = 1024,
PAPR_SYSPARM_MAX_OUTPUT = 4000,
};

/**
* struct papr_sysparm_buf - RTAS work area layout for system parameter functions.
*
* This is the memory layout of the buffers passed to/from
* ibm,get-system-parameter and ibm,set-system-parameter. It is
* distinct from the papr_sysparm_io_block structure that is passed
* between user space and the kernel.
*/
struct papr_sysparm_buf {
__be16 len;
char val[PAPR_SYSPARM_MAX_OUTPUT];
Expand Down
28 changes: 22 additions & 6 deletions arch/powerpc/include/asm/rtas.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define _POWERPC_RTAS_H
#ifdef __KERNEL__

#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <asm/page.h>
#include <asm/rtas-types.h>
Expand Down Expand Up @@ -201,12 +202,25 @@ typedef struct {
/* Memory set aside for sys_rtas to use with calls that need a work area. */
#define RTAS_USER_REGION_SIZE (64 * 1024)

/* RTAS return status codes */
#define RTAS_HARDWARE_ERROR -1 /* Hardware Error */
#define RTAS_BUSY -2 /* RTAS Busy */
#define RTAS_INVALID_PARAMETER -3 /* Invalid indicator/domain/sensor etc. */
#define RTAS_EXTENDED_DELAY_MIN 9900
#define RTAS_EXTENDED_DELAY_MAX 9905
/*
* Common RTAS function return values, derived from the table "RTAS
* Status Word Values" in PAPR+ v2.13 7.2.8: "Return Codes". If a
* function can return a value in this table then generally it has the
* meaning listed here. More extended commentary in the documentation
* for rtas_call().
*
* RTAS functions may use negative and positive numbers not in this
* set for function-specific error and success conditions,
* respectively.
*/
#define RTAS_SUCCESS 0 /* Success. */
#define RTAS_HARDWARE_ERROR -1 /* Hardware or other unspecified error. */
#define RTAS_BUSY -2 /* Retry immediately. */
#define RTAS_INVALID_PARAMETER -3 /* Invalid indicator/domain/sensor etc. */
#define RTAS_UNEXPECTED_STATE_CHANGE -7 /* Seems limited to EEH and slot reset. */
#define RTAS_EXTENDED_DELAY_MIN 9900 /* Retry after delaying for ~1ms. */
#define RTAS_EXTENDED_DELAY_MAX 9905 /* Retry after delaying for ~100s. */
#define RTAS_ML_ISOLATION_ERROR -9000 /* Multi-level isolation error. */

/* statuses specific to ibm,suspend-me */
#define RTAS_SUSPEND_ABORTED 9000 /* Suspension aborted */
Expand Down Expand Up @@ -499,6 +513,8 @@ extern char rtas_data_buf[RTAS_DATA_BUF_SIZE];
/* RMO buffer reserved for user-space RTAS use */
extern unsigned long rtas_rmo_buf;

extern struct mutex rtas_ibm_get_vpd_lock;

#define GLOBAL_INTERRUPT_QUEUE 9005

/**
Expand Down
9 changes: 9 additions & 0 deletions arch/powerpc/include/uapi/asm/papr-miscdev.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_PAPR_MISCDEV_H_
#define _UAPI_PAPR_MISCDEV_H_

enum {
PAPR_MISCDEV_IOC_ID = 0xb2,
};

#endif /* _UAPI_PAPR_MISCDEV_H_ */
58 changes: 58 additions & 0 deletions arch/powerpc/include/uapi/asm/papr-sysparm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_PAPR_SYSPARM_H_
#define _UAPI_PAPR_SYSPARM_H_

#include <linux/types.h>
#include <asm/ioctl.h>
#include <asm/papr-miscdev.h>

enum {
PAPR_SYSPARM_MAX_INPUT = 1024,
PAPR_SYSPARM_MAX_OUTPUT = 4000,
};

struct papr_sysparm_io_block {
__u32 parameter;
__u16 length;
char data[PAPR_SYSPARM_MAX_OUTPUT];
};

/**
* PAPR_SYSPARM_IOC_GET - Retrieve the value of a PAPR system parameter.
*
* Uses _IOWR because of one corner case: Retrieving the value of the
* "OS Service Entitlement Status" parameter (60) requires the caller
* to supply input data (a date string) in the buffer passed to
* firmware. So the @length and @data of the incoming
* papr_sysparm_io_block are always used to initialize the work area
* supplied to ibm,get-system-parameter. No other parameters are known
* to parameterize the result this way, and callers are encouraged
* (but not required) to zero-initialize @length and @data in the
* common case.
*
* On error the contents of the ioblock are indeterminate.
*
* Return:
* 0: Success; @length is the length of valid data in @data, not to exceed @PAPR_SYSPARM_MAX_OUTPUT.
* -EIO: Platform error. (-1)
* -EINVAL: Incorrect data length or format. (-9999)
* -EPERM: The calling partition is not allowed to access this parameter. (-9002)
* -EOPNOTSUPP: Parameter not supported on this platform (-3)
*/
#define PAPR_SYSPARM_IOC_GET _IOWR(PAPR_MISCDEV_IOC_ID, 1, struct papr_sysparm_io_block)

/**
* PAPR_SYSPARM_IOC_SET - Update the value of a PAPR system parameter.
*
* The contents of the ioblock are unchanged regardless of success.
*
* Return:
* 0: Success; the parameter has been updated.
* -EIO: Platform error. (-1)
* -EINVAL: Incorrect data length or format. (-9999)
* -EPERM: The calling partition is not allowed to access this parameter. (-9002)
* -EOPNOTSUPP: Parameter not supported on this platform (-3)
*/
#define PAPR_SYSPARM_IOC_SET _IOW(PAPR_MISCDEV_IOC_ID, 2, struct papr_sysparm_io_block)

#endif /* _UAPI_PAPR_SYSPARM_H_ */
22 changes: 22 additions & 0 deletions arch/powerpc/include/uapi/asm/papr-vpd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_PAPR_VPD_H_
#define _UAPI_PAPR_VPD_H_

#include <asm/ioctl.h>
#include <asm/papr-miscdev.h>

struct papr_location_code {
/*
* PAPR+ v2.13 12.3.2.4 Converged Location Code Rules - Length
* Restrictions. 79 characters plus nul.
*/
char str[80];
};

/*
* ioctl for /dev/papr-vpd. Returns a VPD handle fd corresponding to
* the location code.
*/
#define PAPR_VPD_IOC_CREATE_HANDLE _IOW(PAPR_MISCDEV_IOC_ID, 0, struct papr_location_code)

#endif /* _UAPI_PAPR_VPD_H_ */
Loading

0 comments on commit d0325f7

Please sign in to comment.