<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The background of the warns is this: since our opregion was considered as broken, guest i915 driver directly used the configurations in the fuse register. On CFL, gvt-g got the fuse register's data from hardware, and the real hardware told us that the port
 F was used. However, gvt-d doesn't emulate port F. The following warnings are guest i915 guest driver complaining about the port F doesn't configured correctly.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
So, it looks we can have two options:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
1) Support port F emulation in gvt-g and fix our opregion and add port F support to the opregion.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2) Fix our opregion and let it tell guests OS that we only support port A/B/C/D with dp type output.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As we all agree that we should have only one opregion configuration which can deal with all the supported platforms, I think the option 2 is better. Otherwise, we have to bring platform knowledge into opregion, as not all platforms support port F.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
BR,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Tina</div>
<div>
<div><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0);">
<br>
<hr tabindex="-1" style="display:inline-block; width:98%;">
<b>From:</b> Zhenyu Wang<br>
<b>Sent:</b> Wednesday, March 4, 2020 9:00 PM<br>
<b>To:</b> Zhang, Tina<br>
<b>Cc:</b> intel-gvt-dev@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 1/2] drm/i915/gvt: Fix emulated opregion size issue
<div><br>
</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 2020.03.04 17:50:34 +0800, Tina Zhang wrote:<br>
> The emulated opregion doesn't tell its size correctly. According to the<br>
> intel_vbt_defs.h, vbt_header.vbt_size should the size of VBT (VBT Header,<br>
> BDB Header and data blocks), and bdb_header.bdb_size should be the size<br>
> of BDB (BDB Header and data blocks).<br>
><br>
<br>
The fix looks sane to me, but is below warning directly related to this?<br>
Looks that need some explanation.<br>
<br>
> This fixes guest warnings on cfl like:<br>
> <br>
> [   41.054953] Missing case (encoder->hpd_pin == 9)<br>
> [   41.055572] WARNING: CPU: 0 PID: 145 at drivers/gpu/drm/i915/display/intel_dp.c:5443 cpt_digital_port_connected.isra.28+0x31/0x70 [i915]<br>
> [   41.056805] Modules linked in: intel_rapl_msr intel_rapl_common kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel i915 aesni_intel crypto_simd video drm_kms_helper cec rc_core drm cryptd glue_helper intel_rapl_perf joydev i2c_algo_bit fb_sys_fops
 syscopyarea input_leds sysfillrect mac_hid serio_raw sch_fq_codel sysimgblt qemu_fw_cfg parport_pc ppdev lp parport ip_tables x_tables autofs4 psmouse e1000 i2c_piix4 pata_acpi floppy<br>
> [   41.060685] CPU: 0 PID: 145 Comm: kworker/u4:2 Not tainted 5.6.0-rc3+ #13<br>
> [   41.061369] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.1-0-g8891697-dirty-20180511_165818-tinazhang-linux-1 04/01/2014<br>
> [   41.062670] Workqueue: events_unbound async_run_entry_fn<br>
> [   41.063578] RIP: 0010:cpt_digital_port_connected.isra.28+0x31/0x70 [i915]<br>
> [   41.064274] Code: fe 06 48 89 f8 48 89 e5 53 74 57 83 fe 07 74 4b 83 fe 05 74 1c 89 f2 48 c7 c7 7f 64 56 c0 48 c7 c6 d8 65 56 c0 e8 5f 3e bc c0 <0f> 0b 31 c0 5b 5d c3 bb 00 00 20 00 48 8d b8 b8 07 00 00 ba 01 00<br>
> [   41.066161] RSP: 0018:ffffc9000019fac8 EFLAGS: 00010286<br>
> [   41.066716] RAX: 0000000000000000 RBX: ffff888116266000 RCX: 0000000000000000<br>
> [   41.067429] RDX: 0000000000000001 RSI: ffff888133c19808 RDI: ffff888133c19808<br>
> [   41.068196] RBP: ffffc9000019fad0 R08: 000000000000042a R09: ffff888138017378<br>
> [   41.068907] R10: ffff888116266000 R11: ffffc9000019f918 R12: 0000000000000000<br>
> [   41.069619] R13: ffff88811ea00000 R14: ffff88811ea00000 R15: ffff888116266000<br>
> [   41.070334] FS:  0000000000000000(0000) GS:ffff888133c00000(0000) knlGS:0000000000000000<br>
> [   41.071136] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br>
> [   41.071712] CR2: 00007f08b0ca6320 CR3: 0000000131f3a006 CR4: 0000000000360ef0<br>
> [   41.072427] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000<br>
> [   41.073142] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400<br>
> [   41.073862] Call Trace:<br>
> [   41.074187]  intel_digital_port_connected+0x345/0x470 [i915]<br>
> [   41.074792]  intel_dp_detect+0x279/0x540 [i915]<br>
> [   41.075371]  ? ww_mutex_lock+0x64/0x70<br>
> [   41.075760]  drm_helper_probe_detect+0x50/0x90 [drm_kms_helper]<br>
> [   41.076360]  drm_helper_probe_single_connector_modes+0xe5/0x710 [drm_kms_helper]<br>
> [   41.077113]  drm_client_modeset_probe+0x211/0x14b0 [drm]<br>
> [   41.077646]  ? __schedule+0x294/0x710<br>
> [   41.078025]  ? wq_worker_running+0xe/0x40<br>
> [   41.078431]  ? schedule+0x72/0xb0<br>
> [   41.078770]  ? __switch_to_asm+0x40/0x70<br>
> [   41.079169]  ? __switch_to_asm+0x34/0x70<br>
> [   41.079564]  ? __switch_to_asm+0x40/0x70<br>
> [   41.079963]  ? __switch_to_asm+0x34/0x70<br>
> [   41.080361]  ? __switch_to_asm+0x40/0x70<br>
> [   41.080758]  ? __switch_to_asm+0x34/0x70<br>
> [   41.081152]  ? __switch_to_asm+0x40/0x70<br>
> [   41.081554]  __drm_fb_helper_initial_config_and_unlock+0x46/0x520 [drm_kms_helper]<br>
> [   41.082320]  ? __switch_to_asm+0x34/0x70<br>
> [   41.082716]  ? __switch_to_asm+0x40/0x70<br>
> [   41.083119]  ? __switch_to_xtra+0x130/0x4b0<br>
> [   41.083546]  ? __switch_to_asm+0x34/0x70<br>
> [   41.083948]  ? __switch_to_asm+0x40/0x70<br>
> [   41.084345]  drm_fb_helper_initial_config+0x35/0x40 [drm_kms_helper]<br>
> [   41.085014]  intel_fbdev_initial_config+0x18/0x30 [i915]<br>
> [   41.085553]  async_run_entry_fn+0x3c/0x150<br>
> [   41.085972]  process_one_work+0x1fa/0x3f0<br>
> [   41.086368]  worker_thread+0x34/0x410<br>
> [   41.086742]  kthread+0x121/0x140<br>
> [   41.087073]  ? process_one_work+0x3f0/0x3f0<br>
> [   41.087499]  ? kthread_park+0x90/0x90<br>
> [   41.087869]  ret_from_fork+0x35/0x40<br>
> [   41.088235] ---[ end trace 18d9147ae17b62df ]---<br>
> <br>
> Signed-off-by: Tina Zhang <tina.zhang@intel.com><br>
> ---<br>
>  drivers/gpu/drm/i915/gvt/opregion.c | 5 ++---<br>
>  1 file changed, 2 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/i915/gvt/opregion.c b/drivers/gpu/drm/i915/gvt/opregion.c<br>
> index 867e7629025b..33569b910ed5 100644<br>
> --- a/drivers/gpu/drm/i915/gvt/opregion.c<br>
> +++ b/drivers/gpu/drm/i915/gvt/opregion.c<br>
> @@ -147,15 +147,14 @@ static void virt_vbt_generation(struct vbt *v)<br>
>        /* there's features depending on version! */<br>
>        v->header.version = 155;<br>
>        v->header.header_size = sizeof(v->header);<br>
> -     v->header.vbt_size = sizeof(struct vbt) - sizeof(v->header);<br>
> +     v->header.vbt_size = sizeof(struct vbt);<br>
>        v->header.bdb_offset = offsetof(struct vbt, bdb_header);<br>
>  <br>
>        strcpy(&v->bdb_header.signature[0], "BIOS_DATA_BLOCK");<br>
>        v->bdb_header.version = 186; /* child_dev_size = 33 */<br>
>        v->bdb_header.header_size = sizeof(v->bdb_header);<br>
>  <br>
> -     v->bdb_header.bdb_size = sizeof(struct vbt) - sizeof(struct vbt_header)<br>
> -             - sizeof(struct bdb_header);<br>
> +     v->bdb_header.bdb_size = sizeof(struct vbt) - sizeof(struct vbt_header);<br>
>  <br>
>        /* general features */<br>
>        v->general_features_header.id = BDB_GENERAL_FEATURES;<br>
> -- <br>
> 2.17.1<br>
> <br>
<br>
-- <br>
Open Source Technology Center, Intel ltd.<br>
<br>
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827<br>
</div>
</span></font></div>
</div>
</body>
</html>