Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp780586imm; Fri, 28 Sep 2018 06:45:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62JGGBjokMNOEBq4Sba75aDSegr1zuCcELfv7Ka+0NVSQ+wxA0rbwfclR8Ngkt/6AhjqY4F X-Received: by 2002:aa7:8118:: with SMTP id b24-v6mr17097725pfi.78.1538142356792; Fri, 28 Sep 2018 06:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538142356; cv=none; d=google.com; s=arc-20160816; b=NJmUGQINpMDfnI7VUA8GvxtyVd1324SdcbkLwzJWmL72HwevUxYEpzTfcVszsBCGYn b7du9qw8VbMQf5i30B998tX7vXBbl9l+AhKFrauBbwAwawJdYYroQ4QyfLtAqhSrQsZn EYRednpwQCEFhtglATEIw5hN19jl7W8FO20ZUwOlc2WKS4s8TojdltUB5ZlQg6+3ZQYA bdbFc9aT67pi7dlEHM/HzXJTNgTGHyvMRP4qiiR46OQKido7E2qMK1WMmoj0xTWNYQDR TRDLtYgY5euwSFe+eguBTROYtnL2GwX72a9xmzyspXytUEgInAN/xKYASrMo1E+0hFhm nXNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5n6kIec9uRfxNirP+s3qlYmAx4mDPzzj0BFGdV+CJE4=; b=gGcd/XSsz/Nzy9N7weW0Rw3PImBYmBxzEjoA4ox0LbJXgd54dLWjg1BuT9BtNRaXCG cjlIukAjzpCE8CnemEyEC8n1h+3KxL9B5SCuK7JZy9qv2qzqRhoIu7fJHzxZbOe8fw1+ BZqM5IeT0jRjtuPDFbmYpN4WV97nfx7pGY3bsqEYiS7UkW0ZITyqItFHW55p9vUEiHWF yyo7QEBwnbBPMUdZKVb7zB6d3U1CbK/8pHeOusbtyirqOuOdH2IxC/pbbdJN3wUrH0A1 KW80Pcv+M14FbbbVc1fE1fZA4bVEoGFYHKyL6H+8Wre5ePbLVI8nI5BmIWu+dV8R5WaF GGiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=hQYpCSyE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t80-v6si5087613pfk.228.2018.09.28.06.45.40; Fri, 28 Sep 2018 06:45:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=hQYpCSyE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729242AbeI1UJ0 (ORCPT + 99 others); Fri, 28 Sep 2018 16:09:26 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:35371 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbeI1UJ0 (ORCPT ); Fri, 28 Sep 2018 16:09:26 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 956d62f0; Fri, 28 Sep 2018 13:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=mail; bh=85KEiH+HEWdpKzwre9WUKCPAVmc=; b=hQYpCS yEBui2BTppXXTZjzYeAQn2o8g17QP/odVZEWGEKDt0WkJ5fu25vFWRIxqJsm/3e5 8k9G4zkQogbQUGg+TCSqry29VE7MNJKubWPeVPdiLqw7zfkFQG8sG+bjNHI6nkQt ioLN7OaImDW1dC/t12MbyXcvsdd/5X7fTyGW2/Q4jr/UwEd+U3xpZFJuVfjwwMBr P9xD7YN2J8I6ggD2AkrwWrj88LzT8rArpfr3Xci+0YJC/TOmK/IikRKOYD5DNKYG 7Cv1wsEDbDRPi13C/JzirQ10BOgHuUl8AsXMDzAiqOEcNrNmpmQSOSfUtT/wP6sC mPKu4DzXnRHcMz4Q== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id ff3735a0 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO); Fri, 28 Sep 2018 13:26:45 +0000 (UTC) Received: by mail-ot1-f49.google.com with SMTP id j9-v6so6103953otl.2; Fri, 28 Sep 2018 06:45:32 -0700 (PDT) X-Gm-Message-State: ABuFfojiUTlzQQ2mhQKRgPJK/CE8OPZmckooCe5ggKO0mevmKaYgboRR 0sfcZRgwo9fVPXihNnT6tsJJBKQvltoL94XsSyw= X-Received: by 2002:a9d:1719:: with SMTP id i25-v6mr9530887ota.223.1538142331791; Fri, 28 Sep 2018 06:45:31 -0700 (PDT) MIME-Version: 1.0 References: <20180925145622.29959-1-Jason@zx2c4.com> <20180925145622.29959-2-Jason@zx2c4.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Fri, 28 Sep 2018 15:45:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net-next v6 01/23] asm: simd context helper API To: Ard Biesheuvel Cc: LKML , Netdev , Linux Crypto Mailing List , David Miller , Greg Kroah-Hartman , Samuel Neves , Andrew Lutomirski , Thomas Gleixner , linux-arch@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 28, 2018 at 10:28 AM Ard Biesheuvel wrote: > Given that this patch applies to all architectures at once, it is > probably better to drop the unrelated reordering hunks to avoid > conflicts. Ack. Will retain order for v7. > > +static __must_check inline bool may_use_simd(void) > > +{ > > + return !in_interrupt(); > > +} > > + > > Remember this guy? > > https://marc.info/?l=linux-arch&m=149631094625176&w=2 > > That was never merged, so let's get it right this time. Wow, nice memory. I had forgotten all about that. Queued for v7. > > +static inline void simd_relax(simd_context_t *ctx) > > +{ > > +#ifdef CONFIG_PREEMPT > > + if ((*ctx & HAVE_SIMD_IN_USE) && need_resched()) { > > + simd_put(ctx); > > + simd_get(ctx); > > + } > > +#endif > > Could we return a bool here indicating whether we rescheduled or not? > In some cases, we could pass that into the asm code as a 'reload' > param, allowing repeated loads of key schedules, round constant tables > or S-boxes to be elided. Sure, sounds easy enough.