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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88767C433FE for ; Mon, 11 Apr 2022 11:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243838AbiDKLNg (ORCPT ); Mon, 11 Apr 2022 07:13:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345873AbiDKLKr (ORCPT ); Mon, 11 Apr 2022 07:10:47 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789A845535; Mon, 11 Apr 2022 04:07:10 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1649675228; 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=ID9+1If3O1I5C3aUxVBIdshKrXYHLqFXQhU3D8qfgBk=; b=BWe/fVhB+hrDqGIsQVN2b1au9xQUDzrA1BjDP8e7Uro0Dk9kmI8GekP06spt1vgNs+8dhY XUjE9bJyradtliMB1dBmu9RHOpfLUGUohKh8bFcX2M3MVB8y3lgz/UhobzYiH3zlSPMUAZ 9cxKfaqHD6ZGWhcrByB3KaafVa9gsQGORVEtUQpnXS7HbC19d5DYfh58Iu+8goW7K53bJk SWE7VH1lcqZPhmIZaMBLqgPEdlCPkV3U3yI0gmg84ICBkeU9RRz6fHBunvqJTYtVx2QLFh yaUJO/CYuYEq5OtFmKK779tuHwFkLBm23Effk2gk83Ob20gRVpa3EfcE/9TBqg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1649675228; 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=ID9+1If3O1I5C3aUxVBIdshKrXYHLqFXQhU3D8qfgBk=; b=41PicdIAirKVLp5CLX6NroganBHe4qSH7VB1GdOqBQR/Evh1Ubz1qNGRskL+zkwDGs2Y7u yR54zgYpJXCexJAw== To: Pete Swain Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , John Stultz , Stephen Boyd , "Maciej W. Rozycki" , Johan Hovold , Feng Tang , "Paul E. McKenney" , Juergen Gross , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Pete Swain Subject: Re: [PATCH 2/2] timers: retpoline mitigation for time funcs In-Reply-To: <87r165gmoz.ffs@tglx> References: <20220218221820.950118-1-swine@google.com> <20220218221820.950118-2-swine@google.com> <87r165gmoz.ffs@tglx> Date: Mon, 11 Apr 2022 13:07:08 +0200 Message-ID: <87mtgrg9pf.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Sun, Apr 10 2022 at 14:14, Thomas Gleixner wrote: > On Fri, Feb 18 2022 at 14:18, Pete Swain wrote: >> @@ -245,7 +245,8 @@ static int clockevents_program_min_delta(struct clock_event_device *dev) >> >> dev->retries++; >> clc = ((unsigned long long) delta * dev->mult) >> dev->shift; >> - if (dev->set_next_event((unsigned long) clc, dev) == 0) >> + if (INDIRECT_CALL_1(dev->set_next_event, lapic_next_deadline, >> + (unsigned long) clc, dev) == 0) > > No. We are not sprinkling x86'isms into generic code. Even if we would do that, then this is completely useless. The hotpath function is clockevents_program_event() and not clockevents_program_min_delta(). The latter is invoked from the former if the to be programmed event is in the past _and_ the force argument is set, i.e. in 0.1% of the invocations of clockevents_program_event(), which itself has an indirect call to dev->set_next_event(). If your profiles show clockevents_program_min_delta() as dominant, then there is something massively wrong with your kernel. Thanks, tglx