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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0CB5C282C7 for ; Sat, 26 Jan 2019 11:03:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 667A3217D7 for ; Sat, 26 Jan 2019 11:03:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="l+9Tr0lw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726361AbfAZLDC (ORCPT ); Sat, 26 Jan 2019 06:03:02 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34465 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfAZLDC (ORCPT ); Sat, 26 Jan 2019 06:03:02 -0500 Received: by mail-wm1-f68.google.com with SMTP id y185so6560398wmd.1 for ; Sat, 26 Jan 2019 03:03:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=R6jV4wkUT8GuPYFvcetrJSwtRRTFcKAdo19z0iiO7V0=; b=l+9Tr0lwewC2eiepXS/MXT4L4T3HfdWiIBGkTnaobjjUjrSyeZhE8e9Y1CY/3gI914 DoDfSUh9KyhcM5uq4YFF5Kg83CIKY2jW0mOudB5hlLajR04RPP8GQtKUHBdrfN9u0IHk 4OgzW1ekQUF4JIIqDBQ3NMM2GVyzVk75sMN4qGsioBS5iQRVI8wxqeTpMaKMSDsUj8nC gyueZPF4HV8CiuRmcNAwnhAC9MZPQMk8YMSsLllyzoqilZpcwMEr2s1aBprrQqlyKlfL YbKEr0Ec/CagYLkdUzXNIytknxa1Ce2qQMqLBt8Pl3dRe0MOS4GvS24obiQmkSkMp/zu zZHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=R6jV4wkUT8GuPYFvcetrJSwtRRTFcKAdo19z0iiO7V0=; b=VU7OyGfWlNSyRZO5r4Z3s4IjnwS/RrG6UX762yP/5EQotvUyVkBXDSe+rWVJKKiYPL 7yHiKbNruix93l2Go4RTESud/MEfkoiORjsLPGLISqEhupKsTYA+4LjaRs9mdWIbKszO SjJfEJp+/9++9z+W0khRvF/2+GyjqkLHXO4tCoBtoT5i13nL/yH8HkrwVr78UXXwf8b1 omwzdw5q9jBxQTdDfnQBdKPUs2MYzD0Zs/osBxb48t8F0zoehrMoHQJ7cRHIzbG475ws 5TByB7f5VTn3pqUX5nUvHeW/eq77umVCJqkdEEmflc0oTCN96OFMbRdjvrEULEyPd3ut ibkg== X-Gm-Message-State: AJcUukdlYOuRZ3tuxP8eJPILfGSAm2NJKmsw2lEh7QYT6zQxWAQj0LIt 63oal01VYrKYfsUcvsge9vWNAQ== X-Google-Smtp-Source: ALg8bN7AbPx9wmJCwKbXM3A0oPtsEc3iWEZ66dc26w4QKEdeuYHYXHgMeybAvrWC+I6JJk6bgTOvhQ== X-Received: by 2002:a1c:2804:: with SMTP id o4mr10639164wmo.150.1548500580049; Sat, 26 Jan 2019 03:03:00 -0800 (PST) Received: from LAPTOP-V3S7NLPL (cpc1-cmbg19-2-0-cust104.5-4.cable.virginm.net. [82.27.180.105]) by smtp.gmail.com with ESMTPSA id w16sm132502150wrp.1.2019.01.26.03.02.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 03:02:59 -0800 (PST) References: <1548375028-8308-1-git-send-email-jiong.wang@netronome.com> <1548375028-8308-4-git-send-email-jiong.wang@netronome.com> <3e7a469a-8707-9d51-e1a9-0d57a489fcf7@iogearbox.net> User-agent: mu4e 0.9.18; emacs 25.2.2 From: Jiong Wang To: Daniel Borkmann Cc: Jiong Wang , ast@kernel.org, netdev@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [PATCH bpf-next v3 03/16] bpf: verifier support JMP32 In-reply-to: <3e7a469a-8707-9d51-e1a9-0d57a489fcf7@iogearbox.net> Date: Sat, 26 Jan 2019 11:02:55 +0000 Message-ID: <87a7jnptpc.fsf@netronome.com> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Daniel Borkmann writes: > On 01/25/2019 01:10 AM, Jiong Wang wrote: >> This patch teach verifier about the new BPF_JMP32 instruction class. >> Verifier need to treat it similar as the existing BPF_JMP class. >> A BPF_JMP32 insn needs to go through all checks that have been done on >> BPF_JMP. >> >> Also, verifier is doing runtime optimizations based on the extra info >> conditional jump instruction could offer, especially when the comparison is >> between constant and register that the value range of the register could be >> improved based on the comparison results. These code are updated >> accordingly. >> >> Acked-by: Jakub Kicinski >> Signed-off-by: Jiong Wang > > Series looks good to me, but if I spot this correctly one thing that has > not been addressed here is proper rebase on top of Jakub's dead code > removal, e.g. in opt_hard_wire_dead_code_branches() where we check in > insn_is_cond_jump() for jump opcodes it still only tests for BPF_JMP > class whereas BPF_JMP32 handling needs to be taught here as well. Thanks for catching this. Yes, insn_is_cond_jump() should be updated for JMP32 as well. JMP32 is guaranteed to be with condition jump operation only otherwise the earlier do_check will complain use of reserved encoding bits. I am going to teach insn_is_cond_jump to return true for JMP32. And search the commits, there is another similar new helper function in nfp driver jit. Will fix both places, and re-spin v4. Thanks. Regards, Jiong