Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3683671rwb; Fri, 30 Sep 2022 07:03:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kEsT8fjyXaBsZfMVt2y2uzpjPt4F2IdKWGdun6neIKYFk5gqMFF50toGBBm5tK93HkCmd X-Received: by 2002:a05:6402:4493:b0:451:141d:3231 with SMTP id er19-20020a056402449300b00451141d3231mr7881568edb.318.1664546602682; Fri, 30 Sep 2022 07:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664546602; cv=none; d=google.com; s=arc-20160816; b=lEJDGNf3+KQSagqgRSaYJR/sDMqZ5VPDI313mXdgQJowhREptSsHoN1XqF77pcJwpc YgVC9GUin5Zi47A4XI8lOyAkjv9ieC64ZhhS5ysDNuYxWkeYHFIuH/qCqgvsBesGTYF0 jNtSU8mrCIDg6n27OWBssQzXeAu+VhXlbm6fdOSnUdV+HH6CpjmAQOlqo3QOjbMuoUpw z4qj7Twj4oJuv1JdxwF32/gLtygHgItgdj3B4IFzZU/+RS1Yiyk2ZiWcCNE2T5u28f39 nk7YUzBDt4FUInzRLu66d3WsA7PAygJhGaMLhEwu6E7wBo8iD7keYWg/y1U8QRCCcfN9 Didg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lp7hZW6fL4gPkdYmrpDiNF39G6gXzVijhgQhSUy+zh0=; b=UqL2Kyzej8/xvuZzRFHErFeA3ekP/Gya8IALQKKvXI0r8iHXjvYnJnU01ZaU5O6HyW b0oGo84wbITQebeMuA5FAc8DCXSo13lw6hgChvB/JMb9jdb0bBnjIFP0rrqoojxap1An bLgvbbbJR6S/n5KMVz+p7tmlin/L/Z8/o60zwU95WW+jHc1DX8jZCt53q5XsfgE2d5R9 bHcDjtnWQmxaZk+giawwrXYlBCLwx8jJYnSYqPtmAG+sgccz3Be+ZUUBqZgjXAzw5VZO WvVeXmsCQ2Wj6WX4cpl0Dz2Ha45Lp9elTleA1k4u/+DbkdfYvKy4YBtjTUw4/PU8CJbe Pimg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Pcn8be89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my7-20020a1709065a4700b0078773b9fe48si1564011ejc.855.2022.09.30.07.02.48; Fri, 30 Sep 2022 07:03:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Pcn8be89; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231300AbiI3N0K (ORCPT + 99 others); Fri, 30 Sep 2022 09:26:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbiI3N0H (ORCPT ); Fri, 30 Sep 2022 09:26:07 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DCF818B5CE for ; Fri, 30 Sep 2022 06:26:04 -0700 (PDT) Received: from zn.tnic (p200300ea9733e70a329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e70a:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C59271EC04DA; Fri, 30 Sep 2022 15:25:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1664544357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=lp7hZW6fL4gPkdYmrpDiNF39G6gXzVijhgQhSUy+zh0=; b=Pcn8be89+VAVOJS0cfzE1/U0IVaPLFkQ9HorTbZuSeS7l+DUWA95HnMsYl1o+vezldXhfz TB0JHqgFCWgM/ZYj95/+5sLKmuOcoWlHI9gq12TYtXWDZ3l76bqJRXdlXEfI0otvyjLbmv WJws7lZZcATn54MEu2WjdWfl5QYuZK0= Date: Fri, 30 Sep 2022 15:25:53 +0200 From: Borislav Petkov To: Juergen Gross Cc: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" Subject: Re: [PATCH v3 08/10] x86/mtrr: let cache_aps_delayed_init replace mtrr_aps_delayed_init Message-ID: References: <24088a15-50a1-f818-8c3e-6010925bffbf@suse.com> <6d37c273-423c-fdce-c140-e5b90d723b9e@suse.com> <2e843e28-2836-910e-bcd8-f35872adf21a@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2e843e28-2836-910e-bcd8-f35872adf21a@suse.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 30, 2022 at 03:11:07PM +0200, Juergen Gross wrote: > Yes, this can be done. It would practically have to be the first one just > after CPUHP_BRINGUP_CPU. Right. > The question is whether we really want to call the MTRR/PAT initialization > on hotplugged cpus only after enabling interrupts. Note that the callbacks > are activated only at the end of start_secondary(), while today MTRR/PAT > initialization is called some time earlier by: > > start_secondary() > smp_callin() > smp_store_cpu_info() > identify_secondary_cpu() > mtrr_ap_init() > > I don't think this is a real problem, but I wanted to mention it. Yep, I saw that too but I don't think there will be a problem either. I mean, it should be early enough as you point out not to need proper MTRR/PAT settings yet. But we'll make sure we test this real good too. > The next question would be, why MTRR/PAT init should be special > (meaning: why are all the other functions called that early not > realized via callbacks)? Well, our init code is crazy. Frankly, I don't see why not more of the "init stuff on the freshly hotplugged CPU" work is done there... > Is it just because of the special handling during boot/resume? ... unless this is the case, ofc. Right. > It might be worth a discussion whether there shouldn't be a special group > of callbacks activated BEFORE interrupts are being enabled. That's a good question. /me writes it down to ask tglx when he gets back. I mean, that early I don't think it matters whether IRQs are enabled or not. But this'll need to be audited on a case by case basis. As I said, our boot code is nuts with stuff bolted on everywhere for whatever reasons. > Thanks. I'll write a patch for that. Thanks too. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette