From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbcBJNsI (ORCPT ); Wed, 10 Feb 2016 08:48:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:51037 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751029AbcBJNsF (ORCPT ); Wed, 10 Feb 2016 08:48:05 -0500 Date: Wed, 10 Feb 2016 14:48:02 +0100 (CET) From: Michael Matz To: Borislav Petkov cc: mingo@kernel.org, luto@amacapital.net, tglx@linutronix.de, oleg@redhat.com, brgerst@gmail.com, mcgrof@suse.com, dave.hansen@linux.intel.com, akpm@linux-foundation.org, dvlasenk@redhat.com, peterz@infradead.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, toshi.kani@hp.com, luto@kernel.org, aryabinin@virtuozzo.com, hpa@zytor.com, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/mm] x86/mm: Add INVPCID helpers In-Reply-To: <20160210120827.GA11832@pd.tnic> Message-ID: References: <8a62b23ad686888cee01da134c91409e22064db9.1454096309.git.luto@kernel.org> <20160210120827.GA11832@pd.tnic> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, 10 Feb 2016, Borislav Petkov wrote: > --- a/arch/x86/include/asm/tlbflush.h > +++ b/arch/x86/include/asm/tlbflush.h > @@ -23,7 +23,7 @@ static inline void __invpcid(unsigned long pcid, unsigned long addr, > * invpcid (%rcx), %rax in long mode. > */ > asm volatile (".byte 0x66, 0x0f, 0x38, 0x82, 0x01" > - : : "m" (desc), "a" (type), "c" (desc) : "memory"); > + : : "m" (*desc), "a" (type), "c" (desc) : "memory"); That still doesn't do what you want. Arrays in C are funny. *desc is exactly equivalent to desc[0], _not_ to the whole array, indeed there's no C syntax to name an lvalue of array type in normal expressions. You need to jump through hoops for this: "m" (*(struct {unsigned long x[2];} *)desc) It'd probably be easier to simply declare the descriptor as a struct, rather than an array, then the original syntax would have been mostly correct: struct {u64 d[2];} desc = { pcid, addr }; asm ... "m" (desc), "c" (&desc) Ciao, Michael.