Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1632674imj; Fri, 8 Feb 2019 04:56:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IaklWZ+uC1QdQ6y+FCoiq1szwSjZOU3cV2b/Bn1vGX3nY/ka67J/Z5fYbUylNjt5h5p97Xf X-Received: by 2002:a63:f109:: with SMTP id f9mr15397413pgi.286.1549630577345; Fri, 08 Feb 2019 04:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549630577; cv=none; d=google.com; s=arc-20160816; b=RNq2Hm6kyzVvAqzHqQBetPGJk+rGBaHMnIiXE3d5ir3K7AouS5wR03SsnJbjKz2s4C lmSyMc0geXu2PMiGPKwV8SJFAvpqxN/p7NsmPqFAMnnKqtptUdfkXcZ004/MkR6ivqR6 6nXZIpdZVBZnn7kHKNAMrKgyHiuKc43bE0GTiN4/9fRxHsAH5mhiOyJExvni4emzF6H0 X0evgnM2YbW6J9u3eGTv6oz7HS8rW/c0U+p5o4fRa26J58PHHg7+6EBUSBO5A7qf1yVW mIePt0CINWTOScIoPcv1iPg+O5yzZ05tBZJNRSFh3DSzv47KODKL/AkjaxktShRGbQU9 TvUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :dkim-signature; bh=S1kn21Xe7/docipPWcnKOsqhSa/YEFzLSyBpdTR2gLE=; b=XGhpjbEBBG62/u+JsFKiT9pAguExmwwRcac9tqm9r0n2c3vnwh5yOX6gAPV8FIUcXS 5OdOlmSmO+fRpxhQacPX7hJGjrt4PHMQSwrcl0C+urBXRCQKSVJLuWjoEwjd3dmDnjLN zhAA4LKgSkKmSbGN4+m0UxVh8+c4SOfVqSag+uz9ZI5ce8O0dA5lH1vZY1CBseWTXSq5 LEss9mnM5y4bV6ZJBylLN6uoMqtehDx4P1f/2xTU2a8n0tsJVZC/NCpREm9yZyZUAu12 WfqsQ0bsMueBFga5v3fFX3WxuEdacM4AT0ETxVfOL9uQW4Wdf5B8VC7hEZU6ehNpHhm4 O4tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=aYMfm72z; 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 m61si2349297plb.43.2019.02.08.04.56.01; Fri, 08 Feb 2019 04:56:17 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=aYMfm72z; 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 S1727230AbfBHMwV (ORCPT + 99 others); Fri, 8 Feb 2019 07:52:21 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:20616 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726568AbfBHMwV (ORCPT ); Fri, 8 Feb 2019 07:52:21 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43ww7N226tz9v0dH; Fri, 8 Feb 2019 13:52:16 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=aYMfm72z; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id RPH8uguzozuR; Fri, 8 Feb 2019 13:52:16 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 43ww7N0yfsz9v9DY; Fri, 8 Feb 2019 13:52:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1549630336; bh=S1kn21Xe7/docipPWcnKOsqhSa/YEFzLSyBpdTR2gLE=; h=From:Subject:To:Cc:Date:From; b=aYMfm72zUAsT4J2PvmbcJeFnvPe9AYVbn5/Mo2Ng6gJYvCN3f/E5hkCgseZk33qgl d4FjRrm5iN0IbFkNoS9xcRy8uD1BMcyQZkBb4tVOge2qgfZBLeRGQj6NvHT0UVG37d 7bOsdzWvEQC+v0Q39WsrCT6QyUCvAoeCs+5Vttfc= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 678D88B756; Fri, 8 Feb 2019 13:52:17 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id CUIsjZfggXVe; Fri, 8 Feb 2019 13:52:17 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 394F58B8D9; Fri, 8 Feb 2019 13:52:17 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 11415653E8; Fri, 8 Feb 2019 12:52:16 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [RFC PATCH v1 00/16] powerpc/32: Implement fast syscall entry To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Nicholas Piggin Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 8 Feb 2019 12:52:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The purpose of this series is to implement a fast syscall entry on ppc32. Unlike all other exceptions which can happen at any time and require to preserve all registers, the syscalls do not require the preservation of volatile registers (except LR). Syscall entries can then be optimised with lighter entry code than the general exception handling. In the meantime this series refactorises the exception entry on 40x/6xx/8xx as they are pretty similar, and it takes benh series on rationalise the settings of MSR_EE at exceptions/syscall entries as this change pretty simplies exception entries. On a 8xx, this series improves null_syscall selftest by 17% On a 83xx, this series improves null_syscall selftest by 12,5% Christophe Leroy (16): powerpc: CONFIG_THREAD_INFO_IN_TASK series powerpc/32: Refactor EXCEPTION entry macros for head_8xx.S and head_32.S powerpc/32: move LOAD_MSR_KERNEL() into head_32.h and use it powerpc/32: make the 6xx/8xx EXC_XFER_TEMPLATE() similar to the 40x/booke one powerpc/40x: Don't use SPRN_SPRG_SCRATCH2 in EXCEPTION_PROLOG powerpc/40x: add exception frame marker powerpc/40x: Split and rename NORMAL_EXCEPTION_PROLOG powerpc/40x: Refactor exception entry macros by using head_32.h powerpc/fsl_booke: ensure SPEFloatingPointException() reenables interrupts powerpc/32: enter syscall with MSR_EE inconditionaly set powerpc/32: Enter exceptions with MSR_EE unset powerpc/32: get rid of COPY_EE in exception entry powerpc: Fix 32-bit handling of MSR_EE on exceptions powerpc/32: implement fast entry for syscalls on non BOOKE powerpc/32: Remove MSR_PR test when returning from syscall powerpc/32: don't do syscall stuff in transfer_to_handler on non BOOKE arch/powerpc/Kconfig | 1 + arch/powerpc/Makefile | 7 + arch/powerpc/include/asm/asm-prototypes.h | 4 +- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 2 +- arch/powerpc/include/asm/exception-64s.h | 4 +- arch/powerpc/include/asm/irq.h | 18 +- arch/powerpc/include/asm/livepatch.h | 7 +- arch/powerpc/include/asm/processor.h | 105 +--------- arch/powerpc/include/asm/ptrace.h | 2 +- arch/powerpc/include/asm/reg.h | 2 +- arch/powerpc/include/asm/smp.h | 17 +- arch/powerpc/include/asm/task_size_32.h | 21 ++ arch/powerpc/include/asm/task_size_64.h | 79 ++++++++ arch/powerpc/include/asm/thread_info.h | 19 -- arch/powerpc/kernel/asm-offsets.c | 12 +- arch/powerpc/kernel/entry_32.S | 261 ++++++++++++++----------- arch/powerpc/kernel/entry_64.S | 12 +- arch/powerpc/kernel/epapr_hcalls.S | 5 +- arch/powerpc/kernel/exceptions-64e.S | 13 +- arch/powerpc/kernel/exceptions-64s.S | 2 +- arch/powerpc/kernel/head_32.S | 182 ++++------------- arch/powerpc/kernel/head_32.h | 203 +++++++++++++++++++ arch/powerpc/kernel/head_40x.S | 154 ++++----------- arch/powerpc/kernel/head_44x.S | 16 +- arch/powerpc/kernel/head_64.S | 1 + arch/powerpc/kernel/head_8xx.S | 133 ++----------- arch/powerpc/kernel/head_booke.h | 44 ++--- arch/powerpc/kernel/head_fsl_booke.S | 44 ++--- arch/powerpc/kernel/idle_6xx.S | 8 +- arch/powerpc/kernel/idle_book3e.S | 2 +- arch/powerpc/kernel/idle_e500.S | 8 +- arch/powerpc/kernel/idle_power4.S | 2 +- arch/powerpc/kernel/irq.c | 114 ++--------- arch/powerpc/kernel/kgdb.c | 28 --- arch/powerpc/kernel/machine_kexec_64.c | 6 +- arch/powerpc/kernel/misc_32.S | 17 +- arch/powerpc/kernel/process.c | 63 +++--- arch/powerpc/kernel/setup-common.c | 2 +- arch/powerpc/kernel/setup_32.c | 26 ++- arch/powerpc/kernel/setup_64.c | 51 +---- arch/powerpc/kernel/smp.c | 16 +- arch/powerpc/kernel/stacktrace.c | 29 ++- arch/powerpc/kernel/trace/ftrace_64_mprofile.S | 6 +- arch/powerpc/kernel/traps.c | 8 + arch/powerpc/kvm/book3s_hv_hmi.c | 1 + arch/powerpc/mm/hash_low_32.S | 14 +- arch/powerpc/net/bpf_jit32.h | 5 +- arch/powerpc/sysdev/6xx-suspend.S | 5 +- arch/powerpc/xmon/xmon.c | 2 +- 49 files changed, 816 insertions(+), 967 deletions(-) create mode 100644 arch/powerpc/include/asm/task_size_32.h create mode 100644 arch/powerpc/include/asm/task_size_64.h create mode 100644 arch/powerpc/kernel/head_32.h -- 2.13.3