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

Re: [PATCH 11/11] xen/arm: Process pending vPCI map/unmap operations


  • To: Julien Grall <julien@xxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Tue, 7 Sep 2021 06:34:05 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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; bh=OwCGYDqY51fg4A+y0BsNIv4jmEll0CQOVvaIhZYta9U=; b=Lk74jwz1fTs4WBc3ZDudkOkkHKyzaegLlR0dk/7xvuNzaZ7elTi7NJD4rhfHIUNi5tT1SIVVHuxpaTXHuqo7ibULEFB7bxihR5LD51cxGbcF1qH63rE6Qv72Sz2ce4+UXCI32UZNnEqelASe4yVWnpCj0EXXvZC7GN4blafQju8JC0gBC3NzeqTXZB1XMy/AIuwNTgeE0EzVElCoentvXnET0AcI32o6dS/LdiimDrFIGv5Hy2QNrLy2QgS7wPZD2GbtpZ9DWjellhaLZgn0/Sw5lTgVsSFLLuIaFP9hs4ilS+950bNAEL6fedar3ZT6mL2pBu9q9FME+t+9hE07EA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Io9ggiQeyG7jx0BilvoNnv0Y5zon76kEnRVsj4ppbDCnWrfa+Plo9dSAeKFUXss+H4n/da4IfAqam5QJ9AMTfnBqJEivsX8dtTgRuNc8lQkNBpWOy27183ZZeU5sIeonDDx6jEyi+JgYb7wYQDw66yjuu/ia1Ezi3FNnVunE9DaEVbRa9SwT4XfC/0o6eT0G8GAkE3ESE2ZwwbhO7I64drCZ+Vm1oSA5k7pCBeJ6AiANZJF40VkAqnoJSd+cOhZgz47xSVotJN7xFhLe88sWX/BOKwwGTIPMcTN+QKyZW/yu5lZw0bi/xJwzmah5KELdO6nLESu+AKk+ecEjE/fTDQ==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=epam.com;
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>
  • Delivery-date: Tue, 07 Sep 2021 06:34:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXoJ51zxJWpxhHEEGXNqYYBqazw6uSBESAgASU4wCAAB15AIAABzeAgAALJQCAAANyAIAACPKAgAFOFwA=
  • Thread-topic: [PATCH 11/11] xen/arm: Process pending vPCI map/unmap operations

On 06.09.21 13:38, Julien Grall wrote:
> Hi Oleksandr,
>
> On 06/09/2021 11:06, Oleksandr Andrushchenko wrote:
>> On 06.09.21 12:53, Julien Grall wrote:
>>>>>>> However, looking at the rest of the code, we already have a check for 
>>>>>>> vpci in the common IOREQ code.
>>>>>>
>>>>>> Which may not be enabled as it depends on CONFIG_IOREQ_SERVER.
>>>>>
>>>>> Right. My point is when CONFIG_IOREQ_SERVER is set then you would end up 
>>>>> to call twice vpci_process_pending(). This will have an impact how on 
>>>>> long your vCPU is going to running because you are doubling the work.
>>>>
>>>> So, you suggest that we have in the common IOREQ code something call like
>>>>
>>>> arch_vpci_process_pending? In case of x86 it will have the code currently 
>>>> found in the
>>>>
>>>> common IOREQ sources and for Arm it will be nop?
>>>
>>> No I am suggesting to move the call of the IOREQ code to hvm_do_resume() 
>>> (on x86) and check_for_vcpu_work() (on Arm).
>>
>> Ok, I can move vPCI code to hvm_do_resume, but vPCI is only used for x86 PVH 
>> Dom0.
>
> AFAIK, Roger is planning to use it for x86 PVH guest.
>
>>
>> Do you still think hvm_do_resume is the right place?
> I think so. AFAICT, on x86, the only caller of vcpu_ioreq_handle_completion() 
> is hvm_do_resume(). So it makes sense to push one layer up.

Ok, so I ended up with:

--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -2305,10 +2305,17 @@ static bool check_for_vcpu_work(void)
      }
  #endif

-    local_irq_enable();
-    if ( has_vpci(v->domain) && vpci_process_pending(v) )
-        raise_softirq(SCHEDULE_SOFTIRQ);
-    local_irq_disable();
+    if ( has_vpci(v->domain) )
+    {
+        bool pending;
+
+        local_irq_enable();
+        pending = vpci_process_pending(v);
+        local_irq_disable();
+
+        if ( pending )
+            return true;
+    }
This is how it is done for IOREQ. It seems there is no need to raise softirq.

I also moved vPCI from common code to hvm_do_resume for x86

>
> Cheers,
>
Thanks,

Oleksandr

 


Rackspace

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