[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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Gao, Chao" <chao.gao@xxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Sun, 25 Apr 2021 01:20:07 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.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=K/WSW9N0WNA5Udo4XDhz5W4UR69LQl95DwgYxedeyts=; b=D1rF4muYGNMd6eegBRaux6OXzjiM646+P+HYVAKk20s+6n0HVSKMeuR5WxYM2nKjSq5pyMruBZVEkAZd0yHh4ii6kpMKblNwlFnre3FV2Z4iiIMgOTeL4wlUYPZYHHxsyePEGbXs1ydZB06r326/rH35hg18SM4UheIGYb7Lnaw6r1ak4CU5JjvZiRZgGCiUKp3J3cJeXHrGgicBnssg67Me1CepamHlhziDUpyuiuYZzBicjSJJOKxOWxtKAhj5gIFyO+iaIGGWLIdji62Cv/s6LLfKgndivstFXO1N4tZgD+YkFelH3FFYyu4TyAAqbXMY3wh+pGJczUpy9sczKw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bk9feyXpqTudJp1Xa9iq64p32OmVQgbBxOdzI/hMq6ugkfi8csQO4DE1FD2LJB45lm5Ui5wbGeuSS35/ocj1QESiZLtQAzD1qrM1JOfwQzFYP7umUVcDUn9VUHaDXZG56rtdwZktLe+r6n4HhwvxagwW+P6EZUWRRfNKvbXyHfAaks35ZPk24QRYOgjot3iANVK9IK66DRlhJhXsR2nlfto3o7mf3eP0gaWoGcpSAzcVzUTol5AeaSX5hVTZPV/zRJaOy+L3RKYAsEu5GKhuG2kjYvpSWJLkLbzqYkiv/WLRc+skrauHwad+KQKWVJ9a+78j2X1u6gtZMjtx08pCCg==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=intel.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Sun, 25 Apr 2021 01:20:24 +0000
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.5.1.3
  • Ironport-sdr: HJDrioq7Pv6+Zh0u7uOwbR6NuIupRut97zA5a+pjw5NnPPm+d8dToX8uCbg2Vre6JQamyY7KQY UELNMXqm8xDg==
  • Ironport-sdr: cGiTNimvNb28O32//5Xy4w4nLwM7mLWkSJRj0D4uD9QZV2zVV0pjIBZvwTsDLL7Mkwa9ia6R58 tfP/WWLKAzyg==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXNde1q1zbhr7NX0K4N/BqLKSfc6q9gkqAgAAIjICAAAq7gIABHqeAgAXCM7A=
  • Thread-topic: [PATCH v2] VT-d: Don't assume register-based invalidation is always supported

> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, April 21, 2021 5:23 PM
> 
> On 20.04.2021 18:17, Roger Pau Monné wrote:
> > 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?
> 
> Hmm, yes, perhaps - would allow seeing right away where the call
> came from. Chao, I'd again be fine to flip the dprintk()-s to
> WARN()-s while committing. But of course only provided you and
> Kevin (as the maintainer) agree.
> 

Looks good.

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>

 


Rackspace

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