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

Re: [PATCH v9 1/2] xen+tools: Report Interrupt Controller Virtualization capabilities on x86


  • To: Jane Malalane <jane.malalane@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 7 Apr 2022 10:28:05 +0200
  • 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=5nDfqYXk4k2p9jJC+zgR2+/QjmY/2QJMwVgszh3DnuQ=; b=T76zZPtkZCjFh4fvQQZtIxJbamJCGQb789v1HfYBGslVEeSr+5fgS0gWzVlXqWG1LyRMIKKDDJWqluHbNGFTnbzO8mnA5J35C0YllNBYM3+UtvKLuCjGftt/8DC/s8QldV6Usq2uuxcKq1AogAQJxvzSSKevkzvJWHF6OvTSXrzYMxBtbjGsSF5cTvUh7GBOq4+usPKUNvHyw0U4ityB8wS1k7tpuechPFHRAsyLA/FBpUjyhBTlBFKPkFwBRuCLYwS4e9lsleoZ9KQ7npU+shyRgnwb/HsoJCETSx1EvaiPZ+s30o0C7lzAhYGLSiN9ZEK3Fiv+H1W7TsDt3ahnKw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+Xb9oDw2w5h7u7SEqEfceqm700PY1Hwj7Ii3IVlVdwbKIajpYv66yhGhd6wFdHbRfK1IzN1zw4UVhwOIu9UNEFenB829EEbY6kj6/imGAX9MGdK/f/RhU7Bl0TOnR32a9wUCwLtcWx39xk+lQ5dcFfKvk8YkchWDfpIC3m+RbOqZ/kyM1Sz+LrhxRN0ifdvcokD0IDnhHvIS9uG2doYeAfNZcN63JCyHh1b+vMSiUAMOQctbgMoqVGNTpfjCYurseOtdp7Ldc7sEjPTK+DFr033apE54gBh0WbEG+xUgETuwfSh37mWNDj3YHrgo8OSImsnQVWNwjYmcrpGOJgSWg==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: 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>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Thu, 07 Apr 2022 08:28:31 +0000
  • Ironport-data: A9a23:zERF/alEM7pIsfEjs233gcvo5gwrJkRdPkR7XQ2eYbSJt1+Wr1Gzt xJLWmuPM/rYYzbwfN8nb4nn9U5S75+AzIBnTVFl/y1hESMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EoLd9IR2NYy24DlW1zV4 LsenuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYEz0rFbDgyO4kawhgPhgjZagW9o3lCC3q2SCT5xWun3rExvxvCAc9PJEC+/YxCmZLn RAaAGlTNF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ItKOzOWxFdATbsSl7cKpgeAJ8SQzJ856U 4NSdkbNDS0NykEsS+Y2njJLz9D+qj+zEnAv463pB0BPGIaCZ2IrT0JcTpzencGNTWubqBJba Z0iPA3wAZJLh8sH7qG7zQ+LqL+T5qhruOTXTc2QzocrCWehzKh77D3VzCewxclSjtKhZMv63 LMnQDV7riq96jT8G6R60bjq7Bt3PfxwNpKA8KBzuATNzXXkw6tIKBsQaeLsjwZqPymrHwqjN 7PiRE9ONkb0QKdQkiF5T/WnyXw2jcn7HHvjXeenHvYuMT8AAk3DsJQ7LgpOyfx2g4FhpVRwa hL12WWu958FhXbhhnw4NDOSlVDile0iWBKq59Ts1VvFa8lLJNBp40W+01YVL0aGjjh1YwhGO 5ySOnB+fdtd0+AZXyxhBgg/DWVZAVxIv66eDlBhiTMuAIm2UyRjnFoi/D3p01wtK7UEPJ/lq D52qcBrsA5ciZZV9M7OA47e7rENoX8e2O+DIusGyWTKEgmAQOEl3el2sR/2AmVEKZ4u6fa3q 6xFm9liQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Apr 01, 2022 at 11:47:12AM +0100, Jane Malalane wrote:
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 709a4191ef..e5dde9f8ce 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -117,6 +117,9 @@ static const char __initconst warning_hvm_fep[] =
>  static bool_t __initdata opt_altp2m_enabled = 0;
>  boolean_param("altp2m", opt_altp2m_enabled);
>  
> +bool __ro_after_init assisted_xapic_available;
> +bool __ro_after_init assisted_x2apic_available;
> +
>  static int cf_check cpu_callback(
>      struct notifier_block *nfb, unsigned long action, void *hcpu)
>  {
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> index 56fed2db03..53d97eaf13 100644
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -2145,6 +2145,12 @@ int __init vmx_vmcs_init(void)
>  
>      ret = _vmx_cpu_up(true);
>  
> +    /* Check whether hardware supports accelerated xapic and x2apic. */
> +    assisted_xapic_available = cpu_has_vmx_virtualize_apic_accesses;
> +    assisted_x2apic_available = cpu_has_vmx_virtualize_x2apic_mode &&
> +                                (cpu_has_vmx_apic_reg_virt ||
> +                                 cpu_has_vmx_virtual_intr_delivery);

Setting assisted_x{2}apic_available should only be done !ret, or else
we might be reporting those capabilities when VMX is not usable, which
would be misleading IMO.

The rest LGTM, so with this taken care of:

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks, Roger.



 


Rackspace

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