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

Re: [PATCH 2/3] hvm/irq: tighten check in hvm_domain_use_pirq


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Mar 2022 13:44:16 +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=PAkocuTVtpPDAQB+SGtsJSc/HtS0wVcXFf7Bg9SihhE=; b=bzTJdLB2aDBk6/RPZEKc6KshCAAuM0cKAVLEBuOJSxgYcd/3yAVOcx0Vnr70pMFn4XaBTmUgyxxldp67vedNvI2NV3SHlb8RASW+zjJDwCCQsdX0M+kh8vbAKPUd3/qvRS7rSB4kGwRQNqogZcp1T6/aa4+cD8lWQgqpXb09/iVT3Kww5p+2Zs8qmoYCbnoVGgAg3OlsS67EchwedbITtDefv96aE85K8wCQvG+OKWyz6XkC9gSYdlmR2LZLcMG27H3afQ2Bs1hDonrdUgmxv/qvW6DBxfWM96Br3KlG9MoO7mGp4AeTe0P/s9Q1dxRGoWMdeydHh50o9rTYTn0lzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kBgpjckCcRhCIU12yyJKpZ/Xtmz31CNKWkIsHS7bDe264/TcUanIskNvALVZCQnQW10Jjqini8K8bUnmu3nirGcspWsuNRoWeIIy3Vy95wXL6FRgJeYidTuklqCVEjo6kfoArZEK0FaoljJCAQRsgw70WWfTSU1Dr1VNUZ7Kyp+80PSJD9j/kJfmeDqH4euKLKPVbyu5dAw7eMYIW9wbSRUP+vcNLqvLn3MkCsfOdlg5+jdOPOMHCFOIyfPgYbLfvVGcku7Ecf6taCKC41bnpRDNAAbTg9Vw77LKeR6qJf6pgsoQ9N+cH6Jfbq6AT29OHFGSaA37sDDUEFZoXmLGMw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 03 Mar 2022 12:44:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.03.2022 11:30, Roger Pau Monne wrote:
> hvm_domain_use_pirq checking whether the passed domain is an HVM
> guests is pointless, as all calls originate from HVM only paths.
> Instead check whether the domain has PIRQ support in order to avoid
> further checks.

I agree with this, but I wonder ...

> --- a/xen/arch/x86/hvm/irq.c
> +++ b/xen/arch/x86/hvm/irq.c
> @@ -30,7 +30,7 @@
>  
>  bool hvm_domain_use_pirq(const struct domain *d, const struct pirq *pirq)
>  {
> -    return is_hvm_domain(d) && pirq && pirq->arch.hvm.emuirq != IRQ_UNBOUND;
> +    return has_pirq(d) && pirq && pirq->arch.hvm.emuirq != IRQ_UNBOUND;

... whether there can be a non-NULL pirq in the first place for a
!has_pirq() domain. Judging from e.g. hvm_inject_msi() it looks like
this might be possible, but perhaps wrongly so?

Jan




 


Rackspace

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