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

Re: [PATCH for-4.17 v2] hvm/apic: repurpose the reporting of the APIC assist options


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Nov 2022 08:58:28 +0100
  • 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nz+m1dnv0aD4k84yhtrbB9jb2qGDUFOyLj/d3nJlj3Y=; b=hl9wUhbZF5Ca3I4j3nQvrZ90FMRLnBc4qpXyXqE00t797guQ3O0eqY1SqtZFxL9BIt5Z229lCQWEYVKQMnmjkbRUKhXivS0C2XVHrnuJTg6tDMfI6HbZLnh3XeaNuZ9Y4vdtTV2ugK/3dBfwGuRVabkVpsyZZgrK4oFgbZOvxXz4hxv8DmB3lsWsCt/ulz/DIrqf+rnr2tY3Ir9HqX+kqwQlrmvOTsIK/zxDI7TA6HbBglSOJUwVCU9BQ/oXuyVTwiVRUNqTnrw1wRyxJZ38ZF0ZfZ2tC7m9o0ulmQRO39ESNljQrVxoym8ehj6ONzdQFgFQVzajc8SroztZm/m5sw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aU9RsyA4N/4EilHcStXHrLp05X+g+Y5uEbEHhlTg0YjuugdmKHWdMOuINem+Qb/z/pJMTZJ0te6IXEBVzfvmn2/XdENKczvaKCCrn8Lh5wx11CTF5gGkw+Uo12psl5YhR4GBHLC8WdZsDlFRn9pfYgOeI6+diw/tWwj278vo0qDgfjssz+VyfJnzbAKatWy+pBtDid8KR1uBsQyr4oUgfttrSOx7HeVYXpDqivkstr+gfnHvSxnzxBxdnk4qr/K+DuxCyleXz7wJo8QQ5rRz1H0vkRHJVRqb7ETuJbgbaDKXmprnJuRGhiZMhrcJv0nBGQH4X+LeCUcooraYMPqNVA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "Henry.Wang@xxxxxxx" <Henry.Wang@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 14 Nov 2022 07:58:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.11.2022 18:35, Andrew Cooper wrote:
> On 11/11/2022 07:45, Jan Beulich wrote:
>> On 10.11.2022 23:47, Andrew Cooper wrote:
>>> On 04/11/2022 16:18, Roger Pau Monne wrote:
>>>> --- a/xen/arch/x86/hvm/viridian/viridian.c
>>>> +++ b/xen/arch/x86/hvm/viridian/viridian.c
>>>> @@ -197,7 +197,7 @@ void cpuid_viridian_leaves(const struct vcpu *v, 
>>>> uint32_t leaf,
>>>>          res->a = CPUID4A_RELAX_TIMER_INT;
>>>>          if ( viridian_feature_mask(d) & HVMPV_hcall_remote_tlb_flush )
>>>>              res->a |= CPUID4A_HCALL_REMOTE_TLB_FLUSH;
>>>> -        if ( !cpu_has_vmx_apic_reg_virt )
>>>> +        if ( !has_assisted_xapic(d) )
>>>>              res->a |= CPUID4A_MSR_BASED_APIC;
>>> This check is broken before and after.  It needs to be keyed on
>>> virtualised interrupt delivery, not register acceleration.
>> To me this connection you suggest looks entirely unobvious, so would
>> you mind expanding as to why you're thinking so? The hint to the guest
>> here is related to how it would best access certain registers (aiui),
>> which to me looks orthogonal to how interrupt delivery works.
> 
> I refer you again to the diagram.  (For everyone else on xen-devel, I
> put this together when fixing XSA-412 because Intel's APIC acceleration
> controls are entirely unintuitive.)
> 
> It is "virtual interrupt delivery" which controls EOI/ICR acceleration,
> and not "apic register virtualisation".  There's a decade worth of
> hardware where this logic is an anti-optimsiation, by telling windows to
> use a VMExit-ing mechanism even when microcode would have avoided the
> VMExit.

Okay, I agree that I was mislead by the name of the control. Together
with Paul (re)clarifying what (virtual) MSRs the CPUID hint is about
I agree that it wants to be "virtual interrupt delivery" alone which
is checked here. Which in turn makes this a change orthogonal to the
other APIC assist work.

Jan



 


Rackspace

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