From patchwork Thu Apr 29 03:15:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Niethe X-Patchwork-Id: 1471493 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org; envelope-from=linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NOBadK/1; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FW11l4Mvcz9rx6 for ; Thu, 29 Apr 2021 13:19:07 +1000 (AEST) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FW11l3YKTz3bTW for ; Thu, 29 Apr 2021 13:19:07 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NOBadK/1; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::636; helo=mail-pl1-x636.google.com; envelope-from=jniethe5@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NOBadK/1; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FW0zF15pDz30C4 for ; Thu, 29 Apr 2021 13:16:56 +1000 (AEST) Received: by mail-pl1-x636.google.com with SMTP id b21so5492889plz.0 for ; Wed, 28 Apr 2021 20:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=POSty/xjT/eLodok8fWzwr6xbYAtFXCRxSVPBEi6woo=; b=NOBadK/10MTb8wtEyPK/XSXKZFLjoqJ3g50mEfgERx8/RNh4EppQkBcNMflkNdUwPb ASaOMvfbglBOgEaPznLBBrt3TWYq+87QPDvXMlMdveKpgvZvBpvA4kFrrYk9iWr9ZM1G 9K8c6u15aV7Sz138LuoUrScNGF5Ab3kDdwVK8nHqXM3wkzpU+imRa7HcdBdDFWcJI8lr mz5liLy31Ri5h4UFtn51z0QALqDmEmFTFd/uQspyGwV9Nt/ln1zREbK+FKK84a0bCnvT F7Re43GIY/OYTgTp7v6JaXD67eF/dGBrTMN6+l9WI1qHmqkmhXQOjALDtU14fJhLXrOF 7NzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=POSty/xjT/eLodok8fWzwr6xbYAtFXCRxSVPBEi6woo=; b=JPX8xMoKErz6AVtbCZWgN71Lr2Rq2viHoY+yt5RHDJLKygCMIZdbWmJkVh4nXNqoMh YWOQDIh9LMoG2hrFLdiG0IKDnTAVrvwCPGE8nZBC+xzl8uok3mh5kN0CypfOeS+zVAWk v73vi0ba+5Uzmkisrt8p7B4yy/t/7uAIzBl/ZO56kP80Sn8Yk4Lasf7A+vG3DHWrdIb+ d9BeikoxKUsbuYTajgZzpkrbE/dvjzlOms+HR4nIuDzjwvqRCeskrm54OwrweVYTSJHe xTsNl+IwKk1Ny9bO9Q1Hyr8/XDi4bHV0hyb30BJgBepsAZ2YCqpd8Z489Kk+YeYG07JJ 4a1w== X-Gm-Message-State: AOAM531ArS7dRRDyHCmxN56renF1NPA9JOLKt8XBwp6hu1tWQv+T4mnB 2aAGyKaCL82Yqz9Na+iju4e+KSb6lBw= X-Google-Smtp-Source: ABdhPJxid+nERDImsayJJ46qOnxNj46VzDP5CghkQKYDp67KMeNIxUWFg9fMNtcQnTdYOFUjgIEnRA== X-Received: by 2002:a17:90a:540b:: with SMTP id z11mr36470678pjh.133.1619666214048; Wed, 28 Apr 2021 20:16:54 -0700 (PDT) Received: from tee480.ozlabs.ibm.com (159-196-117-139.9fc475.syd.nbn.aussiebb.net. [159.196.117.139]) by smtp.gmail.com with ESMTPSA id l16sm3650742pjl.32.2021.04.28.20.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Apr 2021 20:16:53 -0700 (PDT) From: Jordan Niethe To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v11 5/9] powerpc/bpf: Remove bpf_jit_free() Date: Thu, 29 Apr 2021 13:15:58 +1000 Message-Id: <20210429031602.2606654-6-jniethe5@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429031602.2606654-1-jniethe5@gmail.com> References: <20210429031602.2606654-1-jniethe5@gmail.com> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ajd@linux.ibm.com, cmr@codefail.de, npiggin@gmail.com, aneesh.kumar@linux.ibm.com, naveen.n.rao@linux.ibm.com, Jordan Niethe , dja@axtens.net Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit 74451e66d516 ("bpf: make jited programs visible in traces") added a default bpf_jit_free() implementation. Powerpc did not use the default bpf_jit_free() as powerpc did not set the images read-only. The default bpf_jit_free() called bpf_jit_binary_unlock_ro() is why it could not be used for powerpc. Commit d53d2f78cead ("bpf: Use vmalloc special flag") moved keeping track of read-only memory to vmalloc. This included removing bpf_jit_binary_unlock_ro(). Therefore there is no reason powerpc needs its own bpf_jit_free(). Remove it. Signed-off-by: Jordan Niethe --- v11: New to series --- arch/powerpc/net/bpf_jit_comp.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index 798ac4350a82..6c8c268e4fe8 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c @@ -257,15 +257,3 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) return fp; } - -/* Overriding bpf_jit_free() as we don't set images read-only. */ -void bpf_jit_free(struct bpf_prog *fp) -{ - unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; - struct bpf_binary_header *bpf_hdr = (void *)addr; - - if (fp->jited) - bpf_jit_binary_free(bpf_hdr); - - bpf_prog_unlock_free(fp); -}