All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Alexander Gordeev <agordeev@redhat.com>
Cc: kvm@vger.kernel.org, "Thomas Huth" <thuth@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH v2 6/9] x86: Optimize virt_to_phys() and phys_to_virt()
Date: Wed, 27 Apr 2016 20:19:28 +0200	[thread overview]
Message-ID: <20160427181928.f6qyhnlrh3c4s5xj@hawk.localdomain> (raw)
In-Reply-To: <20160427165421.GC14081@dhcp-27-118.brq.redhat.com>

On Wed, Apr 27, 2016 at 06:54:22PM +0200, Alexander Gordeev wrote:
> On Wed, Apr 27, 2016 at 03:58:02PM +0200, Andrew Jones wrote:
> > On Wed, Apr 27, 2016 at 03:13:55PM +0200, Alexander Gordeev wrote:
> > > Make use of generic implementations and remove x86
> > > specific virt_to_phys() and phys_to_virt() functions.
> > 
> > I would drop this patch. If x86 needs/wants more stuff from
> > lib/asm-generic/io.h at a later time, then it can be brought
> > in then.
> 
> Will drop it.
> 
> But I do not get your point :) The x86 variants almost duplicate
> the generic ones - so why x86 would not want to bring it?

yes, but a whole file full of stuff is a lot to bring in just to
take advantage of two functions (virt_to_phys/phys_to_virt) that
are likely better off being written more arch-specific sometime
anyway.

thanks,
drew

> 
> > thanks,
> > drew
> > 
> > > 
> > > 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/asm-generic/io.h |  2 ++
> > >  lib/x86/asm/io.h     | 10 +---------
> > >  lib/x86/asm/page.h   |  3 +++
> > >  3 files changed, 6 insertions(+), 9 deletions(-)
> > > 
> > > diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h
> > > index 931415a..3585ac0 100644
> > > --- a/lib/asm-generic/io.h
> > > +++ b/lib/asm-generic/io.h
> > > @@ -165,7 +165,9 @@ static inline unsigned long virt_to_phys(volatile void *address)
> > >  {
> > >  	return __pa((unsigned long)address);
> > >  }
> > > +#endif
> > >  
> > > +#ifndef phys_to_virt
> > >  static inline void *phys_to_virt(unsigned long address)
> > >  {
> > >  	return __va(address);
> > > diff --git a/lib/x86/asm/io.h b/lib/x86/asm/io.h
> > > index 5b901a3..74451d5 100644
> > > --- a/lib/x86/asm/io.h
> > > +++ b/lib/x86/asm/io.h
> > > @@ -40,14 +40,6 @@ static inline void outl(unsigned int value, unsigned short port)
> > >      asm volatile("outl %0, %w1" : : "a"(value), "Nd"(port));
> > >  }
> > >  
> > > -static inline unsigned long virt_to_phys(const void *virt)
> > > -{
> > > -    return (unsigned long)virt;
> > > -}
> > > -
> > > -static inline void *phys_to_virt(unsigned long phys)
> > > -{
> > > -    return (void *)phys;
> > > -}
> > > +#include <asm-generic/io.h>
> > >  
> > >  #endif
> > > diff --git a/lib/x86/asm/page.h b/lib/x86/asm/page.h
> > > index edfe325..a9280ed 100644
> > > --- a/lib/x86/asm/page.h
> > > +++ b/lib/x86/asm/page.h
> > > @@ -24,4 +24,7 @@
> > >  #define	PGDIR_MASK	1023
> > >  #endif
> > >  
> > > +#define __va(x)		((void *)((unsigned long) (x)))
> > > +#define __pa(x)		((unsigned long) (x))
> > > +
> > >  #endif
> > > -- 
> > > 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
> --
> 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 18:19 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
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 [this message]
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=20160427181928.f6qyhnlrh3c4s5xj@hawk.localdomain \
    --to=drjones@redhat.com \
    --cc=agordeev@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.