From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbcLSAXu (ORCPT ); Sun, 18 Dec 2016 19:23:50 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:32288 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbcLSAXs (ORCPT ); Sun, 18 Dec 2016 19:23:48 -0500 Subject: Re: [RFC PATCH 04/14] sparc64: load shared id into context register 1 To: Sam Ravnborg References: <1481913337-9331-1-git-send-email-mike.kravetz@oracle.com> <1481913337-9331-5-git-send-email-mike.kravetz@oracle.com> <20161217074512.GC23567@ravnborg.org> Cc: sparclinux@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "David S . Miller" , Bob Picco , Nitin Gupta , Vijay Kumar , Julian Calaby , Adam Buchbinder , "Kirill A . Shutemov" , Michal Hocko , Andrew Morton From: Mike Kravetz Message-ID: <86a484e6-7b71-383d-b7da-d64b99206fa9@oracle.com> Date: Sun, 18 Dec 2016 16:22:31 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161217074512.GC23567@ravnborg.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/16/2016 11:45 PM, Sam Ravnborg wrote: > Hi Mike > >> diff --git a/arch/sparc/kernel/fpu_traps.S b/arch/sparc/kernel/fpu_traps.S >> index 336d275..f85a034 100644 >> --- a/arch/sparc/kernel/fpu_traps.S >> +++ b/arch/sparc/kernel/fpu_traps.S >> @@ -73,6 +73,16 @@ do_fpdis: >> ldxa [%g3] ASI_MMU, %g5 >> .previous >> >> +661: nop >> + nop >> + .section .sun4v_2insn_patch, "ax" >> + .word 661b >> + mov SECONDARY_CONTEXT_R1, %g3 >> + ldxa [%g3] ASI_MMU, %g4 >> + .previous >> + /* Unnecessary on sun4u and pre-Niagara 2 sun4v */ >> + mov SECONDARY_CONTEXT, %g3 >> + >> sethi %hi(sparc64_kern_sec_context), %g2 > > You missed the second instruction to patch with here. > This bug repeats itself further down. > > Just noted while briefly reading the code - did not really follow the code. Hi Sam, This is my first sparc assembly code, so I could certainly have this wrong. The code I was trying to write has the two nop instructions, that get patched with the mov and ldxa on sun4v. Certainly, this is not elegant. And, the formatting may lead to some confusion. Did you perhaps think the mov instruction after the comment was for patching? I am just trying to understand your comment. -- Mike Kravetz