From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F6DDC433E0 for ; Wed, 6 Jan 2021 09:05:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23BDB2310B for ; Wed, 6 Jan 2021 09:05:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23BDB2310B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NS9DPp8BsSTb73nQ3wR7k2bF0CKbWKbEQ2yB4Ha8jhY=; b=I0K2n2JbTvZrfUb4Dwosafvbm Q9a60fk/4i8zYjIiUx6S5j4IAC+Z0TlZJZx6T7xphLobtHNositiFTx75Z3F8+d/PziH+Iut7oUjP zB9n2VQjsWxeC4wnvCSsRgSJtXyoK5LQf7ox6HH2RVg1A7iyxOJBMX9KnicAzJC5+ifVFE+Vm2ZdD dC5LqkZ0l/GVJG2jwZXJexeMQlsx9VAQey41fMVH7LRdBub4EloU6FfZ5pTWsvJwubv1sbvTMRX5e fCWYeFqQi2dn3iSGiawgE3EfdV3rNtf2Pl8ZDZc0JY2bdb4HbmxdGs00yPetynzTm2g3hpC/KaHj4 41a3Zrcjw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kx4jT-0007Fc-6p; Wed, 06 Jan 2021 09:03:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kx4jP-0007FD-AW for linux-arm-kernel@lists.infradead.org; Wed, 06 Jan 2021 09:03:52 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 29FDA2310A; Wed, 6 Jan 2021 09:03:50 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kx4jM-005bCS-0P; Wed, 06 Jan 2021 09:03:48 +0000 MIME-Version: 1.0 Date: Wed, 06 Jan 2021 09:03:47 +0000 From: Marc Zyngier To: Jing Zhang Subject: Re: [PATCH v2 11/17] arm64: cpufeature: Add an early command-line cpufeature override facility In-Reply-To: References: <20210104135011.2063104-1-maz@kernel.org> <20210104135011.2063104-12-maz@kernel.org> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <90dccfccbfdfa8abb05716c2572af9ca@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: jingzhangos@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kernel-team@android.com, catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210106_040351_463339_585431BF X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, Catalin Marinas , Ard Biesheuvel , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-01-06 02:16, Jing Zhang wrote: > On Mon, Jan 4, 2021 at 8:20 AM Marc Zyngier wrote: [...] >> +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