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

Re: [PATCH] x86/hvm: Widen condition for is_hvm_pv_evtchn_vcpu()


  • To: Jane Malalane <jane.malalane@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 May 2022 11:07:25 +0200
  • 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=6V79cr+/wNigRiUFictH26zhYiRXPF0TuxzZLJBHB6k=; b=H8oAnl9mQMgmL5+C6aOZKWTdGJ3vTDgSlsUcZ1tZLj7Bhp/NOzjNFGXc/rXGNImbGq78HY9OjBW0M2k92pmE0XRxXGP01o+NM4ALJhgKwwY61HBRtctk8ZJSO00acGgRoDQIOrPHagy9/G2YCE/zpmPNJmD/1H8AeuY9NaABldLj6fS1t2xkDA5h62mcdKi1PDnXjci4KczyiNn1DTBXipu+KeFLRUyKDzr495nvueTpcEIZFokXMWnHdJoqVwbwF2CCs5A4jwutXxErNazz2/p5/OyNlqdjNqqgBemJfg4p2S33r1dzz1mSp/D3JBJjDl7ftR3udbHl9ATt1hApEA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OeCCOgvqIU+o+TDhWbxuaphM1XDHG/TLestUivApHsBCLXWIFUfgjlhns9GGZhgQAESyscpQpQgY1NHsNIFaL18OjePONVGP6/UtX8YWFyUwl2XCLqM+nf5OQ4nFga5Hyzj3ns/t5w4vIeLkLubqPWIOunG5BEf9GgIp5WAPDipQpF53BvqaWPeGtd8w2RlO2r+bSL6GOSdNDiVX23nNsxRgUrenws/dfGUf5ILONCBB1865UM4YCwN4TLBI/FMf2ibhFgykbuvrrX9oLP8A+Z8apKddVIrgpnOMP5+pYnNWtt2Q8/0UpPMq0evxo5oip0sZlXF48nVxp7LaEud6dg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 18 May 2022 09:07:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.05.2022 17:14, Jane Malalane wrote:
> Have is_hvm_pv_evtchn_vcpu() return true for vector callbacks for
> evtchn delivery set up on a per-vCPU basis via
> HVMOP_set_evtchn_upcall_vector.

I'm confused: You say "per-vCPU" here, but ...

> --- a/xen/arch/x86/include/asm/domain.h
> +++ b/xen/arch/x86/include/asm/domain.h
> @@ -14,8 +14,14 @@
>  
>  #define has_32bit_shinfo(d)    ((d)->arch.has_32bit_shinfo)
>  
> +/*
> + * Set to true if either the global vector-type callback or per-vCPU
> + * LAPIC vectors are used. Assume all vCPUs will use
> + * HVMOP_set_evtchn_upcall_vector as long as the initial vCPU does.
> + */
>  #define is_hvm_pv_evtchn_domain(d) (is_hvm_domain(d) && \
> -        (d)->arch.hvm.irq->callback_via_type == HVMIRQ_callback_vector)
> +        ((d)->arch.hvm.irq->callback_via_type == HVMIRQ_callback_vector || \
> +         (d)->vcpu[0]->arch.hvm.evtchn_upcall_vector))

... you use (d)->vcpu[0] here (and, yes, you say so in the comment)
and ...

>  #define is_hvm_pv_evtchn_vcpu(v) (is_hvm_pv_evtchn_domain(v->domain))

... you don't alter this at all.

Also (re-ordering context) this ...

> is_hvm_pv_evtchn_vcpu() returning true is a condition for setting up
> physical IRQ to event channel mappings.

... isn't really true - it's is_hvm_pv_evtchn_domain() which controls
this (which in turn is why above you need to make the assumption I've
put under question). With that assumption I think is_hvm_pv_evtchn_vcpu()
would better go away.

Jan




 


Rackspace

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