Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp221557ybt; Mon, 6 Jul 2020 07:49:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwidZt6v6/21nRT0/FCxoc38yI0zgzJJu+anCfK0Sz5lWcOkmUY4nr/uoiHgWw5z8aLnKpI X-Received: by 2002:aa7:c991:: with SMTP id c17mr48659888edt.278.1594046993415; Mon, 06 Jul 2020 07:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594046993; cv=none; d=google.com; s=arc-20160816; b=EELb8Hrar4c0MgGfI3rSuoTfICrP7wkuTz0/QXP/GAfyJalsEsedSGZUkZ0LREeYwS U5On/3cJ16GsX6dXjzqQe3QTYofYXz/ZRxTrh6U0XAOVNZkuJtoiAItCDzqEOs0TXnVv LL1J9UnaKdgQLo9XOtya4BU9GvmO/VI+37PSBYzOATRq64Y9eLDnyXSOMbch1u1+CsWS SBe1D63C+kLn1XPtA6DFAbGLhUPKGuzzXaGZBEFge4sk/h8KkADc2iFjGWnsp1xmTnIi W2H9PyU9V3BB9g8RnHXjTDNG1VBEW5XXYVafhJ/EzzyY5MnRtDVktEQIwyMgRdHqyhRh YPUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=LraJN8c9SSrjQA7IMqbSzEalKGMV2AcQF0lddX0uZjw=; b=Ee75of5O0YLqHgvUhYh7CfovKfZFEv9GC6zVA6SvJhRppa0x5CWIoH3DCikXadDrRs vrCPHeC139cVge7RlnUaxuPkkY0XePCrB6ozSFmFmTsKx+p0YVENtJYGl2tbikqs65WG cNmgvU53AXkCCvm8b15/G+VYMhP+8eBzMim7rGWHzylVb0n8idjhPtvx7QWY07/wseBG UVeAG8mP0sueNQ7TTo1DeQK42DjFVNQ4yhvLBfkq4rWyR+nLe64dlkpKtZL7ALQstVNt EwiEVYey8Ka9nBobWK4ijK5i+Vro7EquDqWsnTXPfh97L47Xa0TuPnf9gYwK2s9Gm9Rg vVFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pNYHdXo3; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si13364337ejf.344.2020.07.06.07.49.30; Mon, 06 Jul 2020 07:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=pNYHdXo3; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729224AbgGFOqg (ORCPT + 99 others); Mon, 6 Jul 2020 10:46:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729140AbgGFOqg (ORCPT ); Mon, 6 Jul 2020 10:46:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E58E1C061755 for ; Mon, 6 Jul 2020 07:46:35 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1594046794; 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=LraJN8c9SSrjQA7IMqbSzEalKGMV2AcQF0lddX0uZjw=; b=pNYHdXo3uo06jVPYTs7f38ecXnHKAST/Jw10LKSmqNvuCrML0UwO0y/15jWeQnhradofZd +Nl/qgtAwILnB8NoKFCKisXkLWR7BtpP4mHV2ya3lIgKubzSrz7Nl8IuBnTTW43mC3De5h +mfn0kiSWX9QdJmpBvuTv2IXRX5UwFq9Fo8/FiakmA0lMaaDJZs0GZv3qrxznNXwUDqvz+ wWpRu4VbbDA8w14w2X6A/nX73TXoIWs/OfLMGBjzWJKw5AK5veuHSrd/BObPv/AE9gDGes ax0bNOOZeDA78EEFKD5D8YRNG2L2FCKcd8ojCoHH8PpKzaXP07MyjIc9z0HaEQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1594046794; 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=LraJN8c9SSrjQA7IMqbSzEalKGMV2AcQF0lddX0uZjw=; b=rhK/PrOrssg2qs4+fJwuPBKS2Jj0jnIlqtOcPI9cYaIDbhhyDfoo79VcXe6LobJDT3JFjY E3Gy6fH4LFPHTIAw== To: Mihai Carabas , linux-kernel@vger.kernel.org Cc: mingo@redhat.com, bp@alien8.de, x86@kernel.org, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, Mihai Carabas Subject: Re: [PATCH RFC 3/7] x86: kernel: cpu: bugs.c: modify static_cpu_has to boot_cpu_has In-Reply-To: <1593703107-8852-4-git-send-email-mihai.carabas@oracle.com> References: <1593703107-8852-1-git-send-email-mihai.carabas@oracle.com> <1593703107-8852-4-git-send-email-mihai.carabas@oracle.com> Date: Mon, 06 Jul 2020 16:46:33 +0200 Message-ID: <87tuykr99y.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mihai Carabas writes: > The usage of static_cpu_has in bugs.c file is counter-productive > since the code is executed once but there is extra effort to patch > it and keep alternatives in a special section --- so there is both > space and time cost. > > Quote from _static_cpu_has definition: > /* > * Static testing of CPU features. Used the same as boot_cpu_has(). It > * statically patches the target code for additional performance. Use > * static_cpu_has() only in fast paths, where every cycle counts. Which > * means that the boot_cpu_has() variant is already fast enough for the > * majority of cases and you should stick to using it as it is generally > * only two instructions: a RIP-relative MOV and a TEST. > */ > > There are two other places where static_cpu_has is used and might be > considered critical paths: __speculation_ctrl_update() and vmx_l1d_flush(). > > Given these facts, changing static_cpu_has to boot_cpu_has is done in > order to bypass alternative instructions which cannot be updated at runtime > for now. Not going to happen. We are not adding 4 conditionals to context switch just to support that late loading horrors. There are better ways to do that. Thanks, tglx