Commit 4215fa2d authored by Michael Ellerman's avatar Michael Ellerman

Merge branch 'fixes' into next

Merge in our fixes branch, which brings in clone3() as well as some
implicit fallthrough fixes we want in next.
parents 2b87a255 b9ee5e04
...@@ -107,22 +107,22 @@ extern void _set_L3CR(unsigned long); ...@@ -107,22 +107,22 @@ extern void _set_L3CR(unsigned long);
static inline void dcbz(void *addr) static inline void dcbz(void *addr)
{ {
__asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory"); __asm__ __volatile__ ("dcbz 0, %0" : : "r"(addr) : "memory");
} }
static inline void dcbi(void *addr) static inline void dcbi(void *addr)
{ {
__asm__ __volatile__ ("dcbi %y0" : : "Z"(*(u8 *)addr) : "memory"); __asm__ __volatile__ ("dcbi 0, %0" : : "r"(addr) : "memory");
} }
static inline void dcbf(void *addr) static inline void dcbf(void *addr)
{ {
__asm__ __volatile__ ("dcbf %y0" : : "Z"(*(u8 *)addr) : "memory"); __asm__ __volatile__ ("dcbf 0, %0" : : "r"(addr) : "memory");
} }
static inline void dcbst(void *addr) static inline void dcbst(void *addr)
{ {
__asm__ __volatile__ ("dcbst %y0" : : "Z"(*(u8 *)addr) : "memory"); __asm__ __volatile__ ("dcbst 0, %0" : : "r"(addr) : "memory");
} }
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_CLONE3
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_UNISTD_H_ */ #endif /* _ASM_POWERPC_UNISTD_H_ */
...@@ -176,9 +176,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg, ...@@ -176,9 +176,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg,
ret |= __get_user_inatomic(temp.v[1], p++); ret |= __get_user_inatomic(temp.v[1], p++);
ret |= __get_user_inatomic(temp.v[2], p++); ret |= __get_user_inatomic(temp.v[2], p++);
ret |= __get_user_inatomic(temp.v[3], p++); ret |= __get_user_inatomic(temp.v[3], p++);
/* fall through */
case 4: case 4:
ret |= __get_user_inatomic(temp.v[4], p++); ret |= __get_user_inatomic(temp.v[4], p++);
ret |= __get_user_inatomic(temp.v[5], p++); ret |= __get_user_inatomic(temp.v[5], p++);
/* fall through */
case 2: case 2:
ret |= __get_user_inatomic(temp.v[6], p++); ret |= __get_user_inatomic(temp.v[6], p++);
ret |= __get_user_inatomic(temp.v[7], p++); ret |= __get_user_inatomic(temp.v[7], p++);
...@@ -259,9 +261,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg, ...@@ -259,9 +261,11 @@ static int emulate_spe(struct pt_regs *regs, unsigned int reg,
ret |= __put_user_inatomic(data.v[1], p++); ret |= __put_user_inatomic(data.v[1], p++);
ret |= __put_user_inatomic(data.v[2], p++); ret |= __put_user_inatomic(data.v[2], p++);
ret |= __put_user_inatomic(data.v[3], p++); ret |= __put_user_inatomic(data.v[3], p++);
/* fall through */
case 4: case 4:
ret |= __put_user_inatomic(data.v[4], p++); ret |= __put_user_inatomic(data.v[4], p++);
ret |= __put_user_inatomic(data.v[5], p++); ret |= __put_user_inatomic(data.v[5], p++);
/* fall through */
case 2: case 2:
ret |= __put_user_inatomic(data.v[6], p++); ret |= __put_user_inatomic(data.v[6], p++);
ret |= __put_user_inatomic(data.v[7], p++); ret |= __put_user_inatomic(data.v[7], p++);
......
...@@ -597,6 +597,14 @@ ppc_clone: ...@@ -597,6 +597,14 @@ ppc_clone:
stw r0,_TRAP(r1) /* register set saved */ stw r0,_TRAP(r1) /* register set saved */
b sys_clone b sys_clone
.globl ppc_clone3
ppc_clone3:
SAVE_NVGPRS(r1)
lwz r0,_TRAP(r1)
rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */
stw r0,_TRAP(r1) /* register set saved */
b sys_clone3
.globl ppc_swapcontext .globl ppc_swapcontext
ppc_swapcontext: ppc_swapcontext:
SAVE_NVGPRS(r1) SAVE_NVGPRS(r1)
......
...@@ -487,6 +487,11 @@ _GLOBAL(ppc_clone) ...@@ -487,6 +487,11 @@ _GLOBAL(ppc_clone)
bl sys_clone bl sys_clone
b .Lsyscall_exit b .Lsyscall_exit
_GLOBAL(ppc_clone3)
bl save_nvgprs
bl sys_clone3
b .Lsyscall_exit
_GLOBAL(ppc32_swapcontext) _GLOBAL(ppc32_swapcontext)
bl save_nvgprs bl save_nvgprs
bl compat_sys_swapcontext bl compat_sys_swapcontext
......
...@@ -516,4 +516,4 @@ ...@@ -516,4 +516,4 @@
432 common fsmount sys_fsmount 432 common fsmount sys_fsmount
433 common fspick sys_fspick 433 common fspick sys_fspick
434 common pidfd_open sys_pidfd_open 434 common pidfd_open sys_pidfd_open
# 435 reserved for clone3 435 nospu clone3 ppc_clone3
...@@ -239,6 +239,7 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr, ...@@ -239,6 +239,7 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
case 2: case 2:
case 6: case 6:
pte->may_write = true; pte->may_write = true;
/* fall through */
case 3: case 3:
case 5: case 5:
case 7: case 7:
......
...@@ -21,7 +21,7 @@ static void kasan_populate_pte(pte_t *ptep, pgprot_t prot) ...@@ -21,7 +21,7 @@ static void kasan_populate_pte(pte_t *ptep, pgprot_t prot)
__set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 0); __set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 0);
} }
static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end) static int __ref kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end)
{ {
pmd_t *pmd; pmd_t *pmd;
unsigned long k_cur, k_next; unsigned long k_cur, k_next;
...@@ -35,7 +35,10 @@ static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_ ...@@ -35,7 +35,10 @@ static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_
if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte) if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte)
continue; continue;
new = pte_alloc_one_kernel(&init_mm); if (slab_is_available())
new = pte_alloc_one_kernel(&init_mm);
else
new = memblock_alloc(PTE_FRAG_SIZE, PTE_FRAG_SIZE);
if (!new) if (!new)
return -ENOMEM; return -ENOMEM;
......
...@@ -630,7 +630,6 @@ static void early_init_this_mmu(void) ...@@ -630,7 +630,6 @@ static void early_init_this_mmu(void)
#ifdef CONFIG_PPC_FSL_BOOK3E #ifdef CONFIG_PPC_FSL_BOOK3E
if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) { if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) {
unsigned int num_cams; unsigned int num_cams;
int __maybe_unused cpu = smp_processor_id();
bool map = true; bool map = true;
/* use a quarter of the TLBCAM for bolted linear map */ /* use a quarter of the TLBCAM for bolted linear map */
......
...@@ -275,12 +275,32 @@ static const struct attribute_group *papr_scm_dimm_groups[] = { ...@@ -275,12 +275,32 @@ static const struct attribute_group *papr_scm_dimm_groups[] = {
NULL, NULL,
}; };
static inline int papr_scm_node(int node)
{
int min_dist = INT_MAX, dist;
int nid, min_node;
if ((node == NUMA_NO_NODE) || node_online(node))
return node;
min_node = first_online_node;
for_each_online_node(nid) {
dist = node_distance(node, nid);
if (dist < min_dist) {
min_dist = dist;
min_node = nid;
}
}
return min_node;
}
static int papr_scm_nvdimm_init(struct papr_scm_priv *p) static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
{ {
struct device *dev = &p->pdev->dev; struct device *dev = &p->pdev->dev;
struct nd_mapping_desc mapping; struct nd_mapping_desc mapping;
struct nd_region_desc ndr_desc; struct nd_region_desc ndr_desc;
unsigned long dimm_flags; unsigned long dimm_flags;
int target_nid, online_nid;
p->bus_desc.ndctl = papr_scm_ndctl; p->bus_desc.ndctl = papr_scm_ndctl;
p->bus_desc.module = THIS_MODULE; p->bus_desc.module = THIS_MODULE;
...@@ -319,8 +339,10 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) ...@@ -319,8 +339,10 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
memset(&ndr_desc, 0, sizeof(ndr_desc)); memset(&ndr_desc, 0, sizeof(ndr_desc));
ndr_desc.attr_groups = region_attr_groups; ndr_desc.attr_groups = region_attr_groups;
ndr_desc.numa_node = dev_to_node(&p->pdev->dev); target_nid = dev_to_node(&p->pdev->dev);
ndr_desc.target_node = ndr_desc.numa_node; online_nid = papr_scm_node(target_nid);
ndr_desc.numa_node = online_nid;
ndr_desc.target_node = target_nid;
ndr_desc.res = &p->res; ndr_desc.res = &p->res;
ndr_desc.of_node = p->dn; ndr_desc.of_node = p->dn;
ndr_desc.provider_data = p; ndr_desc.provider_data = p;
...@@ -338,6 +360,9 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p) ...@@ -338,6 +360,9 @@ static int papr_scm_nvdimm_init(struct papr_scm_priv *p)
ndr_desc.res, p->dn); ndr_desc.res, p->dn);
goto err; goto err;
} }
if (target_nid != online_nid)
dev_info(dev, "Region registered with target node %d and online node %d",
target_nid, online_nid);
return 0; return 0;
......
...@@ -852,6 +852,7 @@ int smu_queue_i2c(struct smu_i2c_cmd *cmd) ...@@ -852,6 +852,7 @@ int smu_queue_i2c(struct smu_i2c_cmd *cmd)
break; break;
case SMU_I2C_TRANSFER_COMBINED: case SMU_I2C_TRANSFER_COMBINED:
cmd->info.devaddr &= 0xfe; cmd->info.devaddr &= 0xfe;
/* fall through */
case SMU_I2C_TRANSFER_STDSUB: case SMU_I2C_TRANSFER_STDSUB:
if (cmd->info.sublen > 3) if (cmd->info.sublen > 3)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment