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

Re: [PATCH 7/9] vpci/header: program p2m with guest BAR view


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Thu, 9 Sep 2021 06:13:05 +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=LC4+rTwvOahb/P0W0i7gTem2KvP4a2j9bmnJIM+0E68=; b=Ms5y0cDgFnHp6VKr2pm6KxmD5IrnkhQkiF1VEeO5x6J6dO1MFk8tgsGAmg5kE2Q9V4SQ2u/xnCa6wdDmNLbfJPLQAaCy9YuMR50UVu444AdY8NoWuzJVR7Urlxd6ex0dC+1YEuLVnJCHxFUCzwmypNhJ0IdX08v2ym1zL5u6uYlt3esota1hDZvqg/zHD1Bx2PRIriynSX1oKBCsiciDV7cUhJk3fUkyDEA2W76BEoAicOR1cTGhxHozB3mUdyTQUGLtanjgXU6k1RnvDHKugXkhfeoIzg0v6JQq+dxJe+FuyeHI4U3Vyx2MFXCtSyWGubs2sEDwxil5Io8M1Ar+jQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XWDJRi7F6o3sao9f/vU/EO3Gsp57Z6dTKNYBpcmPgjfAUac1sBCJqVXlH+cTGthrK9aI2wVJj/IJmx2AH7m+FNswVV0aUPHyA7X6F9LRTNTWHPiXuggsIgySOZY/ARBTW5dn8AoPCI+NH4eHoi/Xd4DaS2o9i6oMQQo5loc4f3BYXVlI+qBl/WdCWSPfePIR+yMELNeFEZ4jFXYewPSx17Dp9CQCnupCwyF7dQy6xsqL7INGv0Audu5IPcky8l4nR/JCPt/q89QQz/a5vYQ1c/r2O6tsAzQ8WHJF3stmK5l3hxCUWDfvXt6Fs/p+/xwLZ1Ar6iU/Z0wRaJnlb757nA==
  • 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: Thu, 09 Sep 2021 06:13:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXoKxowwaOW1OR4UKei+2TOBJan6uXHAEAgAQmJoA=
  • Thread-topic: [PATCH 7/9] vpci/header: program p2m with guest BAR view

On 06.09.21 17:51, Jan Beulich wrote:
> On 03.09.2021 12:08, Oleksandr Andrushchenko wrote:
>> @@ -37,12 +41,28 @@ static int map_range(unsigned long s, unsigned long e, 
>> void *data,
>>                        unsigned long *c)
>>   {
>>       const struct map_data *map = data;
>> +    gfn_t start_gfn;
>>       int rc;
>>   
>>       for ( ; ; )
>>       {
>>           unsigned long size = e - s + 1;
>>   
>> +        /*
>> +         * Any BAR may have holes in its memory we want to map, e.g.
>> +         * we don't want to map MSI regions which may be a part of that BAR,
>> +         * e.g. when a single BAR is used for both MMIO and MSI.
>> +         * In this case MSI regions are subtracted from the mapping, but
>> +         * map->start_gfn still points to the very beginning of the BAR.
>> +         * So if there is a hole present then we need to adjust start_gfn
>> +         * to reflect the fact of that substraction.
>> +         */
>> +        start_gfn = gfn_add(map->start_gfn, s - mfn_x(map->start_mfn));
> I may be missing something, but don't you need to adjust "size" then
> as well?

No, as range sets get consumed we have e and s updated accordingly,

so each time size represents the right value.

>   And don't you need to account for the "hole" not being at
> the start?

We only have MMIO ranges here and all the ranges have their start set

appropriately

>   (As an aside - do you mean "MSI-X regions" everywhere you
> say just "MSI" above?)
Yes, I mean MSI-X: will update
>
> Jan
>

 


Rackspace

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