Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1977981pxb; Sat, 22 Jan 2022 12:00:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJze4Sc2/SBRNW5g8b1lByatCbcnWH1NRGQ8ct8/Ym0Ll+M/E9oUGFUmxrzCJTgIhGDA4bSg X-Received: by 2002:a05:6a00:134e:b0:4bf:5086:2332 with SMTP id k14-20020a056a00134e00b004bf50862332mr8333525pfu.9.1642881647325; Sat, 22 Jan 2022 12:00:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642881647; cv=none; d=google.com; s=arc-20160816; b=eokh7wZEEYrqz7Od+9ghYh/A63H3cdwjS/NDXACbVcCaX1zbIN52I+4fn/j7EPLTZR wiTGiHr8Fh7NPcOK8sJl7EnJy+RvekBWqVXLc+KITGPSQn8e4fHLPY5AVBu4iD5OVxMK mcgBd0+WBv/v7YuT/N0di7TU3yJneu5XAX2MV8jtWVV/AtW60EZ7A3i/tcAqAmMBY3i7 JBK+jhjl/k5+NrRUDF1jT6lpOYpwI+1kpgibF1naTFyAHpoAEvtDnal4JqHHOTAHDu5U AY3L6wFOUoxEtvxVd/lxae/6x/vK/fJzHpvjPZ/93In/ukFT6gXBkFR4sLeeXlB9rT7e csbg== 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=eF7l1EMItic8HXnzow8ikDlVmQVMga9j0gwwj6e0+xM=; b=RehQYD+kWxKVA2oDWIN8XAOAZYP+9VBQGCsEJf6MMkk1JGhBzSkI6gDUyIHo3titx+ udNvnFjRCAtJWKfZAJEG/WhN+OaeXkQ1tow/Y56kfiB98vSzOkB3xbKqfT0UGEm7VRlN xrueXK5A4kOvit/rSjzGkj+ZVUiJtL6q1a0J339+kKh2zwi2qkDqzoL9jPtgDGxe0jDd kjCTCEIi2J1YzdLoesZLSq7fVdbDqdvZZ2l16I405473j5hh0UgpIrss5e82obSKUN0R 68vi87Bm8ISf6MdgkASjDcboJXgxrz7JNla2Q3b3Fm+p2827G1eUzgGkvY7OCMSVkc6+ Wo5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dWpRwR6M; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x3si996318pjr.107.2022.01.22.12.00.35; Sat, 22 Jan 2022 12:00:47 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=dWpRwR6M; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbiAVBM2 (ORCPT + 99 others); Fri, 21 Jan 2022 20:12:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiAVBM0 (ORCPT ); Fri, 21 Jan 2022 20:12:26 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8107EC06173B; Fri, 21 Jan 2022 17:12:26 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id d15-20020a17090a110f00b001b4e7d27474so10491193pja.2; Fri, 21 Jan 2022 17:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eF7l1EMItic8HXnzow8ikDlVmQVMga9j0gwwj6e0+xM=; b=dWpRwR6M3nZvqcY9+bWAl0nwignbdlGztsjsncKa4yrawHasah4JG1vHWpgpc/rfIf NMjQLSVdOjy4kb5OcH/y/+OsnyIo0uTAi3lDgS/if7CRQ+zH6OcCcsaiv18e/OD5SutY 78P1Ta5IwKc9s1RLpiCcCO/UkiEyeKWnJuSPu5Ajzaz5saCA/cYFbfTv6X0HrmHJE3c1 ZuKO0f4hsbVq9RV7UOrkD6Nr4rS2wISEsNB06o039rzlEJhMcB9tMc3r9A9CFVf4sTeL xTqUWse/LJaqp9KHIX8yXSi6geEnbSOkYHeVjZvQxTHHLXdjkXj3OQpGYmzSbvnD7x63 X1zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eF7l1EMItic8HXnzow8ikDlVmQVMga9j0gwwj6e0+xM=; b=aVEju8f+yAPnHgbJDEAWuuQSI3sDO8btYSSyFuZcFQNR/OcfO21tlPoiMzHR4/EQvs mp3nVnyZv9pj5JkKViaoVHRoTjWmWiZmfyjJpUZ76/zydmPHtGMTJZpL0iBzJFuRmfKp IkWyrkNpGXxdjg1PEDQt0OxL5tTWOI3XBWTl51+GD1gS36FrAZTDpOURRqN89wZf0wXm rOLczY1zATI1OazGODjsjT0QO1h9UyzaIz57hBMii6hdT1DSIVYgUpTzla6Q6pjuqjHD 12VscRhbjdBHkdE6+mu2ZEddkYqkCh+htonFNHVnAo58bukEb76LA4YyPV86iVILqdVR QMrg== X-Gm-Message-State: AOAM533M1OGYLoowz+6UbwyF8rFDe1OQVEmjTYnUqzBZGetdqpO/+UDv qh7oSSaoqHTSMm70oo87TCS1CyXeoC4AvLzyIXM= X-Received: by 2002:a17:90a:c78b:: with SMTP id gn11mr3243207pjb.138.1642813945938; Fri, 21 Jan 2022 17:12:25 -0800 (PST) MIME-Version: 1.0 References: <20220121194926.1970172-1-song@kernel.org> <20220121194926.1970172-7-song@kernel.org> <7393B983-3295-4B14-9528-B7BD04A82709@fb.com> <5407DA0E-C0F8-4DA9-B407-3DE657301BB2@fb.com> In-Reply-To: <5407DA0E-C0F8-4DA9-B407-3DE657301BB2@fb.com> From: Alexei Starovoitov Date: Fri, 21 Jan 2022 17:12:14 -0800 Message-ID: Subject: Re: [PATCH v6 bpf-next 6/7] bpf: introduce bpf_prog_pack allocator To: Song Liu Cc: Song Liu , bpf , Network Development , LKML , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Kernel Team , Peter Zijlstra , X86 ML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 21, 2022 at 5:01 PM Song Liu wrote: > > In this way, we need to allocate rw_image here, and free it in > bpf_jit_comp.c. This feels a little weird to me, but I guess that > is still the cleanest solution for now. You mean inside bpf_jit_binary_alloc? That won't be arch independent. It needs to be split into generic piece that stays in core.c and callbacks like bpf_jit_fill_hole_t or into multiple helpers with prep in-between. Don't worry if all archs need to be touched.