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

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


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Tue, 9 Aug 2022 16:26:07 +0000
  • Accept-language: 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=sX80v2nt/z5wq8hiKScglfEvqL9+M79h/DzART4GQDU=; b=ODAT/hag/lCmFKA+zKqM2awrRT6VkHBrDqksadJYCEChmrV03lWn2Jjbi35ARePLrxmYw/R0741xUI86m2YFSj93okXTFycJgzt3bBgOXjXZnkjXjLYIAttIq53PrbbnlUEn1aDE0RmuwO/VheajnwJKNrmOl9y0ELISbWfMZO+GFbXJD+AKu6T8lpljWuGljoOoFCVde2ss9npsGORn+tTAE1pr9WscwjMx7iSDg/KfUXONbdtJu/W6yVoXg0YqCaJdf082lNz9cJeE1XlBo8JmD9+vz0U8Vqj+znaXZBWzXVrxOHvPdVNLUeEQbcP84wjzd87ZmgTJQLlj801PGg==
  • 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=sX80v2nt/z5wq8hiKScglfEvqL9+M79h/DzART4GQDU=; b=CA6DTWK+wIMxaOphSq44YVecxTRxJcYkLbG0NcZ6DTL5niAo2B4aLMDccHzvKf1ajHOcbMCDQvSKJvgZ40poDRuIyteL/biDXpF6HZvZqEYghqaagLJk1Ck0MZEiv2BbTHGzW0S18Q0MdlBC1QrRUw4kYizh09W9mT3+CAr5wjWV0/Q9sLahvYXQGfvdOMgBuvP0Nc9ac25eZOisdlPnnKoitZLTMb1KOTGvyrnwTBVwT8wu+9DtOUv6v5Eu56RUhlgnlUPyEm2A1kesrZbsTgxYVpS7Vifl+o2EU+JalhRAOKMDC3vAWyge143ikcWeUzAGeycRATgec6+vfgKilg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RuuOASsLL07GgiIjHnF9O8BSwDKL0y+CRhVAzTy1qPhZ1KmQhDnWzNludExj4OZ1bA36aRUHb4Jfyz2WHRpvlXkoBb+U8Bu9mlmwJDwl7hz5aFoEW0a56kIW6kSDeAMyiqG0jhN19ZBlTanhBlZZ83q/sW8fILSbskRfE55PcH7LgiDiqAyiBgVajrQu2gEUCIyO9HUXNZOuMjUHZmi8wPfXpC2O7ML1e8zocazA2GTVdbEmZm1FJqhBhy+7eRY/fdbMmFoTK5rqblvEnlu1J3aDMo//dxBKqnpH1aEuKrNCA1gAM+kCi6PlEeDbSza8n9uhqf1PPg7mMVgRkeHsuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UW/TzKWIxvkyw+1s8CjVRG2zb0ha6Eq7Kj1hG+IttMCR1K9Rr1RuVkQla1A/mv0IrFIrCE2Z7saQU7tOVPXv6CDsWY1m4u7IPowRD2H8YbykM0M1qnjZlT9VQ7cZfYiC+0hBMs29Kxxby/VoL8Wd2PTyTeSoNuhpENvEj987DkA0KSUGukHrw+4vbzCad8R8qoi9ycdspgS3limpACps5SQjEUBRZunGvKJ2LFnk2bLtGE7caeQWSF4+CiD9u+q50Qfw/moZguF7ycTds96VMvLppT5jrW461TQ08JVcnGV2cUuQ4cgnQiaeDv/X5uxkaFiHK/d/qRjlCln3Vcignw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Oleksandr <olekstysh@xxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Tue, 09 Aug 2022 16:26:40 +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: AQHYqOJykksEC+xLCUihSPiXurK3kK2lJb0AgAGQGQCAAAa6gIAACx4A
  • Thread-topic: [PATCH] xen/pci: replace call to is_memory_hole to pci_check_bar

Hi Julien,

> On 9 Aug 2022, at 4:46 pm, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul,
> 
> This patch seems to have been sent in-reply-to the SMMUv1 patch. Was it 
> intended?

That was by mistake I want to send all the patches independently but somehow I 
send it 
from single git "send-email” command because of that I think this patch comes 
in-reply-to 
SMMUv1 patch.

> 
> On 09/08/2022 16:22, Rahul Singh wrote:
>>> On 8 Aug 2022, at 4:30 pm, Oleksandr <olekstysh@xxxxxxxxx> wrote:
>>>> +bool pci_check_bar(const struct pci_dev *pdev, mfn_t start, mfn_t end)
>>>> +{
>>>> +    int ret;
>>>> +    struct dt_device_node *dt_node;
>>>> +    struct device *dev = (struct device *)pci_to_dev(pdev);
>>> 
>>> 
>>> The cast is present here because of the const?
>> Yes you are right, cast is because of the const.
>>> 
>>> I would consider passing "const struct pci_dev *pdev" instead of "struct 
>>> device *dev" to pci_find_host_bridge_node() and dropping conversion 
>>> (pci<->dev) in both functions.
> 
> It looks like this function was added without any callers. The commit message 
> claim there will be some. Can you (or Oleksandr) confirm this is not going to 
> be problem for future patches?

I checked the whole PCI passthrough feature branch this function will be used 
when
we add iommu support for PCI device.  

> 
> That said, I agree that the conversion pci -> dev -> pci is pointless. So I 
> would say if there are use case where we only have a 'dev' in hand, then we 
> could ask the caller to do the conversation or we provide an helper if there 
> are too many cases.
> 
>> Yes make sense. I will do that in next version.
> 
> While you are modifying the prototype for pci_find_host_bridge_node() can you 
> consider to also constify the return (it should not be modified)?

Agree, I will constify the retrun also. 

> 
> In any case, the change suggested by Oleksandr should preferably be separate 
> to this patch and added before.

Ack. 

Regards,
Rahul


 


Rackspace

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