mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
s390/cpufeature: Convert MACHINE_HAS_TLB_LC to cpu_has_tlb_lc()
Convert MACHINE_HAS_... to cpu_has_...() which uses test_facility() instead of testing the machine_flags lowcore member if the feature is present. test_facility() generates better code since it results in a static branch without accessing memory. The branch is patched via alternatives by the decompressor depending on the availability of the required facility. Reviewed-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
b49ee5b386
commit
8e31fea55d
|
|
@ -26,5 +26,6 @@ int cpu_have_feature(unsigned int nr);
|
|||
#define cpu_has_nx() test_facility(130)
|
||||
#define cpu_has_rdp() test_facility(194)
|
||||
#define cpu_has_seq_insn() test_facility(85)
|
||||
#define cpu_has_tlb_lc() test_facility(51)
|
||||
|
||||
#endif /* __ASM_S390_CPUFEATURE_H */
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#define MACHINE_FLAG_EDAT2 BIT(8)
|
||||
#define MACHINE_FLAG_TOPOLOGY BIT(10)
|
||||
#define MACHINE_FLAG_TE BIT(11)
|
||||
#define MACHINE_FLAG_TLB_LC BIT(12)
|
||||
#define MACHINE_FLAG_TLB_GUEST BIT(14)
|
||||
#define MACHINE_FLAG_SCC BIT(17)
|
||||
#define MACHINE_FLAG_PCI_MIO BIT(18)
|
||||
|
|
@ -85,7 +84,6 @@ extern unsigned long mio_wb_bit_mask;
|
|||
#define MACHINE_HAS_EDAT2 (get_lowcore()->machine_flags & MACHINE_FLAG_EDAT2)
|
||||
#define MACHINE_HAS_TOPOLOGY (get_lowcore()->machine_flags & MACHINE_FLAG_TOPOLOGY)
|
||||
#define MACHINE_HAS_TE (get_lowcore()->machine_flags & MACHINE_FLAG_TE)
|
||||
#define MACHINE_HAS_TLB_LC (get_lowcore()->machine_flags & MACHINE_FLAG_TLB_LC)
|
||||
#define MACHINE_HAS_TLB_GUEST (get_lowcore()->machine_flags & MACHINE_FLAG_TLB_GUEST)
|
||||
#define MACHINE_HAS_SCC (get_lowcore()->machine_flags & MACHINE_FLAG_SCC)
|
||||
#define MACHINE_HAS_PCI_MIO (get_lowcore()->machine_flags & MACHINE_FLAG_PCI_MIO)
|
||||
|
|
|
|||
|
|
@ -249,8 +249,6 @@ static __init void detect_machine_facilities(void)
|
|||
get_lowcore()->machine_flags |= MACHINE_FLAG_TE;
|
||||
system_ctl_set_bit(0, CR0_TRANSACTIONAL_EXECUTION_BIT);
|
||||
}
|
||||
if (test_facility(51))
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_TLB_LC;
|
||||
if (test_facility(129))
|
||||
system_ctl_set_bit(0, CR0_VECTOR_BIT);
|
||||
if (test_facility(139) && (tod_clock_base.tod >> 63)) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
|
||||
*/
|
||||
|
||||
#include <linux/cpufeature.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/errno.h>
|
||||
|
|
@ -94,7 +95,7 @@ static inline pte_t ptep_flush_direct(struct mm_struct *mm,
|
|||
if (unlikely(pte_val(old) & _PAGE_INVALID))
|
||||
return old;
|
||||
atomic_inc(&mm->context.flush_count);
|
||||
if (MACHINE_HAS_TLB_LC &&
|
||||
if (cpu_has_tlb_lc() &&
|
||||
cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
|
||||
ptep_ipte_local(mm, addr, ptep, nodat);
|
||||
else
|
||||
|
|
@ -411,7 +412,7 @@ static inline pmd_t pmdp_flush_direct(struct mm_struct *mm,
|
|||
if (pmd_val(old) & _SEGMENT_ENTRY_INVALID)
|
||||
return old;
|
||||
atomic_inc(&mm->context.flush_count);
|
||||
if (MACHINE_HAS_TLB_LC &&
|
||||
if (cpu_has_tlb_lc() &&
|
||||
cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
|
||||
pmdp_idte_local(mm, addr, pmdp);
|
||||
else
|
||||
|
|
@ -537,7 +538,7 @@ static inline pud_t pudp_flush_direct(struct mm_struct *mm,
|
|||
if (pud_val(old) & _REGION_ENTRY_INVALID)
|
||||
return old;
|
||||
atomic_inc(&mm->context.flush_count);
|
||||
if (MACHINE_HAS_TLB_LC &&
|
||||
if (cpu_has_tlb_lc() &&
|
||||
cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
|
||||
pudp_idte_local(mm, addr, pudp);
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user