All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, "Thomas Huth" <thuth@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH v2 5/9] x86: Introduce lib/x86/asm/barrier.h
Date: Wed, 27 Apr 2016 18:26:57 +0200	[thread overview]
Message-ID: <20160427162656.GB14081@dhcp-27-118.brq.redhat.com> (raw)
In-Reply-To: <20160427135251.hqvj6rb6gklqxo2k@hawk.localdomain>

On Wed, Apr 27, 2016 at 03:52:51PM +0200, Andrew Jones wrote:
> On Wed, Apr 27, 2016 at 03:13:54PM +0200, Alexander Gordeev wrote:
> > Make x86 consistent with other architectures and put
> > memory barrier defines to lib/x86/asm/barrier.h
> > 
> > Cc: Andrew Jones <drjones@redhat.com>
> > Cc: Thomas Huth <thuth@redhat.com>
> > Cc: Radim Krčmář <rkrcmar@redhat.com>
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > ---
> >  lib/x86/asm/barrier.h | 8 ++++++++
> >  lib/x86/asm/io.h      | 1 +
> >  lib/x86/smp.h         | 4 ----
> >  x86/kvmclock.c        | 1 +
> >  4 files changed, 10 insertions(+), 4 deletions(-)
> >  create mode 100644 lib/x86/asm/barrier.h
> 
> Reviewed-by: Andrew Jones <drjones@redhat.com>

I forgot about your _ASM_X86 vs _ASMX86 nit.
I will resend this (and others affected).

> > 
> > diff --git a/lib/x86/asm/barrier.h b/lib/x86/asm/barrier.h
> > new file mode 100644
> > index 0000000..0ca1c56
> > --- /dev/null
> > +++ b/lib/x86/asm/barrier.h
> > @@ -0,0 +1,8 @@
> > +#ifndef _ASM_X86_BARRIER_H_
> > +#define _ASM_X86_BARRIER_H_
> > +
> > +#define mb()	asm volatile("mfence":::"memory")
> > +#define rmb()	asm volatile("lfence":::"memory")
> > +#define wmb()	asm volatile("sfence" ::: "memory")
> > +
> > +#endif
> > diff --git a/lib/x86/asm/io.h b/lib/x86/asm/io.h
> > index 68b10e5..5b901a3 100644
> > --- a/lib/x86/asm/io.h
> > +++ b/lib/x86/asm/io.h
> > @@ -2,6 +2,7 @@
> >  #define _ASM_X86_IO_H_
> >  
> >  #include "asm/page.h"
> > +#include "asm/barrier.h"
> >  
> >  static inline unsigned char inb(unsigned short port)
> >  {
> > diff --git a/lib/x86/smp.h b/lib/x86/smp.h
> > index 566018f..afabac8 100644
> > --- a/lib/x86/smp.h
> > +++ b/lib/x86/smp.h
> > @@ -2,10 +2,6 @@
> >  #define __SMP_H
> >  #include <asm/spinlock.h>
> >  
> > -#define mb() 	asm volatile("mfence":::"memory")
> > -#define rmb()	asm volatile("lfence":::"memory")
> > -#define wmb()	asm volatile("sfence" ::: "memory")
> > -
> >  void smp_init(void);
> >  
> >  int cpu_count(void);
> > diff --git a/x86/kvmclock.c b/x86/kvmclock.c
> > index 327e60d..208d43c 100644
> > --- a/x86/kvmclock.c
> > +++ b/x86/kvmclock.c
> > @@ -3,6 +3,7 @@
> >  #include "atomic.h"
> >  #include "processor.h"
> >  #include "kvmclock.h"
> > +#include "asm/barrier.h"
> >  
> >  #define unlikely(x)	__builtin_expect(!!(x), 0)
> >  #define likely(x)	__builtin_expect(!!(x), 1)
> > -- 
> > 1.8.3.1
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-04-27 16:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 13:13 [PATCH v2 0/9] Cleanup low-level arch code Alexander Gordeev
2016-04-27 13:13 ` [PATCH v2 1/9] Remove unused and unnecessary PHYS32 macro Alexander Gordeev
2016-04-27 13:13 ` [PATCH v2 2/9] Move phys_addr_t type definition to lib/libcflat.h Alexander Gordeev
2016-04-27 13:42   ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 3/9] x86: Introduce lib/x86/asm/page.h Alexander Gordeev
2016-04-27 13:45   ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 4/9] x86: Introduce lib/x86/asm/io.h Alexander Gordeev
2016-04-27 13:46   ` Andrew Jones
2016-04-27 16:23     ` Alexander Gordeev
2016-04-28  9:24       ` Alexander Gordeev
2016-04-28 11:13         ` Andrew Jones
2016-04-27 13:51   ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 5/9] x86: Introduce lib/x86/asm/barrier.h Alexander Gordeev
2016-04-27 13:52   ` Andrew Jones
2016-04-27 16:26     ` Alexander Gordeev [this message]
2016-04-28 16:23       ` Alexander Gordeev
2016-04-28 17:00         ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 6/9] x86: Optimize virt_to_phys() and phys_to_virt() Alexander Gordeev
2016-04-27 13:58   ` Andrew Jones
2016-04-27 16:54     ` Alexander Gordeev
2016-04-27 18:19       ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 7/9] io: Make ioremap() prototype conform to Linux one Alexander Gordeev
2016-04-27 13:59   ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 8/9] io/x86: Factor out ioremap() Alexander Gordeev
2016-04-27 14:11   ` Andrew Jones
2016-04-27 13:13 ` [PATCH v2 9/9] io: Disable memory re-ordering for generic memory barriers Alexander Gordeev
2016-04-27 14:14   ` Andrew Jones
2016-04-27 13:34 ` [PATCH v2 0/9] Cleanup low-level arch code Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160427162656.GB14081@dhcp-27-118.brq.redhat.com \
    --to=agordeev@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.