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

Re: [PATCH v7 14/16] x86/domain: enable per-domain I/O port bitmaps


  • To: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • From: dmukhin@xxxxxxxx
  • Date: Thu, 14 May 2026 16:52:32 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=rjkls871QgpOdbggwkgTqGJFQijNqTRuu1Y+e6u4TYY=; b=mrkmbRXaFXGEylmpa7nQkrerVvUtm1Nn9NXn+mY6BKK3EEf7Qhlg5Wmqrn/6PJjNd8AtB+n6AjIYZNDK/d/SRtV992farBCs7PVA7MTmkbj7J0PHJ9yzpmcBidb/ypGyIHOmSK6t+GhaZQiFGVOByrEyVRvdlvcVYvjwg7TstomsbIB4Rfl9/WtM8lKe+7dZ0dmpgJPf4ASq3AewfBwMiGxmc5wvi6amkJRmOzbZv9egYJTbVWDK2cke8KNIIJyIYqlN5L9nLDmaAuOYe/8HwPz3E05tekn41wR5zrsiFX+dU/H+w2aVGZh3/sY1gjtDdTXgKV69dZfw93qhBAgloQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=utaCIU1AuOdtfnqUjqn2mw4nqFwrX9IS+R4B4ld7498gs0AHKb7ivKrCCXa/MrnOfU9PehFlQCnu7J7/GytbJVHmpBWZM4Tyq3UGqe3Zyx8ifaN4ZmAPCk3qLr21ZStUGllPAezqNMr11xIkOxeXeMExfvqUx0dXG+dO47+rM4foBBvFc97S7ybZ973lFPPLo9dSTb1h1898BaYv38SICpM+In68JSVPNvcO9w28mAVobMZzyxrUBr8LYNueDQnUKVzNn9P1l+Je7tdN9SznVbti6lMxoNOqYpCkX3HzPiIKsh3rZ+/WFAoHD5o/L04t6Wi1wwz+XWlVVArQ4uxpBA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=ppford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-azureford-onmicrosoft-com header.d=azureford.onmicrosoft.com header.i="@azureford.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=ppserprodsaar header.d=saarlouis.ford.com header.i="@saarlouis.ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=ppfserpocford header.d=ford.com header.i="@ford.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Thu, 14 May 2026 23:52:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

On Tue, Nov 18, 2025 at 08:00:00AM +0200, Mykola Kvach wrote:
[..]

> > +/* Set the default IO Bitmap. */
> > +int ioports_setup_access(struct domain *d)
> > +{
> > +    unsigned int i, offs;
> > +    int rc;
> > +
> > +    if ( pv_shim )
> > +        return 0;
> > +
> > +#ifdef CONFIG_HVM
> 
> ioports_setup_access() now allocates a per-domain io_bitmap for all HVM 
> domains:
> 
> > +    d->arch.hvm.io_bitmap = _xmalloc(HVM_IOBITMAP_SIZE, PAGE_SIZE);
> 
> but I only see this being freed for the hardware domain in the
> existing failure paths.
> Where is io_bitmap freed for non-hardware HVM domains?

Missed that.
I will add something like ioports_release_access() to release resources.

[..]

> >
> > diff --git a/xen/common/emul/vuart/ns16x50.c 
> > b/xen/common/emul/vuart/ns16x50.c
> > index c341f012d005..ea34c3ae598a 100644
> > --- a/xen/common/emul/vuart/ns16x50.c
> > +++ b/xen/common/emul/vuart/ns16x50.c
> > @@ -783,9 +783,20 @@ static int ns16x50_init(void *arg)
> >      struct vuart_ns16x50 *vdev = arg;
> >      const struct vuart_info *info = vdev->info;
> >      struct domain *d = vdev->owner;
> > +    int rc;
> >
> >      ASSERT(vdev);
> >
> > +    /* Disallow sharing physical I/O port */
> 
> Should this be undone on teardown and error paths?
> 
> > +    rc = ioports_deny_access(d, info->base_addr,
> > +                             info->base_addr + info->size - 1);
> 

AFAIR, there was a feedback on that during the earlier iterations of the
series and the agreement was - no need to release resources on teardown
since the domain is being destroyed at this point. 

Thanks,
Denis



 


Rackspace

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