Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2528035pxu; Fri, 9 Oct 2020 21:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfjtaO5kRtU+6Qq9H2D3+yTowIaTOFNK6/x1Z6ZDWDIAhA0IKgas5ywyOqXxOQOWgJU1/2 X-Received: by 2002:a17:906:802:: with SMTP id e2mr17336599ejd.294.1602304849821; Fri, 09 Oct 2020 21:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602304849; cv=none; d=google.com; s=arc-20160816; b=OuNaBr9EIKMsUn9B0QrNPlEPmiDdLU/jzheMDiNih5yRCYboc00i62SwAjvHCJpvtj bFC8fw7a2BxVAiCVIbz3huIjml9a0bRyolhS9lKXHjE6bbmN+Nk5jUcZiPNIw3aGZdgc yTKaV96w+m/RLf7hcFDwFfj+SeZP9klq+BCspB0XAUbT8orfbyY1IYHYhCNzjdbkeK7K Paq2CIdAMpx2cYqfNys3ZBpnI8WD6eNKtX+b12jgYQN5fuWw0bh9A38GKTsp33JgBbOP 7v7oiHPtSBVUHrFEQ/+fE3W7dTQP03gMNMQor/iIO7tDvx6ZnJeCosYgvTkyJ+Gk6JXi c8PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=muZBCKvRf+qhehmxYXUsJci/z0zgrJgVKzC9ZKPd+eg=; b=IaK3r1iHLZ5Tp1n1lrUX7qznDokxKgz3+fLvtXHe7bI10pqaa7EaM3eiIl45pBWwNH FWOG/JtGF78HX7coDKRhWFyLP2l6ZarhNzwIDCo1VAlYpwbhWcPdpiMQrHFesCRe+o8P 6XdHXxelWDbGmLWH9JQq2wtbxSbrWMz98UfcFCEsDLprx+cxGoFpNz61wonfbkRmzhO4 y997I4duLNQu+FycaQm4DmhNgfI97UHgm6B0i0+w7mimF+S5BOozZ8gu4q8HOrbEwKdw Hsl3cQYk5nejtCA4bcWtm/zMDFX/w8y3PdP1XnMtcXRVwL+cFZnMGPJCYOEQQ0FrbbgZ /b9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=gAuQV2Qe; 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=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si7879902eju.428.2020.10.09.21.40.25; Fri, 09 Oct 2020 21:40:49 -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=@wdc.com header.s=dkim.wdc.com header.b=gAuQV2Qe; 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=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391353AbgJIVN7 (ORCPT + 99 others); Fri, 9 Oct 2020 17:13:59 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:50437 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388641AbgJIVNy (ORCPT ); Fri, 9 Oct 2020 17:13:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1602278540; x=1633814540; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uLCpsvC/inR65HE35KjykwBVwDdqIbHHxLVflczTr2Y=; b=gAuQV2QeFJPSYU+xb7Zv7PcKJlsNEx6ZUHcoRRsQijQYjgY1LdMp0ggc 0lWBf8zwEeLXSRr83CHP3UH4OsKPYXrzNEWIU8acdtfMuSVY5QJwNbbj2 ejj3zswe674antiBffUsA/Cx+qffZpgV/PD5c0NxRMh+ITcmI3r8KDVH+ z3qjifw0gJfrWArRVH/tskGVYsABXDI3WXNUvTddwAjPxMluMKNeyJA/T U1/Hwi4Zi62B+uKP7z+/gPVl0BtN59tlRrerMNEVrlA3fS5e2or+B1kZQ O2271rwhdykUpIJezxZBhhDDErGqvYPvVTtlUMY2o6CiriEu2MaYZ5oJm A==; IronPort-SDR: 2jTULRqrLt75s7R9QWiBxH9KryrBoPYyFzEFV2C/SBH39SHg96lxYm81TlNVWlVePygP+0ComR 7wN2LwfR8+jxSd2dVUsoJODU1NeybocyOc0XpRYbUcm/Xa/Flj7XDWpkbzojxj6+mS2qI9n4jn a/OtxcvbpdcMqjlYOQtMAlS0qyb4aTEILuKUMa4yghroDDU/mVJ+NlbcI8RQd4N7grR8EKvJyv H08CmX+eRW72rwSyE8TbkygVIN1g08INQSS2qLWi/cfX6Pi3ChSJ3PjKXTbX+ZTFUw7scVnu8M xHA= X-IronPort-AV: E=Sophos;i="5.77,356,1596470400"; d="scan'208";a="252936932" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 10 Oct 2020 05:22:20 +0800 IronPort-SDR: CiFH05tBtND0QWKQeZMmvomLN4pxVWiaUa7cObTJRBeYmmdUSL3lvzBqcRRdMfz8c+XBmxbDKr RSVMg+v49eVxwJpQHb/xXBhTmxV5oeT0eefbyzIOT9OJu9bEvWqNjPeRlGAtBz9IqL0oIUShl8 tRyeT8ToVSZPs+2+opTeAK013LWaZCmMmU3Iy4G5IP5Rmj4RRIBeGary4TrtFiX808dAkjFsmW Csey8P/JZEvjywqQtDWohvpukB+zcGw+mojGnosE8n2bU0TE3EmNgAlFdm06r2KOqEKIt8Xrg4 ts25VoIBcalsyWyaerd6VfRk Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 13:59:41 -0700 IronPort-SDR: k7VpveUvGC2efjb8TPkb5b963i4tk0vSeShUCYhda4iG2UWjLq+U326k8Xt4PhRxdYNxbiKZlQ /mBkP0UVKgvqGOVYokqviIhHplcWANZ7EsinNEySw51Yn+4Ac5jV/YeNq+Zufdes7yw8VE/Zx+ vE/MtSu5voyQ5Ycv8mdj3yTD9Q/Sd517jWj4nIxipZ5wPzDivks1gcSZ2ikOthVbWJtplBy+nP WQGaAG1aXjZw+VDCaMbqVrqB4Ix9O92YzSxBPXVdJsavTS4J0IZBC6pd/olzUvJb5ymWMbgd6V Rrg= WDCIronportException: Internal Received: from usa003000.ad.shared (HELO jedi-01.hgst.com) ([10.86.60.38]) by uls-op-cesaip01.wdc.com with ESMTP; 09 Oct 2020 14:13:53 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Andrew Morton , Anup Patel , Ard Biesheuvel , Borislav Petkov , Greentime Hu , Guo Ren , Kees Cook , linux-riscv@lists.infradead.org, Michel Lespinasse , Palmer Dabbelt , Paul Walmsley , Zong Li Subject: [PATCH 2/5] RISC-V: Initialize SBI early Date: Fri, 9 Oct 2020 14:13:41 -0700 Message-Id: <20201009211344.2358688-3-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201009211344.2358688-1-atish.patra@wdc.com> References: <20201009211344.2358688-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, SBI is initialized towards the end of arch setup. This prevents the set memory operations to be invoked earlier as it requires a full tlb flush. Initialize SBI as early as possible. Signed-off-by: Atish Patra --- arch/riscv/kernel/setup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 1db17f37736e..a5cac440aadf 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -90,6 +90,9 @@ void __init setup_arch(char **cmdline_p) pr_err("No DTB found in kernel mappings\n"); #endif +#if IS_ENABLED(CONFIG_RISCV_SBI) + sbi_init(); +#endif #ifdef CONFIG_SWIOTLB swiotlb_init(1); #endif @@ -98,10 +101,6 @@ void __init setup_arch(char **cmdline_p) kasan_init(); #endif -#if IS_ENABLED(CONFIG_RISCV_SBI) - sbi_init(); -#endif - #ifdef CONFIG_SMP setup_smp(); #endif -- 2.25.1