[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: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Sep 2021 16:51:30 +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; bh=w+e3TMfIQ3h7vzuGFjSUuI1jlMp8WLtee/hmiATvu5Y=; b=mRALFWuwLamhmvp5l5pH8Y6azbeGOcWmYtnlvx2fKnZYlWLk2OKAObp4NBIAgm3pZTOGJkw8jdnEMqJS174U6jGSJ5L/zg1/fy+h8T0XJT3wxxuZSMHB9Z5ITjLVBSkS4PY9kCqHOJbqrsnaAknyly2xEL7KIPPKG4DGawTnCUfUSlBrEm3gCwQtbtR14fVsEIFshCTmKqur5mBgK+IGGH2ITsm0lVAmbadsDAsmr/OGByxdmuchmzoVg9/0Jt3Nz6+wgbju1jOiXTkQvheBXA0noNnVeHdIybsD7Wyl28CJH+Rn/WfBSdo0TWwnM6ZyHFrJQqV9I5sMEk8ZFPioHQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W9oiN8EiXENiLveTSwmZdfT24vfgz83PH9xzFjxOhbZwXRYCSaw/bJez+tY2VYVmbkhHZFpagBLYrMQd8r0wnkhE8YBfX1Rb5a8dFIVhQlW6h1rfy9AM7DNPcv1n4/EzBuKrjNyk2k44DhrtNBzN5AnK97+oysdCSrqlMrEb/y1ifHhs/Y/+J96O1GIKWBwUB5B6w0mHK8kDYgYmMi5dtdgnIKBJZwup9OuFK0ng2AQGWFHLsgMwofgDTTmfwmsx0I9m5w2vxzoV9Gcg5Tc8KAxuJ+UY83lk0oKn6f/Tkk9/e2p6Zf5pu16k0s44amDohPoX0fQlPxIsbIMacZoZ9g==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: julien@xxxxxxx, sstabellini@xxxxxxxxxx, oleksandr_tyshchenko@xxxxxxxx, volodymyr_babchuk@xxxxxxxx, Artem_Mygaiev@xxxxxxxx, roger.pau@xxxxxxxxxx, bertrand.marquis@xxxxxxx, rahul.singh@xxxxxxx, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 06 Sep 2021 14:51:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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? And don't you need to account for the "hole" not being at
the start? (As an aside - do you mean "MSI-X regions" everywhere you
say just "MSI" above?)

Jan




 


Rackspace

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