[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 06/13] vpci/header: implement guest BAR register handlers
- To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 8 Feb 2022 10:16:59 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=jO5oujVGxYE8gCO9O1wJxedKAsnpNsZI1EHBIUKEpYU=; b=XDSyop4ipRuVzBOk0KvO/3Vv8DFMaVjGAyct66BTyp6K40X2z361HfHKI9Gk2QqqpqyTDCkFq5Eo24bSHLqbqyogwrOoEeI9jFIalct/Z5JhaL31Lo0mR/BFJL2+U7XUEbJnPxLdXl/YsQekPyVG9FGmNZxC3cqjTztV8k24cO+9rD959jQyrxvzJgxJabJ8CorhCRFHc8BI5RNofcPniwwkmf4UoxwHbUXJB8MU7zMEzlMrHr9hG42tYr7d+cTKNA+vTM3N7/4uoYuLFiuHacVP1YE6xNjLSlmfPwp9DmlKiH8QFGirf/m9D+uOMu6rpV7RHHZsq3QCnLO4NtS+0w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DigtZyC5FzcCRoHB7dsm32+4VIQ6S3nal5l68PpjiCmN44GE3SSLY/sRZ5MjIA1/VXJHX+JzVLAgKvjPSxr/n9U1RYbDenS3QVNKnMjH6km19Vx7caamU86iK5Frhk+iHFzU2XGRwwb8ikKsxa30e1dBqYekAGjbrW7KTNx8saMdYBOUtm+RCeY6mBRQNvAokp5WdRP1VjPjq7ubtcscdZSzHfHxrlJ0QTGTBe6mjhSJdoT1SBv2Dgp+PI6HyhtmoHAtH2hORTfrzFzPPloK/IGbiEvOqigmM4cgUcVFxaZwYnzk6U0EAZ46ILc4quXzsgXBS8YmBjs/y9CYMy90pA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 08 Feb 2022 09:17:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 08.02.2022 09:06, Oleksandr Andrushchenko wrote:
>
>
> On 07.02.22 19:06, Jan Beulich wrote:
>> On 04.02.2022 07:34, Oleksandr Andrushchenko wrote:
>>> +static uint32_t guest_bar_ignore_read(const struct pci_dev *pdev,
>>> + unsigned int reg, void *data)
>>> +{
>>> + return 0;
>>> +}
>>> +
>>> +static int bar_ignore_access(const struct pci_dev *pdev, unsigned int reg,
>>> + struct vpci_bar *bar)
>>> +{
>>> + if ( is_hardware_domain(pdev->domain) )
>>> + return 0;
>>> +
>>> + return vpci_add_register(pdev->vpci, guest_bar_ignore_read, NULL,
>>> + reg, 4, bar);
>>> +}
>> For these two functions: I'm not sure "ignore" is an appropriate
>> term here. unused_bar_read() and unused_bar() maybe? Or,
>> considering we already have VPCI_BAR_EMPTY, s/unused/empty/ ? I'm
>> also not sure we really need the is_hardware_domain() check here:
>> Returning 0 for Dom0 is going to be fine as well; there's no need
>> to fetch the value from actual hardware. The one exception might
>> be for devices with buggy BAR behavior ...
> Well, I think this should be ok, so then
> - s/guest_bar_ignore_read/empty_bar_read
> - s/bar_ignore_access/empty_bar
Hmm, seeing it, I don't think empty_bar() is a good function name.
setup_empty_bar() or empty_bar_setup() would make more clear what
the function's purpose is.
> - no is_hardware_domain check
Please wait a little to see whether Roger has any input on this aspect.
Jan
|