[PATCH v1] drm/i915/gvt: opregion virtualization for win guest
Zhenyu Wang
zhenyuw at linux.intel.com
Fri Oct 20 03:30:45 UTC 2017
On 2017.10.14 02:13:22 +0800, Xiaolin Zhang wrote:
> this is an enhanced opregion emulation for win guest
> by filling more struct data members. for simplicity,
> redefined child_device_config structure.
Might be more elaborated. It seems this one does contain
some fixes for e.g header size, version, etc.
> @@ -207,9 +270,8 @@ void intel_vgpu_clean_opregion(struct intel_vgpu *vgpu)
> map_vgpu_opregion(vgpu, false);
> free_pages((unsigned long)vgpu_opregion(vgpu)->va,
> get_order(INTEL_GVT_OPREGION_SIZE));
> -
> - vgpu_opregion(vgpu)->va = NULL;
> }
> + vgpu_opregion(vgpu)->va = NULL;
> }
This is not relate to this, better keep in another one.
>
> /**
> @@ -278,22 +340,23 @@ int intel_gvt_init_opregion(struct intel_gvt *gvt)
> }
>
> /* emulated opregion with VBT mailbox only */
> - header = (struct opregion_header *)gvt->opregion.opregion_va;
> + buf = (u8 *)gvt->opregion.opregion_va;
> + header = (struct opregion_header *)buf;
> memcpy(header->signature, OPREGION_SIGNATURE,
> sizeof(OPREGION_SIGNATURE));
> + header->size = 0x8;
> + header->opregion_ver = 0x02000000;
> header->mboxes = MBOX_VBT;
>
> /* for unknown reason, the value in LID field is incorrect
> * which block the windows guest, so workaround it by force
> * setting it to "OPEN"
> */
> - buf = (u8 *)gvt->opregion.opregion_va;
> buf[INTEL_GVT_OPREGION_CLID] = 0x3;
>
> /* emulated vbt from virt vbt generation */
> virt_vbt_generation(&v);
> - memcpy(gvt->opregion.opregion_va + INTEL_GVT_OPREGION_VBT_OFFSET,
> - &v, sizeof(struct vbt));
> + memcpy(buf + INTEL_GVT_OPREGION_VBT_OFFSET, &v, sizeof(struct vbt));
>
indent error
> return 0;
> }
> --
looks fine to me, thanks
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20171020/f1e51a8b/attachment.sig>
More information about the intel-gvt-dev
mailing list