From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx2.suse.de ([195.135.220.15]) by Galois.linutronix.de with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1f9a3h-0001oq-Mx for speck@linutronix.de; Fri, 20 Apr 2018 19:42:54 +0200 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3A09AAB34 for ; Fri, 20 Apr 2018 17:42:48 +0000 (UTC) Date: Fri, 20 Apr 2018 19:42:42 +0200 From: Borislav Petkov Subject: [MODERATED] Re: [patch 07/11] [PATCH v2 07/10] Linux Patch #7 Message-ID: <20180420174242.GO13977@pd.tnic> References: <20180420022613.270943302@localhost.localdomain> MIME-Version: 1.0 In-Reply-To: <20180420022613.270943302@localhost.localdomain> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Thu, Apr 19, 2018 at 10:25:47PM -0400, speck for konrad.wilk_at_oracle.com= wrote: > x86/cpu: Add fix_this_cpu to be called _after_ check_bugs and at BSP. >=20 > We do a lot of things in the check_bugs() - one of the first > things we do is identify_boot_cpu() which calls identify_cpu() > which calls this_cpu->init. >=20 > Once identify_boot_cpu() is done _then_ it walks through the > spectre_v2_select_mitigation() and alternative_assembler(). >=20 > If there are some CPU fix ups _after_ spectre_v2 is done > we can't activate those on the BSP as we have already > called 'this_cpu->init'. Hence add a new function to > fixup CPUs. Konrad, this is still unnecessary and adding superfluous complexity to an already crazy early boot path. Let me clarify the flow: First you are on the BSP: setup_arch() |-> early_cpu_init |-> early_identify_cpu |-> cpu_set_bug_bits now you have all the X86_BUG bits set so that you can test them in the functions later. Then, you're still on the BSP and can do check_bugs() with all cmdline options picking apart etc etc. setup_arch() |-> check_bugs() |-> ssb_select_mitigation() |-> identify_boot_cpu() <--- HERE you call ->c_init() on the BSP |-> spectre_v2_select_mitigation In that order! So, all you wanna do works without adding this new function pointer. --=20 Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, HR= B 21284 (AG N=C3=BCrnberg) --=20