Received: by 10.223.164.202 with SMTP id h10csp220296wrb; Mon, 13 Nov 2017 05:29:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMa9xEysuaitqYBl2+CkBeubfRV0kGbT9Zhqg/yzkiA7PVHVq7E0JIedm3t64ObhKsTMvrzQ X-Received: by 10.84.242.74 with SMTP id c10mr9311785pll.141.1510579762802; Mon, 13 Nov 2017 05:29:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510579762; cv=none; d=google.com; s=arc-20160816; b=ewyZCgRe5wyq/rn/qfqGZeNEA2VMZk3W0Pr1K1Heq2K+KUP7M3Sfo6XpvCrj6Z9ix6 E3wzqQmpK0ZwaqX4Nm522xSSNX2WF/UlpqJZ7VjStEq5KKLfXFh2C63fhnHRRaqZieT7 EUlYHVFu++asWrwMmzZ4fUlORUQBt6HTQu/SfuhoYpgaAI7OLd5Odb3DZdTJ0SS0M0+1 qq+sFJBsMDiXQU6X5EPGaviB9kBMLW7OhTXjGxQaN9cwRBAqyZsbSoUVgnE1z6YuXcSR 0DS3BTFohGBAPVBo13IrUwwYSYTyvghRkTub6PvOC55cOZ9nGvN7pk8VbusOf8i40bIH OOWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=CpxFtZ+0yOREpQdPl+xSHTaP20XTZxkTMj0o48TjZWs=; b=InutgM6D/QELrXAZTDabcIQYo2boTq/NrXfXVafrBlSqqUaVwsa+z3pGgM5zaE54cn E6HtoneiA1Tn+HEuO5Ot2oWlTRcKM7+xhqZ1c/ukNgNQr3cTIzEcCp2aWAzyJgsuWtOT 27atoaqRT3hGG4rq7DMZjZ38tIzAW2/z/365wPE+kYjl7h4fCmH5snP4KjWyesK/VWfw 2LA2yYFVwrGMk9tbdgBPxIJnl0n1bjhJTV90cf9XHZOIWVQWg4k/meEtDBF9YSW5hUNf d+En5X0PtP3BBUMceffWNU4ckYxGTOAhHRjp2tfLrZHG4xo0AlqwXttHZfwBw0/r1YXm 4UCQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 184si8712519pfd.233.2017.11.13.05.29.09; Mon, 13 Nov 2017 05:29:22 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754132AbdKMM7v (ORCPT + 95 others); Mon, 13 Nov 2017 07:59:51 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:49830 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754120AbdKMM7t (ORCPT ); Mon, 13 Nov 2017 07:59:49 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B635DAAC; Mon, 13 Nov 2017 12:59:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Zhong , Herbert Xu , Sasha Levin Subject: [PATCH 4.9 19/87] crypto: vmx - disable preemption to enable vsx in aes_ctr.c Date: Mon, 13 Nov 2017 13:55:36 +0100 Message-Id: <20171113125617.087514186@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li Zhong [ Upstream commit 7dede913fc2ab9c0d3bff3a49e26fa9e858b0c13 ] Some preemptible check warnings were reported from enable_kernel_vsx(). This patch disables preemption in aes_ctr.c before enabling vsx, and they are now consistent with other files in the same directory. Signed-off-by: Li Zhong Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/vmx/aes_ctr.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/crypto/vmx/aes_ctr.c +++ b/drivers/crypto/vmx/aes_ctr.c @@ -80,11 +80,13 @@ static int p8_aes_ctr_setkey(struct cryp int ret; struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm); + preempt_disable(); pagefault_disable(); enable_kernel_vsx(); ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key); disable_kernel_vsx(); pagefault_enable(); + preempt_enable(); ret += crypto_blkcipher_setkey(ctx->fallback, key, keylen); return ret; @@ -99,11 +101,13 @@ static void p8_aes_ctr_final(struct p8_a u8 *dst = walk->dst.virt.addr; unsigned int nbytes = walk->nbytes; + preempt_disable(); pagefault_disable(); enable_kernel_vsx(); aes_p8_encrypt(ctrblk, keystream, &ctx->enc_key); disable_kernel_vsx(); pagefault_enable(); + preempt_enable(); crypto_xor(keystream, src, nbytes); memcpy(dst, keystream, nbytes); @@ -132,6 +136,7 @@ static int p8_aes_ctr_crypt(struct blkci blkcipher_walk_init(&walk, dst, src, nbytes); ret = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE); while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) { + preempt_disable(); pagefault_disable(); enable_kernel_vsx(); aes_p8_ctr32_encrypt_blocks(walk.src.virt.addr, @@ -143,6 +148,7 @@ static int p8_aes_ctr_crypt(struct blkci walk.iv); disable_kernel_vsx(); pagefault_enable(); + preempt_enable(); /* We need to update IV mostly for last bytes/round */ inc = (nbytes & AES_BLOCK_MASK) / AES_BLOCK_SIZE; From 1583955696057578138@xxx Mon Nov 13 12:57:45 +0000 2017 X-GM-THRID: 1583955696057578138 X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread