arm64: mops: allow disabling MOPS from the kernel command line
authorKristina Martsenko <kristina.martsenko@arm.com>
Tue, 9 May 2023 14:22:34 +0000 (15:22 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 5 Jun 2023 16:05:42 +0000 (17:05 +0100)
Make it possible to disable the MOPS extension at runtime using the
kernel command line. This can be useful for testing or working around
hardware issues. For example it could be used to test new memory copy
routines that do not use MOPS instructions (e.g. from Arm Optimized
Routines).

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Link: https://lore.kernel.org/r/20230509142235.3284028-11-kristina.martsenko@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Documentation/admin-guide/kernel-parameters.txt
arch/arm64/kernel/idreg-override.c

index 9e5bab29685ff0534fe82714dda5e20804c38ead..e01fbfd78ae95e0771ba8a769eff22b338c76a95 100644 (file)
        arm64.nosme     [ARM64] Unconditionally disable Scalable Matrix
                        Extension support
 
+       arm64.nomops    [ARM64] Unconditionally disable Memory Copy and Memory
+                       Set instructions support
+
        ataflop=        [HW,M68k]
 
        atarimouse=     [HW,MOUSE] Atari Mouse
index 370ab84fd06e2eaca9a057ec52d2bd94b50df5d3..8439248c21d327d0f216a154ab59fa80715d9d77 100644 (file)
@@ -123,6 +123,7 @@ static const struct ftr_set_desc isar2 __initconst = {
        .fields         = {
                FIELD("gpa3", ID_AA64ISAR2_EL1_GPA3_SHIFT, NULL),
                FIELD("apa3", ID_AA64ISAR2_EL1_APA3_SHIFT, NULL),
+               FIELD("mops", ID_AA64ISAR2_EL1_MOPS_SHIFT, NULL),
                {}
        },
 };
@@ -174,6 +175,7 @@ static const struct {
          "id_aa64isar1.gpi=0 id_aa64isar1.gpa=0 "
          "id_aa64isar1.api=0 id_aa64isar1.apa=0 "
          "id_aa64isar2.gpa3=0 id_aa64isar2.apa3=0"        },
+       { "arm64.nomops",               "id_aa64isar2.mops=0" },
        { "arm64.nomte",                "id_aa64pfr1.mte=0" },
        { "nokaslr",                    "kaslr.disabled=1" },
 };