From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [kvm-unit-tests PATCH v2 02/10] x86: move io.h to asm Date: Mon, 18 Jan 2016 14:55:43 +0100 Message-ID: <20160118135543.GD4075@hawk.localdomain> References: <1452876695-9240-1-git-send-email-drjones@redhat.com> <1452876695-9240-3-git-send-email-drjones@redhat.com> <20160115213922.GA11566@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, pbonzini@redhat.com, mst@redhat.com, agordeev@redhat.com To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35465 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754904AbcARNzr (ORCPT ); Mon, 18 Jan 2016 08:55:47 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 3B93B8E235 for ; Mon, 18 Jan 2016 13:55:47 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20160115213922.GA11566@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jan 15, 2016 at 10:39:23PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > 2016-01-15 17:51+0100, Andrew Jones: > > Also throw an '#include "asm-generic/io.h"' at the bottom. Doing > > that requires also adding an asm/page.h, and then some changes to > > vm.[ch] to integrate with it. > >=20 > > Signed-off-by: Andrew Jones > > --- >=20 > > diff --git a/lib/x86/vm.h b/lib/x86/vm.h > > @@ -39,11 +39,13 @@ unsigned long *install_large_page(unsigned long= *cr3,unsigned long phys, > > +#define virt_to_phys virt_to_phys > > static inline unsigned long virt_to_phys(const void *virt) > > { > > return (unsigned long)virt; > > } > > =20 > > +#define phys_to_virt phys_to_virt >=20 > Nitpick: if we always define all (both) functions, using two guarding > #defines is pure waste. lib/asm-generic/io.h even has both functions > under one #ifndef virt_to_phys. (It would be better with a sensible > name instead of virt_to_phys and if it was in lib/asm-generic/vm.h. := ]) This is just a consistency with Linux thing again. If you want to drop the #include "asm-generic/io.h" from lib/x86/asm/io.h, then these can go away too. >=20 > > static inline void *phys_to_virt(unsigned long phys) > > { > > return (void *)phys; > -- > 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