Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1863006rwd; Fri, 2 Jun 2023 00:55:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+6MI/gGtCiuXZXK1HMtI5ckjb3P21uZdGZ5g2WHSHZXYTcw07oI/XKAJcf/wl21IjQex8 X-Received: by 2002:ac8:7e93:0:b0:3ec:47d5:ec65 with SMTP id w19-20020ac87e93000000b003ec47d5ec65mr13796081qtj.60.1685692542635; Fri, 02 Jun 2023 00:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685692542; cv=none; d=google.com; s=arc-20160816; b=ryeWGM6605pPfojUlk1QYCvCWBH/nrvhQWDrEBrBpvmiMCUBMVO4RoHL6nT3hYJqfs m575H6mJKGFx2nBU84qA/6SPiFIczAl3HmtyCPpG4gQfNn4T+oFzdPyqc8EDmTc9uBd9 Ul3oDDvhvC5Hp/k9CdsbzMgQ98GdDcXyUIojY0BElEY6dUo76j8njHgX+gdiAAOdUnLl YfoWzcImHBfrn0Qw36wdONPp0kC+fZSTF57oB/TXbTQo++teiuie5wrQXDYe7sq00VKF CWbKNZfq2LKni1vbWID21f8edG+UZRC4NY5NsFQDPwaQHU32a+Xw/k4sznx78xTjrezh 8lvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=oM3fAwJKm3WQ26amYPUOEVz+QzB/5EEs4dGWk0XfUBQ=; b=fb9WCX8J3PkBMJyqUAtpP9Uo4v75mFWzakFJAXoHKuFVIlUcFLkKg/G4Mdhh+OCCZO b+CBauK9dnvQNKciWCuGcSIodDSqMKSs2REGdNy6GsHMO1PonWhG7fatvcTZDV3YePm/ h7QRjk56Xhv+LwvTccjqEEJaNP5+4WvzSTEmHMjFdx3UwfPOOsynOHvFYtS2cB051gWa STKWQKD6MxBXDC3H1KfybR1OwRvbEOajjibWrKxqM9KCRallpVH92f046uqNtO6hQSWu KIlNwzqsuoBTzUnzZUBzwMVFAviKoMGFUs54zc5wruaDSQR9BdJ/+U/4Zc5fNExdqDA0 ijXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=EpcDldyc; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z134-20020a63338c000000b00534780446d9si561139pgz.640.2023.06.02.00.55.29; Fri, 02 Jun 2023 00:55:42 -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=@gmail.com header.s=20221208 header.b=EpcDldyc; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234352AbjFBHlJ (ORCPT + 99 others); Fri, 2 Jun 2023 03:41:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234383AbjFBHk5 (ORCPT ); Fri, 2 Jun 2023 03:40:57 -0400 Received: from mail-yw1-x1142.google.com (mail-yw1-x1142.google.com [IPv6:2607:f8b0:4864:20::1142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D77E1A1; Fri, 2 Jun 2023 00:40:55 -0700 (PDT) Received: by mail-yw1-x1142.google.com with SMTP id 00721157ae682-568bb833462so18651147b3.1; Fri, 02 Jun 2023 00:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685691654; x=1688283654; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oM3fAwJKm3WQ26amYPUOEVz+QzB/5EEs4dGWk0XfUBQ=; b=EpcDldyc/xJAJSWsy4/nbiCnWjNh4lnuQsxXsmfzFcKyo0NOCYcjD6HcsAT+oVgKHP 70MQvmc8G7+kcKUTlKQflJop4tjllC2G8QfpoSrVnf4GMZlkQEEhYS4sQgJbmXb34dq4 NipGqJ/juk0rk3B5Rp0k57Z4TsFF3OxeAisgoW0oP++iiphEP53dJPy016b1vAhS7lWb GAFDOkaD9OxNrBkkqxBHmMF5stHiMJKXjOaCU9q218iA5rYNMin3xs7c1RqsClrIj0MC /mANooql1iZXtf52FZN9VtANxbeVPdKi3wnNBDvJIL8ic73tcVwt+bIrXwp17dQkvf5U DMRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685691654; x=1688283654; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oM3fAwJKm3WQ26amYPUOEVz+QzB/5EEs4dGWk0XfUBQ=; b=OXnSdvAkg/M7dLvNViKnsxsOS0L8cIBZRjvcBWnxTsxY+qGxTRySnT3Lsjv9gilNEn XM8NVWICUKmVDkgI2nmjEQFI1qYPCP1c8Y0l3vGEQCBYMDoepWfEPY5NoaVHAvYp1/cz KGaVkBxipbbFRlj4lv28A9R9qFwJoj0k7/LKsXU4ixT3aokyqb4ZSzddzevxJbN4S4ru bexmA+YO1SAPuA0uj5oOWTSWKm5BhYzKXZGvoYHxZy50Bvi+wZ0l36c9PlOuSwqsPwgb 0ogL2r0SHZf4AgZNm8euxz88I1naavdLY98i16lCv9ME3JJa+nwadX67ZpqbVKr5SfzC Y1Og== X-Gm-Message-State: AC+VfDy6pZZCXdEmMChOUJ527piNylJdvI7K6TwuuPn17ie1VT59t54o irYlOR5lyiROunxXbllfW4scRP8iNoqwh5Y0PtA= X-Received: by 2002:a81:4e11:0:b0:561:81b:734b with SMTP id c17-20020a814e11000000b00561081b734bmr11667281ywb.39.1685691654522; Fri, 02 Jun 2023 00:40:54 -0700 (PDT) MIME-Version: 1.0 References: <20230602065958.2869555-1-imagedong@tencent.com> <20230602065958.2869555-3-imagedong@tencent.com> In-Reply-To: <20230602065958.2869555-3-imagedong@tencent.com> From: Menglong Dong Date: Fri, 2 Jun 2023 15:40:43 +0800 Message-ID: Subject: Re: [PATCH bpf-next v2 2/5] bpf, x86: allow function arguments up to 14 for TRACING To: olsajiri@gmail.com Cc: davem@davemloft.net, dsahern@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mykolal@fb.com, shuah@kernel.org, benbjiang@tencent.com, iii@linux.ibm.com, imagedong@tencent.com, xukuohai@huawei.com, chantr4@gmail.com, zwisler@google.com, eddyz87@gmail.com, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Fri, Jun 2, 2023 at 3:01=E2=80=AFPM wrote: > > From: Menglong Dong > @@ -2262,6 +2327,7 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_im= age *im, void *image, void *i > > if (flags & BPF_TRAMP_F_CALL_ORIG) { > restore_regs(m, &prog, nr_regs, regs_off); > + prepare_origin_stack(m, &prog, nr_regs, arg_stack_off); > > if (flags & BPF_TRAMP_F_ORIG_STACK) { > emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, 8)= ; > @@ -2321,14 +2387,14 @@ int arch_prepare_bpf_trampoline(struct bpf_tramp_= image *im, void *image, void *i > if (save_ret) > emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, -8); > > - EMIT1(0x5B); /* pop rbx */ > + emit_ldx(&prog, BPF_DW, BPF_REG_6, BPF_REG_FP, -rbx_off); > EMIT1(0xC9); /* leave */ > if (flags & BPF_TRAMP_F_SKIP_FRAME) > /* skip our return address and return to parent */ > EMIT4(0x48, 0x83, 0xC4, 8); /* add rsp, 8 */ > emit_return(&prog, prog); > /* Make sure the trampoline generation logic doesn't overflow */ > - if (WARN_ON_ONCE(prog > (u8 *)image_end - BPF_INSN_SAFETY)) { > + if (prog > (u8 *)image_end - BPF_INSN_SAFETY) { Oops, this line is a mistake, and I should keep it still. > ret =3D -EFAULT; > goto cleanup; > } > -- > 2.40.1 >