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 97ADCC00140 for ; Wed, 24 Aug 2022 16:46:14 +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=uaFAAiEj8UWa5sVuoTdXbmljZ4qcgXSzjbW21MdRYaA=; b=IFaSxWWRk7veDZ Q5KEl+JGsOiCUUNkN39M+IgqmS2a7Nxnt8v3zDSKUkUsB/09xABRLMgusrS1RerNmDidy3V+kb+bH TS0XtauBnYuxVkkUm15++pdlypRNvV18bmCfCjulFqO4aWWC38PLvyeSNDhZwO6lIPeXah7k6arXl c1eTMo5fDKlzMyEfh1J/QJ/qONd+VsKSQ4swHJwxgKVfoYhv81gBrSDGZTEjoOWPuHRVbFEqJ+woN f1y7VVs4+fv1KPA8R3VfnRCA2JK9Wj47r8xk95DzhKuCMMhw00vmMEjN4i3ItqnKTTtkGOVsxlcj9 jKvEGp+301N+ssXtY8OA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQtVB-00EVhI-S5; Wed, 24 Aug 2022 16:45:14 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQtV8-00EVeU-SY for linux-arm-kernel@lists.infradead.org; Wed, 24 Aug 2022 16:45:12 +0000 Received: by mail-pl1-x62d.google.com with SMTP id u22so16133532plq.12 for ; Wed, 24 Aug 2022 09:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=tU1yBnqhlu3GqyKX52PVBbY7hfY440wN3o9LUS939qw=; b=dMwaDYcQTBZEUAz6w9NArwGUlxFWdZ3Pss5DJq8kQ35DIDbNM2J2BoG/fLJUW7rAsk 0QkvfhDnsJ4GpqK+iwL2pNU8/iNzBW0S4Vz8aXQDoTWy5C9oPqxuTmJv7ilJjJwJHmXc Kev/YZH83qJsfs9xjvwGtRFhUI4Bn2u9JNj2hZfiZhr8jSp1vQlhxBzwpdAzhlIPp+ak VdN83DtNcVMzLg9ICJmdmqkTLFRdO/ClUvv+FlSKobXzKj/BQ7yWjJaL7hLXxQelxtQj 1Fmqnu76cf5fKgdgEA7VgO+8MnkMbKLlJsxV3HeCVq8ipj8XaQFvLBn7h+plvbH4rhDk TO8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=tU1yBnqhlu3GqyKX52PVBbY7hfY440wN3o9LUS939qw=; b=CgKecsbcDBJH4R/YucMveowhDjlOKkh0ykrQsVzFye6+89lXIssLeKiQcg2pTz92cC F9eZ6lrqsetMnmA2ySVN1eHpuBiJ6OGrNnfLNJ8geHfGdxq4z64xgzMAqLTpZKoWG9/1 l5+cL3qov7hgKOCT0KXj/ozbX6kq3pxk44Mvv6kQuK/MclnQ4lfmQilckEqdBrLXe3Pg wdUPdzh4n93ZIf5z5sPyls93kvJDMEcg+9vYyotS4JXV9QGqL+d4GyhNw9114Lm0YFxu wGLBCMaVkvgHio/9EdYRSUoGAY3YhhM7JPJyx4pojSRqI2IXmChfu+8WOgbet+ooBLvb f1fg== X-Gm-Message-State: ACgBeo3iCJJrEGowm9kHg2fxsdB2+jpntDaD6iSreZNHWhXexWUpH9UG kM8yBAby8gGkTQm7hTkUaNOTlw== X-Google-Smtp-Source: AA6agR6mRl2fzdjX6KtKC9JWf9pNY+kiiRoR9PXpwCPuruebJXijTYHgPAAsuT/LODAzP52270zQ/w== X-Received: by 2002:a17:90b:3684:b0:1fa:f48e:abd0 with SMTP id mj4-20020a17090b368400b001faf48eabd0mr28499pjb.180.1661359507905; Wed, 24 Aug 2022 09:45:07 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id o19-20020aa79793000000b005364944e538sm9721693pfp.99.2022.08.24.09.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 09:45:07 -0700 (PDT) Date: Wed, 24 Aug 2022 16:45:03 +0000 From: Sean Christopherson To: Will McVicker Cc: Kees Cook , Peter Zijlstra , Sami Tolvanen , LKML , linux-arm-kernel , kvmarm , kvm@vger.kernel.org Subject: Re: [PATCH v4 09/17] perf/core: Use static_call to optimize perf_guest_info_callbacks Message-ID: References: <20211111020738.2512932-1-seanjc@google.com> <20211111020738.2512932-10-seanjc@google.com> <202202061011.A255DE55B@keescook> <202202061854.B5B11282@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-20220824_094510_968289_6C5869D3 X-CRM114-Status: GOOD ( 24.29 ) 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 Fri, Feb 18, 2022, Will McVicker wrote: > On Sun, Feb 6, 2022 at 6:56 PM Kees Cook wrote: > > > > 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... Peter and/or Kees, can you provide a pointer to the patches that could potentially be used as a basis for fixing ARM CFI? Or even better, send a patch to actually fix this? :-) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel