Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp479634rdb; Thu, 2 Nov 2023 09:01:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3fHbaFkoN72o8Cr98akUzWb0PTz3YdLIqUQlJzU4Eio6VJf+/60QzQpIdzbNt3F4OZNL0 X-Received: by 2002:a17:90a:2a4d:b0:27d:6dfb:405c with SMTP id d13-20020a17090a2a4d00b0027d6dfb405cmr14001081pjg.42.1698940863009; Thu, 02 Nov 2023 09:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698940862; cv=none; d=google.com; s=arc-20160816; b=Z5tMlcgqLy16prht0tCUQB9zgja+lzeHwM0vAOLCOZ8k6VoR6ofyIwRJz02ANmXobh K9+wCpiX4+IF8DCdzziu7U/0wJckgTQF9qKHtrergg2h/CvCVTcmICrWVnEkCUUf1EuC YGEJtQ4PdgU16cuPaJpg00XxDjaWJYOLFEHpzzerOa02Mi3BD0hiCNoWKXsHK3+bARzd CCkdaWpV95Kl7En5MPYEjyoVrgsHGgUOOtUNnWrzVe7xyV0EFTnywwTOHVY3Oo3qOe5D rhgVja43UzEHodeWrcF/SyLpWtgH3Jhg4PAwK/wjFUIRGWRYDwc7vnrgS2RMl8mI9utX GDng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+O5VfXaJ2+Ncr6Q2MVN8Na2Te8/hecFSWNiG31y2EU0=; fh=8Fns8wHWLsKqVMKR5iR1DBOHBhQ6zhYqk+gXrmo34vE=; b=qvZEQpwjZ5lLdFprBJ4JjucakzlC7NNhwsqCT8W/XeJgUzBEjdbIJgR/wL+b6q923n 2GBiUWkjvZTiZheWLyJ8tSZN+nT9BoWM3hdxKcH/KcY7nfGGcrbQ89HisCX7YWdbl0tK DYhiuC6ldA8fyHp9towhjcC4R62uP0a6pGi0rkKjbKeLrSwIoW7ZLJiELjsaTyo/Oubv IGddTpwoqwgIxIcQMTkD0Eqw3ZO5LuvlLwRjCEj7audMCFUZZe9kH8cc/OhVxlcGyhtA 46q3bC0801EuKh4Nr7juMbMetp1KR6wSzm6BfVw7lVaLvySZx721qiEWbpomSOYMTJFi yl9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id kb2-20020a17090ae7c200b00276b35bc424si56373pjb.26.2023.11.02.09.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A864C8071055; Thu, 2 Nov 2023 09:00:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347676AbjKBQAE (ORCPT + 99 others); Thu, 2 Nov 2023 12:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235482AbjKBQAC (ORCPT ); Thu, 2 Nov 2023 12:00:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3A4E7186; Thu, 2 Nov 2023 09:00:00 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 41DEC2F4; Thu, 2 Nov 2023 09:00:42 -0700 (PDT) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.27.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45F3B3F738; Thu, 2 Nov 2023 08:59:58 -0700 (PDT) Date: Thu, 2 Nov 2023 15:59:52 +0000 From: Mark Rutland To: Alexei Starovoitov Cc: Puranjay Mohan , Florent Revest , Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Catalin Marinas , bpf , KP Singh , linux-arm-kernel , LKML Subject: Re: [PATCH bpf-next v4 0/3] bpf, arm64: use BPF prog pack allocator in BPF JIT Message-ID: References: <20230626085811.3192402-1-puranjay12@gmail.com> <7e05efe1-0af0-1896-6f6f-dcb02ed8ca27@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 02 Nov 2023 09:00:13 -0700 (PDT) On Thu, Aug 03, 2023 at 12:13:00PM +0100, Mark Rutland wrote: [...] > However, in looking at it I think > there may me a wider potential isssue w.r.t. the way instruction memory gets > reused, because as writtten today the architecture doesn't seem to have a > guarantee on when instruction fetches are completed and therefore when it's > safe to modify instruction memory. Usually we're saved by TLB maintenance, > which this series avoids by design. Just to confirm on this point specifically, per discussions with our architects, the (architectural) execution of an instruction ensures that there are no outstanding fetches for prior instructions. IIUC that will be clarified the next release of the ARM ARM. So as long as we're certain all threads have left the old code (e.g. via a flag, RCU tasks rude synchronization, whatever) before we overwrite slots in the shared buffer, we should be good. We will need to be very careful with the maintenance when installing new code into the shared buffer (e.g. we will require an IPI to all other CPUs), but that should be relatively simple. I'll go review the latest patches with that in mind. Thanks, Mark.