[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 2/2] xen/pci: replace call to is_memory_hole to pci_check_bar


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 7 Sep 2022 13:23:27 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wC2PthZ9nIyxbUBb8wmSNNGbLyqH4j5Y9GpvsILWGI8=; b=JJWid93T5BUeTB0w78yxwCJYAzucr3Ql7rlda0Vzp8nY55u8xNY9Rw5Tg2J1KCfhSdr8IZo8gYrqjgqnfwMm94GCvoH+DXDRxY6X7GtrPka7CrUN4EbGIUNhJUA0aI++v3VfvDXrk4cKFF9LEjFOYtc9no3Cjkay0LfUiGCXJW5go9U8+/v1Zqd0uClhmfR2RGnJF9m4z4WWrnPLFS+DsTqxKZfhZ1uz04y8V2zyEkD41I54W2oM80kWkpVbtlbgJroVEZd77nl00hyfGBPfVETbInpXUG0e7CND4jspOvvu4LoT4SGMBlJu/lKP4LiAScCfW/hxPweUnZ4A9e1dsQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wC2PthZ9nIyxbUBb8wmSNNGbLyqH4j5Y9GpvsILWGI8=; b=nz1Mq/Cb6urKiqaBw/X4UeD9Jerd0bv7uES0UOHlIQI6ysi0Nm3TGJJn+h0+sZy6xBJba4Gdk+ZJ6iCycw0brDE9tIAJwoj8BylGFrSG5aVyDWCEEKWlNfKNr5Y+LG1RClNdskrFhspsWUDU+yJCyl6886m6pDP9FuKw/5eNFjSTqFK8OFV5FU3FQ6PGccHf/I9TdEsIvHYVs97eukvk5ytSHlFZdLIN2yIzyLTR/8qJScNfy5dqQfHpSiwV2gETL5wLQ3y67IT3MslTnHZIojvdB0UICWh1jDYqMZxMuRawC54rCI2bB2kHQQ+hTA3hD6bs5T++R4Al6PZ0MsKgEg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=fzGcc0t1PrWrGJ0HsbBvFyZ3+YLkxuapu+Iun9/fLl+6eVtY/GYA65dc9Z8NmCiHXysB4+TzZbkzJ/YkSlgZEL1Exhd8cRQE/2Wd15y8QeG6OLMh5AoBjevpRLbw39ubOM1IScSVefMVijXSn5wOnGTfSDqvf1Ee+F47kAhvl3exbNDoNpDIEvCAlozpg3SNCgHuCEZ0t8PoloGgnpSItXNUysvb+sy7N7QnHEgB3dH3dNlK6ey93eG4o6tXLNUaI3ATWLlmOP4IgojnHMOt1cwq/R0AaPQ2lrAWYawGE9trFD1ifHvc9jhNPh6Z4ww2mUgcIGIHDQZES4NucYslCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3wxVYYky6L2NoOiWbBpE8NFpyFq4pTynoCOgQ7vPjE9vZAzUCOQ5p8c7th/Bv0fy1MIDC2ga+F+MA+Whliw57sqlvU5LdbMFxLrpmrB5zXi8Owz5dKFTJps1BESqZaai6VEcLxIaCtR44FiQUSCQe0X8QlxlinVW2dRgqNRFWAoK80PaS+V+ZQiG8t2filuqLsfHfS2Yygylfz0b/P/oliV/lSfHpPCiGsEtPCy4F9LiAHPq811dY3XxDOs1tvx7MgH+++TbN8jTps/vRdyGI/1amwUaP/pY/vZU5PXc9Ych89U6nYZ5awOcV4fpUFkpYLPjD9lUNnza/7b4aglwA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 07 Sep 2022 13:23:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYwqqLAtgrk5Z7CEC9g3vN92mek63T3yeAgAALyICAAAnBAA==
  • Thread-topic: [PATCH v4 2/2] xen/pci: replace call to is_memory_hole to pci_check_bar

Hi,

> On 7 Sep 2022, at 13:48, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Jan,
> 
> On 07/09/2022 13:06, Jan Beulich wrote:
>> On 07.09.2022 13:09, Rahul Singh wrote:
>>> is_memory_hole was implemented for x86 and not for ARM when introduced.
>>> Replace is_memory_hole call to pci_check_bar as function should check
>>> if device BAR is in defined memory range. Also, add an implementation
>>> for ARM which is required for PCI passthrough.
>>> 
>>> On x86, pci_check_bar will call is_memory_hole which will check if BAR
>>> is not overlapping with any memory region defined in the memory map.
>>> 
>>> On ARM, pci_check_bar will go through the host bridge ranges and check
>>> if the BAR is in the range of defined ranges.
>>> 
>>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>>> ---
>>> Changes in v4:
>>>  - check "s <= e" before callback
>>>  - Add TODO comment for revisiting the function pci_check_bar() when
>>>    ACPI PCI passthrough support is added.
>>>  - Not Added the Jan Acked-by as patch is modified.
>> Hmm, I don't see any change to the parts the ack covers (x86 and common),
>> so please re-instate. I'm not in the position to ack Arm changes; things
>> would be different for a Reviewed-by without scope restriction.
> 
> I would like the question about the BAR alignment to be resolved before 
> giving my Reviewed-by/Acked-by here.

In here we have a range specified by the host controller and the bar should be 
strictly inside that range.
Now if the controller range is not properly aligned, there is an error in the 
device tree or ACPI table or in the firmware and we should have detected that 
earlier.

The itself BAR should fit inside the controller range boundary.

If the BAR start and end are not properly aligned we cannot map them so this 
should be an error (if we have to map them).

I am not entirely sure we should try to check this here or maybe would it be 
easier to fail if addr is not aligned or size is not aligned if we want to 
check something.

Bertrand


> 
> Hopefully Stefano can clarify it.
> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.