diff mbox

hw/xen: Set emu_mask for igd_opregion register

Message ID 1499400478-24427-1-git-send-email-xiong.y.zhang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang, Xiong Y July 7, 2017, 4:07 a.m. UTC
In igd passthrough environment, guest could only access opregion at the
first bootup time. Once guest shutdown, later guest couldn't access 
opregion anymore.
This is because qemu set emulated guest opregion base address to host
register. Later guest get a wrong host opregion base address, and couldn't
access it anymore.

This patch set emu_mask for igd_opregion register, so guest won't set
guest opregion base address to host.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
---
 hw/xen/xen_pt_config_init.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Anthony PERARD July 10, 2017, 2:46 p.m. UTC | #1
On Fri, Jul 07, 2017 at 12:07:58PM +0800, Xiong Zhang wrote:
> In igd passthrough environment, guest could only access opregion at the
> first bootup time. Once guest shutdown, later guest couldn't access 
> opregion anymore.
> This is because qemu set emulated guest opregion base address to host
> register. Later guest get a wrong host opregion base address, and couldn't
> access it anymore.
> 
> This patch set emu_mask for igd_opregion register, so guest won't set
> guest opregion base address to host.
> 
> Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

> ---
>  hw/xen/xen_pt_config_init.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
> index 6f18366..1f04ec5 100644
> --- a/hw/xen/xen_pt_config_init.c
> +++ b/hw/xen/xen_pt_config_init.c
> @@ -1535,6 +1535,7 @@ static XenPTRegInfo xen_pt_emu_reg_igd_opregion[] = {
>          .offset     = 0x0,
>          .size       = 4,
>          .init_val   = 0,
> +        .emu_mask   = 0xFFFFFFFF,
>          .u.dw.read   = xen_pt_intel_opregion_read,
>          .u.dw.write  = xen_pt_intel_opregion_write,
>      },
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index 6f18366..1f04ec5 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -1535,6 +1535,7 @@  static XenPTRegInfo xen_pt_emu_reg_igd_opregion[] = {
         .offset     = 0x0,
         .size       = 4,
         .init_val   = 0,
+        .emu_mask   = 0xFFFFFFFF,
         .u.dw.read   = xen_pt_intel_opregion_read,
         .u.dw.write  = xen_pt_intel_opregion_write,
     },