mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
aarch64 ID_AA64PFR0_EL1.SVE check
This commit is contained in:
@@ -14739,6 +14739,8 @@ The Linux kernel shows `/proc/cpuinfo` compatibility as `sve`.
|
|||||||
|
|
||||||
Official spec: https://developer.arm.com/docs/100891/latest/sve-overview/introducing-sve
|
Official spec: https://developer.arm.com/docs/100891/latest/sve-overview/introducing-sve
|
||||||
|
|
||||||
|
SVE support is indicated by `ID_AA64PFR0_EL1.SVE` which is dumped from link:baremetal/arch/aarch64/dump_regs.c[].
|
||||||
|
|
||||||
===== SVE bibliography
|
===== SVE bibliography
|
||||||
|
|
||||||
* https://www.rico.cat/files/ICS18-gem5-sve-tutorial.pdf step by step of a complete code execution examples, the best initial tutorial so far
|
* https://www.rico.cat/files/ICS18-gem5-sve-tutorial.pdf step by step of a complete code execution examples, the best initial tutorial so far
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ int main(void) {
|
|||||||
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-paging */
|
/* https://cirosantilli.com/linux-kernel-module-cheat#arm-paging */
|
||||||
printf("SCTLR_EL1.M 0x%" PRIX32 "\n", (sctlr_el1 >> 0) & 1);
|
printf("SCTLR_EL1.M 0x%" PRIX32 "\n", (sctlr_el1 >> 0) & 1);
|
||||||
|
|
||||||
|
uint64_t id_aa64pfr0_el1;
|
||||||
|
__asm__ ("mrs %0, id_aa64pfr0_el1" : "=r" (id_aa64pfr0_el1) : :);
|
||||||
|
printf("ID_AA64PFR0_EL1 0x%" PRIX64 "\n", id_aa64pfr0_el1);
|
||||||
|
printf("ID_AA64PFR0_EL1.SVE 0x%" PRIX64 "\n", (id_aa64pfr0_el1 >> 32) & 0xF);
|
||||||
|
|
||||||
uint64_t CurrentEL;
|
uint64_t CurrentEL;
|
||||||
__asm__ ("mrs %0, CurrentEL;" : "=r" (CurrentEL) : :);
|
__asm__ ("mrs %0, CurrentEL;" : "=r" (CurrentEL) : :);
|
||||||
printf("CurrentEL 0x%" PRIX64 "\n", CurrentEL);
|
printf("CurrentEL 0x%" PRIX64 "\n", CurrentEL);
|
||||||
|
|||||||
Reference in New Issue
Block a user