[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: Rahul Singh <Rahul.Singh@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 19 Aug 2022 08:07:09 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- 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=RXJohMWn1R/5zadL3QrVtUMPdaKqZXbEzPsfOpT/vFM=; b=Mtne8Acn/rtMt2gBw0YMeY4tqkciPpF/LGv4IM03OILiB/OXkiEKZ4Yb36q2CZ9hBg+3MfZMeCKAzyr6qnnFkLDD7oJ/fJjWU+usi6nenE/Yx2csqcnd+2y50KCMIK+VB4vb8VIf9UKVyBEpdTWhLhtNCJw3CWVGtJA/sDcGWpKcyB/XmppJaAAnx0vHMLQGv5i1r1yCoAwEr8lch0h1GZury5od6Q2g4ckff2W4c3K9DlWXvptSbNlIjHUJsk1Rvb9F3c5yQIE5KTxkKNuU7jIHjNvOVjw0B+BKj29gCXQTN6bdRHC6uBBlPXCiZbGH+xY5RGOY2BJdnqVqayYa7w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PSrYtXFAtdyyvJRkLeav4dHU9rnXEM4ybubp+oU2Fufi3miGp+0TMFw8PTLhgeHwvfjsLxGX8tmJTC+HRosIB/GTPV1brKE+572wTvGLtHsdkrRAVdvHMe2/I4LOkNFEy2G+c6eZ49sZ6DYrGGKprJu6GOobqpmFg7+6bgr25l+TtxFg8ViriaexfqYceKilKDOKVn+MQUiJPVYWXSnvSiIc8rjPDaz51d9WRThB1mXPkW9xrYT0NlSX7yGpW2EZPBddIFUW1jzd4Ak+vZxToz/RLUXpgVpJvMhLWV9aiKLzsI/IhwcM3mJUpOoMGteclD5l4a0qxkjuUbNwW6/MjQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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 06:07:22 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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?
>>> + 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?
Jan
|