Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756192AbdLOUev (ORCPT ); Fri, 15 Dec 2017 15:34:51 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34824 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755530AbdLOUes (ORCPT ); Fri, 15 Dec 2017 15:34:48 -0500 Subject: Re: [PATCH v10 3/5] bpf: add a bpf_override_function helper To: Josef Bacik , , , , , , , , , , , References: <1513365176-6744-1-git-send-email-josef@toxicpanda.com> <1513365176-6744-4-git-send-email-josef@toxicpanda.com> CC: Josef Bacik From: Alexei Starovoitov Message-ID: <5c212496-f898-988c-ea40-4ac6b7168d87@fb.com> Date: Fri, 15 Dec 2017 12:34:18 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1513365176-6744-4-git-send-email-josef@toxicpanda.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2620:10d:c090:200::7:63d7] X-ClientProxiedBy: MWHPR03CA0015.namprd03.prod.outlook.com (2603:10b6:300:117::25) To DM3PR15MB0970.namprd15.prod.outlook.com (2603:10b6:0:10::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbea8296-c1aa-4f7a-7ef6-08d543fb3a8f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307);SRVR:DM3PR15MB0970; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0970;3:DiOnCDdYRHE32iCA7qZCe1X/sSHZlaA16vR0eQxTnJpXEc6iiNTP71tdXmwCGuJz+oACnnCW9xfhYgwmf99OGeZrxBDCGQ/LJtLLpZz7I8rx+N22wXC9hOuSGYbpvO8BswHngbBUXJgi9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s0mbPvf9kWZS1CfAQS+h4I/LQoxZix/Iiivfrjj4UK6bHpWyI0Umo2Zf6MI2rxSlJ4Ig1TCdhFnr1FPJ3gvww39FYuxaSwXiRniim7DWFBGBvG1ZZ/u5I7BEuA8rMifOrxbqoWMb7SuKexD+vnlKjB0ku853ecvzqDY+57mibC4OKW37BLS6Cz0hKXCqZPaqvGJO7tQmAQJc;4:zSLirUp51mDGb6fSSsyDG3B5zK5PYasMDKj91KHGJHYdPpLYss0a9+Kh/7aQajfcuA0GVhnmsko4/tQ4AfeA+q1ouv/M/kCGIDcc4obf2Rv0EvHcxdqfNZDSste6hJQh3Oa8AqK7TjgKFz/VNObS7ryByxRE31IJRAcYlKgPpFxvuQIz0rYvO/tcX/q/6bldPbDVJ24h3oLu/QPqAKgylVQzOb6i/Kz1FjGa+jamCbNlsMn3uhD7rCcX06iJQjafGs1B+mLDQHn5VW2L7whz4Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(11241501184)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148)(201708071742011);SRVR:DM3PR15MB0970;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM3PR15MB0970; X-Forefront-PRVS: 05220145DE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(396003)(39860400002)(376002)(366004)(24454002)(199004)(189003)(97736004)(52396003)(6116002)(53546011)(386003)(50466002)(1706002)(36756003)(8936002)(316002)(230700001)(67846002)(76176011)(64126003)(6666003)(106356001)(5660300001)(65956001)(2950100002)(31696002)(47776003)(65826007)(83506002)(52116002)(65806001)(7736002)(4326008)(305945005)(6246003)(31686004)(2906002)(53936002)(8676002)(229853002)(105586002)(25786009)(478600001)(58126008)(86362001)(6486002)(81166006)(23746002)(81156014)(68736007)(7416002)(921003)(42262002)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB0970;H:[IPv6:2620:10d:c082:1055:fc94:ba2a:76d:8e0a];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM3PR15MB0970;23:2yJd3LuZ2ke8s6MqRPTwjAhH3zq+aVPQmGC4D?= =?Windows-1252?Q?6fWxc4gIKZeePKi34Q0jXHIZO06uvEQTHXNM/ZXkMlYAf7Tr/5pl6R1I?= =?Windows-1252?Q?a5cXmAV8keEoAmJkoxfEEzZmiCbQKIt8BWU8hTUQS4yBdYkKI0W0zi6v?= =?Windows-1252?Q?X2be04v3ha2G2v0sxS+7XPzj7E+yuT7EqeBAAPbz0My3xfrP6o01j3Fn?= =?Windows-1252?Q?sMNTDq5HAdJ1eXgL9N62oJhXh3KRv3br4xokYjhA1QdD7HbeoAcYAAxs?= =?Windows-1252?Q?5Dkt9VCpx2rseocI7wjYFFxGPpbmXDWcr4F14+SgXyIhAv73rr5eqxYL?= =?Windows-1252?Q?AoFVGIUsIVCW3EobKxkBPTNJTc3bjspLPsRbgImBX6txg81x7ZhPRmfJ?= =?Windows-1252?Q?k+t5dsTfPiXvOfirQhp2iJ1J6B5zHrg6ROhOcNtzjQUjs3SbpwWzMa4H?= =?Windows-1252?Q?oYWgJzkF4841y7LW3l+7TcyRKjEUwzly9KceEOIuCE60rrt9pZ0em4Tj?= =?Windows-1252?Q?P1nsEw9wkIIWTBE2UhDvKp/506MTBDsoF+Vp1SUJ9eyyfPAuRZ/YgIkn?= =?Windows-1252?Q?uf9ocdefrpQ/5zu/A0JB+RDCIGc7PtkwxLIK2s9B8P/ijRIHskDrgUoX?= =?Windows-1252?Q?nqQdXOx8boVXlt94lc7/0QAfhEODVSH5l8mZokqyxPI6Crg2N+lDLHr7?= =?Windows-1252?Q?t6t2ulWBSr5LyG2WdI57iXw8eK1PFglr8YNKtoRTgPOw9SHcKFup/lA4?= =?Windows-1252?Q?mVdXz0TbIon3HXToJCx2roCZ1LKxhhyH7YwVX/jihwIVpOHCvFIdA787?= =?Windows-1252?Q?ugpRryLg1qXXbQddZNZnoYCQlUmG9w0U1zv63MG/puFcz4005/UdVpS0?= =?Windows-1252?Q?97Sl8cXSqI4QM8Jkmmy5VPpxE/1VhBDNvfeWEj/xT/+lmTH5PEWdyaJD?= =?Windows-1252?Q?tAbaGBDLf2SL6IFRGRpyvlSg+sRMYPQhnE3NfJEWT+qrkeAKfgO6DRL6?= =?Windows-1252?Q?Al0lG2x7B3clBoMHm/xyMQHEOEHYub5k0oM5zssVvprHAzW3STsRtxyk?= =?Windows-1252?Q?CvcKvfcS2IKccef0zZ7+cxlLACIaJf/zjBOwifNTDItymOjWfb+7JQo9?= =?Windows-1252?Q?/r9YD+/Nd3c5CzLbsr2LpzVdOs1TGqon/iDJw7t/MkRI0csGfYjmKWeT?= =?Windows-1252?Q?CBk4JI25TE7Je5+DOMffbSkC9LOXLCGfNW57ervN0P/elZWfRtl5dK8l?= =?Windows-1252?Q?6a7NPQPrUo/sy2l02V4k2fnJtVxhiUz0VszPQxIRv3xbQWtbboxHHCNo?= =?Windows-1252?Q?ZZtEsgxAjTgG/dJVeGioOnM6B5H1lz5Hd9WLMjb9/hk7B+FtRDDuW5is?= =?Windows-1252?Q?kPa2d6oxmBp?= X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0970;6:G7IgnDr4uQzk2DGdYhlfVFhgK/4S6rbF7h/h4R97MHAlvhSf6P1eu+115B5A2CYdM/DaaEC29bZfZYAEZ4iahxiLXOwU8dPSfWPDJExJ0vYKMFbMTuPQMzM4cd3TEQwbgMMKm9/yxxGxW/buVw5OkdLe+IJO9fYZ8EKzgN/AlhPUsefqFzu/Yz7N9BmI+q4nM9uB4yRRr7b0XVwmDCOTnYqaUa1uVGyU/vRa7QJaiRN1Q9nxsC4i6klhWUSCdURmHHRgbQ54iYWzlbXiQANE89kQOlhkLaGPn5HCo7Ski6dEvdLsAnbmedeOiwDYebTDyXvy01P/I6EJA7SFMd1oIreaKJvA/B2uGVc6fIct5fU=;5:OVspzawfK52ARkxQ0/dezy3AFUMx3N+pkc4WueLTvSMoDaYOiIP0mpPRGuAcCt7SSVKaKsG9OqAdTU1U9VyzyHNZtUP4R0aHYRaRvZ8RyUuma8sw7v1gzKIDGkFS7r+3AxxWfZmlBBunyDt7D8CamGXc9Dbz7+yMidTLOcUz2hU=;24:bIBrAseKVgiv6VZIu0RFX+jIpADbkXlNibVIEiPcv7ADW/s0lpBByZdD+2vcPApDA9CzDgcK5X/hw0wb8wLn1oYpZV6Jjp/XqdkUh0aSC1Y=;7:0gcpSoS+8doMUM/8e0heY76QQ/fpaMNU1ps7FCGcxvwMjCGQRKhRswjPVNmUrxya7t20e5ynJi9iSpntTFZTTq+QxDNMOxy9RqboLVKjLU/PKgCrXjCJ9ZbT0icCTMXxhGhaAhK3LCa5/TBAWuwXcqLdkDm+OoXt4sRHgZ0ob9QI6K1MxrbaFyE+r76k3At+1PLEeWOm380dHCr62ei9UcpnyscP3c4hHXd9oISDVwpspgDzwcOjHcEJmSULRuqV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB0970;20:oufq4jXP1k9/HdQLVnmcfAs6odLGOYlACfjcADZnnV3e6lqxySg1Qmzch9HDdeOO50xTyhTyBCT0GfRDRTWAJSVHfrXYcFZX2gHT/xRTeP3yRzJ7/CrJ3ZjTwbvbnqPJ5zC0oYVObU83TbbXwFjCC92670+9WAi45fxzul2NIHM= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2017 20:34:22.3627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbea8296-c1aa-4f7a-7ef6-08d543fb3a8f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB0970 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-15_11:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 602 Lines: 17 On 12/15/17 11:12 AM, Josef Bacik wrote: > +#ifdef CONFIG_BPF_KPROBE_OVERRIDE > +BPF_CALL_2(bpf_override_return, struct pt_regs *, regs, unsigned long, rc) > +{ > + __this_cpu_write(bpf_kprobe_override, 1); > + regs_set_return_value(regs, rc); > + arch_ftrace_kprobe_override_function(regs); > + return 0; > +} since you're doing a respin can you adopt the change I did to make this helper fail at load time if that #config is not set instead of runtime? Also how big is the v9-v10 change ? May be do it as separate patch, since previous set already sitting in bpf-next and there are patches on top?