Re: [PATCH v2 11/17] arm64: cpufeature: Add an early command-line cpufeature override facility
From: Marc Zyngier <maz@kernel.org>
Date: 2021-01-06 09:05:57
Also in:
kvmarm
On 2021-01-06 02:16, Jing Zhang wrote:
On Mon, Jan 4, 2021 at 8:20 AM Marc Zyngier [off-list ref] wrote:
[...]
quoted
+static __init void parse_cmdline(void) +{ + if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) { + const u8 *prop; + void *fdt; + int node; + + fdt = get_early_fdt_ptr(); + if (!fdt) + goto out; + + node = fdt_path_offset(fdt, "/chosen"); + if (node < 0) + goto out; + + prop = fdt_getprop(fdt, node, "bootargs", NULL); + if (!prop) + goto out; + + match_options(prop); + + if (!IS_ENABLED(CONFIG_CMDLINE_EXTEND)) + return; + } + +out: + match_options(CONFIG_CMDLINE); +} + +void __init init_shadow_regs(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(regs); i++) { + if (regs[i]->val) + *regs[i]->val = 0; + if (regs[i]->mask) + *regs[i]->mask = 0; + } + + parse_cmdline(); + + for (i = 0; i < ARRAY_SIZE(regs); i++) { + if (regs[i]->val) + __flush_dcache_area(regs[i]->val, sizeof(*regs[i]->val)); + if (regs[i]->mask) + __flush_dcache_area(regs[i]->mask, sizeof(*regs[i]->mask)); + }Could you shed some light on the usage of __flush_dcache_area here? Thanks.
Some of this data gets used by secondary CPUs when they have their
MMU off. If we don't clean to the PoC, they will miss the updates
and things will randomly fail.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel