[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/9] vpci/header: Implement guest BAR register handlers
- To: Jan Beulich <jbeulich@xxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Wed, 8 Sep 2021 15:35:29 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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; bh=6pkHIxDai02+KJhR4h/In0HYY9J2Svl375q3OsrMWnc=; b=Zap9DTGZnzafuJ2yOJ+MTdLUVY1O9Q/Eecp6RXDQ37u/VfAZDrEtvLSTc/cs/TmR3w1bE3eYq6U9vMuzE1Tw5NrdCzBohHJcCMunNloc8Z5rxciZW3QAotJI8SfT5oeFcecQq/+ICrsANo4ayG4e4kwRp8oCKbzV9H7kFk27r8P3eX+yGoU4oZS81b+9jLjwyLI22o5VVrTVZmPbyJRRggZELBnebouU0IdedGXmwgUU75k/hTxc7XK6IPezbSE4APo9V44R080aC3+8wR11OGaR7+wFCWxL/6ZCyfJGTVHLhtwTDKTvmBQUWjBSRLTGmofSNwanP6fzcwOOMUdq2A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJOKCfFNsfO6eyg8HXQr2MEpj6QsQu3kY8a3pNpivqMBixsFS4WmKzSY54+faDCJkEHJJ2UtuNgkGhDVof0BycXil8ti7zj4+anLImbaQ6EZ7d8IHIQj8tJEcNd1R1oN54MKH7G+d3QbfCLHnZyE3ZBBxm3Uo2oeZN+khcXofoIUQejGy1NVZp2uEccPzLuzoLGndYS/VnxeNXYKg57bfF/kgyxlqGSuJLhjRirY9AwghdUF4xl3LZVdE0hUfo91kDDzIEiNtkPJnKo2tDP/Fp14ohL1zAa0n++qI081aFDC01sAWcdGZvMBaQVFkatW4E39m1i6mK0UKuqxweY37w==
- Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=epam.com;
- Cc: "julien@xxxxxxx" <julien@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 08 Sep 2021 15:35:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHXoKxmxnIdZosa7ESbvTmPlG6KHauXFn+AgAGCLICAADFtgIAAE0qAgAEIooCAAAS6AIAABV4AgAA6yACAABRDgIAACAOAgAAEOQCAAAGQAA==
- Thread-topic: [PATCH 5/9] vpci/header: Implement guest BAR register handlers
On 08.09.21 18:29, Jan Beulich wrote:
> On 08.09.2021 17:14, Oleksandr Andrushchenko wrote:
>> On 08.09.21 17:46, Jan Beulich wrote:
>>> On 08.09.2021 15:33, Oleksandr Andrushchenko wrote:
>>>> static void guest_bar_write(const struct pci_dev *pdev, unsigned int reg,
>>>> uint32_t val, void *data)
>>>> {
>>>> struct vpci_bar *bar = data;
>>>> bool hi = false;
>>>>
>>>> if ( bar->type == VPCI_BAR_MEM64_HI )
>>>> {
>>>> ASSERT(reg > PCI_BASE_ADDRESS_0);
>>>> bar--;
>>>> hi = true;
>>>> }
>>>> else
>>>> {
>>>> val &= PCI_BASE_ADDRESS_MEM_MASK;
>>>> val |= bar->type == VPCI_BAR_MEM32 ?
>>>> PCI_BASE_ADDRESS_MEM_TYPE_32
>>>> :
>>>> PCI_BASE_ADDRESS_MEM_TYPE_64;
>>>> val |= bar->prefetchable ? PCI_BASE_ADDRESS_MEM_PREFETCH : 0;
>>>> }
>>>>
>>>> bar->guest_addr &= ~(0xffffffffull << (hi ? 32 : 0));
>> Do you think this needs to be 0xfffffffful, not 0xffffffffull?
>>
>> e.g. s/ull/ul
> If guest_addr is uint64_t then ull would seem more correct to me,
> especially when considering (hypothetical?) 32-bit architectures
> potentially wanting to use this code.
Ok, then I'll keep ull
>
> Jan
>
Thank you,
Oleksandr
|