KVM/VFIO GVT-g broken on 5.4.0-rc8?
Alex Williamson
alex.williamson at redhat.com
Thu Nov 21 15:19:18 UTC 2019
On Thu, 21 Nov 2019 13:45:25 +0800
Zhenyu Wang <zhenyuw at linux.intel.com> wrote:
> On 2019.11.20 21:35:44 -0700, Alex Williamson wrote:
> > I was trying to test John Hubbard's latest gup series[1] with GVT-g,
> > but I'm unable to run a Windows 10 VM with a i915-GVTg_V4_2 on
> > af42d3466bdc ("Linux 5.4-rc8"). The host kernel prints:
> >
> > [ 64.402671] gvt: len is not valid: len=11 valid_len=3
> > [ 64.407932] gvt: vgpu 2: MI_OP_2F handler error
> > [ 64.412502] gvt: vgpu 2: cmd parser error
> > [ 64.416591] 0x0
> > [ 64.416592] 0x2f
> >
> > [ 64.421930] gvt: vgpu 2: scan wa ctx error
> > [ 64.426088] GVT Internal error for the guest
> > [ 64.430486] Now vgpu 2 will enter failsafe mode.
> > [ 64.435179] gvt: vgpu 2: failed to submit desc 0
> > [ 64.439853] gvt: vgpu 2: fail submit workload on ring 0
> > [ 64.445125] gvt: vgpu 2: fail to emulate MMIO write 00002230 len 4
> > [ 103.522117] gvt: len is not valid: len=11 valid_len=3
> > [ 103.527419] gvt: vgpu 2: MI_OP_2F handler error
> > [ 103.532004] gvt: vgpu 2: cmd parser error
> > [ 103.536062] 0x0
> > [ 103.536063] 0x2f
> >
> > [ 103.541342] gvt: vgpu 2: scan wa ctx error
> > [ 103.545466] GVT Internal error for the guest
> > [ 103.549863] Now vgpu 2 will enter failsafe mode.
> > [ 103.554502] gvt: vgpu 2: failed to submit desc 0
> > [ 103.559156] gvt: vgpu 2: fail submit workload on ring 0
> > [ 103.564388] gvt: vgpu 2: fail to emulate MMIO write 00002230 len 4
> >
> > And the VM reboots before reaching the desktop, possibly with a BSOD.
> > The same VM configuration works on host kernel 5.3.11-200.fc30.x86_64.
> > Device manager reports HD Graphics 5500 driver version 20.19.15.4624,
> > which was installed by Windows update. Thanks,
> >
>
> Hi, Alex, looks this windows driver is old which utilized MI_ATOMIC command
> that trigger bug in gvt driver, when we validated newer version which doesn't
> use that command anymore so we didn't catch that.
>
> Could you help to try below one? Sorry for inconvenience..
Yes, this resolves it. Thanks,
Alex
> From 9cc476838deecf54eee92cb03ab12821cd0b7c38 Mon Sep 17 00:00:00 2001
> From: Zhenyu Wang <zhenyuw at linux.intel.com>
> Date: Thu, 21 Nov 2019 13:37:09 +0800
> Subject: [PATCH] drm/i915/gvt: Fix cmd length check for MI_ATOMIC
>
> Correct valid command length check for MI_ATOMIC, need to check inline
> data available field instead of operand data length for whole command.
>
> Fixes: 00a33be40634 ("drm/i915/gvt: Add valid length check for MI variable commands")
> Cc: stable at vger.kernel.org
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
> drivers/gpu/drm/i915/gvt/cmd_parser.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> index 6a3ac8cde95d..21a176cd8acc 100644
> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> @@ -1599,9 +1599,9 @@ static int cmd_handler_mi_op_2f(struct parser_exec_state *s)
> if (!(cmd_val(s, 0) & (1 << 22)))
> return ret;
>
> - /* check if QWORD */
> - if (DWORD_FIELD(0, 20, 19) == 1)
> - valid_len += 8;
> + /* check inline data */
> + if (cmd_val(s, 0) & BIT(18))
> + valid_len = CMD_LEN(9);
> ret = gvt_check_valid_cmd_length(cmd_length(s),
> valid_len);
> if (ret)
More information about the intel-gvt-dev
mailing list