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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Fri, 19 Aug 2022 10:18:46 +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=f73UH0LIQxmDL/PiMutUsS/SpWhd51iSg4oXe08yPOs=; b=eBSvxX9seKkUbS/y7ZjitFn4iW/iHO/lb/tFeYiGV5VgZDXCYIDbeZaOhJVIhRsoWIaAsOcO+M3gmCU6OUxGJRdZbR69Pv+fGbmqQ0hWriDrW/bJnr9t1+9ZIKXGp6XbxCRIEDBICDMgpoQeAom2EBf9s+39H1wT79LvdBIhAl2ONriYvyEfokBArGL35gEcTeGREwFlDMpkxqhRYzO3l53AlVfo+aLtFan/HTdTrt1WaaBTOm5/Mr0JfngFbnRHLcqS1YD7NBhHEXFDKNC88/IWTBMQIFy+4LHJIizbrKTtQ9QY0Xl19Pb81v9X/yktYfi7LUiCnq334t+clGe9ug==
  • 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=f73UH0LIQxmDL/PiMutUsS/SpWhd51iSg4oXe08yPOs=; b=DMQwwQmxwi4wnyGmIF26QdonBld9NFOlG8cYgnoJn5spVxUJWIQVTMAEKJFyqVHxkPbXRJauULZgmqNQ/C7bt5EkskSZY3wqWnNmiLye06xLbRQfP+MjhXZxQr05SC37uhdDrT0jZy7EnanOhjCpn86pj4DZGDRqotpGvhxzq8MHdPVsuLDO3ffUkIXakv2sz4j6rg/Mq7Nbz/h8lGydTlqWUgOKxqqBMfjN7bKT0kZzZ0qJiz1oO9JJCrjFJ1F9SZ3FHvtO5thR/YtpvG1CxwgI4ap6I8+pibOlvN/3kGG7hSPxt5JPP+GeTqzAw1GBwe/F5m7iOFgidTWofB3eOQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Hb+Cl9KJaoOjd/rlOZvo5Shr3BirfEwPr4Y3cIHObh+tPcaTWJ9uWPx9h//Vdy7FbCXaJB8ZR8Airt/YfvQi1ogLjIi+L9ioVx7fF/D1QGzPrzqYlNXnc5OLD5b9hhxoVdbXKtTrFFBuBc8NeCBTkDQWX49dyxCPq1r9lyARU2CWI/VfqjqNrvSTr7BQwabA1wZIsOwzqEBgfVGvjMXgkLx1oTLfH76w1Djp/SKDL6aNjZTWQQcJCdzPN6MMKg8+7wpzeki7DL6LDfSziLc+00QTT2uAEEYXNi+jQS2VYIb6mKlGwtit091TSylhqM3OsmaqtkY9EIDTFf98UzV5qA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QTf6nzuWDD0uBi9mWrm3sEXO8DjznDRArlxOA4aScd0sI+HdxBh2mJ+Bppdw9XGvNaf2sfZlHlGoe1ql5jJkotimDG/0tCtS5GTrwHGexK0Ytuab+PO1nHkiaaXooCIkbOIvIKF3UGA1elq5l10C4ScSmGMnfJI0d4VGFG4LU3V0ShXqqdafLj+LUPahHmJvgTzgUXHZXcBv6DxSw2fY9h1oW19m2pHMLJuFFA3zIKfcZ+q8Q/Z9Y350FPRSuDMLQKibaF098YENjbb+hXp8vZnYT7YZTUW+nLwlq9Aimg3zG+ZBmPPlFF+vtiV2ccbH9p+Z2lXit3w0FHHtVu8PEA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, 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: Fri, 19 Aug 2022 10:19:14 +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: AQHYskgSn+BMkn6XSUmZynj+RN74K62zNKQAgAGMxwCAAP3ZgIAARkyA
  • Thread-topic: [PATCH v2 2/2] xen/pci: replace call to is_memory_hole to pci_check_bar

Hi Jan,

> On 19 Aug 2022, at 7:07 am, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> On 18.08.2022 16:58, Rahul Singh wrote:
>>> On 17 Aug 2022, at 4:18 pm, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>> On 17.08.2022 16:45, Rahul Singh wrote:
>>>> @@ -363,6 +373,42 @@ int __init pci_host_bridge_mappings(struct domain *d)
>>>>    return 0;
>>>> }
>>>> 
>>>> +static int is_bar_valid(const struct dt_device_node *dev,
>>>> +                        u64 addr, u64 len, void *data)
>>> 
>>> s/u64/uint64_t/g please.
>> 
>> Ack. 
>>> 
>>>> +{
>>>> +    struct pdev_bar *bar_data = data;
> 
> const?

Ack.
> 
>>>> +    unsigned long s = mfn_x(bar_data->start);
>>>> +    unsigned long e = mfn_x(bar_data->end);
>>>> +
>>>> +    if ( (s < e) && (s >= PFN_UP(addr)) && (e <= PFN_UP(addr + len - 1)) )
>>> 
>>> Doesn't this need to be s >= PFN_DOWN(addr)? Or else why is e checked
>>> against PFN_UP()?
>> 
>> Ack. I will modify as if ( (s < e) && (s >= PFN_DOWN(addr)) && (e <= 
>> PFN_UP(addr + len - 1)) )
> 
> Hmm, doesn't it further need to be s <= e, seeing that the range passed
> to pci_check_bar() is an inclusive one?

Agree, I will do the modification in next version.


Regards,
Rahul



 


Rackspace

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