Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2561923lqz; Wed, 3 Apr 2024 01:29:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFGRd0JNn6mPsTJ4u64eQy/z2yzjFAU5NjNuGhOfI9L0vQ2mc4IT5oZvYFenDFsHULMR1XoUAqAapLPXewRcEIL3D1FqOFRBbIZF2Wwg== X-Google-Smtp-Source: AGHT+IEH4eNeEfKFiURfjxyZ844uzC6Z6JfjiSocPVvKusFXC0SBr/xdVy751+FFTl/uUetrMMoG X-Received: by 2002:ad4:4f2a:0:b0:699:1e96:df4e with SMTP id fc10-20020ad44f2a000000b006991e96df4emr3531646qvb.47.1712132955975; Wed, 03 Apr 2024 01:29:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712132955; cv=pass; d=google.com; s=arc-20160816; b=NVNYyxFwoOamo2JdcMDGBcgnv6Sze9+FxncJ+y1vaBQhXgpAv/VGiEnunNOMkEKF4r 2bF0SAKP2m57tDAqTfVziRwfpTzEtlqDqePKpXg2jv/hpPYadKEIFkDmqFw6cK9iDUtm lQ2kFyg1NVmHE4rV3POAiN/PDbH/HbliFieK/XZ7vqFmOF8XYverw530sjfKl0eD1fmY kSAlQkXrRVFSYYDpN9w/A+CLx/GthtQsKUqXrjn1aDevEV2BGlkWshYEcHQjsd4bMWLX NRAXOeLGpsRBkr23dE0lULUORBG5Lr0dGL0VNkmi29fX19DAuUhIpVf1BpWRw+wPY0hj fGaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=F5GLYZ4fuSE5dKqNTu6A1TqQnoPZxyaU8BdFxxFCn24=; fh=eU75h2Iq/Sl7geMVqycHadElmZt9zY+//8adOBLUgbM=; b=LgxjX24daqTzWtOFDArGF3nxiHIyw9LqDKNlX/3ANTxMAQfxFmSLw4w9KphGMbwDdk KK4MyEl6XoM11bfNtlw4FQFWaWycXvWHoMuxVwsmi88sdocW5CE59lN6lyF7RaMXlx4W X2jq0EaMPz66AKmsCFrVomXWTCsKTr+FaAeOe9pgjiT/L8GiURyPFR7bXfM+g02hBgsg yCw8f3DI+d8BQVzHihZ9yhrZGAbI4lXI7+bLRRftwpUQ1ShxhLXkerBf1HtDTqbTM49J xdE12D7HhBl2Ba34ZR1VMlAWx4O/A/ffgBUmubtSOmeUPFPviCa6djrxS7067SRAIyMD F13g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-crypto+bounces-3280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l11-20020ad4408b000000b006992762485esi888515qvp.286.2024.04.03.01.29.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 01:29:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-crypto+bounces-3280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3280-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E642D1C23158 for ; Wed, 3 Apr 2024 08:29:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68144811E6; Wed, 3 Apr 2024 08:23:04 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 677D56F51D for ; Wed, 3 Apr 2024 08:23:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.85.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712132584; cv=none; b=UmlYI4iFr7lqrITJveJ4GBJ00xbXYSy0Wl57yohpXtj/4aDbVS7yKkMpIsD8fAhLIEMACGztDfhmB3HDoipBtt9YGwHxVQerLOrgXe4L2/OFlodcI7PJlHEKAotzxGAZWeFpc7bvGUUw7XHQefiCbMuklSEel5PJWJBf5pFWuOc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712132584; c=relaxed/simple; bh=/xd3hpbu+Zi9SGSjwWRNxiGqByXLHzVBCsLyu3K7PJI=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=sA6x7lsO6WxQPlzo3QpuG2U+0dwU6+QNFhApwCn18BvdcayeQYLKEBVE2NO2IgojcLoLGEqg4mBgRPh0nXf9w5x0Db4iyL97PA75Eot2q6//jBZhF8HyAup49bdbhCET2qB7XJ6A4he61kYxg1J7/1ntXR6EEXySIJ82eJ5VE24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.85.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-201-xd3CvAPlOiKWi4y9JosihA-1; Wed, 03 Apr 2024 09:12:35 +0100 X-MC-Unique: xd3CvAPlOiKWi4y9JosihA-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 3 Apr 2024 09:12:10 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 3 Apr 2024 09:12:10 +0100 From: David Laight To: 'Eric Biggers' , Ard Biesheuvel CC: "linux-crypto@vger.kernel.org" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Andy Lutomirski , "Chang S . Bae" Subject: RE: [PATCH 0/6] Faster AES-XTS on modern x86_64 CPUs Thread-Topic: [PATCH 0/6] Faster AES-XTS on modern x86_64 CPUs Thread-Index: AQHaf518oZDDPKfpuUWrj9ZpRMjHLrFWPMWw Date: Wed, 3 Apr 2024 08:12:09 +0000 Message-ID: <6629b8120807458ab76e1968056f5e10@AcuMS.aculab.com> References: <20240326080305.402382-1-ebiggers@kernel.org> <20240326164755.GB1524@sol.localdomain> In-Reply-To: <20240326164755.GB1524@sol.localdomain> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: Eric Biggers > Sent: 26 March 2024 16:48 .... > Consider Intel Ice Lake for example, these are the AES-256-XTS encryption= speeds > on 4096-byte messages in MB/s I'm seeing: >=20 > xts-aes-aesni 5136 > xts-aes-aesni-avx 5366 > xts-aes-vaes-avx2 9337 > xts-aes-vaes-avx10_256 9876 > xts-aes-vaes-avx10_512 10215 >=20 > So yes, on that CPU the biggest boost comes just from VAES, staying on AV= X2. > But taking advantage of AVX512 does help a bit more, first from the parts= other > than 512-bit registers, then a bit more from 512-bit registers. How much does the kernel_fpu_begin() cost on real workloads? (ie when the registers are live and it forces an extra save/restore) I've not looked at the code but I often see what looks like excessive inlining in crypto code. This will speed up benchmarks but can have a negative effect on real code both because of the time taken to load the code and the effect of displacing other code. It might be that this code is a simple loop.... =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)