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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00C0CC433F5 for ; Mon, 7 Feb 2022 02:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Zo7Mx1Hv0LtrN7/TBevpS1a4k7U6ODZkVrIrGZ+wOlw=; b=OaGMNcUvqOxAS6 FJQ+hDX2Sb+AUhSPlvQU/bo8EG+cBU1guYbToCyUHifqKvYwFvO+hx0MqKI1Gn69ADU8eNB24fBgU jiiqXog4znEzhBGK4WbEQIBo7hsCdL4SsySaWnKSkXBWlKmsWBP2lEvlsqfkHP3ggzViiAdVSjgS4 51grlfmDWUK1MO8Aw0yU/Yy9PbH5Ki/+gNLSWqzkh838CsxG0mxUUwXYJROaTjR131a3kP277vYKA 6UfbQ9iM1hdq8jXp5h/vPyECPLKpJ3+X0tmL4W4Ycz2ftlHqYB8vnPprHQ67mhnKvwbJujY31O0i3 Mr0PADJ4rtA9SPqYw1jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nGuCA-008ths-7E; Mon, 07 Feb 2022 02:56:02 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nGuC6-008tgl-1V for linux-arm-kernel@lists.infradead.org; Mon, 07 Feb 2022 02:55:59 +0000 Received: by mail-pf1-x42f.google.com with SMTP id i17so10559022pfq.13 for ; Sun, 06 Feb 2022 18:55:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2Pa0V6uNmqfY1ryqz8Euha/wH0C0Ls7fitkB4Pk5MqA=; b=gRAy4PoGc6tworsSuNdh30bSZQIj9aWCyJMXg0AshOgRXWF3uHuOAwnvny2SfX5X9L kZ0MQf0StanDgY9gtsakTJJlP0m+u6Klf4IYOPKO1rIjoD10FJjy9pjQaW7ROoUUrOC6 NPztgeTkHnfAGYppVDGgBG/GOze2NmDg+3Enw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2Pa0V6uNmqfY1ryqz8Euha/wH0C0Ls7fitkB4Pk5MqA=; b=NsERusPusMR3R3WkzlacLIX7IeAAYNsdaEewVhXMiPm0oTEXY6mDIGHlasImIoPnaj xZz/AM01dREq/dUwyb5DqVcqPF2v4bWJAUB9uxdS5nw/BUOoe7jkyl0bisbQTSqMyN3s 4IsNr1fQ48rEn5YmPfdLHbEHy+CrH7ZKkzJJwL0CNhbpSdZPSZMw3lzEQI8s9t8bECUF KVM+EXruORE2QTGK5mcVI1Bu19LjyNmwmkrXyfVx3v5U+PTxU3/CGGFiGurSSK1qdPoj O5S28i9DW+TsOAdO/4FDlvZyJOXnkh2txIwKPjdZk1urP5v3Fa1u42LG8jKFEEECcLW7 g4CQ== X-Gm-Message-State: AOAM530xZS4KN6E7z62IWKyyLB/onUNtLtOZk4cuCRAaTmbfpDQu+3xe EEKQ42tkVUpHT/yj4JhcZ/gw1A== X-Google-Smtp-Source: ABdhPJwHPVPoUNs7X6rVF0qEiMM2Yz+rYinp0zhxBkrnP/OdvFlTr0vh4/W4vp+6BQZPaSJE/nM/WA== X-Received: by 2002:a65:48c5:: with SMTP id o5mr7729001pgs.284.1644202557293; Sun, 06 Feb 2022 18:55:57 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id nv13sm9221650pjb.17.2022.02.06.18.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 18:55:56 -0800 (PST) Date: Sun, 6 Feb 2022 18:55:56 -0800 From: Kees Cook To: Peter Zijlstra Cc: Sami Tolvanen , Sean Christopherson , LKML , linux-arm-kernel , kvmarm , kvm@vger.kernel.org, Will McVicker Subject: Re: [PATCH v4 09/17] perf/core: Use static_call to optimize perf_guest_info_callbacks Message-ID: <202202061854.B5B11282@keescook> References: <20211111020738.2512932-1-seanjc@google.com> <20211111020738.2512932-10-seanjc@google.com> <202202061011.A255DE55B@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220206_185558_142576_9FB65D33 X-CRM114-Status: GOOD ( 17.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Feb 06, 2022 at 09:28:52PM +0100, Peter Zijlstra wrote: > On Sun, Feb 06, 2022 at 10:45:15AM -0800, Kees Cook wrote: > > > I'm digging through the macros to sort this out, but IIUC, an example of > > the problem is: > > > > > so the caller is expecting "unsigned int (*)(void)" but the prototype > > of __static_call_return0 is "long (*)(void)": > > > > long __static_call_return0(void); > > > > Could we simply declare a type-matched ret0 trampoline too? > > That'll work for this case, but the next case the function will have > arguments we'll need even more nonsense... Shouldn't the typeof() work there too, though? I.e. as long as the return value can hold a "0", it'd work. > And as stated in that other email, there's tb_stub_func() having the > exact same problem as well. Yeah, I'd need to go look at that again. > The x86_64 CFI patches had a work-around for this, that could trivially > be lifted I suppose. Yeah, I think it'd be similar. I haven't had a chance to go look at that again... -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel