From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07BC141F36E for ; Tue, 28 Jul 2026 09:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785231024; cv=none; b=B5/AAOwVG3wanjIbK2xzIWS2mTEIUyr4LdGtyNiv4tFg7LgrCfDKYNGmJz+x6pK9RnGHBtkkU++cgIPX5gp27Qzqn6w1M3BNIj3rMj90z3pJO0RT0grn3lYFMPdNgkQx+Rn2C8m1oFTeOU96PLsrvdA6xxGhT6MNs8uOMsiiy1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785231024; c=relaxed/simple; bh=5birTs3jZadiSM71ETEkOn2VcKNyOlS3GF0BwSWxb4Y=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sYn5vvVpJmGIFP0dRscR00NAjCc6Xpx2Y5EgIGin4e8oooLQ1FaGYbwgpAGJnn29UfBY8jbewB6nWNhOfdM0i6yuxwGEThQaQ5eqTtz8iqfNjKIZdFZLv/x1SEsAB6VmEvPEZpl3Ozx0M3AofvloJtWlA77T6k4+eViZApnz04o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qdfn5M+9; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qdfn5M+9" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4953de5be0aso23708685e9.0 for ; Tue, 28 Jul 2026 02:30:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785231020; x=1785835820; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=fd4u7HbSw7LmAIg2c748Ol/BOezHkKcbVf+2ouQF5V0=; b=qdfn5M+990Eb/ueBBcYv4rI4czjhL32WeHkZFSAwMUANwR8LSeNpH9aJ042VXMwygF ilJzjV2kFlmv8zcvodkKL6qEEq9OLAEUc8cG1tReGvP/w6VrGzYTJCN/2IXLqS4FiuPW CAlnz2cyfJg9e1dct16QM0RR31YC1zXwXuantdTNbo23qLau2NL3cvQvFw5RrUVZ9tR2 69ejLOml3G0SKy9/U9MZCK/Ic5d3i13kxbul28Uk7Dg1rc9gPkWMRbb2oBQCBtXOrgB/ jR0/3u88g+ms7a6sUW2hWd4AH2mMI8mm8zfa6m9kFgp1MQnCnexOdM3Gy7QrMDcMXCl2 obHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785231020; x=1785835820; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=fd4u7HbSw7LmAIg2c748Ol/BOezHkKcbVf+2ouQF5V0=; b=J8ay/PTBCpXBNJ6XQJGTdRoXGOVnRwXRjzphuI+4qNUGWOmQ9B4NxcbR0oYrz383/M z8Mj0oMdBQqJsf0z1qwxWePuRtAbILvYM+cX5RbxAY7qinPRUQ5Bd72D4OZMliDaMWF2 8UV+kYULu038QNTyM8GzPXkS+5CiraaikqRDuCIzuWZ/qTkghxSanJYGifx3TGWobhzD EypbQF986wySRHsCq+4EnB+LEUOwAsA0RGcWIXRXvvZ5LzHnQHNr7TXnOQGUJHve4XV2 hMITRtTtAdTABTtsQSB5DFsqWSSoTv2B+8S47w9ycc5gIi07qvY8oi5wAeACMwSC8Nu5 TMtA== X-Forwarded-Encrypted: i=1; AHgh+RruiqyB7WcnPjlE+TFbbyNODhseTr0jyVb7En6EgTAQe2UHxWSGDJbOISxTKT/vQ4OiKJwvflJRiKhEmwQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx2snDMOy6+rFTe3g9RYXLaMGd4z/6W5sNh2uJ/CGGsAStEUy9+ wfJsvWkizPstfM8mNZ5ijDxuP3mIf/eJ17hBjm1C308bX2Na7fQo7SpA X-Gm-Gg: AR+sD12PlL7XauyFOkE5TG5ORaZPkZQiGcj7DcSLvyIWsgMJ8Y3WgYnAU23zpjKZRyP yuZhdijMFGmmamd2/mjlSwWq6TvPFcvtH9wNUUpJQR37wag/WV/Aa45ELsTVYwptRfR9QBV0+Eh 50NNK7qhmN9z7niICWVi4Pl9PBY+auKSjVrCyvV0is89De5WLMRbyKWNxsP/0PbbWrBrJX8TtSm WykaPgxuM2+/Ekbt/VG1s/N0poKLmeo6UTHj/aibQYw+NCsCJfaQZXMTPHjx+uiQntca9DGVRqa TB4j9cvnDqkgobOH/5zvs1CdcmmD4ch0jEmXL9mIiqzO4pt717SZQCUt8sWIkzFiwMGTbTgCBwX izE9gMYNP1JBbsr42w8fvdO1CvLW+WfoBacJyzI3806zLeJu2Qqc48SATKp+SV67onRA3J3cbm2 MrANcIcGQuSYJeEj6vgO4+duggrmnzZNUJnMyeR4Y= X-Received: by 2002:a05:600c:310b:b0:495:779c:fbef with SMTP id 5b1f17b1804b1-496c65aaf28mr16540495e9.37.1785231020039; Tue, 28 Jul 2026 02:30:20 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-496c44b84edsm99732275e9.5.2026.07.28.02.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 02:30:19 -0700 (PDT) Date: Tue, 28 Jul 2026 10:30:18 +0100 From: David Laight To: Eric Biggers Cc: x86@kernel.org, linux-um@lists.infradead.org, linux-raid@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Andrew Morton Subject: Re: [PATCH v2 3/8] crypto: x86 - Stop using cpu_has_xfeatures() Message-ID: <20260728103018.00938ac6@pumpkin> In-Reply-To: <20260728021603.79870-4-ebiggers@kernel.org> References: <20260728021603.79870-1-ebiggers@kernel.org> <20260728021603.79870-4-ebiggers@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 27 Jul 2026 19:15:58 -0700 Eric Biggers wrote: > Checking both boot_cpu_has(X86_FEATURE_AVX*) and cpu_has_xfeatures() has > never really been needed in practice, and it's never been universally > done (e.g., lib/raid/ omits cpu_has_xfeatures()). Nevertheless, both > x86 and UML now explicitly clear the AVX and AVX-512 flags if their > xfeatures are missing, which should remove any remaining doubts. > > Thus, remove all the calls to cpu_has_xfeatures(), as well as the > related checks of boot_cpu_has(X86_FEATURE_OSXSAVE). > > In a few cases there was no corresponding boot_cpu_has(X86_FEATURE_AVX*) > check, so add the missing ones. > > Signed-off-by: Eric Biggers > --- ... > --- a/arch/x86/crypto/aria_gfni_avx512_glue.c > +++ b/arch/x86/crypto/aria_gfni_avx512_glue.c > @@ -196,24 +196,15 @@ static struct skcipher_alg aria_algs[] = { > > static int __init aria_avx512_init(void) > { > - const char *feature_name; > - > if (!boot_cpu_has(X86_FEATURE_AVX) || > !boot_cpu_has(X86_FEATURE_AVX2) || Doesn't AVX2 require AVX support? > !boot_cpu_has(X86_FEATURE_AVX512F) || > !boot_cpu_has(X86_FEATURE_AVX512VL) || And (less sure) AVX512xxx require AVX2? So the extra checks could be reduced. David > - !boot_cpu_has(X86_FEATURE_GFNI) || > - !boot_cpu_has(X86_FEATURE_OSXSAVE)) { > + !boot_cpu_has(X86_FEATURE_GFNI)) {