Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp777326ybz; Wed, 22 Apr 2020 07:50:33 -0700 (PDT) X-Google-Smtp-Source: APiQypJXWF66UnZmB19IRmfMYkoPCSprSaZIYdX2Rd4Es+WD0nqfHnjcfLzpTGBuU0uDzY7waH7t X-Received: by 2002:a17:906:dbed:: with SMTP id yd13mr3894316ejb.130.1587567033698; Wed, 22 Apr 2020 07:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587567033; cv=none; d=google.com; s=arc-20160816; b=LWs4tBNh3E4yjnOqekzBlRxpRZCSotA008yP1yE/L3VmE5wN2E7RSC6RJkPcmTfOok StN6bLCvWCAACtoQ/JTS41dUDjAJQk6bdQc/+bc/M9v//PZimIOSHHx4Z/yl9WS0+GTW e40/z9ucha5ssKV6un2K4yegnBTotzGz153DqNzvRRCf+wcGa2nZoiE7SI0+NVzBixWb v4ZmXlu5fUcrOekc/Z+KfdwbEha2iFcyHzsKvJV4nioQNhhqTwjJrJjUmqNdrMDBzk4T Soqw78IClH3fKyIbQ9JPa1KeAJt2EhJeTViqiwLKfGXAS7ZLrc62a4Rs+dr9+RoS4Pv7 AVfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yzqaMB+8BnO2Izr18cVyvxaydmgJpxP+bLQgE3UobPk=; b=s9wGSyZeZv+fVBtNl49Io/aKDZ6i+JlUz9r+ehDAgiKfVzri5qP4dCGQTQ3hkXnJdm wXm85AotO5mMeKpngw0+Nu1D3r/PZ7i9cDkgO1lyxgnprP5swEIv9+d10IY2YQh/W2qf KbxDvs+ersiuzyV/B2iK8tKN8GQxKy2dGGl8lPKSsSdcAzyseUnIWboS/JiYspXAvL0I JQ/dwuqKRnYTFvSSfGF/atXbdoC4eA94LQ6ny43P4S8kVKEtHLnm1fwcDUxyqECDXr4O CkOz3/SQOE0Y36Q3ds5eHhqHxhHD3+z2kQfwXguA28toCULzN+BovVciZy5oSmXEknyZ on8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=F1zcTfO8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ld23si3513125ejb.242.2020.04.22.07.50.08; Wed, 22 Apr 2020 07:50:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=F1zcTfO8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbgDVOqF (ORCPT + 99 others); Wed, 22 Apr 2020 10:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbgDVOqF (ORCPT ); Wed, 22 Apr 2020 10:46:05 -0400 Received: from vultr.net.flygoat.com (vultr.net.flygoat.com [IPv6:2001:19f0:6001:3633:5400:2ff:fe8c:553]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08419C03C1A9; Wed, 22 Apr 2020 07:45:53 -0700 (PDT) Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id DCE7D204A1; Wed, 22 Apr 2020 14:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1587566752; bh=d4zdAfEVk89xMUtjnc1CAZCW8CYh3ZX5UtenqK1aYyM=; h=From:To:Cc:Subject:Date:From; b=F1zcTfO8Mux96/JF7N855buoiaKxCULu4jKp1Gy2a3/O6jtiC7+wuyh1Wcwi1Xl5M AdaFMHufg6R4ogVoxw2d5VObTM/pEHZRchmnApq4IPei1HphotM9IYUCEOkE5yuunp a7BXxIwNhKe0mQolLxDUYNDSHi9GGodkjg+6eBA3COqHTK7DFKGV5oYbMjMbF01tux Nd8pqCnlW6MZHIn3Av67xtkQGVXxtlJ7qKa7JRRn15uN+qMJdPprEusNeX5ERTKCJl k+0uJg9ySPnO/J8qA+A6tuipD0ZWH9591K7Cdj1Ib5UDSNX4uMXLsu6Wnc9rU2Ak+I F9ErtmmLg6JeQ== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: Clear XContext at boot time Date: Wed, 22 Apr 2020 22:45:34 +0800 Message-Id: <20200422144535.1253459-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org XContext might be dirty at boot time. We need to clear it to ensure early stackframe is safe. Signed-off-by: Jiaxun Yang --- arch/mips/kernel/head.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index 351d40fe0859..3b02ffe46304 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S @@ -132,6 +132,9 @@ dtb_found: #endif MTC0 zero, CP0_CONTEXT # clear context register +#ifdef CONFIG_64BIT + MTC0 zero, CP0_XCONTEXT +#endif PTR_LA $28, init_thread_union /* Set the SP after an empty pt_regs. */ PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE -- 2.26.0.rc2