Commit e7270e47 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 's390-5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull more s390 updates from Vasily Gorbik:

 - Fix physical vs virtual confusion in some basic mm macros and
   routines. Caused by __pa == __va on s390 currently.

 - Get rid of on-stack cpu masks.

 - Add support for complete CPU counter set extraction.

 - Add arch_irq_work_raise implementation.

 - virtio-ccw revision and opcode fixes.

* tag 's390-5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/cpumf: Add support for complete counter set extraction
  virtio/s390: implement virtio-ccw revision 2 correctly
  s390/smp: implement arch_irq_work_raise()
  s390/topology: move cpumasks away from stack
  s390/smp: smp_emergency_stop() - move cpumask away from stack
  s390/smp: __smp_rescan_cpus() - move cpumask away from stack
  s390/smp: consolidate locking for smp_rescan()
  s390/mm: fix phys vs virt confusion in vmem_*() functions family
  s390/mm: fix phys vs virt confusion in pgtable allocation routines
  s390/mm: fix invalid __pa() usage in pfn_pXd() macros
  s390/mm: make pXd_deref() macros return a pointer
  s390/opcodes: rename selhhhr to selfhr
parents c19798af cf6acb8b
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_S390_IRQ_WORK_H
#define _ASM_S390_IRQ_WORK_H
static inline bool arch_irq_work_has_interrupt(void)
{
return true;
}
void arch_irq_work_raise(void);
#endif /* _ASM_S390_IRQ_WORK_H */
...@@ -135,7 +135,7 @@ static inline void pmd_populate(struct mm_struct *mm, ...@@ -135,7 +135,7 @@ static inline void pmd_populate(struct mm_struct *mm,
#define pmd_populate_kernel(mm, pmd, pte) pmd_populate(mm, pmd, pte) #define pmd_populate_kernel(mm, pmd, pte) pmd_populate(mm, pmd, pte)
#define pmd_pgtable(pmd) \ #define pmd_pgtable(pmd) \
(pgtable_t)(pmd_val(pmd) & -sizeof(pte_t)*PTRS_PER_PTE) ((pgtable_t)__va(pmd_val(pmd) & -sizeof(pte_t)*PTRS_PER_PTE))
/* /*
* page table entry allocation/free routines. * page table entry allocation/free routines.
......
...@@ -1219,8 +1219,8 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) ...@@ -1219,8 +1219,8 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot)
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) #define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
#define p4d_deref(pud) (p4d_val(pud) & _REGION_ENTRY_ORIGIN) #define p4d_deref(pud) ((unsigned long)__va(p4d_val(pud) & _REGION_ENTRY_ORIGIN))
#define pgd_deref(pgd) (pgd_val(pgd) & _REGION_ENTRY_ORIGIN) #define pgd_deref(pgd) ((unsigned long)__va(pgd_val(pgd) & _REGION_ENTRY_ORIGIN))
static inline unsigned long pmd_deref(pmd_t pmd) static inline unsigned long pmd_deref(pmd_t pmd)
{ {
...@@ -1229,12 +1229,12 @@ static inline unsigned long pmd_deref(pmd_t pmd) ...@@ -1229,12 +1229,12 @@ static inline unsigned long pmd_deref(pmd_t pmd)
origin_mask = _SEGMENT_ENTRY_ORIGIN; origin_mask = _SEGMENT_ENTRY_ORIGIN;
if (pmd_large(pmd)) if (pmd_large(pmd))
origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE; origin_mask = _SEGMENT_ENTRY_ORIGIN_LARGE;
return pmd_val(pmd) & origin_mask; return (unsigned long)__va(pmd_val(pmd) & origin_mask);
} }
static inline unsigned long pmd_pfn(pmd_t pmd) static inline unsigned long pmd_pfn(pmd_t pmd)
{ {
return pmd_deref(pmd) >> PAGE_SHIFT; return __pa(pmd_deref(pmd)) >> PAGE_SHIFT;
} }
static inline unsigned long pud_deref(pud_t pud) static inline unsigned long pud_deref(pud_t pud)
...@@ -1244,12 +1244,12 @@ static inline unsigned long pud_deref(pud_t pud) ...@@ -1244,12 +1244,12 @@ static inline unsigned long pud_deref(pud_t pud)
origin_mask = _REGION_ENTRY_ORIGIN; origin_mask = _REGION_ENTRY_ORIGIN;
if (pud_large(pud)) if (pud_large(pud))
origin_mask = _REGION3_ENTRY_ORIGIN_LARGE; origin_mask = _REGION3_ENTRY_ORIGIN_LARGE;
return pud_val(pud) & origin_mask; return (unsigned long)__va(pud_val(pud) & origin_mask);
} }
static inline unsigned long pud_pfn(pud_t pud) static inline unsigned long pud_pfn(pud_t pud)
{ {
return pud_deref(pud) >> PAGE_SHIFT; return __pa(pud_deref(pud)) >> PAGE_SHIFT;
} }
/* /*
...@@ -1329,7 +1329,7 @@ static inline bool gup_fast_permitted(unsigned long start, unsigned long end) ...@@ -1329,7 +1329,7 @@ static inline bool gup_fast_permitted(unsigned long start, unsigned long end)
} }
#define gup_fast_permitted gup_fast_permitted #define gup_fast_permitted gup_fast_permitted
#define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot)) #define pfn_pte(pfn, pgprot) mk_pte_phys(((pfn) << PAGE_SHIFT), (pgprot))
#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
#define pte_page(x) pfn_to_page(pte_pfn(x)) #define pte_page(x) pfn_to_page(pte_pfn(x))
...@@ -1636,7 +1636,7 @@ static inline pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, ...@@ -1636,7 +1636,7 @@ static inline pmd_t pmdp_collapse_flush(struct vm_area_struct *vma,
} }
#define pmdp_collapse_flush pmdp_collapse_flush #define pmdp_collapse_flush pmdp_collapse_flush
#define pfn_pmd(pfn, pgprot) mk_pmd_phys(__pa((pfn) << PAGE_SHIFT), (pgprot)) #define pfn_pmd(pfn, pgprot) mk_pmd_phys(((pfn) << PAGE_SHIFT), (pgprot))
#define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot)) #define mk_pmd(page, pgprot) pfn_pmd(page_to_pfn(page), (pgprot))
static inline int pmd_trans_huge(pmd_t pmd) static inline int pmd_trans_huge(pmd_t pmd)
......
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright IBM Corp. 2021
* Interface implementation for communication with the CPU Measurement
* counter facility device driver.
*
* Author(s): Thomas Richter <tmricht@linux.ibm.com>
*
* Define for ioctl() commands to communicate with the CPU Measurement
* counter facility device driver.
*/
#ifndef _PERF_CPUM_CF_DIAG_H
#define _PERF_CPUM_CF_DIAG_H
#include <linux/ioctl.h>
#include <linux/types.h>
#define S390_HWCTR_DEVICE "hwctr"
#define S390_HWCTR_START_VERSION 1
struct s390_ctrset_start { /* Set CPUs to operate on */
__u64 version; /* Version of interface */
__u64 data_bytes; /* # of bytes required */
__u64 cpumask_len; /* Length of CPU mask in bytes */
__u64 *cpumask; /* Pointer to CPU mask */
__u64 counter_sets; /* Bit mask of counter sets to get */
};
struct s390_ctrset_setdata { /* Counter set data */
__u32 set; /* Counter set number */
__u32 no_cnts; /* # of counters stored in cv[] */
__u64 cv[0]; /* Counter values (variable length) */
};
struct s390_ctrset_cpudata { /* Counter set data per CPU */
__u32 cpu_nr; /* CPU number */
__u32 no_sets; /* # of counters sets in data[] */
struct s390_ctrset_setdata data[0];
};
struct s390_ctrset_read { /* Structure to get all ctr sets */
__u64 no_cpus; /* Total # of CPUs data taken from */
struct s390_ctrset_cpudata data[0];
};
#define S390_HWCTR_MAGIC 'C' /* Random magic # for ioctls */
#define S390_HWCTR_START _IOWR(S390_HWCTR_MAGIC, 1, struct s390_ctrset_start)
#define S390_HWCTR_STOP _IO(S390_HWCTR_MAGIC, 2)
#define S390_HWCTR_READ _IOWR(S390_HWCTR_MAGIC, 3, struct s390_ctrset_read)
#endif
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <linux/irq_work.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched/hotplug.h> #include <linux/sched/hotplug.h>
...@@ -62,6 +63,7 @@ enum { ...@@ -62,6 +63,7 @@ enum {
ec_call_function_single, ec_call_function_single,
ec_stop_cpu, ec_stop_cpu,
ec_mcck_pending, ec_mcck_pending,
ec_irq_work,
}; };
enum { enum {
...@@ -434,10 +436,12 @@ void notrace smp_yield_cpu(int cpu) ...@@ -434,10 +436,12 @@ void notrace smp_yield_cpu(int cpu)
*/ */
void notrace smp_emergency_stop(void) void notrace smp_emergency_stop(void)
{ {
cpumask_t cpumask; static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED;
static cpumask_t cpumask;
u64 end; u64 end;
int cpu; int cpu;
arch_spin_lock(&lock);
cpumask_copy(&cpumask, cpu_online_mask); cpumask_copy(&cpumask, cpu_online_mask);
cpumask_clear_cpu(smp_processor_id(), &cpumask); cpumask_clear_cpu(smp_processor_id(), &cpumask);
...@@ -458,6 +462,7 @@ void notrace smp_emergency_stop(void) ...@@ -458,6 +462,7 @@ void notrace smp_emergency_stop(void)
break; break;
cpu_relax(); cpu_relax();
} }
arch_spin_unlock(&lock);
} }
NOKPROBE_SYMBOL(smp_emergency_stop); NOKPROBE_SYMBOL(smp_emergency_stop);
...@@ -505,6 +510,8 @@ static void smp_handle_ext_call(void) ...@@ -505,6 +510,8 @@ static void smp_handle_ext_call(void)
generic_smp_call_function_single_interrupt(); generic_smp_call_function_single_interrupt();
if (test_bit(ec_mcck_pending, &bits)) if (test_bit(ec_mcck_pending, &bits))
__s390_handle_mcck(); __s390_handle_mcck();
if (test_bit(ec_irq_work, &bits))
irq_work_run();
} }
static void do_ext_call_interrupt(struct ext_code ext_code, static void do_ext_call_interrupt(struct ext_code ext_code,
...@@ -537,6 +544,13 @@ void smp_send_reschedule(int cpu) ...@@ -537,6 +544,13 @@ void smp_send_reschedule(int cpu)
pcpu_ec_call(pcpu_devices + cpu, ec_schedule); pcpu_ec_call(pcpu_devices + cpu, ec_schedule);
} }
#ifdef CONFIG_IRQ_WORK
void arch_irq_work_raise(void)
{
pcpu_ec_call(pcpu_devices + smp_processor_id(), ec_irq_work);
}
#endif
/* /*
* parameter area for the set/clear control bit callbacks * parameter area for the set/clear control bit callbacks
*/ */
...@@ -775,11 +789,13 @@ static int smp_add_core(struct sclp_core_entry *core, cpumask_t *avail, ...@@ -775,11 +789,13 @@ static int smp_add_core(struct sclp_core_entry *core, cpumask_t *avail,
static int __smp_rescan_cpus(struct sclp_core_info *info, bool early) static int __smp_rescan_cpus(struct sclp_core_info *info, bool early)
{ {
struct sclp_core_entry *core; struct sclp_core_entry *core;
cpumask_t avail; static cpumask_t avail;
bool configured; bool configured;
u16 core_id; u16 core_id;
int nr, i; int nr, i;
get_online_cpus();
mutex_lock(&smp_cpu_state_mutex);
nr = 0; nr = 0;
cpumask_xor(&avail, cpu_possible_mask, cpu_present_mask); cpumask_xor(&avail, cpu_possible_mask, cpu_present_mask);
/* /*
...@@ -800,6 +816,8 @@ static int __smp_rescan_cpus(struct sclp_core_info *info, bool early) ...@@ -800,6 +816,8 @@ static int __smp_rescan_cpus(struct sclp_core_info *info, bool early)
configured = i < info->configured; configured = i < info->configured;
nr += smp_add_core(&info->core[i], &avail, configured, early); nr += smp_add_core(&info->core[i], &avail, configured, early);
} }
mutex_unlock(&smp_cpu_state_mutex);
put_online_cpus();
return nr; return nr;
} }
...@@ -847,9 +865,7 @@ void __init smp_detect_cpus(void) ...@@ -847,9 +865,7 @@ void __init smp_detect_cpus(void)
pr_info("%d configured CPUs, %d standby CPUs\n", c_cpus, s_cpus); pr_info("%d configured CPUs, %d standby CPUs\n", c_cpus, s_cpus);
/* Add CPUs present at boot */ /* Add CPUs present at boot */
get_online_cpus();
__smp_rescan_cpus(info, true); __smp_rescan_cpus(info, true);
put_online_cpus();
memblock_free_early((unsigned long)info, sizeof(*info)); memblock_free_early((unsigned long)info, sizeof(*info));
} }
...@@ -1178,11 +1194,7 @@ int __ref smp_rescan_cpus(void) ...@@ -1178,11 +1194,7 @@ int __ref smp_rescan_cpus(void)
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
smp_get_core_info(info, 0); smp_get_core_info(info, 0);
get_online_cpus();
mutex_lock(&smp_cpu_state_mutex);
nr = __smp_rescan_cpus(info, false); nr = __smp_rescan_cpus(info, false);
mutex_unlock(&smp_cpu_state_mutex);
put_online_cpus();
kfree(info); kfree(info);
if (nr) if (nr)
topology_schedule_update(); topology_schedule_update();
......
...@@ -62,16 +62,16 @@ static struct mask_info drawer_info; ...@@ -62,16 +62,16 @@ static struct mask_info drawer_info;
struct cpu_topology_s390 cpu_topology[NR_CPUS]; struct cpu_topology_s390 cpu_topology[NR_CPUS];
EXPORT_SYMBOL_GPL(cpu_topology); EXPORT_SYMBOL_GPL(cpu_topology);
static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) static void cpu_group_map(cpumask_t *dst, struct mask_info *info, unsigned int cpu)
{ {
cpumask_t mask; static cpumask_t mask;
cpumask_copy(&mask, cpumask_of(cpu)); cpumask_copy(&mask, cpumask_of(cpu));
switch (topology_mode) { switch (topology_mode) {
case TOPOLOGY_MODE_HW: case TOPOLOGY_MODE_HW:
while (info) { while (info) {
if (cpumask_test_cpu(cpu, &info->mask)) { if (cpumask_test_cpu(cpu, &info->mask)) {
mask = info->mask; cpumask_copy(&mask, &info->mask);
break; break;
} }
info = info->next; info = info->next;
...@@ -89,23 +89,24 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu) ...@@ -89,23 +89,24 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
break; break;
} }
cpumask_and(&mask, &mask, cpu_online_mask); cpumask_and(&mask, &mask, cpu_online_mask);
return mask; cpumask_copy(dst, &mask);
} }
static cpumask_t cpu_thread_map(unsigned int cpu) static void cpu_thread_map(cpumask_t *dst, unsigned int cpu)
{ {
cpumask_t mask; static cpumask_t mask;
int i; int i;
cpumask_copy(&mask, cpumask_of(cpu)); cpumask_copy(&mask, cpumask_of(cpu));
if (topology_mode != TOPOLOGY_MODE_HW) if (topology_mode != TOPOLOGY_MODE_HW)
return mask; goto out;
cpu -= cpu % (smp_cpu_mtid + 1); cpu -= cpu % (smp_cpu_mtid + 1);
for (i = 0; i <= smp_cpu_mtid; i++) for (i = 0; i <= smp_cpu_mtid; i++)
if (cpu_present(cpu + i)) if (cpu_present(cpu + i))
cpumask_set_cpu(cpu + i, &mask); cpumask_set_cpu(cpu + i, &mask);
cpumask_and(&mask, &mask, cpu_online_mask); cpumask_and(&mask, &mask, cpu_online_mask);
return mask; out:
cpumask_copy(dst, &mask);
} }
#define TOPOLOGY_CORE_BITS 64 #define TOPOLOGY_CORE_BITS 64
...@@ -250,10 +251,10 @@ void update_cpu_masks(void) ...@@ -250,10 +251,10 @@ void update_cpu_masks(void)
for_each_possible_cpu(cpu) { for_each_possible_cpu(cpu) {
topo = &cpu_topology[cpu]; topo = &cpu_topology[cpu];
topo->thread_mask = cpu_thread_map(cpu); cpu_thread_map(&topo->thread_mask, cpu);
topo->core_mask = cpu_group_map(&socket_info, cpu); cpu_group_map(&topo->core_mask, &socket_info, cpu);
topo->book_mask = cpu_group_map(&book_info, cpu); cpu_group_map(&topo->book_mask, &book_info, cpu);
topo->drawer_mask = cpu_group_map(&drawer_info, cpu); cpu_group_map(&topo->drawer_mask, &drawer_info, cpu);
topo->booted_cores = 0; topo->booted_cores = 0;
if (topology_mode != TOPOLOGY_MODE_HW) { if (topology_mode != TOPOLOGY_MODE_HW) {
id = topology_mode == TOPOLOGY_MODE_PACKAGE ? 0 : cpu; id = topology_mode == TOPOLOGY_MODE_PACKAGE ? 0 : cpu;
......
...@@ -58,7 +58,7 @@ unsigned long *crst_table_alloc(struct mm_struct *mm) ...@@ -58,7 +58,7 @@ unsigned long *crst_table_alloc(struct mm_struct *mm)
if (!page) if (!page)
return NULL; return NULL;
arch_set_page_dat(page, 2); arch_set_page_dat(page, 2);
return (unsigned long *) page_to_phys(page); return (unsigned long *) page_to_virt(page);
} }
void crst_table_free(struct mm_struct *mm, unsigned long *table) void crst_table_free(struct mm_struct *mm, unsigned long *table)
...@@ -161,7 +161,7 @@ struct page *page_table_alloc_pgste(struct mm_struct *mm) ...@@ -161,7 +161,7 @@ struct page *page_table_alloc_pgste(struct mm_struct *mm)
page = alloc_page(GFP_KERNEL); page = alloc_page(GFP_KERNEL);
if (page) { if (page) {
table = (u64 *)page_to_phys(page); table = (u64 *)page_to_virt(page);
memset64(table, _PAGE_INVALID, PTRS_PER_PTE); memset64(table, _PAGE_INVALID, PTRS_PER_PTE);
memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE);
} }
...@@ -194,7 +194,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) ...@@ -194,7 +194,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
mask = atomic_read(&page->_refcount) >> 24; mask = atomic_read(&page->_refcount) >> 24;
mask = (mask | (mask >> 4)) & 3; mask = (mask | (mask >> 4)) & 3;
if (mask != 3) { if (mask != 3) {
table = (unsigned long *) page_to_phys(page); table = (unsigned long *) page_to_virt(page);
bit = mask & 1; /* =1 -> second 2K */ bit = mask & 1; /* =1 -> second 2K */
if (bit) if (bit)
table += PTRS_PER_PTE; table += PTRS_PER_PTE;
...@@ -217,7 +217,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) ...@@ -217,7 +217,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm)
} }
arch_set_page_dat(page, 0); arch_set_page_dat(page, 0);
/* Initialize page table */ /* Initialize page table */
table = (unsigned long *) page_to_phys(page); table = (unsigned long *) page_to_virt(page);
if (mm_alloc_pgste(mm)) { if (mm_alloc_pgste(mm)) {
/* Return 4K page table with PGSTEs */ /* Return 4K page table with PGSTEs */
atomic_xor_bits(&page->_refcount, 3 << 24); atomic_xor_bits(&page->_refcount, 3 << 24);
...@@ -239,10 +239,10 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) ...@@ -239,10 +239,10 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
struct page *page; struct page *page;
unsigned int bit, mask; unsigned int bit, mask;
page = pfn_to_page(__pa(table) >> PAGE_SHIFT); page = virt_to_page(table);
if (!mm_alloc_pgste(mm)) { if (!mm_alloc_pgste(mm)) {
/* Free 2K page table fragment of a 4K page */ /* Free 2K page table fragment of a 4K page */
bit = (__pa(table) & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t)); bit = ((unsigned long) table & ~PAGE_MASK)/(PTRS_PER_PTE*sizeof(pte_t));
spin_lock_bh(&mm->context.lock); spin_lock_bh(&mm->context.lock);
mask = atomic_xor_bits(&page->_refcount, 1U << (bit + 24)); mask = atomic_xor_bits(&page->_refcount, 1U << (bit + 24));
mask >>= 24; mask >>= 24;
...@@ -269,14 +269,14 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table, ...@@ -269,14 +269,14 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
unsigned int bit, mask; unsigned int bit, mask;
mm = tlb->mm; mm = tlb->mm;
page = pfn_to_page(__pa(table) >> PAGE_SHIFT); page = virt_to_page(table);
if (mm_alloc_pgste(mm)) { if (mm_alloc_pgste(mm)) {
gmap_unlink(mm, table, vmaddr); gmap_unlink(mm, table, vmaddr);
table = (unsigned long *) (__pa(table) | 3); table = (unsigned long *) ((unsigned long)table | 3);
tlb_remove_table(tlb, table); tlb_remove_table(tlb, table);
return; return;
} }
bit = (__pa(table) & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t)); bit = ((unsigned long) table & ~PAGE_MASK) / (PTRS_PER_PTE*sizeof(pte_t));
spin_lock_bh(&mm->context.lock); spin_lock_bh(&mm->context.lock);
mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24)); mask = atomic_xor_bits(&page->_refcount, 0x11U << (bit + 24));
mask >>= 24; mask >>= 24;
...@@ -285,7 +285,7 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table, ...@@ -285,7 +285,7 @@ void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table,
else else
list_del(&page->lru); list_del(&page->lru);
spin_unlock_bh(&mm->context.lock); spin_unlock_bh(&mm->context.lock);
table = (unsigned long *) (__pa(table) | (1U << bit)); table = (unsigned long *) ((unsigned long) table | (1U << bit));
tlb_remove_table(tlb, table); tlb_remove_table(tlb, table);
} }
...@@ -293,7 +293,7 @@ void __tlb_remove_table(void *_table) ...@@ -293,7 +293,7 @@ void __tlb_remove_table(void *_table)
{ {
unsigned int mask = (unsigned long) _table & 3; unsigned int mask = (unsigned long) _table & 3;
void *table = (void *)((unsigned long) _table ^ mask); void *table = (void *)((unsigned long) _table ^ mask);
struct page *page = pfn_to_page(__pa(table) >> PAGE_SHIFT); struct page *page = virt_to_page(table);
switch (mask) { switch (mask) {
case 0: /* pmd, pud, or p4d */ case 0: /* pmd, pud, or p4d */
......
...@@ -27,14 +27,14 @@ static void __ref *vmem_alloc_pages(unsigned int order) ...@@ -27,14 +27,14 @@ static void __ref *vmem_alloc_pages(unsigned int order)
if (slab_is_available()) if (slab_is_available())
return (void *)__get_free_pages(GFP_KERNEL, order); return (void *)__get_free_pages(GFP_KERNEL, order);
return (void *) memblock_phys_alloc(size, size); return memblock_alloc(size, size);
} }
static void vmem_free_pages(unsigned long addr, int order) static void vmem_free_pages(unsigned long addr, int order)
{ {
/* We don't expect boot memory to be removed ever. */ /* We don't expect boot memory to be removed ever. */
if (!slab_is_available() || if (!slab_is_available() ||
WARN_ON_ONCE(PageReserved(phys_to_page(addr)))) WARN_ON_ONCE(PageReserved(virt_to_page(addr))))
return; return;
free_pages(addr, order); free_pages(addr, order);
} }
...@@ -57,7 +57,7 @@ pte_t __ref *vmem_pte_alloc(void) ...@@ -57,7 +57,7 @@ pte_t __ref *vmem_pte_alloc(void)
if (slab_is_available()) if (slab_is_available())
pte = (pte_t *) page_table_alloc(&init_mm); pte = (pte_t *) page_table_alloc(&init_mm);
else else
pte = (pte_t *) memblock_phys_alloc(size, size); pte = (pte_t *) memblock_alloc(size, size);
if (!pte) if (!pte)
return NULL; return NULL;
memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE); memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE);
...@@ -85,7 +85,7 @@ static void vmemmap_flush_unused_sub_pmd(void) ...@@ -85,7 +85,7 @@ static void vmemmap_flush_unused_sub_pmd(void)
{ {
if (!unused_sub_pmd_start) if (!unused_sub_pmd_start)
return; return;
memset(__va(unused_sub_pmd_start), PAGE_UNUSED, memset((void *)unused_sub_pmd_start, PAGE_UNUSED,
ALIGN(unused_sub_pmd_start, PMD_SIZE) - unused_sub_pmd_start); ALIGN(unused_sub_pmd_start, PMD_SIZE) - unused_sub_pmd_start);
unused_sub_pmd_start = 0; unused_sub_pmd_start = 0;
} }
...@@ -98,7 +98,7 @@ static void vmemmap_mark_sub_pmd_used(unsigned long start, unsigned long end) ...@@ -98,7 +98,7 @@ static void vmemmap_mark_sub_pmd_used(unsigned long start, unsigned long end)
* getting removed (just in case the memmap never gets initialized, * getting removed (just in case the memmap never gets initialized,
* e.g., because the memory block never gets onlined). * e.g., because the memory block never gets onlined).
*/ */
memset(__va(start), 0, sizeof(struct page)); memset((void *)start, 0, sizeof(struct page));
} }
static void vmemmap_use_sub_pmd(unsigned long start, unsigned long end) static void vmemmap_use_sub_pmd(unsigned long start, unsigned long end)
...@@ -119,7 +119,7 @@ static void vmemmap_use_sub_pmd(unsigned long start, unsigned long end) ...@@ -119,7 +119,7 @@ static void vmemmap_use_sub_pmd(unsigned long start, unsigned long end)
static void vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end) static void vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)
{ {
void *page = __va(ALIGN_DOWN(start, PMD_SIZE)); unsigned long page = ALIGN_DOWN(start, PMD_SIZE);
vmemmap_flush_unused_sub_pmd(); vmemmap_flush_unused_sub_pmd();
...@@ -128,7 +128,7 @@ static void vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end) ...@@ -128,7 +128,7 @@ static void vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)
/* Mark the unused parts of the new memmap page PAGE_UNUSED. */ /* Mark the unused parts of the new memmap page PAGE_UNUSED. */
if (!IS_ALIGNED(start, PMD_SIZE)) if (!IS_ALIGNED(start, PMD_SIZE))
memset(page, PAGE_UNUSED, start - __pa(page)); memset((void *)page, PAGE_UNUSED, start - page);
/* /*
* We want to avoid memset(PAGE_UNUSED) when populating the vmemmap of * We want to avoid memset(PAGE_UNUSED) when populating the vmemmap of
* consecutive sections. Remember for the last added PMD the last * consecutive sections. Remember for the last added PMD the last
...@@ -141,11 +141,11 @@ static void vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end) ...@@ -141,11 +141,11 @@ static void vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)
/* Returns true if the PMD is completely unused and can be freed. */ /* Returns true if the PMD is completely unused and can be freed. */
static bool vmemmap_unuse_sub_pmd(unsigned long start, unsigned long end) static bool vmemmap_unuse_sub_pmd(unsigned long start, unsigned long end)
{ {
void *page = __va(ALIGN_DOWN(start, PMD_SIZE)); unsigned long page = ALIGN_DOWN(start, PMD_SIZE);
vmemmap_flush_unused_sub_pmd(); vmemmap_flush_unused_sub_pmd();
memset(__va(start), PAGE_UNUSED, end - start); memset((void *)start, PAGE_UNUSED, end - start);
return !memchr_inv(page, PAGE_UNUSED, PMD_SIZE); return !memchr_inv((void *)page, PAGE_UNUSED, PMD_SIZE);
} }
/* __ref: we'll only call vmemmap_alloc_block() via vmemmap_populate() */ /* __ref: we'll only call vmemmap_alloc_block() via vmemmap_populate() */
...@@ -166,7 +166,7 @@ static int __ref modify_pte_table(pmd_t *pmd, unsigned long addr, ...@@ -166,7 +166,7 @@ static int __ref modify_pte_table(pmd_t *pmd, unsigned long addr,
if (pte_none(*pte)) if (pte_none(*pte))
continue; continue;
if (!direct) if (!direct)
vmem_free_pages(pfn_to_phys(pte_pfn(*pte)), 0); vmem_free_pages((unsigned long) pfn_to_virt(pte_pfn(*pte)), 0);
pte_clear(&init_mm, addr, pte); pte_clear(&init_mm, addr, pte);
} else if (pte_none(*pte)) { } else if (pte_none(*pte)) {
if (!direct) { if (!direct) {
...@@ -176,7 +176,7 @@ static int __ref modify_pte_table(pmd_t *pmd, unsigned long addr, ...@@ -176,7 +176,7 @@ static int __ref modify_pte_table(pmd_t *pmd, unsigned long addr,
goto out; goto out;
pte_val(*pte) = __pa(new_page) | prot; pte_val(*pte) = __pa(new_page) | prot;
} else { } else {
pte_val(*pte) = addr | prot; pte_val(*pte) = __pa(addr) | prot;
} }
} else { } else {
continue; continue;
...@@ -201,7 +201,7 @@ static void try_free_pte_table(pmd_t *pmd, unsigned long start) ...@@ -201,7 +201,7 @@ static void try_free_pte_table(pmd_t *pmd, unsigned long start)
if (!pte_none(*pte)) if (!pte_none(*pte))
return; return;
} }
vmem_pte_free(__va(pmd_deref(*pmd))); vmem_pte_free((unsigned long *) pmd_deref(*pmd));
pmd_clear(pmd); pmd_clear(pmd);
} }
...@@ -242,7 +242,7 @@ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr, ...@@ -242,7 +242,7 @@ static int __ref modify_pmd_table(pud_t *pud, unsigned long addr,
IS_ALIGNED(next, PMD_SIZE) && IS_ALIGNED(next, PMD_SIZE) &&
MACHINE_HAS_EDAT1 && addr && direct && MACHINE_HAS_EDAT1 && addr && direct &&
!debug_pagealloc_enabled()) { !debug_pagealloc_enabled()) {
pmd_val(*pmd) = addr | prot; pmd_val(*pmd) = __pa(addr) | prot;
pages++; pages++;
continue; continue;
} else if (!direct && MACHINE_HAS_EDAT1) { } else if (!direct && MACHINE_HAS_EDAT1) {
...@@ -338,7 +338,7 @@ static int modify_pud_table(p4d_t *p4d, unsigned long addr, unsigned long end, ...@@ -338,7 +338,7 @@ static int modify_pud_table(p4d_t *p4d, unsigned long addr, unsigned long end,
IS_ALIGNED(next, PUD_SIZE) && IS_ALIGNED(next, PUD_SIZE) &&
MACHINE_HAS_EDAT2 && addr && direct && MACHINE_HAS_EDAT2 && addr && direct &&
!debug_pagealloc_enabled()) { !debug_pagealloc_enabled()) {
pud_val(*pud) = addr | prot; pud_val(*pud) = __pa(addr) | prot;
pages++; pages++;
continue; continue;
} }
......
...@@ -597,7 +597,7 @@ b9b3 cu42 RRE_RR ...@@ -597,7 +597,7 @@ b9b3 cu42 RRE_RR
b9bd trtre RRF_U0RR b9bd trtre RRF_U0RR
b9be srstu RRE_RR b9be srstu RRE_RR
b9bf trte RRF_U0RR b9bf trte RRF_U0RR
b9c0 selhhhr RRF_RURR b9c0 selfhr RRF_RURR
b9c8 ahhhr RRF_R0RR2 b9c8 ahhhr RRF_R0RR2
b9c9 shhhr RRF_R0RR2 b9c9 shhhr RRF_R0RR2
b9ca alhhhr RRF_R0RR2 b9ca alhhhr RRF_R0RR2
......
...@@ -117,7 +117,7 @@ struct virtio_rev_info { ...@@ -117,7 +117,7 @@ struct virtio_rev_info {
}; };
/* the highest virtio-ccw revision we support */ /* the highest virtio-ccw revision we support */
#define VIRTIO_CCW_REV_MAX 1 #define VIRTIO_CCW_REV_MAX 2
struct virtio_ccw_vq_info { struct virtio_ccw_vq_info {
struct virtqueue *vq; struct virtqueue *vq;
...@@ -952,7 +952,7 @@ static u8 virtio_ccw_get_status(struct virtio_device *vdev) ...@@ -952,7 +952,7 @@ static u8 virtio_ccw_get_status(struct virtio_device *vdev)
u8 old_status = vcdev->dma_area->status; u8 old_status = vcdev->dma_area->status;
struct ccw1 *ccw; struct ccw1 *ccw;
if (vcdev->revision < 1) if (vcdev->revision < 2)
return vcdev->dma_area->status; return vcdev->dma_area->status;
ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw)); ccw = ccw_device_dma_zalloc(vcdev->cdev, sizeof(*ccw));
......
...@@ -168,6 +168,7 @@ enum cpuhp_state { ...@@ -168,6 +168,7 @@ enum cpuhp_state {
CPUHP_AP_PERF_X86_CQM_ONLINE, CPUHP_AP_PERF_X86_CQM_ONLINE,
CPUHP_AP_PERF_X86_CSTATE_ONLINE, CPUHP_AP_PERF_X86_CSTATE_ONLINE,
CPUHP_AP_PERF_S390_CF_ONLINE, CPUHP_AP_PERF_S390_CF_ONLINE,
CPUHP_AP_PERF_S390_CFD_ONLINE,
CPUHP_AP_PERF_S390_SF_ONLINE, CPUHP_AP_PERF_S390_SF_ONLINE,
CPUHP_AP_PERF_ARM_CCI_ONLINE, CPUHP_AP_PERF_ARM_CCI_ONLINE,
CPUHP_AP_PERF_ARM_CCN_ONLINE, CPUHP_AP_PERF_ARM_CCN_ONLINE,
......
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