From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [kvm-unit-tests PATCH v3 3/6] pci: Accomodate 64 bit BARs in pci_dev::resource[] Date: Tue, 28 Feb 2017 18:40:02 +0800 Message-ID: <20170228104002.GC13926@pxdev.xzpeter.org> References: <20170228070225.GK10022@pxdev.xzpeter.org> <20170228095151.GA6585@agordeev.lab.eng.brq.redhat.com> <20170228095501.GB13926@pxdev.xzpeter.org> <20170228102213.GD6583@agordeev.lab.eng.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, Thomas Huth , Andrew Jones To: Alexander Gordeev Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500AbdB1KkM (ORCPT ); Tue, 28 Feb 2017 05:40:12 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2C747E9D4 for ; Tue, 28 Feb 2017 10:40:07 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20170228102213.GD6583@agordeev.lab.eng.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Feb 28, 2017 at 11:22:14AM +0100, Alexander Gordeev wrote: > On Tue, Feb 28, 2017 at 05:55:01PM +0800, Peter Xu wrote: > > > bool pci_bar_is_valid(struct pci_dev *dev, int bar_num) > > > { > > > return dev->resource[bar_num] != INVALID_PHYS_ADDR; > > > } > > (*) > > > I see. Could I ask why we cannot just use INVALID_PHYS_ADDR for > > res[bar_num+1] when bar_num is 64bit (just like what patch 2 did)? > > INVALID_PHYS_ADDR is already used to mark unimplemented BARs (*). > > INVALID_PHYS_ADDR is also confusing if we think of index into > high-part of 64-bit address. A high-part is apparently valid. Okay. Then both work for me. Thanks, -- peterx