From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752974AbdEQUob (ORCPT ); Wed, 17 May 2017 16:44:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbdEQUo3 (ORCPT ); Wed, 17 May 2017 16:44:29 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AEF5B80C0D Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AEF5B80C0D Date: Wed, 17 May 2017 15:44:27 -0500 From: Josh Poimboeuf To: Eric Biggers Cc: linux-crypto@vger.kernel.org, Herbert Xu , "David S . Miller" , x86@kernel.org, linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH] crypto: x86/aes - Don't use %rbp as temporary register Message-ID: <20170517204427.lwvzonoa26paoitk@treble> References: <20170517040308.406-1-ebiggers3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170517040308.406-1-ebiggers3@gmail.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 17 May 2017 20:44:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 16, 2017 at 09:03:08PM -0700, Eric Biggers wrote: > From: Eric Biggers > > When using the "aes-asm" implementation of AES (*not* the AES-NI > implementation) on an x86_64, v4.12-rc1 kernel with lockdep enabled, the > following warning was reported, along with a long unwinder dump: > > WARNING: kernel stack regs at ffffc90000643558 in kworker/u4:2:155 has bad 'bp' value 000000000000001c > > The problem is that aes_enc_block() and aes_dec_block() use %rbp as a > temporary register, which breaks stack traces if an interrupt occurs. > > Fix this by replacing %rbp with %r9, which was being used to hold the > saved value of %rbp. This required rearranging the AES round macro > slightly since %r9d cannot be used as the target of a move from %ah-%dh. > > Performance is essentially unchanged --- actually about 0.2% faster than > before. Interestingly, I also measured aes-generic as being nearly 7% > faster than aes-asm, so perhaps aes-asm has outlived its usefulness... > > Signed-off-by: Eric Biggers Reviewed-by: Josh Poimboeuf -- Josh