Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
2d28cd8
drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers
dianders Sep 1, 2023
a6605d3
drm/ast: Implement polling for VGA and SIL164 connectors
tdz Mar 25, 2024
d590747
drm/hisilicon/hibmc: convert to struct drm_edid
jnikula May 14, 2024
7904dcb
drm/hisilicon/hibmc: Use video aperture helpers
tdz Sep 30, 2024
70f516f
drm/hisilicon/hibmc: add dp aux in hibmc drivers
mark1188-ui Jan 3, 2025
456e97d
drm/hisilicon/hibmc: add dp link moduel in hibmc drivers
mark1188-ui Jan 3, 2025
16de176
drm/hisilicon/hibmc: add dp hw moduel in hibmc driver
mark1188-ui Jan 3, 2025
f7588e6
drm/hisilicon/hibmc: refactored struct hibmc_drm_private
mark1188-ui Jan 3, 2025
733e1b7
drm/hisilicon/hibmc: add dp module in hibmc
mark1188-ui Jan 3, 2025
b46f020
drm/hisilicon/hibmc: select CONFIG_DRM_DISPLAY_DP_HELPER
arndb Jan 27, 2025
9aecb0e
drm/hisilicon/hibmc: Restructuring the header dp_reg.h
mark1188-ui Mar 31, 2025
614e45b
drm/hisilicon/hibmc: Add dp serdes cfg to adjust serdes rate, voltage…
mark1188-ui Mar 31, 2025
a36d1b7
drm/hisilicon/hibmc: Add dp serdes cfg in dp process
mark1188-ui Mar 31, 2025
fcc20e2
drm/hisilicon/hibmc: Refactor the member of drm_aux in struct hibmc_dp
mark1188-ui Mar 31, 2025
ee3ff9d
drm/hisilicon/hibmc: Getting connector info and EDID by using AUX cha…
mark1188-ui Mar 31, 2025
530fec9
drm/hisilicon/hibmc: Add colorbar-cfg feature and its debugfs file
mark1188-ui Mar 31, 2025
a905c17
drm/hisilicon/hibmc: Enable this hot plug detect of irq feature
mark1188-ui Mar 31, 2025
8f2387a
drm/hisilicon/hibmc: Add MSI irq getting and requesting for HPD
mark1188-ui Mar 31, 2025
d602622
drm/hisilicon/hibmc: Add vga connector detect functions
mark1188-ui Mar 31, 2025
aff3a78
drm/hisilicon/hibmc: fix the i2c device resource leak when vdac init …
mark1188-ui Aug 13, 2025
c8dd9c7
drm/hisilicon/hibmc: fix irq_request()'s irq name variable is local
mark1188-ui Aug 13, 2025
c285687
drm/hisilicon/hibmc: fix rare monitors cannot display problem
mark1188-ui Aug 13, 2025
e469c61
drm/hisilicon/hibmc: fix dp and vga cannot show together
mark1188-ui Aug 13, 2025
42cec0a
arm64/sysreg: Update ID_AA64MMFR1_EL1 register
Nov 2, 2024
f8dc07b
arm64: Add support for FEAT_HAFT
Nov 2, 2024
fc8664f
arm64: Enable ARCH_HAS_NONLEAF_PMD_YOUNG
Nov 2, 2024
5362485
arm64: pgtable: Warn unexpected pmdp_test_and_clear_young()
Nov 2, 2024
0ec128a
arm64: Support AT_HWCAP3
broonie Oct 4, 2024
e4fe15f
uapi/auxvec: Define AT_HWCAP3 and AT_HWCAP4 aux vector, entries
Feb 14, 2024
7cd9b3a
binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4
broonie Oct 4, 2024
f4516a2
arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1
Jan 19, 2026
c7b8e32
arm64: Add support for FEAT_{LS64, LS64_V}
Jan 19, 2026
164063c
KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest
Jan 19, 2026
55fd143
irqchip/gicv3-its: Add workaround for hip09 ITS erratum 162100801
Nov 16, 2024
66355c4
sched/fair: Use candidate prev/recent_used CPU if scanning failed for…
Oct 19, 2023
05a4e61
cpu/SMT: Provide a default topology_is_primary_thread()
Mar 11, 2025
6469881
arch_topology: Support SMT control for OF based system
Mar 11, 2025
1f50b4b
arm64: Kconfig: Enable HOTPLUG_SMT
Mar 11, 2025
8c452a6
arm64: topology: Support SMT control on ACPI based system
Mar 11, 2025
a002f5b
arm64: setup: name 'tcr2' register
Nov 2, 2024
a4245f3
cpufreq/schedutil: Use a fixed reference frequency
vingu-linaro Dec 11, 2023
b48d889
cpufreq: Fix re-boost issue after hotplugging a CPU
Jan 17, 2025
cbe2c31
cpufreq: Introduce a more generic way to set default per-policy boost…
Jan 17, 2025
4632d53
cpufreq: CPPC: Fix wrong max_freq in policy initialization
Jan 17, 2025
92846ab
cpufreq: ACPI: Remove set_boost in acpi_cpufreq_cpu_init()
Jan 17, 2025
b4c9615
cpufreq: prevent NULL dereference in cpufreq_online()
AboorvaDevarajan Feb 5, 2025
679729b
cpufreq: CPPC: Remove cpu_data_list
May 26, 2025
f7e6339
cpufreq: CPPC: Do not return a value from populate_efficiency_class()
May 26, 2025
e262f8b
cpufreq: CPPC: Remove forward declaration of cppc_cpufreq_register_em()
May 26, 2025
afb2c18
cpufreq: Contain scaling_cur_freq.attr in cpufreq_attrs
Jun 23, 2025
84fe24e
cpufreq: Remove duplicate check in __cpufreq_offline()
Jun 23, 2025
7491908
cpufreq: Move the check of cpufreq_driver->get into cpufreq_verify_cu…
Jul 9, 2025
169411d
drm/hisilicon/hibmc: fix dp probabilistical detect errors after HPD irq
mark1188-ui Dec 10, 2025
7c58a63
drm/hisilicon/hibmc: add dp mode valid check
mark1188-ui Dec 10, 2025
e39bdc7
drm/hisilicon/hibmc: fix no showing problem with loading hibmc manually
mark1188-ui Dec 10, 2025
e58276a
drm/hisilicon/hibmc: Adding reset colorbar cfg in dp init.
mark1188-ui Dec 10, 2025
7d784b3
cpufreq: Introduce policy->boost_supported flag
vireshk Jan 23, 2025
2dd86bf
cpufreq: ACPI: Re-sync CPU boost state on system resume
vireshk Apr 24, 2025
2a5dc41
cpuidle: Init cpuidle only for present CPUs
JackyBai Mar 7, 2025
7a3bb61
cpufreq: Init cpufreq only for present CPUs
JackyBai Mar 13, 2025
523ad1b
arch_topology: init capacity_freq_ref to 0
ionela-voinescu Aug 27, 2024
4334efe
cpufreq: Allow arch_freq_get_on_cpu to return an error
bea-arm Jan 31, 2025
aa4f6f1
cpufreq: Introduce an optional cpuinfo_avg_freq sysfs entry
bea-arm Jan 31, 2025
2fb59c8
arm64: Provide an AMU-based version of arch_freq_get_on_cpu
bea-arm Jan 31, 2025
ef22a5f
arm64: Update AMU-based freq scale factor on entering idle
bea-arm Jan 31, 2025
42d66c8
arm64: Utilize for_each_cpu_wrap for reference lookup
bea-arm Feb 20, 2025
1d2b5c2
hwtracing: hisi_ptt: Disable interrupt after trace end
Oct 10, 2023
abeaa40
hwtracing: hisi_ptt: Optimize the trace data committing
Oct 10, 2023
e560be2
PCI/DPC: Ignore Surprise Down error on hot removal
skoralah Feb 7, 2024
ff279f4
drivers/perf: hisi_pcie: Rename hisi_pcie_pmu_{config,clear}_filter()
Feb 23, 2024
2320ce1
drivers/perf: hisi_pcie: Introduce hisi_pcie_pmu_get_event_ctrl_val()
Feb 23, 2024
4c2d3e1
drivers/perf: hisi_pcie: Fix incorrect counting under metric mode
Feb 23, 2024
077c873
drivers/perf: hisi_pcie: Add more events for counting TLP bandwidth
Feb 23, 2024
25fd9db
drivers/perf: hisi_pcie: Check the target filter properly
Feb 23, 2024
da5fb52
drivers/perf: hisi_pcie: Relax the check on related events
Feb 23, 2024
988412d
drivers/perf: hisi_pcie: Merge find_related_event() and get_event_idx()
Feb 23, 2024
14f3c12
drivers/perf: hisi_pcie: Export supported Root Ports [bdf_min, bdf_max]
Aug 29, 2024
82ec615
docs: perf: Update usage for target filter of hisi-pcie-pmu
Feb 23, 2024
61c568d
docs: perf: Fix build warning of hisi-pcie-pmu.rst
Mar 5, 2024
5501d3b
perf hisi-ptt: Fix memory leak in lseek failure handling
visitorckw Sep 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions Documentation/admin-guide/perf/hisi-pcie-pmu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ The "identifier" sysfs file allows users to identify the version of the
PMU hardware device.

The "bus" sysfs file allows users to get the bus number of Root Ports
monitored by PMU.
monitored by PMU. Furthermore users can get the Root Ports range in
[bdf_min, bdf_max] from "bdf_min" and "bdf_max" sysfs attributes
respectively.

Example usage of perf::

Expand All @@ -37,9 +39,21 @@ Example usage of perf::
hisi_pcie0_core0/rx_mwr_cnt/ [kernel PMU event]
------------------------------------------

$# perf stat -e hisi_pcie0_core0/rx_mwr_latency/
$# perf stat -e hisi_pcie0_core0/rx_mwr_cnt/
$# perf stat -g -e hisi_pcie0_core0/rx_mwr_latency/ -e hisi_pcie0_core0/rx_mwr_cnt/
$# perf stat -e hisi_pcie0_core0/rx_mwr_latency,port=0xffff/
$# perf stat -e hisi_pcie0_core0/rx_mwr_cnt,port=0xffff/

The related events usually used to calculate the bandwidth, latency or others.
They need to start and end counting at the same time, therefore related events
are best used in the same event group to get the expected value. There are two
ways to know if they are related events:

a) By event name, such as the latency events "xxx_latency, xxx_cnt" or
bandwidth events "xxx_flux, xxx_time".
b) By event type, such as "event=0xXXXX, event=0x1XXXX".

Example usage of perf group::

$# perf stat -e "{hisi_pcie0_core0/rx_mwr_latency,port=0xffff/,hisi_pcie0_core0/rx_mwr_cnt,port=0xffff/}"

The current driver does not support sampling. So "perf record" is unsupported.
Also attach to a task is unsupported for PCIe PMU.
Expand All @@ -51,8 +65,12 @@ Filter options

PMU could only monitor the performance of traffic downstream target Root
Ports or downstream target Endpoint. PCIe PMU driver support "port" and
"bdf" interfaces for users, and these two interfaces aren't supported at the
same time.
"bdf" interfaces for users.
Please notice that, one of these two interfaces must be set, and these two
interfaces aren't supported at the same time. If they are both set, only
"port" filter is valid.
If "port" filter not being set or is set explicitly to zero (default), the
"bdf" filter will be in effect, because "bdf=0" meaning 0000:000:00.0.

- port

Expand Down Expand Up @@ -95,7 +113,7 @@ Filter options

Example usage of perf::

$# perf stat -e hisi_pcie0_core0/rx_mrd_flux,trig_len=0x4,trig_mode=1/ sleep 5
$# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=0xffff,trig_len=0x4,trig_mode=1/ sleep 5

3. Threshold filter

Expand All @@ -109,7 +127,7 @@ Filter options

Example usage of perf::

$# perf stat -e hisi_pcie0_core0/rx_mrd_flux,thr_len=0x4,thr_mode=1/ sleep 5
$# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=0xffff,thr_len=0x4,thr_mode=1/ sleep 5

4. TLP Length filter

Expand All @@ -127,4 +145,4 @@ Filter options

Example usage of perf::

$# perf stat -e hisi_pcie0_core0/rx_mrd_flux,len_mode=0x1/ sleep 5
$# perf stat -e hisi_pcie0_core0/rx_mrd_flux,port=0xffff,len_mode=0x1/ sleep 5
17 changes: 16 additions & 1 deletion Documentation/admin-guide/pm/cpufreq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,20 @@ are the following:
If that frequency cannot be determined, this attribute should not
be present.

``cpuinfo_avg_freq``
An average frequency (in KHz) of all CPUs belonging to a given policy,
derived from a hardware provided feedback and reported on a time frame
spanning at most few milliseconds.

This is expected to be based on the frequency the hardware actually runs
at and, as such, might require specialised hardware support (such as AMU
extension on ARM). If one cannot be determined, this attribute should
not be present.

Note, that failed attempt to retrieve current frequency for a given
CPU(s) will result in an appropriate error, i.e: EAGAIN for CPU that
remains idle (raised on ARM).

``cpuinfo_max_freq``
Maximum possible operating frequency the CPUs belonging to this policy
can run at (in kHz).
Expand Down Expand Up @@ -289,7 +303,8 @@ are the following:
Some architectures (e.g. ``x86``) may attempt to provide information
more precisely reflecting the current CPU frequency through this
attribute, but that still may not be the exact current CPU frequency as
seen by the hardware at the moment.
seen by the hardware at the moment. This behavior though, is only
available via c:macro:``CPUFREQ_ARCH_CUR_FREQ`` option.

``scaling_driver``
The scaling driver currently in use.
Expand Down
12 changes: 12 additions & 0 deletions Documentation/arch/arm64/booting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,18 @@ Before jumping into the kernel, the following conditions must be met:

- HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1.

For CPUs support for 64-byte loads and stores without status (FEAT_LS64):

- If the kernel is entered at EL1 and EL2 is present:

- HCRX_EL2.EnALS (bit 1) must be initialised to 0b1.

For CPUs support for 64-byte loads and stores with status (FEAT_LS64_V):

- If the kernel is entered at EL1 and EL2 is present:

- HCRX_EL2.EnASR (bit 2) must be initialised to 0b1.

The requirements described above for CPU mode, caches, MMUs, architected
timers, coherency and system registers apply to all CPUs. All CPUs must
enter the kernel in the same exception level. Where the values documented
Expand Down
12 changes: 9 additions & 3 deletions Documentation/arch/arm64/elf_hwcaps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ architected discovery mechanism available to userspace code at EL0. The
kernel exposes the presence of these features to userspace through a set
of flags called hwcaps, exposed in the auxiliary vector.

Userspace software can test for features by acquiring the AT_HWCAP or
AT_HWCAP2 entry of the auxiliary vector, and testing whether the relevant
flags are set, e.g.::
Userspace software can test for features by acquiring the AT_HWCAP,
AT_HWCAP2 or AT_HWCAP3 entry of the auxiliary vector, and testing
whether the relevant flags are set, e.g.::

bool floating_point_is_present(void)
{
Expand Down Expand Up @@ -320,6 +320,12 @@ HWCAP2_MOPS
HWCAP2_HBC
Functionality implied by ID_AA64ISAR2_EL1.BC == 0b0001.

HWCAP3_LS64
Functionality implied by ID_AA64ISAR1_EL1.LS64 == 0b0001.

HWCAP3_LS64_V
Functionality implied by ID_AA64ISAR1_EL1.LS64 == 0b0010.

4. Unused AT_HWCAP bits
-----------------------

Expand Down
2 changes: 2 additions & 0 deletions Documentation/arch/arm64/silicon-errata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ stable kernels.
| | ,10C,11} | | |
| | SMMU PMCG | | |
+----------------+-----------------+-----------------+-----------------------------+
| Hisilicon | Hip09 | #162100801 | HISILICON_ERRATUM_162100801 |
+----------------+-----------------+-----------------+-----------------------------+
+----------------+-----------------+-----------------+-----------------------------+
| Qualcomm Tech. | Kryo/Falkor v1 | E1003 | QCOM_FALKOR_ERRATUM_1003 |
+----------------+-----------------+-----------------+-----------------------------+
Expand Down
33 changes: 32 additions & 1 deletion arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config ARM64
select ARCH_HAS_MEMBARRIER_SYNC_CORE
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
select ARCH_HAS_NONLEAF_PMD_YOUNG if ARM64_HAFT
select ARCH_HAS_PTE_DEVMAP
select ARCH_HAS_PTE_SPECIAL
select ARCH_HAS_SETUP_DMA_OPS
Expand Down Expand Up @@ -237,6 +238,7 @@ config ARM64
select HAVE_KRETPROBES
select HAVE_GENERIC_VDSO
select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
select HOTPLUG_SMT if HOTPLUG_CPU
select IRQ_DOMAIN
select IRQ_FORCED_THREADING
select KASAN_VMALLOC if KASAN
Expand Down Expand Up @@ -1219,6 +1221,17 @@ config HISILICON_ERRATUM_161600802

If unsure, say Y.

config HISILICON_ERRATUM_162100801
bool "Hip09 162100801 erratum support"
default y
help
When enabling GICv4.1 in hip09, VMAPP will fail to clear some caches
during unmapping operation, which will cause some vSGIs lost.
To fix the issue, invalidate related vPE cache through GICR_INVALLR
after VMOVP.

If unsure, say Y.

config QCOM_FALKOR_ERRATUM_1003
bool "Falkor E1003: Incorrect translation due to ASID change"
default y
Expand Down Expand Up @@ -2136,7 +2149,25 @@ config ARM64_EPAN
if the cpu does not implement the feature.
endmenu # "ARMv8.7 architectural features"

config ARM64_SVE
menu "ARMv8.8 architectural features"

config ARM64_HAFT
bool "Support for Hardware managed Access Flag for Table Descriptors"
depends on ARM64_HW_AFDBM
default y
help
The ARMv8.9/ARMv9.5 introduces the feature Hardware managed Access
Flag for Table descriptors. When enabled an architectural executed
memory access will update the Access Flag in each Table descriptor
which is accessed during the translation table walk and for which
the Access Flag is 0. The Access Flag of the Table descriptor use
the same bit of PTE_AF.

The feature will only be enabled if all the CPUs in the system
support this feature. If unsure, say Y.

endmenu # "ARMv8.8 architectural features"

bool "ARM Scalable Vector Extension support"
default y
help
Expand Down
9 changes: 8 additions & 1 deletion arch/arm64/include/asm/cpufeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <asm/hwcap.h>
#include <asm/sysreg.h>

#define MAX_CPU_FEATURES 128
#define MAX_CPU_FEATURES 192
#define cpu_feature(x) KERNEL_HWCAP_ ## x

#define ARM64_SW_FEATURE_OVERRIDE_NOKASLR 0
Expand Down Expand Up @@ -434,6 +434,7 @@ void cpu_set_feature(unsigned int num);
bool cpu_have_feature(unsigned int num);
unsigned long cpu_get_elf_hwcap(void);
unsigned long cpu_get_elf_hwcap2(void);
unsigned long cpu_get_elf_hwcap3(void);

#define cpu_set_named_feature(name) cpu_set_feature(cpu_feature(name))
#define cpu_have_named_feature(name) cpu_have_feature(cpu_feature(name))
Expand Down Expand Up @@ -822,6 +823,12 @@ static inline bool system_supports_lpa2(void)
return cpus_have_final_cap(ARM64_HAS_LPA2);
}

static inline bool system_supports_haft(void)
{
return IS_ENABLED(CONFIG_ARM64_HAFT) &&
cpus_have_final_cap(ARM64_HAFT);
}

int do_emulate_mrs(struct pt_regs *regs, u32 sys_reg, u32 rt);
bool try_emulate_mrs(struct pt_regs *regs, u32 isn);

Expand Down
11 changes: 11 additions & 0 deletions arch/arm64/include/asm/el2_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
ubfx x0, x0, #ID_AA64MMFR1_EL1_HCX_SHIFT, #4
cbz x0, .Lskip_hcrx_\@
mov_q x0, HCRX_HOST_FLAGS

/* Enable LS64, LS64_V if supported */
mrs_s x1, SYS_ID_AA64ISAR1_EL1
ubfx x1, x1, #ID_AA64ISAR1_EL1_LS64_SHIFT, #4
cbz x1, .Lset_hcrx_\@
orr x0, x0, #HCRX_EL2_EnALS
cmp x1, #ID_AA64ISAR1_EL1_LS64_LS64_V
b.lt .Lset_hcrx_\@
orr x0, x0, #HCRX_EL2_EnASR

.Lset_hcrx_\@ :
msr_s SYS_HCRX_EL2, x0
.Lskip_hcrx_\@:
.endm
Expand Down
7 changes: 6 additions & 1 deletion arch/arm64/include/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,22 @@
#define KERNEL_HWCAP_MOPS __khwcap2_feature(MOPS)
#define KERNEL_HWCAP_HBC __khwcap2_feature(HBC)

#define __khwcap3_feature(x) (const_ilog2(HWCAP3_ ## x) + 128)
#define KERNEL_HWCAP_LS64 __khwcap3_feature(LS64)
#define KERNEL_HWCAP_LS64_V __khwcap3_feature(LS64_V)

/*
* This yields a mask that user programs can use to figure out what
* instruction set this cpu supports.
*/
#define ELF_HWCAP cpu_get_elf_hwcap()
#define ELF_HWCAP2 cpu_get_elf_hwcap2()
#define ELF_HWCAP3 cpu_get_elf_hwcap3()

#ifdef CONFIG_COMPAT
#define COMPAT_ELF_HWCAP (compat_elf_hwcap)
#define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2)
extern unsigned int compat_elf_hwcap, compat_elf_hwcap2;
extern unsigned int compat_elf_hwcap, compat_elf_hwcap2, compat_elf_hwcap3;
#endif

enum {
Expand Down
10 changes: 6 additions & 4 deletions arch/arm64/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static inline void __pud_populate(pud_t *pudp, phys_addr_t pmdp, pudval_t prot)

static inline void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmdp)
{
pudval_t pudval = PUD_TYPE_TABLE;
pudval_t pudval = PUD_TYPE_TABLE | PUD_TABLE_AF;

pudval |= (mm == &init_mm) ? PUD_TABLE_UXN : PUD_TABLE_PXN;
__pud_populate(pudp, __pa(pmdp), pudval);
Expand All @@ -48,7 +48,7 @@ static inline void __p4d_populate(p4d_t *p4dp, phys_addr_t pudp, p4dval_t prot)

static inline void p4d_populate(struct mm_struct *mm, p4d_t *p4dp, pud_t *pudp)
{
p4dval_t p4dval = P4D_TYPE_TABLE;
p4dval_t p4dval = P4D_TYPE_TABLE | P4D_TABLE_AF;

p4dval |= (mm == &init_mm) ? P4D_TABLE_UXN : P4D_TABLE_PXN;
__p4d_populate(p4dp, __pa(pudp), p4dval);
Expand Down Expand Up @@ -77,14 +77,16 @@ static inline void
pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
{
VM_BUG_ON(mm && mm != &init_mm);
__pmd_populate(pmdp, __pa(ptep), PMD_TYPE_TABLE | PMD_TABLE_UXN);
__pmd_populate(pmdp, __pa(ptep),
PMD_TYPE_TABLE | PMD_TABLE_AF | PMD_TABLE_UXN);
}

static inline void
pmd_populate(struct mm_struct *mm, pmd_t *pmdp, pgtable_t ptep)
{
VM_BUG_ON(mm == &init_mm);
__pmd_populate(pmdp, page_to_phys(ptep), PMD_TYPE_TABLE | PMD_TABLE_PXN);
__pmd_populate(pmdp, page_to_phys(ptep),
PMD_TYPE_TABLE | PMD_TABLE_AF | PMD_TABLE_PXN);
}

#endif
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/pgtable-hwdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#define P4D_TYPE_MASK (_AT(p4dval_t, 3) << 0)
#define P4D_TYPE_SECT (_AT(p4dval_t, 1) << 0)
#define P4D_SECT_RDONLY (_AT(p4dval_t, 1) << 7) /* AP[2] */
#define P4D_TABLE_AF (_AT(p4dval_t, 1) << 10) /* Ignored if no FEAT_HAFT */
#define P4D_TABLE_PXN (_AT(p4dval_t, 1) << 59)
#define P4D_TABLE_UXN (_AT(p4dval_t, 1) << 60)

Expand All @@ -105,6 +106,7 @@
#define PUD_TYPE_MASK (_AT(pudval_t, 3) << 0)
#define PUD_TYPE_SECT (_AT(pudval_t, 1) << 0)
#define PUD_SECT_RDONLY (_AT(pudval_t, 1) << 7) /* AP[2] */
#define PUD_TABLE_AF (_AT(pudval_t, 1) << 10) /* Ignored if no FEAT_HAFT */
#define PUD_TABLE_PXN (_AT(pudval_t, 1) << 59)
#define PUD_TABLE_UXN (_AT(pudval_t, 1) << 60)

Expand All @@ -115,6 +117,7 @@
#define PMD_TYPE_TABLE (_AT(pmdval_t, 3) << 0)
#define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0)
#define PMD_TABLE_BIT (_AT(pmdval_t, 1) << 1)
#define PMD_TABLE_AF (_AT(pmdval_t, 1) << 10) /* Ignored if no FEAT_HAFT */

/*
* Section
Expand Down
10 changes: 8 additions & 2 deletions arch/arm64/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,15 +931,17 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,
return young;
}

#ifdef CONFIG_TRANSPARENT_HUGEPAGE
#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG)
#define __HAVE_ARCH_PMDP_TEST_AND_CLEAR_YOUNG
static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
unsigned long address,
pmd_t *pmdp)
{
/* Operation applies to PMD table entry only if FEAT_HAFT is enabled */
VM_WARN_ON(pmd_table(READ_ONCE(*pmdp)) && !system_supports_haft());
return ptep_test_and_clear_young(vma, address, (pte_t *)pmdp);
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG */

#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
Expand Down Expand Up @@ -1097,6 +1099,10 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf,
*/
#define arch_has_hw_pte_young cpu_has_hw_af

#ifdef CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG
#define arch_has_hw_nonleaf_pmd_young system_supports_haft
#endif

/*
* Experimentally, it's cheap to set the access flag in hardware and we
* benefit from prefaulting mappings as 'old' to start with.
Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/include/uapi/asm/hwcap.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,10 @@
#define HWCAP2_MOPS (1UL << 43)
#define HWCAP2_HBC (1UL << 44)

/*
* HWCAP3 flags - for AT_HWCAP3
*/
#define HWCAP3_LS64 (1UL << 0)
#define HWCAP3_LS64_V (1UL << 1)

#endif /* _UAPI__ASM_HWCAP_H */
Loading