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

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


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jane Malalane <jane.malalane@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Jan 2022 17:13:20 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=M7agNBwAW35NCMmLxaJCuGiltg/y7cl+y+ySz9srLAY=; b=lp717sMPWS5qK+eHh3gBEaUlC1qJtvyJxYZkT6AflxqRX5zkrLCdYg1ORBdswbM4f2vKe1oOz5OfFPXXV+xS/7M2lKdw7wb5D7Ah9cSZqxQTWu75lpQcYhbm2EkUsaimdmEq3PxzkqjWxPIfBstn37yIENKpEoXjPIx7EhkLaIzbkbOoVnsbD0lKBizBQkByZ0krhq1sT+/oSbfjhzV90ZmbT702LwG0N7zvxcb9jeoHtCKqqs1zACTnEU2JB/oVYyrdRpRzos6rRFWRa6d0RYk24P5E32oqBawcmbMoFpKEvhi3cp+mq/9VvmmSkg3k4XFRh8nE4ikLK8pEfumEBg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cuW55Q7ezPPGkhb5YEbl4USLrszxSOO6/ox2LRXo4/gpMYmYZXz1tAhi8hKizdZUaBLTF/LghWta6di69AJBLphi0onBRYkG2J7pYasTlOazL2uaP+Zya3Q1XcYCAyTPtMrPov0IofzdT408/BDpruJH11GeitUhCH9AZFYmPW75oj8Xai7CEFO4EXmVH6rIIcLW+l9oSEZpa9wYS2/UQ1LCOSCy0iF0f91tK4yH2bYUgewn6a7W1ih6RiqwSgOe6ZtF3zJQiuIacTJDv2gELnh9oVLkVJkDJBDCSDP5+HISnNIYeS/opLzazqwEDElY3beRclWeZvGcQfhIp8p+eg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 31 Jan 2022 16:13:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.01.2022 17:05, Anthony PERARD wrote:
> On Thu, Jan 27, 2022 at 04:01:33PM +0000, Jane Malalane wrote:
>> --- a/tools/libs/light/libxl_x86.c
>> +++ b/tools/libs/light/libxl_x86.c
>> @@ -819,11 +825,44 @@ void 
>> libxl__arch_domain_create_info_setdefault(libxl__gc *gc,
>>  {
>>  }
>>  
>> -void libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
>> -                                              libxl_domain_build_info 
>> *b_info)
>> +int libxl__arch_domain_build_info_setdefault(libxl__gc *gc,
>> +                                             libxl_domain_build_info 
>> *b_info,
>> +                                             const libxl_physinfo *physinfo)
>>  {
>> +    int rc;
>> +    bool assisted_xapic;
>> +    bool assisted_x2apic;
>> +
>>      libxl_defbool_setdefault(&b_info->acpi, true);
>>      libxl_defbool_setdefault(&b_info->arch_x86.msr_relaxed, false);
>> +
>> +    libxl_defbool_setdefault(&b_info->arch_x86.assisted_xapic, false);
>> +    libxl_defbool_setdefault(&b_info->arch_x86.assisted_x2apic, false);
>> +
>> +    assisted_xapic = libxl_defbool_val(b_info->arch_x86.assisted_xapic);
>> +    assisted_x2apic = libxl_defbool_val(b_info->arch_x86.assisted_x2apic);
>> +
>> +    if ((assisted_xapic || assisted_x2apic) &&
>> +        b_info->type == LIBXL_DOMAIN_TYPE_PV)
>> +    {
>> +        LOG(ERROR, "Interrupt Controller Virtualization not supported for 
>> PV");
>> +        rc = ERROR_INVAL;
>> +        goto out;
>> +    }
>> +
>> +    if ((assisted_xapic && !physinfo->cap_assisted_xapic) ||
>> +         (assisted_x2apic && !physinfo->cap_assisted_x2apic))
>> +    {
>> +        LOG(ERROR, "x%sAPIC hardware supported emulation not available",
>> +            assisted_xapic && !physinfo->cap_assisted_xapic ? "" : "2");
>> +        rc =  ERROR_INVAL;
>> +        goto out;
>> +    }
> 
> Would it make sens to enable assisted_xapic and assisted_x2apic by
> default based on hardware support? That way users of libxl could benefit
> from the upgrade without having to enable it.

I think that's the only sensible way - disabling by default would result
in perceived performance regressions, I suppose.

Jan




 


Rackspace

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