From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Date: Sun, 27 May 2018 13:55:32 +0200 From: Martin Mares To: Bjorn Helgaas Cc: Rajat Jain , Bjorn Helgaas , linux-pci Subject: Re: [PATCH] lspci: Indicate if the OS / kernel go out-of-sync on BAR Message-ID: References: <20180516013333.135259-1-rajatja@google.com> <20180524223751.GC15320@bhelgaas-glaptop.roam.corp.google.com> <20180525183049.GB63280@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180525183049.GB63280@bhelgaas-glaptop.roam.corp.google.com> List-ID: Hello! > I don't disagree; that does sound like it could be useful. I just > don't know the best way to accomplish it. Seems like you'd have to do > something in resource_show() to re-read the BAR and validate the > cache. I don't know what you do if you find that it's invalid. I also do not see how to do it in a reasonably simple way. I checked lspci and it turned out that it already add a "[virtual]" marker in cases when the BAR is zero (which was this case -- am I right?) and the kernel reports a non-zero address. However, it turned out that the check is never triggered on I/O regions, because the BAR contains a non-zero type bit. I have modified the check to take into account just the address part of the BAR. You can check it in the master branch. Martin