Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp560259lqi; Thu, 7 Mar 2024 05:38:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU7xpyIwYqK9EQusKu1oeYaXo/xIAMTyV3DG7+i664p6OX5j9MrHCE8VQxJtXg9/2HVVtVZp1RWmUslPYIXaEnaq/z7hnBgFtPXEBGOcg== X-Google-Smtp-Source: AGHT+IEfvEEhusjKx/NFb4Ps3N2y+tylA5FXy0pXj2AINR1EPb2c2YtN2gC3z/xUdvfeKlWNXIJh X-Received: by 2002:a17:906:3b45:b0:a45:b64d:8611 with SMTP id h5-20020a1709063b4500b00a45b64d8611mr1285693ejf.14.1709818685688; Thu, 07 Mar 2024 05:38:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709818685; cv=pass; d=google.com; s=arc-20160816; b=lOGtDOtzWDT/oghV7pKO2HVyKiXlviYvNswqxL4UO0pv2FpJuziDdOI/hHwdGi0QQA KQGKs8O/DRaBBiHzmGC9/r/pIE244VZl85TppzvC2yUTRy/NWHuOCbLAYCO74n/2npe9 f5yGTt9vaRyAM432oleZZ3/rS5WVmGmRcxNZRQ32k+HHjEcziCwMvHJW8GeZfUvFWhn5 dF0FICD17QL3wK2zjRJIXKBqkyBbZ+OOo1dmazDV3FNB258taNhZRaEgJigiuXBSevGi O1+7hyxsy5s+5QEfrNhvYgZ1x+yRpxpnE1g1Q8ZzHJW4XTomukEodMyHoXNpgWICyc4d w4DQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:cc:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=Ag3jtviUWsG1ivLfoWdJ4fz2F6hgZrEfLrLh3FXjId0=; fh=Cgjen7VptPUVT/ICOzIA/uIywZIdvQlkIKwp/bPOXaI=; b=lTCCIU4eec9feR7I4OsodYEIW/ZaGCWh2L54FftbWBhxjgrl7zA/OxoOMyZDj1w65f Lq4lju4yoL342Gy8rOUntADco0rtnBbtFiF2Rswfy2+A0RhEGxGr+IEeDfoGy5jH2uxO vPmF8cRewcg8qliIvnGj8uYaTv6FdDvISyo5Ob0Wmh928EAf0/Aq1dKGLV6yOy5Qbxrx 1X7XqNrZL/i8rIGzlzLXQ1x2+q7PBX+9z018sTB75lyBl8DhCHH98h5A2nqCJ9Xq4jyu XBp8vd7b7BuD5yZR/7nGua45oeTbXACXRICOs2KonWzoJrBsu15fiyXwfIgHh27CY6u3 zwPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-95615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95615-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=QUARANTINE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id js16-20020a17090797d000b00a45ceff2392si565298ejc.707.2024.03.07.05.38.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-95615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95615-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=QUARANTINE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4DBE91F21E40 for ; Thu, 7 Mar 2024 13:38:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7301812D212; Thu, 7 Mar 2024 13:37:49 +0000 (UTC) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95F2412BEB6; Thu, 7 Mar 2024 13:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709818669; cv=none; b=kNB4KTold+tI0TY7uvOW0gGixYds+bGpC18cE5I1lv6EMHZzoelYwZ3vDC9KV10NChf8Mzn8voz8zXelpz+2F9nCu/vqgh8+Xb5ZnzNxo9bTj5hlguievBae18w2Fu/MywmydH28prAo55CNvN7OJhCz3Wh4KJwkfZGONQLcQfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709818669; c=relaxed/simple; bh=OVr0pI2pabYmwUQqqDKQMzljSj1CvAAHW3fslRAS1Mw=; h=Message-ID:Date:MIME-Version:Subject:To:References:CC:From: In-Reply-To:Content-Type; b=JpkOn/bXZfVvcv3DVQ2+dgFRoSnXuQ3ba1gNIh3Psctx2HTyj6KwkF7SpFoDl3tBV/zGu3XnE2fcfdsQ3o9KSnt34o6UK5hr8GEPnhdm1Wq3WcMoof1+rFtH58o6Rl2zSf6ND5qYM8uUi1qncTlYI/YPfAoYOK1S1O7P0Qfj6/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Tr9MK5mltz1vvq5; Thu, 7 Mar 2024 21:37:01 +0800 (CST) Received: from kwepemd100009.china.huawei.com (unknown [7.221.188.135]) by mail.maildlp.com (Postfix) with ESMTPS id 7B29B1A016C; Thu, 7 Mar 2024 21:37:42 +0800 (CST) Received: from [10.67.109.184] (10.67.109.184) by kwepemd100009.china.huawei.com (7.221.188.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Thu, 7 Mar 2024 21:37:41 +0800 Message-ID: <6beb3f5a-5d72-4443-81bf-3c809b86f7e0@huawei.com> Date: Thu, 7 Mar 2024 21:37:40 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next 1/1] riscv64/cfi,bpf: Support kCFI + BPF on riscv64 Content-Language: en-US To: Puranjay Mohan , , , References: <20240303170207.82201-1-puranjay12@gmail.com> <20240303170207.82201-2-puranjay12@gmail.com> CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Luke Nelson , Xi Wang , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Sami Tolvanen , Peter Zijlstra , Kees Cook From: Pu Lehui In-Reply-To: <20240303170207.82201-2-puranjay12@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100009.china.huawei.com (7.221.188.135) On 2024/3/4 1:02, Puranjay Mohan wrote: > The riscv BPF JIT doesn't emit proper kCFI prologues for BPF programs [SNIP] > > -void bpf_jit_build_prologue(struct rv_jit_context *ctx) > +void bpf_jit_build_prologue(struct rv_jit_context *ctx, bool is_subprog) Not tracked in time. Some nits, although it has been merged. We don't need to add new parameters here since we can fetch prog in ctx. Others, it looks great. > { > int i, stack_adjust = 0, store_offset, bpf_stack_adjust; > > @@ -1740,6 +1749,9 @@ void bpf_jit_build_prologue(struct rv_jit_context *ctx) > > store_offset = stack_adjust - 8;