From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH v2 02/10] x86: move io.h to asm Date: Fri, 15 Jan 2016 22:39:23 +0100 Message-ID: <20160115213922.GA11566@potion.brq.redhat.com> References: <1452876695-9240-1-git-send-email-drjones@redhat.com> <1452876695-9240-3-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, pbonzini@redhat.com, mst@redhat.com, agordeev@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48363 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbcAOVj0 (ORCPT ); Fri, 15 Jan 2016 16:39:26 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id DED978E221 for ; Fri, 15 Jan 2016 21:39:26 +0000 (UTC) Content-Disposition: inline In-Reply-To: <1452876695-9240-3-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. > > Signed-off-by: Andrew Jones > --- > 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; > } > > +#define phys_to_virt phys_to_virt 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. :]) > static inline void *phys_to_virt(unsigned long phys) > { > return (void *)phys;