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

Re: [RFC XEN PATCH 3/6] x86/pvh: shouldn't check pirq flag when map pirq in PVH


  • To: Huang Rui <ray.huang@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 21 Mar 2023 11:17:40 +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=FYdFNzOjWtfWRDJZXDxLk/6F3Q8pA0+6+Xj+s121WLE=; b=WzsbyInjIpUoaijIepe98VoG5L7GEMOy4FkOtLRCfeJ5DV5I/Mi+PFozmjPY7jQNhrCFQuDtXBtdNme2Wu5UZTbJ7Mliq1BRFuWNll+jOEtku0KrfIWqh5boRRv1GAr8UsO7I0H8k8jtN75yAmnrd8sC+5IRHGTqiBSiU92eQn8vK8hKpMAG6MXnVSh+gUDL7p/SYok3aXFcUhvg6d6xvSDC01xIO7bCWD+xTjvII/SuwBJI2053c3QT5CkYOovFDf4clxYCPxMelVKg2PPXJbfPC7bA285suRAQmymh/qfs90gAESGz6m/TVcMumezyPA1NyhO+aHMFV+EE5MXAjg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fPscaiVsMH3w8ceA7QbPYBfVohRPc/FglKfhgEiT02Q9CbkKxubhx2XzX0GAlwon8DITnEcbHBSnjkrC7CEaG8SCsa5VWBdWiKahyvbYdH+QWHvComar30nszruo6gL1YD+qGkJimyH/jlntrtxBSa9FYw+YfqUMBGOzeaTW6YMtoNrYj5UEUdE34d61ZvyNyy2v9JNYMGblB+wD95lDf1Q9WCdwZCCZnGaMaBXzlOetFtkT8WYDdaCtAE9f3pbigr25bRulB+Ii7ireY3IyueilSL2lmyhoViO8/iMeW5O11fZqWpUcAkPD2sSoodNCbIRc76UuhDmlCC0KwV/RsA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Deucher, Alexander" <Alexander.Deucher@xxxxxxx>, "Koenig, Christian" <Christian.Koenig@xxxxxxx>, "Hildebrand, Stewart" <Stewart.Hildebrand@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, "Huang, Honglei1" <Honglei1.Huang@xxxxxxx>, "Zhang, Julia" <Julia.Zhang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 21 Mar 2023 10:17:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.03.2023 11:09, Huang Rui wrote:
> On Wed, Mar 15, 2023 at 11:57:45PM +0800, Roger Pau Monné wrote:
>> On Sun, Mar 12, 2023 at 03:54:52PM +0800, Huang Rui wrote:
>>> From: Chen Jiqian <Jiqian.Chen@xxxxxxx>
>>>
>>> PVH is also hvm type domain, but PVH hasn't X86_EMU_USE_PIRQ
>>> flag. So, when dom0 is PVH and call PHYSDEVOP_map_pirq, it
>>> will fail at check has_pirq();
>>>
>>> Signed-off-by: Chen Jiqian <Jiqian.Chen@xxxxxxx>
>>> Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
>>> ---
>>>  xen/arch/x86/hvm/hypercall.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
>>> index 405d0a95af..16a2f5c0b3 100644
>>> --- a/xen/arch/x86/hvm/hypercall.c
>>> +++ b/xen/arch/x86/hvm/hypercall.c
>>> @@ -89,8 +89,6 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
>>> arg)
>>>      case PHYSDEVOP_eoi:
>>>      case PHYSDEVOP_irq_status_query:
>>>      case PHYSDEVOP_get_free_pirq:
>>> -        if ( !has_pirq(currd) )
>>> -            return -ENOSYS;
>>
>> Since I've taken a look at the Linux side of this, it seems like you
>> need PHYSDEVOP_map_pirq and PHYSDEVOP_setup_gsi, but the later is not
>> in this list because has never been available to HVM type guests.
> 
> Do you mean HVM guest only support MSI(-X)?

I don't think that was meant. Instead, as per discussion elsewhere, we
may need to make PHYSDEVOP_setup_gsi available to PVH Dom0. (DomU-s
wouldn't be allowed to use this sub-op, so the statement Roger made
simply doesn't apply to "HVM guest".)

>> I would like to better understand the usage by PVH dom0 for GSI
>> passthrough before deciding on what to do here.  IIRC QEMU also uses
>> PHYSDEVOP_{un,}map_pirq in order to allocate MSI(-X) interrupts.
>>
> 
> The MSI(-X) interrupt doesn't work even on the passthrough device at domU
> even the dom0 is PV domain. It seems a common problem, I remember Christian
> encountered the similar issue as well. So we fallback to use the GSI
> interrupt instead.

Looks like this wants figuring out properly as well then. MSI(-X)
generally works for pass-through devices, from all I know.

Jan



 


Rackspace

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