[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151019112526.GB20341@pd.tnic>
Date: Mon, 19 Oct 2015 13:25:26 +0200
From: Borislav Petkov <bp@...en8.de>
To: Chris Wilson <chris@...is-wilson.co.uk>
Cc: linux-kernel@...r.kernel.org,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
"H . Peter Anvin" <hpa@...ux.intel.com>,
Imre Deak <imre.deak@...el.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] x86: Add an explicit barrier() to clflushopt()
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists