From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH v2 6/9] x86: Optimize virt_to_phys() and phys_to_virt() Date: Wed, 27 Apr 2016 15:58:02 +0200 Message-ID: <20160427135802.5o5kfr7gdgvntoat@hawk.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Thomas Huth , Radim =?utf-8?B?S3LEjW3DocWZ?= To: Alexander Gordeev Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40979 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbcD0N6H (ORCPT ); Wed, 27 Apr 2016 09:58:07 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 66ABE1E4A for ; Wed, 27 Apr 2016 13:58:06 +0000 (UTC) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: 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. thanks, drew >=20 > Cc: Andrew Jones > Cc: Thomas Huth > Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 > Signed-off-by: Alexander Gordeev > --- > 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(-) >=20 > 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 > =20 > +#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, unsign= ed short port) > asm volatile("outl %0, %w1" : : "a"(value), "Nd"(port)); > } > =20 > -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 > =20 > #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 > =20 > +#define __va(x) ((void *)((unsigned long) (x))) > +#define __pa(x) ((unsigned long) (x)) > + > #endif > --=20 > 1.8.3.1 >=20 > -- > 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