Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6333147rwb; Tue, 9 Aug 2022 13:21:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR6X408N/KS6yqUipV9aaSQv97foIYLxapZs+ILk/kJG0EofHkPHoLayXufpUKnQBoGvQYKS X-Received: by 2002:a63:8442:0:b0:41b:f6a3:7805 with SMTP id k63-20020a638442000000b0041bf6a37805mr20272205pgd.569.1660076499683; Tue, 09 Aug 2022 13:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660076499; cv=none; d=google.com; s=arc-20160816; b=BAcOp5O9k5Zgt1PpbFbszpe+nAKRIm4zHebZFogB2Cq9uzpfk5MamJNxkepMTmilUZ +E8M/wF8jU6/PKjWgkgjuXrrjkmsahRTGKUuG1r6EWO5WOsUXHZg6lJyDfgt0jIot8/S 7dfqq4Mvf2OmWcwYCDUQccMKqTPfLBNN38XpWM6OaAC+Dc28fFKwuumKBC/ZKr1UenxX elEicw5JGD6jDcpFP3gimUg/AnznRNO66vMP8ioaIWh8x+Q8JArP00kVK29bu3xp2xs0 FH4RP7Ww3/BwdyuLypBE8dr0huIzAxahyIzq+Fjc09amswA3nqx96C8oAVvopFK54bXb b5/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=BBTwmz2rPJKGWSSwRXS8i02OixhR40SD6KCPKUvKk6w=; b=e6+P80qnWwv8HU6FvwWhtZeh7ObEDRFer2UxQn/HW1J0mVXU599ctxCyr2rPbFpccP JCy61juXcntmhpYsYsUF/q9Tjgf3ZrU5zgcG0eLaWQ1LuYcxC4TTDKwNQz/jCBFMjSQa hNhJdgMYd2W7QX8z5eEKlvg4NxegXKbZzImBFa1dRmC55wp7ZW/bAPTzdVE5YdexYkxK 22/ZnPGw8rDVro7nLloG85fVM8avfQkhKEppAeVkyyVxNcOvgeodQiI5RUHHxKDgNBs0 czF6+FDhwMS8aZnk7dVm+Z6GO0ez5H48OLpiQ+el84n164Ms+hzs6WWZlTbBf6qa8zrc eihQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ckejNwe6; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a635847000000b004128ed0ebecsi1137163pgm.568.2022.08.09.13.21.25; Tue, 09 Aug 2022 13:21:39 -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=@linutronix.de header.s=2020 header.b=ckejNwe6; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238784AbiHIUGw (ORCPT + 99 others); Tue, 9 Aug 2022 16:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346396AbiHIUGf (ORCPT ); Tue, 9 Aug 2022 16:06:35 -0400 Received: from galois.linutronix.de (unknown [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65C931EAE0 for ; Tue, 9 Aug 2022 13:06:33 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1660075577; 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: in-reply-to:in-reply-to:references:references; bh=BBTwmz2rPJKGWSSwRXS8i02OixhR40SD6KCPKUvKk6w=; b=ckejNwe6FrsRxTbgsNJCUykONduBpIZjiQQfSLhxwAXffLAEetoPKttRSd6jAq/c8o+bkB mAe9FjP2sly+3UIusQYt4EBvNkY+ZQdspmHSS0hLjD250yTASIoQ5Cbphguj2iCwkbHgho UjSzWxuCrZpZ9AIIiqiRQoz36bjJtLP1XYLisiLazoibEjUGcrjyHSDMxdOxYEdPJ9fVKL HVY4c655ui4F9/KTmYIgSu1bnHIZk0Qp+GXt8p+edWXO+KY3ptM9uI2LURUR2GHMU0nrnL 0Hxn+pbiE3zc+HQqeQlWnXIlEypJXQ6eSWhbHvyfglceXdQoPxHIGzkSO7opMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1660075577; 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: in-reply-to:in-reply-to:references:references; bh=BBTwmz2rPJKGWSSwRXS8i02OixhR40SD6KCPKUvKk6w=; b=SFHyKU9+zBxwEiZ7g/IG8qmcCPxn50vJ0Ydza45N8GGb5LeELXxppZnQ/btRi/h7+wVS9G Ms1IW5noLW7Zs0Cg== To: Borislav Petkov , Ingo Molnar Cc: Ira Weiny , Andy Lutomirski , Dave Hansen , Rik van Riel , x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 5/5] x86/entry: Store CPU info on exception entry In-Reply-To: References: <20220805173009.3128098-1-ira.weiny@intel.com> <20220805173009.3128098-6-ira.weiny@intel.com> <5d62c1d0-7425-d5bb-ecb5-1dc3b4d7d245@intel.com> Date: Tue, 09 Aug 2022 22:06:16 +0200 Message-ID: <87o7wtqj0n.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RDNS_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, Aug 08 2022 at 14:01, Borislav Petkov wrote: > On Mon, Aug 08, 2022 at 01:03:24PM +0200, Ingo Molnar wrote: >> I'd like to hear what Andy Lutomirski thinks about the notion that >> "2 instructions don't matter at all" ... >> >> Especially since it's now 4 instructions: > > He wasn't opposed to it when we talked on IRC last week. > >> ... 4 instructions in the exception path is a non-trivial impact. > > How do I measure this "impact"? > > Hell, we recently added retbleed - and IBRS especially on Intel - on > the entry path which is whopping 30% perf impact in some cases. And > now we're arguing about a handful of insns. I'm sceptical they'll be > anything else but "in-the-noise" in any sensible workload. I'm not worried about the 4 instructions per se, but storing the CPU number on every exception and interrupt entry just to use it in exactly one place, i.e. the user mode #PF handler, does not make any sense at all. Get the CPU number before enabling interrupts and hand it in to the bad area variants. I know that the aux reg code is required for other things, but just for this it's complete overkill. Thanks, tglx