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

Re: [PATCH v2] VT-d: Don't assume register-based invalidation is always supported


  • To: Chao Gao <chao.gao@xxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 20 Apr 2021 17:08:15 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=emQiayagX5yYHoDuRCF7Vu/STi3G6Ui+9OhOy3leMwo=; b=YH4GhicczYyHRE/WopTJKP0Q/hIuN9eQ1LQOIPWBfD/TNeeRxZbYLhYLjfFrHo8sdQfodbtcWTaqpGuEnrSFWoqDYmRivNZxXacE81dm/szNXcXQRJwWbjQJkV/j7lUpc9pIMZyvB/klgQgmGjew4q7AJnfQ8AvI2mkdEJZ4B1pHKEYu4eTa4OvcxS35hIQrUrnkkTVir4JajJP2cqj/MNrAn8IPs7Cr/ttYSXTGRTcwuDoFvx9uu4DOAADD7sPpM5wR3XRkd1T9bn3qqZfX1ahESeq8HaNybA8N2TRYCaqkKUbg9GPWgUzGXUe4XL4x6C/ZT0cbebiccHhrdUCMNg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e1DjIaNQDKu9ok3lglDWjuj/WpFaQZ4W/vQVS3ZZ9bdt2w/WPpv9CSIoNpqTA4lCWDOVciYJkemO01FGYjwG5X6+322drh0Ogx3+zghTeEFW9Q9dWRcIdLb0oAGsREbgxSnmQoCtS/ZAfeJ47MD3zMfEIP7+0Wd+PtfLSA7F6tMXC9QAYNC/1JgTlJGaWe4PabuIdReNFVc3tXOokVra8u9lcOcpZcbsJ+VjRPslclrBzv1eCVNFikmxLGVJd8qAuXHt8lhhkr4hnfuGm7tpZs8EBUJuwD+5U9AGl3HelL4pmJpt/g0hymJS6S+bsBQRfs2nyrTmEmUsyImQT81OKQ==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Tue, 20 Apr 2021 15:08:33 +0000
  • Ironport-hdrordr: A9a23:SkuwXahyExw99v6QIhld/55wj3BQX09w3DAbvn1ZSRFFG/Gwv/ uF2NwGyB75jysQUnk8mdaGfJKNW2/Y6IQd2+YsFJ+Ydk3DtHGzJI9vqbHjzTrpBjHk+odmuZ tIW5NVTOf9BV0St6vHySGzGdo43Z2j+Kenme/Rwx5WPHtXQotn6Bp0DRveN0VwShVPC5ZRLu vg2uNsoT28dXMLKvmqH3VtZZmPm/TntrLDJSQHCRku9RWUgVqTg9DHOjWRwxt2aUIo/Z4M6m 7A+jaJhZmLk/b+8RPE0n+W0pI+oqqb9vJmJOihzvcYMS/tjAHAXvUsZ5SnsCouqO+irHYG+e O82isIBMh453PPcmzdm3KEsWiB7B8U53Dv0lOei3f4yPaJPA4SMdZLho5Sb3Limi8dlex8y6 5C0ia4sJdaHHr77UPAzuXITB1jmw6Ip2Mjm4co/hhieLYZAYUhz7A3zQdwKtMtDSj64IcoHK 1FF8fH/stbdluccjTwonRv6MbEZAV8Ij62Bmw5/uCF2Tlfm350i2ECwtYEo3sG/JUhD7FZ+u X/NLhynr0mdL5WUYtNQMM6BeenAG3ERhzBdEiIJ078Ka0BM3XR77n6/asy/+P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ironport-sdr: HO5XOFWmIQG29Y4kHw9L7hAYso7iots7tog2MZvF8fgjzVA0yDJFabhvIIHnQxGIiurNOuXrL5 2KJcKOupkKKQlT6SXAgn4QyX0Y25fshYj8/0/ZffdVLeBkVM0pSfxIzY4HH7crrEzcsIuHN7os /p6piFW8mX8BmIxokM4dU5I1dHejlGCRHlv4x0HxDnKR1S/ZojPfwe4qnME8c3bc1eOFXjOaw7 NXSl9bpWXwL0AtXkrG/Pf8pJnTjvu3f4lO9vKPJ95yGaPr4JmYYIV9LYmGQhZYZhgh5IU7LUPs OfU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Apr 02, 2020 at 04:06:06AM +0800, Chao Gao wrote:
> --- a/xen/drivers/passthrough/vtd/qinval.c
> +++ b/xen/drivers/passthrough/vtd/qinval.c
> @@ -442,6 +442,23 @@ int enable_qinval(struct vtd_iommu *iommu)
>      return 0;
>  }
>  
> +static int vtd_flush_context_noop(struct vtd_iommu *iommu, uint16_t did,
> +                                  uint16_t source_id, uint8_t function_mask,
> +                                  uint64_t type, bool 
> flush_non_present_entry)
> +{
> +    dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: Cannot flush CONTEXT.\n");
> +    return -EIO;
> +}
> +
> +static int vtd_flush_iotlb_noop(struct vtd_iommu *iommu, uint16_t did,
> +                                uint64_t addr, unsigned int size_order,
> +                                uint64_t type, bool flush_non_present_entry,
> +                                bool flush_dev_iotlb)
> +{
> +    dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: Cannot flush IOTLB.\n");
> +    return -EIO;
> +}

I think I would add an ASSERT_UNREACHABLE() to both noop handlers
above, as I would expect trying to use them without the proper mode
being configured would point to an error elsewhere?

Thanks, Roger.



 


Rackspace

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