From: David Miller Date: Tue, 17 Jan 2017 19:42:54 +0000 Subject: Re: [PATCH v4 4/4] sparc64: Add support for ADI (Application Data Integrity) Message-Id: <20170117.144254.1482863576417019498.davem@davemloft.net> List-Id: References: <0c08eb00e5a9735d7d0bcbeaadeacaa761011aab.1483999591.git.khalid.aziz@oracle.com> <20170116.233924.374841184595409216.davem@davemloft.net> <767310a9-d3bd-9721-2d20-ce2c60cddd06@oracle.com> In-Reply-To: <767310a9-d3bd-9721-2d20-ce2c60cddd06@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: khalid.aziz@oracle.com Cc: corbet@lwn.net, viro@zeniv.linux.org.uk, nitin.m.gupta@oracle.com, mike.kravetz@oracle.com, akpm@linux-foundation.org, mingo@kernel.org, kirill.shutemov@linux.intel.com, adam.buchbinder@gmail.com, hughd@google.com, minchan@kernel.org, keescook@chromium.org, chris.hyser@oracle.com, atish.patra@oracle.com, cmetcalf@mellanox.com, atomlin@redhat.com, jslaby@suse.cz, joe@perches.com, paul.gortmaker@windriver.com, mhocko@suse.com, lstoakes@gmail.com, jack@suse.cz, dave.hansen@linux.intel.com, vbabka@suse.cz, dan.j.williams@intel.com, iamjoonsoo.kim@lge.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-mm@kvack.org, khalid@gonehiking.org From: Khalid Aziz Date: Tue, 17 Jan 2017 12:32:46 -0700 > On 01/16/2017 09:39 PM, David Miller wrote: >> From: Khalid Aziz >> Date: Wed, 11 Jan 2017 09:12:54 -0700 >> >>> + __asm__ __volatile__( >>> + ".word 0xa1438000\n\t" /* rd %mcdper, %l0 */ >> >> Just use "rd %%asr14, %0" this way you don't have to play all of these >> fixed register games which kill the code generated by gcc. If you >> forcefully clobber a windowed register like %l0 it means the function >> being emitted can never be a leaf function, tail calls are no longer >> allowed, etc. > > Hi David, > > "rd %%asr14, %0" should work but does not due to bugs in assembler - > , and > . These bugs > were fixed in binutils 2.27 but older assemblers will cause kernel > build to fail. Using byte coded equivalent is the safest option. Fair enough. Then please at least use %g1 or another usable global register to avoid at least some of the problems I mentioned.