From patchwork Thu Feb 21 09:35:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 10823381 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 717D01399 for ; Thu, 21 Feb 2019 09:37:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 611B92FF8F for ; Thu, 21 Feb 2019 09:37:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 554A930274; Thu, 21 Feb 2019 09:37:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id CD1A52FF8F for ; Thu, 21 Feb 2019 09:37:12 +0000 (UTC) Received: (qmail 26025 invoked by uid 550); 21 Feb 2019 09:36:48 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 25916 invoked from network); 21 Feb 2019 09:36:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=russell.cc; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=BR4nmlG38Vcfk JEZ7L+GC7sDOM8u+gc3unYkKg7uXUE=; b=SLo9XSjWMEjj3DF4Hye2wp9JbawlD UvhVhu/Rjvdohb0NPPAiCKYo6RX/sGCv7VQkPnsBsyqKhW21XQrd3lrHCh0RCwR6 GpGB3hus3U1U4QNh0qpoKGld6pRvJYQzny78biWw47WpnTkhDkQiIdFLp4lOhS7C b3ilzY0Q9X+kZaaKvrYZXx2eiGC5/K7ntJvbqEy2HXhNW9Ie4KI0qaxbxkPI0xCO GvoQfcLevJJyBHCN4UZRLQZCPTyL5p0n9RWCGKBzrf2PGvy3h32nvtN2wdg5zLXB sbUR79MR6sPrDd5RWLPWDCvhUzf2cC/xhjT8vN+sTqvpi3Y+2Uo5OmpDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=BR4nmlG38VcfkJEZ7L+GC7sDOM8u+gc3unYkKg7uXUE=; b=Y7ESvZkQ B6GNLB+PH4njI7EE5xcvOV5r1lOtZWjpFp8qgnaEzmBtC7nm3Az+dnEweTyIi0DX kwuwrDKo/kUmsYxhu8gU7veZjD6bRR9HfUrBhiz/yCbiEAbarptUQDuXg+Ude7zi 1x7AgmxBG8mz8cHPi6t5HWq1rf7tQKLxcT5XhA/mNz6lUt0PSYcg4ftde7g9+cTA OzCBrJt74iOiuZwY8YI0fq8iqXU6vI8WuZStMGEM3GsRKr3g9pxDVIY3hBj+HYaH fuA1ISMYm5nHKtLruhfvwUMz/YYgLNBOQiwkokSS2IdBmCtwgThRidLh2UcjQ6Cq VBGHZPahAEo9OQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdekgddtjeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfedtmdenucfjughrpefhvf fufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfhushhsvghllhcuvehurhhr vgihuceorhhushgtuhhrsehruhhsshgvlhhlrdgttgeqnecukfhppeduvddvrdelledrke dvrddutdenucfrrghrrghmpehmrghilhhfrhhomheprhhushgtuhhrsehruhhsshgvlhhl rdgttgenucevlhhushhtvghrufhiiigvpedv X-ME-Proxy: From: Russell Currey To: linuxppc-dev@lists.ozlabs.org Cc: mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@c-s.fr, kernel-hardening@lists.openwall.com, Russell Currey Subject: [PATCH 4/7] powerpc/64: Setup KUP on secondary CPUs Date: Thu, 21 Feb 2019 20:35:58 +1100 Message-Id: <20190221093601.27920-5-ruscur@russell.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190221093601.27920-1-ruscur@russell.cc> References: <20190221093601.27920-1-ruscur@russell.cc> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Some platforms (i.e. Radix MMU) need per-CPU initialisation for KUP. Any platforms that only want to do KUP initialisation once globally can just check to see if they're running on the boot CPU, or check if whatever setup they need has already been performed. Note that this is only for 64-bit. Signed-off-by: Russell Currey --- arch/powerpc/kernel/setup_64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 771f280a6bf6..17921ee7f3a0 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -390,6 +390,9 @@ void early_setup_secondary(void) /* Initialize the hash table or TLB handling */ early_init_mmu_secondary(); + /* Perform any KUP setup that is per-cpu */ + setup_kup(); + /* * At this point, we can let interrupts switch to virtual mode * (the MMU has been setup), so adjust the MSR in the PACA to