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

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


  • To: Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 27 Sep 2021 10:06:16 +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; bh=ZBc77q+KcNW4aZDXnGFVHZi2SMQ/1hAVmd8/In7Ex0A=; b=OsEkZrXW0CXb+o7yCQ4qnBZ5XUcoiYNaZFWobwL6/Zayg6Cb65AWn8MmlobNLkGF2z+9WQsANvuyfC73AXsM0RlT5/lLU1PFYoxoj2UAsVS6wsZZhW91G1DE5tvBa/+/haVHEX+jtmgFBRp1EqUVIniXQQs0BPnA48gDy4Qt+aTUETmF8oDAHHXKDKLOMUU9ZIBE4MQbAk7DSYmCyLX+DtVNjDbdvoSETKiXHmg/X6pir3Izbc7bEc5bkuHOkq281DA0EDHnuOYfMKjUiR7cyGAIWyzQ5oy6LCcDmVCMBE2JIxOIGOh2gCXlF/DGWD8QD1OjPMbkbDZxmBZP0JynNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=md3g5j5F0EBEFss1X1iYUtpGyeOaXlHLAaewwWMI1+j+aXEGzJ8OedfFb0gIJXQLfdvw7sqhbEpSLfWfv2+D1w4CbDBaO6LeWR99Zuot0ZR9W2pU64+kuMkCWaX833aoWVsl67A08dVJSsxZIVb+53yzMwR5ecncLU+EPC/C4/k8NLmtmX+ffpS08C02UyG2QeU5Qx4a7s+v6MklbWx9X5JM6i7+FW/oclEhN1iz8vWcNTWjkONFDj3Pdl+Yu+2ag5Bpri4SUQ+oUyGsgPtVZKCbROUrftd4T7iEYgSZT5pfw54mTeYR9JxwTQwMV/F4Sk//LCy6FSK7iCwci/5MbA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: julien@xxxxxxx, sstabellini@xxxxxxxxxx, oleksandr_tyshchenko@xxxxxxxx, volodymyr_babchuk@xxxxxxxx, Artem_Mygaiev@xxxxxxxx, roger.pau@xxxxxxxxxx, bertrand.marquis@xxxxxxx, rahul.singh@xxxxxxx, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 27 Sep 2021 08:06:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

+ Paul (retaining full context for this reason)

On 23.09.2021 14:54, Oleksandr Andrushchenko wrote:
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> 
> vPCI may map and unmap PCI device memory (BARs) being passed through which
> may take a lot of time. For this those operations may be deferred to be
> performed later, so that they can be safely preempted.
> Run the corresponding vPCI code while switching a vCPU.
> 
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
> 
> ---
> Since v1:
>  - Moved the check for pending vpci work from the common IOREQ code
>    to hvm_do_resume on x86

While perhaps obvious for Arm folks, I'd like to see the reason for this
spelled out in the description.

> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -549,6 +549,12 @@ void hvm_do_resume(struct vcpu *v)
>      if ( !vcpu_ioreq_handle_completion(v) )
>          return;
>  
> +    if ( has_vpci(v->domain) && vpci_process_pending(v) )
> +    {
> +        raise_softirq(SCHEDULE_SOFTIRQ);
> +        return;
> +    }

Note that you're altering behavior here: Originally this was done ...

> @@ -212,19 +210,12 @@ static bool wait_for_io(struct ioreq_vcpu *sv, ioreq_t 
> *p)
>  
>  bool vcpu_ioreq_handle_completion(struct vcpu *v)
>  {
> -    struct domain *d = v->domain;
>      struct vcpu_io *vio = &v->io;
>      struct ioreq_server *s;
>      struct ioreq_vcpu *sv;
>      enum vio_completion completion;
>      bool res = true;
>  
> -    if ( has_vpci(d) && vpci_process_pending(v) )
> -    {
> -        raise_softirq(SCHEDULE_SOFTIRQ);
> -        return false;
> -    }

... first thing. And I think it wants (perhaps even needs) to remain
that way; otherwise you'll need to explain why not, and why the change
is correct / safe.

Jan




 


Rackspace

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