Skip to content

Commit

Permalink
From patchwork series 377040
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox Snowpatch committed Oct 11, 2023
1 parent b8b05bc commit 2c0bd19
Show file tree
Hide file tree
Showing 27 changed files with 68 additions and 65 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/book3s/64/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ static inline pte_t pte_mkuser(pte_t pte)
*/
static inline int pte_devmap(pte_t pte)
{
u64 mask = cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE);
__be64 mask = cpu_to_be64(_PAGE_DEVMAP | _PAGE_PTE);

return (pte_raw(pte) & mask) == mask;
}
Expand Down
16 changes: 8 additions & 8 deletions arch/powerpc/include/asm/imc-pmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ struct imc_events {
* The following is the data structure to hold trace imc data.
*/
struct trace_imc_data {
u64 tb1;
u64 ip;
u64 val;
u64 cpmc1;
u64 cpmc2;
u64 cpmc3;
u64 cpmc4;
u64 tb2;
__be64 tb1;
__be64 ip;
__be64 val;
__be64 cpmc1;
__be64 cpmc2;
__be64 cpmc3;
__be64 cpmc4;
__be64 tb2;
};

/* Event attribute array index */
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/include/asm/kvm_ppc.h
Original file line number Diff line number Diff line change
Expand Up @@ -943,18 +943,18 @@ static inline void kvmppc_set_##reg(struct kvm_vcpu *vcpu, ulong val) \
static inline u##size kvmppc_get_##reg(struct kvm_vcpu *vcpu) \
{ \
if (kvmppc_shared_big_endian(vcpu)) \
return be##size##_to_cpu(vcpu->arch.shared->reg); \
return be##size##_to_cpu((__be##size __force)vcpu->arch.shared->reg); \
else \
return le##size##_to_cpu(vcpu->arch.shared->reg); \
return le##size##_to_cpu((__le##size __force)vcpu->arch.shared->reg); \
} \

#define SHARED_WRAPPER_SET(reg, size) \
static inline void kvmppc_set_##reg(struct kvm_vcpu *vcpu, u##size val) \
{ \
if (kvmppc_shared_big_endian(vcpu)) \
vcpu->arch.shared->reg = cpu_to_be##size(val); \
vcpu->arch.shared->reg = (u##size __force)cpu_to_be##size(val); \
else \
vcpu->arch.shared->reg = cpu_to_le##size(val); \
vcpu->arch.shared->reg = (u##size __force)cpu_to_le##size(val); \
} \

#define SHARED_WRAPPER(reg, size) \
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/opal.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int64_t opal_pci_set_power_state(uint64_t async_token, uint64_t id,
uint64_t data);
int64_t opal_pci_poll2(uint64_t id, uint64_t data);

int64_t opal_int_get_xirr(uint32_t *out_xirr, bool just_poll);
int64_t opal_int_get_xirr(__be32 *out_xirr, bool just_poll);
int64_t opal_int_set_cppr(uint8_t cppr);
int64_t opal_int_eoi(uint32_t xirr);
int64_t opal_int_set_mfrr(uint32_t cpu, uint8_t mfrr);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ copy_mc_to_user(void __user *to, const void *from, unsigned long n)
if (check_copy_size(from, n, true)) {
if (access_ok(to, n)) {
allow_write_to_user(to, n);
n = copy_mc_generic((void *)to, from, n);
n = copy_mc_generic((void __force *)to, from, n);
prevent_write_to_user(to, n);
}
}
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/eeh_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int eeh_result_priority(enum pci_ers_result result)
case PCI_ERS_RESULT_NEED_RESET:
return 6;
default:
WARN_ONCE(1, "Unknown pci_ers_result value: %d\n", (int)result);
WARN_ONCE(1, "Unknown pci_ers_result value: %d\n", result);
return 0;
}
};
Expand All @@ -60,7 +60,7 @@ static const char *pci_ers_result_name(enum pci_ers_result result)
case PCI_ERS_RESULT_NO_AER_DRIVER:
return "no AER driver";
default:
WARN_ONCE(1, "Unknown result type: %d\n", (int)result);
WARN_ONCE(1, "Unknown result type: %d\n", result);
return "unknown";
}
};
Expand Down
12 changes: 6 additions & 6 deletions arch/powerpc/kernel/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void _insb(const volatile u8 __iomem *port, void *buf, long count)
return;
asm volatile("sync");
do {
tmp = *port;
tmp = *(const volatile u8 __force *)port;
eieio();
*tbuf++ = tmp;
} while (--count != 0);
Expand All @@ -49,7 +49,7 @@ void _outsb(volatile u8 __iomem *port, const void *buf, long count)
return;
asm volatile("sync");
do {
*port = *tbuf++;
*(volatile u8 __force *)port = *tbuf++;
} while (--count != 0);
asm volatile("sync");
}
Expand All @@ -64,7 +64,7 @@ void _insw_ns(const volatile u16 __iomem *port, void *buf, long count)
return;
asm volatile("sync");
do {
tmp = *port;
tmp = *(const volatile u16 __force *)port;
eieio();
*tbuf++ = tmp;
} while (--count != 0);
Expand All @@ -80,7 +80,7 @@ void _outsw_ns(volatile u16 __iomem *port, const void *buf, long count)
return;
asm volatile("sync");
do {
*port = *tbuf++;
*(volatile u16 __force *)port = *tbuf++;
} while (--count != 0);
asm volatile("sync");
}
Expand All @@ -95,7 +95,7 @@ void _insl_ns(const volatile u32 __iomem *port, void *buf, long count)
return;
asm volatile("sync");
do {
tmp = *port;
tmp = *(const volatile u32 __force *)port;
eieio();
*tbuf++ = tmp;
} while (--count != 0);
Expand All @@ -111,7 +111,7 @@ void _outsl_ns(volatile u32 __iomem *port, const void *buf, long count)
return;
asm volatile("sync");
do {
*port = *tbuf++;
*(volatile u32 __force *)port = *tbuf++;
} while (--count != 0);
asm volatile("sync");
}
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,10 @@ int iommu_tce_check_gpa(unsigned long page_shift, unsigned long gpa)
}
EXPORT_SYMBOL_GPL(iommu_tce_check_gpa);

extern long iommu_tce_xchg_no_kill(struct mm_struct *mm,
struct iommu_table *tbl,
unsigned long entry, unsigned long *hpa,
enum dma_data_direction *direction)
long iommu_tce_xchg_no_kill(struct mm_struct *mm,
struct iommu_table *tbl,
unsigned long entry, unsigned long *hpa,
enum dma_data_direction *direction)
{
long ret;
unsigned long size = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ struct option_vector7 {
} __packed;

struct ibm_arch_vec {
struct { u32 mask, val; } pvrs[14];
struct { __be32 mask, val; } pvrs[14];

u8 num_vectors;

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void __init early_setup(unsigned long dt_ptr)
*/
initialise_paca(&boot_paca, 0);
fixup_boot_paca(&boot_paca);
WARN_ON(local_paca != 0);
WARN_ON(local_paca);
setup_paca(&boot_paca); /* install the paca into registers */

/* -------- printk is now safe to use ------- */
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static int die_owner = -1;
static unsigned int die_nest_count;
static int die_counter;

extern void panic_flush_kmsg_start(void)
void panic_flush_kmsg_start(void)
{
/*
* These are mostly taken from kernel/panic.c, but tries to do
Expand All @@ -170,7 +170,7 @@ extern void panic_flush_kmsg_start(void)
bust_spinlocks(1);
}

extern void panic_flush_kmsg_end(void)
void panic_flush_kmsg_end(void)
{
kmsg_dump(KMSG_DUMP_PANIC);
bust_spinlocks(0);
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kexec/core_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ void default_machine_kexec(struct kimage *image)

#ifdef CONFIG_PPC_64S_HASH_MMU
/* Values we need to export to the second kernel via the device tree. */
static unsigned long htab_base;
static unsigned long htab_size;
static __be64 htab_base;
static __be64 htab_size;

static struct property htab_base_prop = {
.name = "linux,htab-base",
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/kexec/file_load_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <asm/plpks.h>

struct umem_info {
u64 *buf; /* data buffer for usable-memory property */
__be64 *buf; /* data buffer for usable-memory property */
u32 size; /* size allocated for the data buffer */
u32 max_entries; /* maximum no. of entries */
u32 idx; /* index of current entry */
Expand Down Expand Up @@ -443,10 +443,10 @@ static int locate_mem_hole_bottom_up_ppc64(struct kexec_buf *kbuf,
*
* Returns buffer on success, NULL on error.
*/
static u64 *check_realloc_usable_mem(struct umem_info *um_info, int cnt)
static __be64 *check_realloc_usable_mem(struct umem_info *um_info, int cnt)
{
u32 new_size;
u64 *tbuf;
__be64 *tbuf;

if ((um_info->idx + cnt) <= um_info->max_entries)
return um_info->buf;
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/kvm/book3s_64_vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ static void kvm_spapr_tce_liobn_put(struct kref *kref)
call_rcu(&stit->rcu, kvm_spapr_tce_iommu_table_free);
}

extern void kvm_spapr_tce_release_iommu_group(struct kvm *kvm,
struct iommu_group *grp)
void kvm_spapr_tce_release_iommu_group(struct kvm *kvm,
struct iommu_group *grp)
{
int i;
struct kvmppc_spapr_tce_table *stt;
Expand All @@ -105,8 +105,8 @@ extern void kvm_spapr_tce_release_iommu_group(struct kvm *kvm,
rcu_read_unlock();
}

extern long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd,
struct iommu_group *grp)
long kvm_spapr_tce_attach_iommu_group(struct kvm *kvm, int tablefd,
struct iommu_group *grp)
{
struct kvmppc_spapr_tce_table *stt = NULL;
bool found = false;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kvm/book3s_xive_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
u8 priority;
struct kvm_ppc_xive_eq kvm_eq;
int rc;
__be32 *qaddr = 0;
__be32 *qaddr = NULL;
struct page *page;
struct xive_q *q;
gfn_t gfn;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/mm/drmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static int drmem_update_dt_v1(struct device_node *memory,
struct property *new_prop;
struct of_drconf_cell_v1 *dr_cell;
struct drmem_lmb *lmb;
u32 *p;
__be32 *p;

new_prop = clone_property(prop, prop->length);
if (!new_prop)
Expand Down
8 changes: 4 additions & 4 deletions arch/powerpc/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
cgctx.stack_size = round_up(fp->aux->stack_depth, 16);

/* Scouting faux-generate pass 0 */
if (bpf_jit_build_body(fp, 0, &cgctx, addrs, 0, false)) {
if (bpf_jit_build_body(fp, NULL, &cgctx, addrs, 0, false)) {
/* We hit something illegal or unsupported. */
fp = org_fp;
goto out_addrs;
Expand All @@ -134,7 +134,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
*/
if (cgctx.seen & SEEN_TAILCALL || !is_offset_in_branch_range((long)cgctx.idx * 4)) {
cgctx.idx = 0;
if (bpf_jit_build_body(fp, 0, &cgctx, addrs, 0, false)) {
if (bpf_jit_build_body(fp, NULL, &cgctx, addrs, 0, false)) {
fp = org_fp;
goto out_addrs;
}
Expand All @@ -146,9 +146,9 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
* update ctgtx.idx as it pretends to output instructions, then we can
* calculate total size from idx.
*/
bpf_jit_build_prologue(0, &cgctx);
bpf_jit_build_prologue(NULL, &cgctx);
addrs[fp->len] = cgctx.idx * 4;
bpf_jit_build_epilogue(0, &cgctx);
bpf_jit_build_epilogue(NULL, &cgctx);

fixup_len = fp->aux->num_exentries * BPF_FIXUP_LEN * 4;
extable_len = fp->aux->num_exentries * sizeof(struct exception_table_entry);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/hv-24x7.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ static int get_count_from_result(struct perf_event *event,
for (i = count = 0, element_data = res->elements + data_offset;
i < num_elements;
i++, element_data += data_size + data_offset)
count += be64_to_cpu(*((u64 *) element_data));
count += be64_to_cpu(*((__be64 *)element_data));

*countp = count;

Expand Down
11 changes: 6 additions & 5 deletions arch/powerpc/perf/imc-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ static int nest_imc_event_init(struct perf_event *event)
break;
}
pcni++;
} while (pcni->vbase != 0);
} while (pcni->vbase);

if (!flag)
return -ENODEV;
Expand Down Expand Up @@ -1025,16 +1025,16 @@ static bool is_thread_imc_pmu(struct perf_event *event)
return false;
}

static u64 * get_event_base_addr(struct perf_event *event)
static __be64 *get_event_base_addr(struct perf_event *event)
{
u64 addr;

if (is_thread_imc_pmu(event)) {
addr = (u64)per_cpu(thread_imc_mem, smp_processor_id());
return (u64 *)(addr + (event->attr.config & IMC_EVENT_OFFSET_MASK));
return (__be64 *)(addr + (event->attr.config & IMC_EVENT_OFFSET_MASK));
}

return (u64 *)event->hw.event_base;
return (__be64 *)event->hw.event_base;
}

static void thread_imc_pmu_start_txn(struct pmu *pmu,
Expand All @@ -1058,7 +1058,8 @@ static int thread_imc_pmu_commit_txn(struct pmu *pmu)

static u64 imc_read_counter(struct perf_event *event)
{
u64 *addr, data;
__be64 *addr;
u64 data;

/*
* In-Memory Collection (IMC) counters are free flowing counters.
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/4xx/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int __init ppc4xx_l2c_probe(void)
}

/* Install error handler */
if (request_irq(irq, l2c_error_handler, 0, "L2C", 0) < 0) {
if (request_irq(irq, l2c_error_handler, 0, "L2C", NULL) < 0) {
printk(KERN_ERR "Cannot install L2C error handler"
", cache is not enabled\n");
of_node_put(np);
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/powermac/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,8 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
struct device_node* node;
int i;
volatile u32 __iomem *base;
const u32 *addrp, *revp;
const __be32 *addrp;
const u32 *revp;
phys_addr_t addr;
u64 size;

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powernv/opal-fadump.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static inline void opal_fadump_read_regs(char *bufp, unsigned int regs_cnt,
for (i = 0; i < regs_cnt; i++, bufp += reg_entry_size) {
reg_entry = (struct hdat_fadump_reg_entry *)bufp;
val = (cpu_endian ? be64_to_cpu(reg_entry->reg_val) :
(u64)(reg_entry->reg_val));
(u64 __force)(reg_entry->reg_val));
opal_fadump_set_regval_regnum(regs,
be32_to_cpu(reg_entry->reg_type),
be32_to_cpu(reg_entry->reg_num),
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ static bool find_aa_index(struct device_node *dr_node,
struct property *ala_prop,
const u32 *lmb_assoc, u32 *aa_index)
{
u32 *assoc_arrays, new_prop_size;
__be32 *assoc_arrays;
u32 new_prop_size;
struct property *new_prop;
int aa_arrays, aa_array_entries, aa_array_sz;
int i, index;
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/platforms/pseries/hvconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
{
long ret;
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
unsigned long *lbuf = (unsigned long *)buf;
__be64 *lbuf = (__be64 __force *)buf;

ret = plpar_hcall(H_GET_TERM_CHAR, retbuf, vtermno);
lbuf[0] = be64_to_cpu(retbuf[1]);
lbuf[1] = be64_to_cpu(retbuf[2]);
lbuf[0] = cpu_to_be64(retbuf[1]);
lbuf[1] = cpu_to_be64(retbuf[2]);

if (ret == H_SUCCESS)
return retbuf[0];
Expand Down
Loading

0 comments on commit 2c0bd19

Please sign in to comment.