Message ID | 1450859136-98482-3-git-send-email-quan.xu@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> From: Xu, Quan > Sent: Wednesday, December 23, 2015 4:26 PM > > Signed-off-by: Quan Xu <quan.xu@intel.com> Acked-by: Kevin Tian <kevin.tian@intel.com>
> On 25.12.2015 at 10:57am, <Tian, Kevin> wrote: > > From: Xu, Quan > > Sent: Wednesday, December 23, 2015 4:26 PM > > > > Signed-off-by: Quan Xu <quan.xu@intel.com> > > Acked-by: Kevin Tian <kevin.tian@intel.com> Thanks Kevin! -Quan
>>> On 23.12.15 at 09:25, <quan.xu@intel.com> wrote: > --- a/xen/drivers/passthrough/vtd/qinval.c > +++ b/xen/drivers/passthrough/vtd/qinval.c > @@ -28,6 +28,11 @@ > #include "vtd.h" > #include "extern.h" > > +static int __read_mostly iommu_qi_timeout_ms = 1; I'll take the liberty to convert this to "unsigned int" when committing. Jan
>>> On 23.12.15 at 09:25, <quan.xu@intel.com> wrote: > --- a/xen/drivers/passthrough/vtd/qinval.c > +++ b/xen/drivers/passthrough/vtd/qinval.c > @@ -28,6 +28,11 @@ > #include "vtd.h" > #include "extern.h" > > +static int __read_mostly iommu_qi_timeout_ms = 1; > +integer_param("iommu_qi_timeout_ms", iommu_qi_timeout_ms); But wait - this needs to be accompanied by an entry in docs/misc/xen-command-line.markdown. Jan
On 14.01.2016 at 12:56am, <JBeulich@suse.com> wrote: > >>> On 23.12.15 at 09:25, <quan.xu@intel.com> wrote: > > --- a/xen/drivers/passthrough/vtd/qinval.c > > +++ b/xen/drivers/passthrough/vtd/qinval.c > > @@ -28,6 +28,11 @@ > > #include "vtd.h" > > #include "extern.h" > > > > +static int __read_mostly iommu_qi_timeout_ms = 1; > > I'll take the liberty to convert this to "unsigned int" when committing. > Jan, thanks. I can also do it in next v5. Quan
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c index 946e812..b227e4e 100644 --- a/xen/drivers/passthrough/vtd/qinval.c +++ b/xen/drivers/passthrough/vtd/qinval.c @@ -28,6 +28,11 @@ #include "vtd.h" #include "extern.h" +static int __read_mostly iommu_qi_timeout_ms = 1; +integer_param("iommu_qi_timeout_ms", iommu_qi_timeout_ms); + +#define IOMMU_QI_TIMEOUT (iommu_qi_timeout_ms * MILLISECS(1)) + static void print_qi_regs(struct iommu *iommu) { u64 val; @@ -167,10 +172,12 @@ static int queue_invalidate_wait(struct iommu *iommu, start_time = NOW(); while ( poll_slot != QINVAL_STAT_DONE ) { - if ( NOW() > (start_time + DMAR_OPERATION_TIMEOUT) ) + if ( NOW() > (start_time + IOMMU_QI_TIMEOUT) ) { print_qi_regs(iommu); - panic("queue invalidate wait descriptor was not executed"); + dprintk(XENLOG_WARNING VTDPREFIX, + "Queue invalidate wait descriptor was timeout.\n"); + return -ETIMEDOUT; } cpu_relax(); }
Signed-off-by: Quan Xu <quan.xu@intel.com> --- xen/drivers/passthrough/vtd/qinval.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)