Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp275893ima; Fri, 1 Feb 2019 03:12:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IYbXcvqMMBUZ0raaR3mIpJBUl46D90vR0v/hK7fMlX3ZUmwO/r2kX/QD3pYXo/jAhTQPha7 X-Received: by 2002:a63:2ccd:: with SMTP id s196mr1823597pgs.194.1549019535246; Fri, 01 Feb 2019 03:12:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549019535; cv=none; d=google.com; s=arc-20160816; b=OPAQAVwSpf9nqHc06p4/fBuf8hwQl22uWX2GRhzzx8Oa2iTae1BmLzxfTWMm1z+J9g 2m8FzIu+6diF5AzMtAbaMrxYI+QX0TxADg3f/WNTBLs9GqCVgJDuclHswjCOlkFd3Sv5 sBfN+yYn8bBjfUChiS5nZxPQWHGTKA63CLj72u/VOJ/1dzLVeY/5GdWY8Uu2PanDz+5J 4qgY6GbbfsU53aTGZZYx8lf9ekcDVIz38j4aYTj8nA7hQ3V34LAFHQH8HRTGog7A5oF8 tHZWv7vXzde67lcSV9GSwHyuEsd8Hamy6+FJq8jHYkCa6Qjq4kKGPedvYaJnXv1AoiuC Ofug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=scu2ggkpIIIZ1Duuu7n8iJeZbV1ekoQ+FFCRVwtpOn8=; b=lo9HvUVC04W+cGCcwsws+Ssqaagl5Qty+WFxeJNBdeluXsdH31Ng6CoZr/5hp1azWX HtQVzc+Mu6MwCewUkfvHoSXW7IdxmwczSky/XLVQUmH85zpLtM2w6funQ8EJD9KS7hg/ Rp/BlEyx2Mkt+Wv/AoUT8uXqoiO4BzErTC9IDH3esp247aTHX1jXIH7+GWrZDItKvSC8 EQ/334EJMynN60bAZ1EISTs68nx6LogMkaFTwTw1/gsUe1qjhQgXxPaWKNKOTBDsH0ed LzDAnYwqoPK6Wtb9VlUXJLwTdztw1vDMjxPoPddvBc4OUR5msNqN8nP/mhaLZoJ6HOVQ wTCQ== ARC-Authentication-Results: i=1; mx.google.com; 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 s84si6850998pgs.306.2019.02.01.03.11.59; Fri, 01 Feb 2019 03:12:15 -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; 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 S1729979AbfBALKg (ORCPT + 99 others); Fri, 1 Feb 2019 06:10:36 -0500 Received: from ozlabs.org ([203.11.71.1]:36517 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbfBALKg (ORCPT ); Fri, 1 Feb 2019 06:10:36 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 43rZCG05wgz9s4Z; Fri, 1 Feb 2019 22:10:33 +1100 (AEDT) From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC PATCH] powerpc/6xx: Don't set back MSR_RI before reenabling MMU In-Reply-To: <9f9dd859d571e324c7412ed9db9da8cfba678257.1548956511.git.christophe.leroy@c-s.fr> References: <9f9dd859d571e324c7412ed9db9da8cfba678257.1548956511.git.christophe.leroy@c-s.fr> Date: Fri, 01 Feb 2019 22:10:30 +1100 Message-ID: <87lg2zojbt.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > By delaying the setting of MSR_RI, a 1% improvment is optained on > null_syscall selftest on an mpc8321. > > Without this patch: > > root@vgoippro:~# ./null_syscall > 1134.33 ns 378.11 cycles > > With this patch: > > root@vgoippro:~# ./null_syscall > 1121.85 ns 373.95 cycles > > The drawback is that a machine check during that period > would be unrecoverable, but as only main memory is accessed > during that period, it shouldn't be a concern. On 64-bit server CPUs accessing main memory can cause a UE (Uncorrectable Error) which can trigger a machine check. So it may still be a concern, it depends how paranoid you are. > diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S > index 146385b1c2da..ea28a6ab56ec 100644 > --- a/arch/powerpc/kernel/head_32.S > +++ b/arch/powerpc/kernel/head_32.S > @@ -282,8 +282,6 @@ __secondary_hold_acknowledge: > stw r1,GPR1(r11); \ > stw r1,0(r11); \ > tovirt(r1,r11); /* set new kernel sp */ \ > - li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \ > - MTMSRD(r10); /* (except for mach check in rtas) */ \ > stw r0,GPR0(r11); \ > lis r10,STACK_FRAME_REGS_MARKER@ha; /* exception frame marker */ \ > addi r10,r10,STACK_FRAME_REGS_MARKER@l; \ Where does RI get enabled? I don't see it anywhere obvious. cheers