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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DBB4C433EF for ; Mon, 11 Jul 2022 14:48:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231436AbiGKOsr (ORCPT ); Mon, 11 Jul 2022 10:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbiGKOso (ORCPT ); Mon, 11 Jul 2022 10:48:44 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DB3C5F55 for ; Mon, 11 Jul 2022 07:48:40 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id v14so7337458wra.5 for ; Mon, 11 Jul 2022 07:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OeIwrghjWv1itdsEcBmUCDSZH1m4e3A3+aJ94H0DMKA=; b=mi5bzmfy76j/A0JqIGs4L9rTEq0UWTfjTNwH3NpU3XTt27ad7yjuV7drDTaywqs6A+ 4+PQPa4vsJKRy6zcuawPUL65Zf2/19jaUHFTHnDHJHoeYqW25gy1LmILfUYjWKW86eWD FdIkLUsvTwlzo4+ghyC3YeigJia/vQ2OWjAv0x/qmIllC6gdLkN6JHZa70zbttJAJAfv e9d7JAzmuIQlfoZFZpczZcL4OKiCrJGT8QxC7Ew3F+fgtuD6T9nlF+Qb1/zAgoj4rnQx w7l9P5A7lTiEzPIA+YBAS9jO5qh1tsVoyq5mcISyDKbf1uPs08WSzfO8ZO+gwos0AU8D l5JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OeIwrghjWv1itdsEcBmUCDSZH1m4e3A3+aJ94H0DMKA=; b=f9N09jtxqK0K2t+Vn4TUsf6HJLLwoaDcVicW16gbOXtWEw0qn1DmK58WnQDe6zRXjk 1+lPzHaQofktao98AkkyJ57qAWzX8hrLIlsXay1RDm2+cUkgGEYwTRpTPNkkhkTiAgAb 6EDm2TtudiU7sAhwKMydBuoWHKqNvbd/2iCYZ3HmwlrxwmAh7m0szYFnEtJt9x+QP8OT Pb7eM1hZd0bUrglV+YeKZgkcXGx5GZ8D7RYHZ8USsKlumIJaTb1MSX2FJ9eH2yJ2kwsW LUuRXR0TgNEx0nPayY5wHPmq4pntT+6qQ+XLU3p8FI+TJLsh3Arx/b6hI+AGhF1T2Dc7 FL5w== X-Gm-Message-State: AJIora84O7SaJ/veWL/XLkXahmu7m2OZrpa8JSv04kbaD3dH6sjknS0O QvtKE/dqIE/Na8M14OXo6PMMmA== X-Google-Smtp-Source: AGRyM1vscC01dfCS/5xXseWFralreHKQW/CSj8vShH3qf6EqRgbWjqqNp17PAFhHjKV/myPWE6uc+g== X-Received: by 2002:a5d:6e5c:0:b0:21d:7ba1:3601 with SMTP id j28-20020a5d6e5c000000b0021d7ba13601mr17597477wrz.554.1657550918856; Mon, 11 Jul 2022 07:48:38 -0700 (PDT) Received: from myrica (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id b17-20020adff911000000b0021d819c8f6dsm5922653wrr.39.2022.07.11.07.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 07:48:38 -0700 (PDT) Date: Mon, 11 Jul 2022 15:48:13 +0100 From: Jean-Philippe Brucker To: Xu Kuohai Cc: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Will Deacon , KP Singh , Mark Rutland , Catalin Marinas , Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , Zi Shen Lim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Jakub Kicinski , Jesper Dangaard Brouer , Russell King , James Morse , Hou Tao , Jason Wang Subject: Re: [PATCH bpf-next v7 4/4] bpf, arm64: bpf trampoline for arm64 Message-ID: References: <20220708093032.1832755-1-xukuohai@huawei.com> <20220708093032.1832755-5-xukuohai@huawei.com> <4852eba8-9fd0-6894-934c-ab89c0c7cea9@huawei.com> <893b2d5f-16e9-0b1d-4ae6-8199e0f4ccf8@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <893b2d5f-16e9-0b1d-4ae6-8199e0f4ccf8@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 11, 2022 at 10:40:42PM +0800, Xu Kuohai wrote: > On 7/11/2022 10:37 PM, Jean-Philippe Brucker wrote: > > On Mon, Jul 11, 2022 at 10:16:00PM +0800, Xu Kuohai wrote: > >>>> + if (save_ret) > >>>> + emit(A64_STR64I(p->jited ? r0 : A64_R(0), A64_SP, retval_off), > >>>> + ctx); > >>> > >>> This should be only A64_R(0), not r0. r0 happens to equal A64_R(0) when > >>> jitted due to the way build_epilogue() builds the function at the moment, > >>> but we shouldn't rely on that. > >>> > >> > >> looks like I misunderstood something, will change it to: > >> > >> /* store return value, which is held in x0 for interpreter and in > >> * bpf register r0 for JIT, > > > > It's simpler than that: in both cases the return value is in x0 because > > the function follows the procedure call standard. You could drop the > > comment to avoid confusion and only do the change to A64_R(0) > > > > OK, will send v9 since v8 was just sent Right sorry about this, I could have been clearer Thanks, Jean 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 38EC6C433EF for ; Mon, 11 Jul 2022 14:49:58 +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=t8SoxGA/EPqcgkR0VtD8ULxPMqVMKJIVSFHDOSNYT4M=; b=fcoREnXoiv93vg EjaDjwFGGAruyidshb9Qu2FcFvbv9mxBCr6E273pgSlpab66hvtJpe/1bpe6ZFnHihjn6kMKsNrYS ThNMc2dqgQwbCH5OFKAyxl2ES1cykcYa8h0+BIDBH4mYlVmbAj3e3Ma+ayLvWuhH6iQTRfFHDSNbb o/wlUzOk1D4FpV/qphMbCLaSAWFugUV+53y4haeYXj/Ei2gWgRlCO+YaH6WCEHg6o5eEs2JoduRQC UMt8TO8iWJVgHL3mnEfoG+Mtsc59C2DNcSxqMZ/MaNtauL0vqXrQrs99hSiBR7n3g3w4IZG+mtOAM znPVEgf6Ia/JsbZlZQVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAuiM-002XJX-Qf; Mon, 11 Jul 2022 14:48:46 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAuiJ-002XEv-0X for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 14:48:44 +0000 Received: by mail-wr1-x430.google.com with SMTP id a5so7320865wrx.12 for ; Mon, 11 Jul 2022 07:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OeIwrghjWv1itdsEcBmUCDSZH1m4e3A3+aJ94H0DMKA=; b=mi5bzmfy76j/A0JqIGs4L9rTEq0UWTfjTNwH3NpU3XTt27ad7yjuV7drDTaywqs6A+ 4+PQPa4vsJKRy6zcuawPUL65Zf2/19jaUHFTHnDHJHoeYqW25gy1LmILfUYjWKW86eWD FdIkLUsvTwlzo4+ghyC3YeigJia/vQ2OWjAv0x/qmIllC6gdLkN6JHZa70zbttJAJAfv e9d7JAzmuIQlfoZFZpczZcL4OKiCrJGT8QxC7Ew3F+fgtuD6T9nlF+Qb1/zAgoj4rnQx w7l9P5A7lTiEzPIA+YBAS9jO5qh1tsVoyq5mcISyDKbf1uPs08WSzfO8ZO+gwos0AU8D l5JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OeIwrghjWv1itdsEcBmUCDSZH1m4e3A3+aJ94H0DMKA=; b=GXCJbYaA9sEmbgtkuqWUrIQbDrKPc53XHI1z7Mk0CI8KdGp2PTsY1Bm3UU1xDIN9d6 pmGmaNZfuulLQyMcHJsh90ywT6GuKkJlEAgyWD+j0QTgDaEQ8PpHwr94MppydlcEAf7T bvaqmF4ykJMP3rTSM3/3Y0MxINsF5WAqXcGotX53B6lP0YWC+mm7WlBho7qP9coVK0IK h8Ucs4gcHP47iDaOiyApVvCofVwnFE7v/GX1xpVJDdTupi2dHmg89HXIeDd5XEJtJ4qX me2wmj+zKrLCPuJeSFAujtZyhDbmPXRQaACB2IBeGa/yXAdd1ipgefF5/drN6lBe+rz2 +Ifg== X-Gm-Message-State: AJIora/CHqVgnO1rWcFeRXZ8iQVG/tkvFDV0mkZHrmneNPOvlYjzBnNT 3agexF8d092TQEW/gN6N+320bg== X-Google-Smtp-Source: AGRyM1vscC01dfCS/5xXseWFralreHKQW/CSj8vShH3qf6EqRgbWjqqNp17PAFhHjKV/myPWE6uc+g== X-Received: by 2002:a5d:6e5c:0:b0:21d:7ba1:3601 with SMTP id j28-20020a5d6e5c000000b0021d7ba13601mr17597477wrz.554.1657550918856; Mon, 11 Jul 2022 07:48:38 -0700 (PDT) Received: from myrica (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id b17-20020adff911000000b0021d819c8f6dsm5922653wrr.39.2022.07.11.07.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 07:48:38 -0700 (PDT) Date: Mon, 11 Jul 2022 15:48:13 +0100 From: Jean-Philippe Brucker To: Xu Kuohai Cc: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Will Deacon , KP Singh , Mark Rutland , Catalin Marinas , Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , Zi Shen Lim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Jakub Kicinski , Jesper Dangaard Brouer , Russell King , James Morse , Hou Tao , Jason Wang Subject: Re: [PATCH bpf-next v7 4/4] bpf, arm64: bpf trampoline for arm64 Message-ID: References: <20220708093032.1832755-1-xukuohai@huawei.com> <20220708093032.1832755-5-xukuohai@huawei.com> <4852eba8-9fd0-6894-934c-ab89c0c7cea9@huawei.com> <893b2d5f-16e9-0b1d-4ae6-8199e0f4ccf8@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <893b2d5f-16e9-0b1d-4ae6-8199e0f4ccf8@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_074843_083163_BA897760 X-CRM114-Status: GOOD ( 16.80 ) 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 Mon, Jul 11, 2022 at 10:40:42PM +0800, Xu Kuohai wrote: > On 7/11/2022 10:37 PM, Jean-Philippe Brucker wrote: > > On Mon, Jul 11, 2022 at 10:16:00PM +0800, Xu Kuohai wrote: > >>>> + if (save_ret) > >>>> + emit(A64_STR64I(p->jited ? r0 : A64_R(0), A64_SP, retval_off), > >>>> + ctx); > >>> > >>> This should be only A64_R(0), not r0. r0 happens to equal A64_R(0) when > >>> jitted due to the way build_epilogue() builds the function at the moment, > >>> but we shouldn't rely on that. > >>> > >> > >> looks like I misunderstood something, will change it to: > >> > >> /* store return value, which is held in x0 for interpreter and in > >> * bpf register r0 for JIT, > > > > It's simpler than that: in both cases the return value is in x0 because > > the function follows the procedure call standard. You could drop the > > comment to avoid confusion and only do the change to A64_R(0) > > > > OK, will send v9 since v8 was just sent Right sorry about this, I could have been clearer Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel