Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp303866pxj; Thu, 3 Jun 2021 07:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1y19xT9yRmBvcp7JGEgD2GpPZHB1ccs7WIPSOqhu6d9ScvYAlgvJQ9bfncAg2sX0skelY X-Received: by 2002:a05:6402:22d0:: with SMTP id dm16mr4932505edb.123.1622729327458; Thu, 03 Jun 2021 07:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622729327; cv=none; d=google.com; s=arc-20160816; b=QkgSCC8/qQkRSI4QY0mnWJcm9akMlRBjeA6Kp78/UtvMHQzDTqSXlTrnTVuzFY0Mhg rw/HFFIr4wmoVaM1ErYimwfrCdQCQem4yWdB59pIuJQ7NZNY7zj7j6T5CR0h/BC7Z65E Y96oxdC61kiM1VkEPTfnUv/3yFtvJ3zSVEX7GFLfjCwKZay9dyqjRssSA6K8Bbmc8QVm pVUa8thelFnywDeSiQMQOXSd5Lc9qwlnoyqqgabgEkR6n43lkf8WfFz6EsKB6lII2deL OYqJ0EqBgeFsyPkhPTxFr5FOTjCmc/vu7Tmlsf0YzaSgvqUhkz1s3o/LfS9QTDnmgDG2 aggw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gBucM2tWIfE7RZufFyihAb1W7wKbEZlz8vfM9AwERz4=; b=rmuhYaEdnOgubNojPDdMTH7BEDbtkZjJmSmqO7f6vNIRV9BWUYyzI8h5VeB+0yKn/J tEgL03X0+5poieoZ20y3gVrA7Ee7WSFQPuc1QH6ULpk39NAn9b9spUJC4DmG5cj9wtQf 1kL3FOp+Rq+R0WZyK0mDyr+wCycs8S472ixLwjnAeMUSWmkvCl0Zt5LqUZahrCIRY6Z1 KdU2DJTM2kSXCJ+IT4GVbundEyj23wXlh996jzTY7ncaa0aWCB0MoNN1aeK1JhMqVcXY PhHO+xVYLWM3MTxKV+o6UkJpquUjjqfmaUYcBsOxnnsoCoJ07vPXwBC+ZpAE+GV6YhYg yuVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fGK8XT6+; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a6si2270756ejy.213.2021.06.03.07.08.14; Thu, 03 Jun 2021 07:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fGK8XT6+; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231376AbhFCOI4 (ORCPT + 99 others); Thu, 3 Jun 2021 10:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbhFCOI4 (ORCPT ); Thu, 3 Jun 2021 10:08:56 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD451C06174A; Thu, 3 Jun 2021 07:07:08 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id i67so6006452qkc.4; Thu, 03 Jun 2021 07:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gBucM2tWIfE7RZufFyihAb1W7wKbEZlz8vfM9AwERz4=; b=fGK8XT6+BUSnhZ8oa5WyG3+FwOoVnO7kx1SWuB1mWpl8OSCDir9F25H536ejgTS5MW zEP18f/4RqSBokjZipKa28rD/yHbL40Ik1TtuOGvN3KhRjstap7dLalCasO3rKIZAyCT LGh3UhS3NyagGfg3oKKmXH48t5uKuo7WgRWy3ZZ1Nwsvcx9wakm79frr+jsaehC4LNPJ 1BfFcn1OCaAyJjmWD6VQovcjuamQ2ZVwsF7QivS8uexgpAKYv3V7Eiwm1Qi/OQDgjkIS lCw/02Zs5IVl3EubFSsyWR84WtIcFcPCfCCpvoYGW0ff9hL+qAo1TZGkbFduwyBQ4XLX YLZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gBucM2tWIfE7RZufFyihAb1W7wKbEZlz8vfM9AwERz4=; b=B7uj0sdCGfmw/3QW5lw3Gvf19miPQvvPqAsWaJy8bd4A/CoEAaLT39LZZ3EjMMohyE NOg12kl1tFXOXg/4Ij08kiVIgjz1iEu63Wnx4UJz0aCL7sEmZimMQjdL9imxEqNzjJ5j tPdRMCz1hc/0O9bBsEqd+GajZFisNwC5W0Yc8UbWLEY6qVAzXEgqn2UgREIHdKlxN1EE qw3HsmUHwP56L9tnvJ/Q2jgz+eVy2XRsPZicblmErnJSoVQP8/ahTCX4CPrE7FhMH7e3 E/Pp2X3irN9nGHA+3PpyrwRmsoMaBMkIr0cw0rKYcOgOfCmhs0aKUJTSqhje1PhRhRjs 11lQ== X-Gm-Message-State: AOAM532zrIn3pctLq7NUXl33HxjWg0gTJcN/IspCqIlkMn/o/f3+aAv1 Uv3QLj2kvlugfc8wLG6LajLX0sSWpUJmm9JUuFc0TMKuMKYVhQ== X-Received: by 2002:a05:620a:22f3:: with SMTP id p19mr32675566qki.281.1622729228073; Thu, 03 Jun 2021 07:07:08 -0700 (PDT) MIME-Version: 1.0 References: <20210603055341.24473-1-liuhangbin@gmail.com> In-Reply-To: From: Hangbin Liu Date: Thu, 3 Jun 2021 22:06:56 +0800 Message-ID: Subject: Re: [PATCH] crypto: x86/curve25519 - fix cpu feature checking logic in mod_exit To: "Jason A. Donenfeld" Cc: Linux Crypto Mailing List , Herbert Xu , Netdev , stable Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jun 3, 2021 at 6:24 PM Jason A. Donenfeld wrote: > > if (IS_REACHABLE(CONFIG_CRYPTO_KPP) && > > - (boot_cpu_has(X86_FEATURE_BMI2) || boot_cpu_has(X86_FEATURE_ADX))) > > + static_branch_likely(&curve25519_use_bmi2_adx)) > > crypto_unregister_kpp(&curve25519_alg); > > } > > Looks like the error is actually that the `||` should be a `&&`. But > if you'd like to branch on that static key instead, that's fine. Yes, the code would be shorter by checking the static key :) Thanks hangbin