From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbbJSLZe (ORCPT ); Mon, 19 Oct 2015 07:25:34 -0400 Received: from mail.skyhub.de ([78.46.96.112]:55772 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750863AbbJSLZd (ORCPT ); Mon, 19 Oct 2015 07:25:33 -0400 Date: Mon, 19 Oct 2015 13:25:26 +0200 From: Borislav Petkov To: Chris Wilson Cc: linux-kernel@vger.kernel.org, Ross Zwisler , "H . Peter Anvin" , Imre Deak , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] x86: Add an explicit barrier() to clflushopt() Message-ID: <20151019112526.GB20341@pd.tnic> References: <1445248735-11915-1-git-send-email-chris@chris-wilson.co.uk> <20151019101612.GA20341@pd.tnic> <20151019110529.GG27143@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151019110529.GG27143@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2015 at 12:05:29PM +0100, Chris Wilson wrote: > In order to add the clobbers, I had to adjust the macro slightly: > > +#define alternative_output(oldinstr, newinstr, feature, output) \ > + asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ > + : output : "i" (0) : "memory") > > and that also works. The concern I have here is that the asm does use > "+m" as its output already, and the clflush() asm doesn't require the > manual clobber. Yeah, you could make the above #define alternative_output(oldinstr, newinstr, feature, output, clobber...) and use it to define clflushopt(). hpa might have a better idea, though... -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.