linux-mips
[Top] [All Lists]

[PATCH 0/2] MIPS: mipsregs.h: Optimise read of const Cop0 regs

To: linux-mips@linux-mips.org
Subject: [PATCH 0/2] MIPS: mipsregs.h: Optimise read of const Cop0 regs
From: James Hogan <jhogan@kernel.org>
Date: Mon, 11 Dec 2017 16:13:13 +0000
Authentication-results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org
Authentication-results: mail.kernel.org; spf=none smtp.mailfrom=jhogan@kernel.org
Cc: James Hogan <jhogan@kernel.org>, Ralf Baechle <ralf@linux-mips.org>, "Maciej W . Rozycki" <macro@mips.com>
Dmarc-filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5200A20C01
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Certain coprocessor 0 registers (namely CP0_PRId) should never change,
and can safely be read with a non-volatile inline asm statement. This
improves performance under virtualisation, since access to the CP0_PRId
register traps even with hardware assisted virtualisation (VZ), and the
use of volatile prevents the compiler discarding the MFC0 if the value
isn't used.

Patch 1 adds alternative COP0 read macros for registers which shouldn't
change, and patch 2 uses one of those macros to read CP0_PRId.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maciej W. Rozycki <macro@mips.com>
Cc: linux-mips@linux-mips.org

James Hogan (2):
  MIPS: mipsregs.h: Add read const Cop0 macros
  MIPS: mipsregs.h: Make read_c0_prid use const accessor

 arch/mips/include/asm/mipsregs.h | 39 +++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 11 deletions(-)

base-commit: ae64f9bd1d3621b5e60d7363bc20afb46aede215
-- 
git-series 0.9.1

<Prev in Thread] Current Thread [Next in Thread>