Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp810812imm; Mon, 2 Jul 2018 23:52:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcZ1esSORl2Us9Jm59G/c21pAmRPq/DbcleOtacSCcC7h8BuYriwDhe3a/pE8cy2JnTqv40 X-Received: by 2002:a63:5106:: with SMTP id f6-v6mr6961896pgb.95.1530600740183; Mon, 02 Jul 2018 23:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530600740; cv=none; d=google.com; s=arc-20160816; b=QVmKLruMM2WhSs6QTDQElgXUCrdt8/Rm+DEKkQAMokPaSW1q3ThdnIoDNk/Vk6FdBU jmlVwyJ3GgdQ7SNRAX1Gdta5jMCLQ+I5tjpaGIHM2p1zwHnmrPxHT9cdwPiVzYINGhoC 5262DiyS1WdZzLJCy8AD52SdfLMdYMOkcGBBzu2uvDKnBWfXmdUMePS0+dnZqk1XYgfq 1ugEHcCJ4rolNcPWJSgOHXGL1fdnTJXkVLzpY+GFplf2vTfWHw9ATTjYo0yh4jNnbaqN DmP6ohanGEPEobbPQv3EzFMJ6TwL+pIWB0YPSDMSP3sJYBK4ySwr0wC74gzHeO6NSsQd vbqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:subject:cc:to:from:date:message-id :mime-version:dkim-signature:arc-authentication-results; bh=5uuzG7uVNpV6P+yJSI5AsQLYX+rFUQo92zJAOhM9/EE=; b=z32nAuz4XF1u7xJSUVUFKhmAQhklVb/HsQ+aXaHZbVNqvNk9S8cobEv4DlWW9XdVUp p7i3+wGIFADUoX4DuxGHpTWODQXML/sD/zG6W/Q8CjJHmQ3MIgDjp0e3LCKzs1vhsgZU L8I0aJJUMslv3hSk6yUS/il60zqdKvjGTo7wuaK1KvfVla1RZbGo8zwypB2j/VZGMHhg dgS9eHqk/StrjPwOjAIGgPgg6YrZvChpsbV7mI55RplD7lxX+4mLT1fj9+0Ml4jn4+4v p+OyWkmY+XDaJgh5HiR5INDgebB7rCIRT5bf6mdCaSmwOIvF5qZPR0Ay1N5GTXwjOAhN VgiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b="aQuui7/u"; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i38-v6si413367pgm.394.2018.07.02.23.52.05; Mon, 02 Jul 2018 23:52:20 -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=@oracle.com header.s=corp-2017-10-26 header.b="aQuui7/u"; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903AbeGCGuV (ORCPT + 99 others); Tue, 3 Jul 2018 02:50:21 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:44740 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753033AbeGCGuT (ORCPT ); Tue, 3 Jul 2018 02:50:19 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w636iJNb117137; Tue, 3 Jul 2018 06:49:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=5uuzG7uVNpV6P+yJSI5AsQLYX+rFUQo92zJAOhM9/EE=; b=aQuui7/uVajDrHRcZpCv1CbZJH+x+kJEpuw/mPR/Hqub9aXPN6FVje4fNFtzfp7hW072 FkbrKDOZ8A80EDD4kcSF6KRyglA5eMaAj4fIFcanyTizNJPvd5hvWEODMPg047fN9cvx 4+44tfdZVbHi+HcSOlNSHjTE1+SosLo2RiTwu3tRy6ZU6OvRHpUItsIS7n7Ql75kRKw4 XA8xCC7zdTzLt9pP9BD8uEkmgDamyOR2boo7s4CpAXO6Z3/hzU6lZrSeT8P/jYPIvCIB g6jruT4LmZzSTL0bIc7D/TtbxR7Hp8d/e/aXRf6eHhIM0UEBAbAwttniXMpQUcUPGYvG WQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2jwyccqac1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jul 2018 06:49:55 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w636nsxt024118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Jul 2018 06:49:55 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w636nsXi028318; Tue, 3 Jul 2018 06:49:54 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 2 Jul 2018 23:49:54 -0700 (PDT) From: Zhenzhong Duan To: Cc: , , , , Subject: [PATCH] x86/mm/32: Initialize CR4 shadow before __flush_tlb_all() X-Mailer: Zimbra on Oracle Beehive Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8942 signatures=668704 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=829 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807030077 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In x86_32, __flush_tlb_all() may have read cr4 shadow before the initialization of cr4 shadow in cpuinit(). Fix it by adding cr4_init_shadow() call ahead of __flush_tlb_all(). Signed-off-by: Zhenzhong Duan Cc: Srinivas Reddy Eeda --- arch/x86/kernel/smpboot.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index c2f7d1d..db9656e 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -221,6 +221,11 @@ static void notrace start_secondary(void *unused) #ifdef CONFIG_X86_32 =09/* switch away from the initial page table */ =09load_cr3(swapper_pg_dir); +=09/* +=09 * Initialize the CR4 shadow before doing anything that could +=09 * try to read it. +=09 */ +=09cr4_init_shadow(); =09__flush_tlb_all(); #endif =09load_current_idt(); --=20 1.7.3