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

Re: [PATCH 6/9] vpci/header: Handle p2m range sets per BAR

  • To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 9 Sep 2021 11:39:46 +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=h0lILzb8aXfHStZ4bHwZau/9qfFE+vcjL8U5FhxolXw=; b=HNA40bmZRC4aYw7wYFA0XU29uS11YbWcaiOXouEhrMAcH+THz4UFZ1C3T7r/rXNQkf8/JNOMWPsfjjLoXp6ssXB1clG2S2vmVkOGlmJ3XsglLg7fTudeqKiRjaxBGh2VmID5OUeCxtV7mg5/toJNeBf36wtPjRm9j7q7JM/9zZiNw47LMpK1LEGS2tNiXdTv+is6XEZ6oUGouOseXv39oWjmFfBUKSC9SqSwFIKojULlExRk8haLPZvFwJ+IaXoMCfd97kkj6cA/qnOBpEOFgfU9jAkNNIj+wqC6xo/4kmthvTsytQ5Z1cukQN++I7vmkT/rdGYtkefBOL6I/cxsuQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxgAtZGG/kx0hAhZqOlM4HtTS+TT80M4MJcPDiJw9s3OxZyQJf3OroZttd+kFUE/D8S5T4Bu1myu6LCOiUeUELJYtcajDDw5q6C5gLBZ6+tG2jbfIa9y/8sZBBj/gBeCrAQBuEkp6hVOboRbu5GQQy5RgYEcJJCBI6xG8jJzxntGPGItifgLjdCLy0S2c73GXeNQjZuYLqt2SZeN8f+nSToBGLKiRLKITCHUn9Qb2SoC7rPR3cdJFE5NNJR4ltC0kuyt/GCF6PSllyVMpAQ7YxuiaEf28BvFuh+SbkLgwLHinLMx6Svcvs9iHIkaXg3W8qIAS3AD/UFDEnMI58fujQ==
  • 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" <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 09:40:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09.09.2021 11:12, Oleksandr Andrushchenko wrote:
> Anyways, I am open to any decision on what would be the right approach here:
> 1. Use range sets per BAR as in the patch
> 2. Remove range sets completely and have a per-vCPU list with mapping
> data as I described above
> 3. Anything else?

A decision first requires a proposal. I think 3 is the way to investigate
first: Rather than starting from the code we currently have, start from
what you need for DomU-s to work. If there's enough overlap with how we
handle Dom0, code can be shared. If things are sufficiently different,
separate code paths are likely better. As said - to me a guest altering a
BAR is merely a very special form of a request to change its P2M. The M
parts remains unchanged (which is the major difference from Dom0), while
the P part changes. As long as you can assume no two BARs to share a page,
this would appear to suggest that it's simply a P2M operation plus book
keeping at the vPCI layer. Completely different from Dom0 handling.

All of this applies only with memory decoding enabled, I expect.
Disabling memory decoding on a device ought to be a simple "unmap all
BARs", while enabling is "map all BARs". Which again is, due to the
assumed lack of sharing of pages, much simpler than on Dom0: You only
need to subtract the MSI-X table range(s) (if any, and perhaps not
necessary when unmapping, as there's nothing wrong to unmap a P2M slot
which wasn't mapped); this may not even require any rangeset at all to

And in fact I wonder whether for DomU-s you want to support BAR changes
in the first place while memory decoding is enabled. Depends much on
how quirky the guest OSes are that ought to run on top.




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