[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 20 Apr 2021 18:17: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=hTS6hH/45NmzXfaUvkoqMgEaNze7Gg4cK6PcbYYj9wQ=; b=oPvEaLLtz66QQphEkyqI2h1fM3Nui7MdPY6IUF9qipobWaNXrasJoYKEiw0JVcaK8qGyC339Ov6NiWWSgtaojm5VrNStqqukYG7VxapBfw6JDAkNpL2w8HneAoaptKhnY5pC41LpZCjVJQQlSNRFy8krCYVinHqtLFbsQZXkgC/L/fziIinIy/Ccr7dgm+AoQKCGxQI0K6L0WjzFtWSSOgg7IsitnoV5RB2D3BiYNwCWqkSvSI4/hUMtU5ICpXgZyouas29UWo9yxr7pvZY8fljl2BpDWtkQFEk0mudLI5+33IjkPkjIKghiIY1+p2qMgAkuyBkB5NMxp9fawVPQ5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YUE9l0aCSLAK1YiNIC2ThYozD9zpFZPhuGJseNJ3s1B4pgyBjnYSCwIhovzGt+yRMOB3hgW/Vab4GWLjY6+JZyI4wPdg+91DYxS+tcPl3koUy8IIl8pOAimwjyiLSsEwt0oXu+beq8KbWOBEvRyR9XyEi+/Jg0C2SwzAUuuRY0zLVHX8l3AFKOHmPb170lwc1+Fbe6Lee9o858dxZ9+3PZE/9bmiJb5XC8LdKV1KJzeokO3i6IJBKASPRCNBGZ1fhizuRZPqhCn1V7khOLFaYIqFGNaN0PYiAFQI2Fq1vMnelKKwkQBp0swI9pzSd7H+HJtzUrn2ZKYWXhiOJsRCJg==
  • Authentication-results: esa2.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>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Chao Gao <chao.gao@xxxxxxxxx>
  • Delivery-date: Tue, 20 Apr 2021 16:17:36 +0000
  • Ironport-hdrordr: A9a23:qEPZx6qVoMH22ZVNdsIN0McaV5uNKtV00zAX/kB9WHVpW+SivY SHgOkb2RjoiDwYRXEnnpS6NLOdRG7HnKQa3aA4Bp3neAX9omOnIMVZ7YXkyyD9ACGWzIFg/I 9aWexFBNX0ZGIXse/T/BS4H9E8wNOO7aCvgqPkw21wSBxxApsB0y5SIG+gYytLbSNBAoc0E4 fZy8pcvjy7eWkWaMPTPAh5Y8HoodrXmJX6JSMcDxk85wWUyR+u4rj2Ex+Xty1uLw9n67Ek7G TDjkjF9ryu2svLsCP0+k3yy9BtmNXnwsZeH8DksKkoAxjllwrAXvUFZ5SspzYwydvfjGoCsN 6JmBs4OtQ21nW5RBDLnTLI+y3NlAkj8GXjz1jwuwqRneXcSCghA8RMwaJ1GyGpk3YIh9133K JV02/xjfM+Znms7UeNham8azhQmkW5unYkm+II5kYvKrc2U7NNsZcZuHpcDZZoJlOL1KkcDO JsAMvAjcwmCG+yUnaxhBgJ/PWcGl43HhuAX3EYvN2U3zV8jBlCvjol7f1asXEa+J0nTZ5Yo8 zCL6RzjblLCvQbdKRnGY46MIWKI12IZD+JCXmVK1j8Dq0LUki94qLf0fEQ3qWH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rVuNAMjTESgvI Di6uiX1HP0/T5f/4LMfX0gJe1zJw==
  • Ironport-sdr: ABVWH3Pkx+mzR5lU0sB74xJgDUhTvltp4rYfE7/UMGF5DIFzGujFQ+YfsmkHDruCIhwhA0pXBG Ij+t6Bm9Dc+7D9TPRnlmxrsdBrfa6Y5aP5o/yFKoKGfUg3+0QJCUgNHs2nVieeYvDa7d+LUNQp UBE6nzCrGMrBzv1NIs1sFSsPcxSt9KlkbacwNu+rrdYD6S8Nj7UIUtRKK7itOJrBJFufiX6dfx dku4YYMaVzRRoKwqakuo7nHberlWgiUsOiLKdbwgFCk9cDysPeZP5cOC7hs2Jz0fsh/QFVRm/A yqk=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Apr 20, 2021 at 05:38:51PM +0200, Jan Beulich wrote:
> On 20.04.2021 17:08, Roger Pau Monné wrote:
> > 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?
> 
> If such an assertion triggered e.g. during S3 suspend/resume, it may
> lead to the box simply not doing anything useful, without there being
> any way to know what went wrong. If instead the system at least
> managed to resume, the log message could be observed.

Oh, OK then. I'm simply worried that people might ignore such one line
messages, maybe add a WARN?

Would it make sense to mark as tainted which could help identify the
issue on production builds? Maybe that's too much.

Thanks, Roger.



 


Rackspace

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