From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v2 3/5] hvmloader: Remove minimum size for BARs to relocate to 64-bit space Date: Thu, 20 Jun 2013 10:01:44 +0100 Message-ID: <51C2C4F8.6020109@eu.citrix.com> References: <1371573984-28514-1-git-send-email-george.dunlap@eu.citrix.com> <1371573984-28514-3-git-send-email-george.dunlap@eu.citrix.com> <20130619211440.GA10214@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130619211440.GA10214@zion.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: Ian Jackson , Hanweidong , Stefano Stabellini , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 19/06/13 22:14, Wei Liu wrote: > On Tue, Jun 18, 2013 at 05:46:22PM +0100, George Dunlap wrote: >> Allow devices with BARs less than 512MiB to be relocated to high memory. >> >> This will only be invoked if there is not enough low MMIO space to map >> the device, and will be done preferentially to large devices first; so >> in all likelihood only large devices will be remapped anyway. >> >> This is needed to work-around the issue of qemu-xen not being able to >> handle moving guest memory around to resize the MMIO hole. The default >> MMIO hole size is less than 256MiB. >> >> Signed-off-by: George Dunlap >> CC: Ian Jackson >> CC: Ian Campbell >> CC: Stefano Stabellini >> CC: Hanweidong >> --- >> tools/firmware/hvmloader/config.h | 1 - >> tools/firmware/hvmloader/pci.c | 5 ++--- >> 2 files changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h >> index 8143d6f..6641197 100644 >> --- a/tools/firmware/hvmloader/config.h >> +++ b/tools/firmware/hvmloader/config.h >> @@ -55,7 +55,6 @@ extern struct bios_config ovmf_config; >> /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */ >> #define PCI_MEM_START 0xf0000000 >> #define PCI_MEM_END 0xfc000000 >> -#define PCI_MIN_BIG_BAR_SIZE 0x20000000 >> >> extern unsigned long pci_mem_start, pci_mem_end; >> >> diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c >> index 7f306a1..a483b02 100644 >> --- a/tools/firmware/hvmloader/pci.c >> +++ b/tools/firmware/hvmloader/pci.c >> @@ -265,9 +265,8 @@ void pci_setup(void) >> if ( (bar_data & PCI_BASE_ADDRESS_SPACE) == >> PCI_BASE_ADDRESS_SPACE_MEMORY ) >> { >> - /* Mapping high memory if PCI deivce is 64 bits bar and the bar size >> - is larger than 512M */ >> - if (using_64bar && (bar_sz > PCI_MIN_BIG_BAR_SIZE)) { >> + /* Mapping high memory if PCI device is 64 bits bar */ >> + if (using_64bar) { > I think the original had style problem, if you look at other occurrences > for 'if', it should be > > if ( condition ) > statement; Ack. -George