Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4001279imw; Mon, 11 Jul 2022 22:33:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uTqdvjrAhMY1nIkAUWEQHI1I6rG4BwLSC2kQfq4VlChVEN1irWaxAi9wtxOuMaSdPL3Fz+ X-Received: by 2002:aa7:d555:0:b0:43a:1be7:9e17 with SMTP id u21-20020aa7d555000000b0043a1be79e17mr29699173edr.183.1657604034178; Mon, 11 Jul 2022 22:33:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657604034; cv=pass; d=google.com; s=arc-20160816; b=YscFJMZRtPaGiml/BPHzoj1kwEsOzC8hkJfQlar+/Jic4P31XSxEt79/M4IXbgecP1 7NEoCOSDzmwb2lVRAg1xvgc/OPkjkDh3w3Qxnowt46m/Zi3TIxaD/ZRmCDuKs2qijWnQ aIv4b1o4EfI+14mTeTwt9TCKxErgi4VibUkADWHP5HZODi2MvRVnDOvvAO+EWEx8ILrd TqFhF17ij3cywaumfajsLeeswL7pQPuIDjw9nuuvg00xXp2uqZyPMQ5bhMSUm9cjWwOT XzVFD24WvDGNxrohUmshWxGc6J12ucD/eTduzlAwib9oXLl8Z5tR3aZP4L4hPfBlFGGu hBXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-id:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=y3Da/pjKg7oVB7RthE1K+wRqmdA/jS/CL15VJkSclJc=; b=UqhYoVrPsLeOVyAWNTdNvX8xA6mQq4xxSc//O9N2U2LPBU0gtBY5CX8jstHVaFtKcj JCVIWS0jlPNr8RvTnyTwj97MF76hzxIUpuxHNxyo0iItrVfbs66OIO9xilbL/TGDVXxu wPvdxpNSwEN8gzXuXpboauhWpiZrxNAIFVXpsuyHV1R2glDrezNyPxySmKJDZwZRDiy7 Iy4QbXtNL99zNOyQshozBo8PJjkhVbj6UJvbfHCXDJauyxsEKzDOnR9GjfD2mjxmB8Fz 7zs85grqeDtrs0s3JeG1T+2aZKPbQlVKFGm8EzkY1zWesIJUj/5RYMkmPCd9o/OWnc/y ZdZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=mB2a11ox; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kg10-20020a17090776ea00b0072ae569ffa5si11859388ejc.137.2022.07.11.22.33.29; Mon, 11 Jul 2022 22:33:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=mB2a11ox; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbiGLFPc (ORCPT + 99 others); Tue, 12 Jul 2022 01:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbiGLFPa (ORCPT ); Tue, 12 Jul 2022 01:15:30 -0400 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE4D18238E; Mon, 11 Jul 2022 22:15:29 -0700 (PDT) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26BNCNxN009483; Mon, 11 Jul 2022 22:15:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : mime-version; s=facebook; bh=y3Da/pjKg7oVB7RthE1K+wRqmdA/jS/CL15VJkSclJc=; b=mB2a11ox4hUuh/48jkZUlCrg/XJ603a02VZtqDdJqqfIh6bwS8MV0H21DqnIH3C5axDs d3uViMXY1trcP0QOBYYCI1pSWjNdxXXlPPyUIGfMqSPmaJWuQ5fLj/zjXNFJyqBhxcP9 y0WxyIwI+jhXoGP2IxlEjJ/Io6UTHTquUck= Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3h79045h5v-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Jul 2022 22:15:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ua+EGZInU3XYRX1FiDhwscioGgxAwh/rkDjREDt8rf6Dbkk9YBGA57Z7lPGNpoxuIrTS95GFk/G1swglXdTEZaCibr+gItSkhe0kkdPbq6bisXXJe0QMgxyfd6r6xhhNTlFz80kyU42Y1YyulIKEyNIoCSNvyVYR/o7s2juP2rTpA+AqWhzFb1grD/NvQ3dg/3d8TXqLk0r9GKO8Yb9ohGeGcRmMtZ/hX51DyaOW70QO2SnoG4iYKCqAno5/yPnqEll3ZZRJoTNe6kji0ysaY00B03LGXC99OK7TkJ67VGo2koXs9MUxLukdf+mnm+PeCo+y3z+K2RH03CYWK9FNZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=y3Da/pjKg7oVB7RthE1K+wRqmdA/jS/CL15VJkSclJc=; b=iJ/QWh59Irm9YCXrsNfXY327F6EFfZNn6WBZWTVqp7vhjhhczq0kYeweg4oNGAjkEwRIHIZkgV/RJtszGXMXfTpu9FsITI7i6hoZ0/Ga2neuNTVKZpXqZVV/ImYanR1ea3jsMdf1p6ClaRwyeXfmRlhdIshS7D39361sYDtRus6j8hS8PaUnlkLQ77r2KUlPzXdOinIHfMUEtgYyHESW8rM94yETpTQ9VlfFqQP49qFeuppqdoKMJbe6kvVX/+BkEH4aYw6Y1C9wvTALFAksdGo1hZ5W/cTZhlaYLulLU+J4ZlxdEhZ7eJ2dIJhiHkkdFXtuaJzVK7LibzhdRFZiYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fb.com; dmarc=pass action=none header.from=fb.com; dkim=pass header.d=fb.com; arc=none Received: from SA1PR15MB5109.namprd15.prod.outlook.com (2603:10b6:806:1dc::10) by SA1PR15MB4966.namprd15.prod.outlook.com (2603:10b6:806:1d5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Tue, 12 Jul 2022 05:15:26 +0000 Received: from SA1PR15MB5109.namprd15.prod.outlook.com ([fe80::e8cd:89e9:95b6:e19a]) by SA1PR15MB5109.namprd15.prod.outlook.com ([fe80::e8cd:89e9:95b6:e19a%8]) with mapi id 15.20.5417.026; Tue, 12 Jul 2022 05:15:26 +0000 From: Song Liu To: Steven Rostedt CC: Song Liu , Networking , bpf , lkml , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Kernel Team , Jiri Olsa , Masami Hiramatsu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , "live-patching@vger.kernel.org" Subject: Re: [PATCH v2 bpf-next 0/5] ftrace: host klp and bpf trampoline together Thread-Topic: [PATCH v2 bpf-next 0/5] ftrace: host klp and bpf trampoline together Thread-Index: AQHYdrnMgR7UbO/WnEm8o1uHxIdxmK16Fg0AgABZSIA= Date: Tue, 12 Jul 2022 05:15:26 +0000 Message-ID: <8B0FCB44-6241-4220-A1AE-CF91AAA25777@fb.com> References: <20220602193706.2607681-1-song@kernel.org> <20220711195552.22c3a4be@gandalf.local.home> In-Reply-To: <20220711195552.22c3a4be@gandalf.local.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3696.100.31) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 12e7159b-2eba-4a4b-8733-08da63c587d8 x-ms-traffictypediagnostic: SA1PR15MB4966:EE_ x-fb-source: Internal x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xl0sx3gTs2lIHabOjrGMvDvX9Yy9dul2d51doQE6M827MjCMxlmOmBjO9WFgpuOc72ScGA1nyJZ+Y+fY8aWJRqrn6r7j6UAVnOQPHgnfsPOdoCxu+vbDgzgSvJsmDhpJ6ukM+5aWDAp66qBAWsSnxhyFFo2KYWlKVgWtJYBJggfPcw4luI91xAK+zHF0CjD17FoD7sxEKzTe89XdC8j3prRhyyiuNY4dHlRewTndLH897xlPy28DdKQj+zwIGHMHX2DnqhVMkuT3G4xNtsS9OzHiZNZOrcnZuIr2QQc0dico5PUQd0vWfugOKGVgJLjDS8NreT518jWoLy3SUuwhNvzEEVdort5tB5Y1cmdtbYY0oPYEYQrBhaWgcq4nRV6CKwE0ibbzWBx+LjHObruj1sjJmPYi8NW7pDHgZJEudwHGqZJWDMJxEziNkz9Q7jUDJBqSLok4OF0NI2CF3WMeJlsnowWLONC4LiiEtBgBsruTzuS+4aKegPC4fYzXBG8gYL7QeigLkK+IgJpU8uLg3LkCu66DvLd+0BPN2WaaJnMgi4hm8fx/UwPKXXe9stxnmpuHb3QPl/PCJ9egcY0YWazkYtUCWWpNrtAp5j8Of2VF/0RWzJh3E3ubWxZde3wlUZG/gzunZWUbq5iCcbp5O1YggoxPvLtKZ7XL9LromlVFx56DnRrRmqegHytOhkfiFYwrObh8XyxjV9SXOwAO/wUtNJYOB7UqNfHyrz5oCzlteE1GaM+WwbOOLoVphureBTH3xR9y3KMBdF63hf2pe9LKv9tqpgFMKcs4YLdCZWAqp4HCZ3o61sUG5bXsg6Lg+px6gjJvKlzHGrl1Z505UjecLybt7ghwkQRSSjnIsFk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR15MB5109.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(346002)(376002)(39860400002)(366004)(396003)(71200400001)(91956017)(6486002)(6512007)(6916009)(8676002)(54906003)(2906002)(41300700001)(4326008)(64756008)(53546011)(5660300002)(8936002)(316002)(33656002)(6506007)(7416002)(83380400001)(36756003)(66556008)(186003)(86362001)(38070700005)(2616005)(76116006)(122000001)(478600001)(38100700002)(66946007)(66476007)(66446008)(45980500001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SwCYPs07m/wAnE5qhyY3M/W77aDD0O3hODk2VQghJ0KaUmhWxy7VK11fr5iW?= =?us-ascii?Q?BUFUAoFH+YluDJSv/hHcQKDiCveJBFsu9Ldt0yJd6tOqv9LKo+8zTyzJvjmr?= =?us-ascii?Q?Q3i9mFnht/Gwb/n5RzOXQyjJvXXMt31Q7PP3DOa19o7xKaqvx+cXb+lOgl+b?= =?us-ascii?Q?8XvvCqqnPgnUi5xTRXd8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qOYvG?= =?us-ascii?Q?EI24h9VcMeM8quE1cEKNmVzWYMLkC9OgHYLrpfnmgK+eV6k3DM41A1JltXFZ?= =?us-ascii?Q?9HrV8HAXLHKiV9ZsSKEls+ZwzFnb2MZByE0vI+h0M7Yh/ERaqb4JqQnfZm3V?= =?us-ascii?Q?LDhe6dJmntLy9P25fguWSWoBfgxdBo9R2/aEi5mDxYbfvslSYl5PDriwl02b?= =?us-ascii?Q?7T1LyHkNrkWXbmYrtbaK4vsos6sR0Cpl+vukpEEO0MN0BBkQshxmGpWHnvfe?= =?us-ascii?Q?aoVXy/e0RFXJSdzxm9ptCzyyu7dhuO92eQiuHveKRtKZzstVA2BTWPtu+mfN?= =?us-ascii?Q?nHc1/TMWJLhrv/RVr7DyNR5jDv8HeMte1+jec0uYIyW+IsGbLKs8tfsbc5ZA?= =?us-ascii?Q?ad4j/wSfUZqoQr1MqP2ZxGeg8o4NW6gqOwEgs/3dfyzbwT04xO+xIjsRrrS4?= =?us-ascii?Q?esv6FDDpxSJUD9wFU/L2hmtA8bHI5E/pgkhRRZxZ+f6WAeVPCp5ztoATiLy1?= =?us-ascii?Q?KN/rLEJWczvVvFVMwes3j55RSrCc91BAS1GEc+d567vsije09v8cGZit8za7?= =?us-ascii?Q?FGKy/B0g6QoAQOBLvNeQ7ko=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: <0A964BC18D363A4F97E8D7CB3D832762@namprd15.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: fb.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR15MB5109.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12e7159b-2eba-4a4b-8733-08da63c587d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2022 05:15:26.4856 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Lk4+5bvLngiyK9Fg0LTMgm7paGEt8GdMCr5VjQPctq5uHGPqnuUEAErVvRrurHuXLYDaW+YeizMLP1KQUTm9XQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR15MB4966 X-Proofpoint-ORIG-GUID: M6n4Pgt7f76FeOGH5MJdPvnfBtsJT8kj X-Proofpoint-GUID: M6n4Pgt7f76FeOGH5MJdPvnfBtsJT8kj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-12_03,2022-07-08_01,2022-06-22_01 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jul 11, 2022, at 4:55 PM, Steven Rostedt wrote: > > I just realized that none of the live kernel patching folks are Cc'd on > this thread. I think they will care much more about this than I do. vger.kernel.org often drops my email when the CC list is too long. So I try to keep the list short. In this case, since we are not changing live patch code, and there isn't any negative impact for live patch side, I didn't CC live patch folks. I will at least CC live-patching@ in the next version. Thanks, Song PS: I am the live patch guy at Meta. :) > > -- Steve > > > On Thu, 2 Jun 2022 12:37:01 -0700 > Song Liu wrote: > >> Changes v1 => v2: >> 1. Fix build errors for different config. (kernel test robot) >> >> Kernel Live Patch (livepatch, or klp) and bpf trampoline are important >> features for modern systems. This set allows the two to work on the same >> kernel function as the same time. >> >> live patch uses ftrace with IPMODIFY, while bpf trampoline use direct >> ftrace. Existing policy does not allow the two to attach to the same kernel >> function. This is changed by fine tuning ftrace IPMODIFY policy, and allows >> one non-DIRECT IPMODIFY ftrace_ops and one non-IPMODIFY DIRECT ftrace_ops >> on the same kernel function at the same time. Please see 3/5 for more >> details on this. >> >> Note that, one of the constraint here is to let bpf trampoline use direct >> call when it is not working on the same function as live patch. This is >> achieved by allowing ftrace code to ask bpf trampoline to make changes. >> >> Jiri Olsa (1): >> bpf, x64: Allow to use caller address from stack >> >> Song Liu (4): >> ftrace: allow customized flags for ftrace_direct_multi ftrace_ops >> ftrace: add modify_ftrace_direct_multi_nolock >> ftrace: introduce FTRACE_OPS_FL_SHARE_IPMODIFY >> bpf: trampoline: support FTRACE_OPS_FL_SHARE_IPMODIFY >> >> arch/x86/net/bpf_jit_comp.c | 13 +- >> include/linux/bpf.h | 8 ++ >> include/linux/ftrace.h | 79 +++++++++++ >> kernel/bpf/trampoline.c | 109 +++++++++++++-- >> kernel/trace/ftrace.c | 269 +++++++++++++++++++++++++++++++----- >> 5 files changed, 424 insertions(+), 54 deletions(-) >> >> -- >> 2.30.2 >