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

Re: [PATCH v5 2/2] x86/xen: Allow per-domain usage of hardware virtualized APIC


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 8 Mar 2022 13:33:01 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2C0RNWLQWwXVTO4kQL0oJOjTz3hJD7BB5iUxb4AYlYI=; b=myC09QMuXi5xZeP8CAHlCPdADg2ZC2AKQ6t9TdZWUJbyn4O9Bcl4RoEOr+85N6pUPGU1k1hXPxdfzo6Op2zeHNHN5itc7P1RJmQAGftoDNR3e5mul/PZ5vBZt0yodCfy4ZEz+Aip3NptO3KFw4HwjalzuicspDLYW1ASSnC4v4KxVhBUhH4UqLO048MiPXrqyJkC0afpE+KVyA7XxCOvfQVgiL8T14r0EvgtFZ1HVPB6O4rg0KfPvGuKqbT1+UZSzDAIOlnIg+X464NFVOv5t3mQKnP1E2kcTIMwD0J9sTBqN2uj2ZME5dIgwwUVNNpuSKb/STB4R1soR53C7FwHzA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HERxmhygmrHBhnX5QXu//PDSM4Xse1fx/PAbhq+k41GhYFhGkeL8YmUr0ZZNys9E8CNW+AuCbEW+yhD3h4FTQjXYLHPqkQFrCVFS+FGtZdeotQyOwTdk+vmHjkbOGXeHcbmlCS1w2LILpMulWJUrwp5gJR64nUFUM+fcQvBcVnQ+shWHd9SL3YGFfDtqoLAZJyV7Useyp4k6k+lx5ig0cp9aoJI4Imge2CkUCP4IAu1FClsgyGhYzA0XROo+ESwubjynN2EwAgxe9ehHc9F2Qgn0+kRVn9yO6aSkNjo6NEJeG7iTcC+fPP315dkXzPeTQhTucb2sLBBfhfDvlSv97Q==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jane Malalane <jane.malalane@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 08 Mar 2022 12:33:22 +0000
  • Ironport-data: A9a23:/pqJ1avvFWQTkhYlpixzN63jD+fnVKpeMUV32f8akzHdYApBsoF/q tZmKW6CM/aOYmDyKNF2Pt609EsH78CEz9M2SQc/+yw3FikX+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQyw4bVvqYy2YLjW1jV6 YuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8mYpWWu+4ZAiN3Eh9hGYJ8p56dAlqW5Jn7I03uKxMAwt1rBUAye4YZ5vx2ESdF8 vlwxDIlN07ZwbjsmfTiF7cq1p9LwMrDZevzvll6yj7UF7A+SI3rS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av6gDQMUg/X4CePD0oTuLDr9rEmNbPZgMHPQcu7E2rgSmz4LD3PhCE1lNGOgk/i4sKwC zgqUjU96+ju/a0xlv10HLS1Y1fnJ/ExsFYDMKBp8AJInHHixquZq5mR7qe1QpF692H2RIPqp 3hsh0gN8N85zf4eXy0mwLk303a3DMn+xbZuCilqEqmhfa8aCMxCsJHi44cWADe8VAcsNZ117 8O936FtrJMZCmw0xjV1pztbVVHh0C0qX0tnao4lHpES7YTb7dXsMg24F5VKpEdByj3gbpXXN WGNPuspcq+TGnqL0ww5gJUsZ+RtzUIb1q7q3E5y4KoO2M8pgE686MarPZv6kvouqhNDqWs3N 60QZiApIs+PvP+UpgNdtvpYfHHfFAlEii8eV57HzzcZdQ60jT22trK3Ik=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Mar 08, 2022 at 01:24:23PM +0100, Jan Beulich wrote:
> On 08.03.2022 12:38, Roger Pau Monné wrote:
> > On Mon, Mar 07, 2022 at 03:06:09PM +0000, Jane Malalane wrote:
> >> @@ -685,13 +687,31 @@ int arch_sanitise_domain_config(struct 
> >> xen_domctl_createdomain *config)
> >>          }
> >>      }
> >>  
> >> -    if ( config->arch.misc_flags & ~XEN_X86_MSR_RELAXED )
> >> +    if ( config->arch.misc_flags & ~(XEN_X86_MSR_RELAXED |
> >> +                                     XEN_X86_ASSISTED_XAPIC |
> >> +                                     XEN_X86_ASSISTED_X2APIC) )
> >>      {
> >>          dprintk(XENLOG_INFO, "Invalid arch misc flags %#x\n",
> >>                  config->arch.misc_flags);
> >>          return -EINVAL;
> >>      }
> >>  
> >> +    if ( (assisted_xapic || assisted_x2apic) && !hvm )
> >> +    {
> >> +        dprintk(XENLOG_INFO,
> >> +                "Interrupt Controller Virtualization not supported for 
> >> PV\n");
> >> +        return -EINVAL;
> >> +    }
> >> +
> >> +    if ( (assisted_xapic && !assisted_xapic_available) ||
> >> +         (assisted_x2apic && !assisted_x2apic_available) )
> >> +    {
> >> +        dprintk(XENLOG_INFO,
> >> +                "Hardware assisted x%sAPIC requested but not available\n",
> >> +                assisted_xapic && !assisted_xapic_available ? "" : "2");
> >> +        return -EINVAL;
> > 
> > I think for those two you could return -ENODEV if others agree.
> 
> If by "two" you mean the xAPIC and x2APIC aspects here (and not e.g. this
> and the earlier if()), then I agree. I'm always in favor of using distinct
> error codes when possible and at least halfway sensible.

I would be fine by using it for the !hvm if also. IMO it makes sense
as PV doesn't have an APIC 'device' at all, so ENODEV would seem
fitting. EINVAL is also fine as the caller shouldn't even attempt that
in the first place.

So let's use it for the last if only.

Thanks, Roger.



 


Rackspace

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