Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp166173pxf; Thu, 25 Mar 2021 00:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4QRi/fJTtAluk5qN856fY2wMjTunwng3MZeOpRQyBezgOGx+3Up/w11nIaIYXBJ7KCtIm X-Received: by 2002:a17:906:ae88:: with SMTP id md8mr7681761ejb.264.1616658604388; Thu, 25 Mar 2021 00:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616658604; cv=none; d=google.com; s=arc-20160816; b=n0XSzAwUi3Wihzzvnz/urkqcC02HE885l3hjLLPjYvS8Gv24kwZWQWJ4i61b3gJpea 2+D3f9K0FhanLRH341i4/FS5gJIYMyfSd0Azm2cf4Y/FKv3HDfYm73t86NqW+51ZDOf2 NGMy2cEr14QxLYkLR7qOefdydSiF5Bnfwe1CNptKlY1ThOM/Jr/fgPG0sIrE5u7l4osl Kd0Hj6RCmEAurqG2KTUvJhZ3SjWmAi9fOHIxqjBzPJRmEnDoGve5PseOQZ0zOdSMtR8A vIF1QmxRFdqB8WgNl6ukF68P2eq3EYpSnQxJiICjfjpOT7o1PFZLr4/SUYtUUV4vF4y9 wJlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YzayAXsK+tEk7+sF481Nzpsp/lQC6o5R6iaNfRI0SCw=; b=xA7f5LghukNYdvRVon85V9YVO43pzJ7Nl1eHEoockW3SfsxBEhmqS5QcuI/EbdtVhx g4yn3vXgvoKKu3btYVv9hNmMPz93uLX/L+K7mYEhzMLmhPEEyyLtPml+o4Qeg55/sbvk PFErx+P9REx7E0UW2OEGb+SJDJlwQjs/quqovTG/KCbPlT9dojuA4cW2dZTdYy0pJK9X T+oBjtxIUn+kA5pO9EgGX3keR/OfE0efU8d4NyvFnHivxJ4MJnonX60TlvJG489BkAt3 14R+4rTIoHxD57Rdp+rc8dqh9LyBm57qwddLKJJIVUHqLrBqfXW6TbkQQH+U0U3qPOJe 2ryQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rgBCa1ga; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si3667084edr.399.2021.03.25.00.49.41; Thu, 25 Mar 2021 00:50:04 -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=@kernel.org header.s=k20201202 header.b=rgBCa1ga; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229448AbhCYHqb (ORCPT + 99 others); Thu, 25 Mar 2021 03:46:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbhCYHqI (ORCPT ); Thu, 25 Mar 2021 03:46:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1EB0A61A1E for ; Thu, 25 Mar 2021 07:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616658368; bh=urWTServCtxCJX98E/tfAkTHjzvy+O9XuEj2LiVFDvw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rgBCa1gaQh/waTUpg6cJOQjfaY25azwtqiNzrmZzev/pr7XSMMDddyTizUNBe+k6B k4NcklOk8msBdTquCaAN9xpTh4NhVnr2DVpEMDEnm5NZKdvkqozwG25RmcUfCxKZwi 9dL4tysVARLTphmF/Ban9rntGoch7KME95OE/6hCF0KBevWIKVvfozBU/shAChQANv KHUhtnCdSpaB2zsXTg6SCx0TSwAjvd0hpjW8egWIP3+Im33mO5gxswmTJXR8V5lpIV w+I2B84gQcqgKuanrgFEplh3v3Kr6Uw1aCHAZ9kKnUJVSYCorKsSv7DS17bCT4aCPP U5xMuFN1+X6OQ== Received: by mail-oo1-f43.google.com with SMTP id j20-20020a4ad6d40000b02901b66fe8acd6so266295oot.7 for ; Thu, 25 Mar 2021 00:46:08 -0700 (PDT) X-Gm-Message-State: AOAM532Bjymf1Y2raaVb/6F/hcecW5XI5dTtVYh8zhAXb66g5KPG9Q4y mwHs8bhrFWkC1XkzQdsqgSHxaSx9958U5kI8iaA= X-Received: by 2002:a4a:395d:: with SMTP id x29mr5968148oog.41.1616658367226; Thu, 25 Mar 2021 00:46:07 -0700 (PDT) MIME-Version: 1.0 References: <0f4679d6-44a4-d045-f249-a9cffb126fd4@rasmusvillemoes.dk> <2b38d13f-9f90-b94b-7de4-c924696e6a9f@rasmusvillemoes.dk> <170687fb-13ef-e9b8-ac69-032202b344fe@rasmusvillemoes.dk> In-Reply-To: From: Ard Biesheuvel Date: Thu, 25 Mar 2021 08:45:56 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] static_call: fix function type mismatch To: Peter Zijlstra Cc: Rasmus Villemoes , Sami Tolvanen , Steven Rostedt , Arnd Bergmann , Josh Poimboeuf , Jason Baron , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Frederic Weisbecker , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Mar 2021 at 08:43, Peter Zijlstra wrote: > > On Thu, Mar 25, 2021 at 01:42:41AM +0100, Rasmus Villemoes wrote: > > > Actually, it looks like I can't select PREEMPT_DYNAMIC> and tweaking Kconfig > > > > Ah, there's no prompt on the "bool" line, so it doesn't show up. That > > seems to be a mistake, since there's an elaborate help text which says > > > > The runtime overhead is negligible with > > HAVE_STATIC_CALL_INLINE enabled > > but if runtime patching is not available for the specific > > architecture > > then the potential overhead should be considered. > > > > So it seems that it was meant to be "you can enable this if you really > > want". > > > > to force enable it on arm64 results in a build error > > Right, PREEMPT_DYNAMIC really hard relies on HAVE_STATIC_CALL > > There's an implicit dependency in the select: > > config PREEMPT > ... > select PREEMPT_DYNAMIC if HAVE_PREEMPT_DYNAMIC > > > > ("implicit declaration of function 'static_call_mod'"). > > > > Seems to be an omission in the last !HAVE_STATIC_CALL branch in > > static_call_types.h, and there's also no > > EXPORT_STATIC_CALL_TRAMP{,_GPL} in static_call.h for that case. > > That interface doesn't make sense for !HAVE_STATIC_CALL. It's impossible > to not export the function pointer itself but still call it for > !HAVE_STATIC_CALL. I proposed an implementation for the indirect static call variety for arm64 here [0] but we haven't yet decided whether it is needed, given that indirect calls are mostly fine on arm64 (modulo CFI of course) Maybe this helps? [0] https://lore.kernel.org/linux-arm-kernel/20201120082103.4840-1-ardb@kernel.org/