Received: from eggs.gnu.org ([2001:4830:134:3::10]:58265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5vAn-0001Yo-Hv for qemu-devel@nongnu.org; Mon, 07 Dec 2015 07:45:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5vAj-0007ZV-Bq for qemu-devel@nongnu.org; Mon, 07 Dec 2015 07:45:45 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:2762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5vAj-0007Yv-2P for qemu-devel@nongnu.org; Mon, 07 Dec 2015 07:45:41 -0500 Date: Mon, 7 Dec 2015 12:45:10 +0000 From: Stefano Stabellini In-Reply-To: <56548D8402000078000B8840@prv-mh.provo.novell.com> Message-ID: References: <56548BD202000078000B881F@prv-mh.provo.novell.com> <56548D8402000078000B8840@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: Re: [Qemu-devel] [PATCH RFC v2 4/4] xen/MSI: re-expose masking capability List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Beulich Cc: xen-devel , qemu-devel@nongnu.org, Stefano Stabellini On Tue, 24 Nov 2015, Jan Beulich wrote: > Now that the hypervisor intercepts all config space writes and monitors > changes to the masking flags, this undoes the main effect of the > XSA-129 fix, exposing the masking capability again to guests. > > Signed-off-by: Jan Beulich > --- > TBD: We probably need to deal with running on an older hypervisor. I > can't, however, immediately see a way for qemu to find out. Actually QEMU has already an infrastructure to detect the hypervisor version at compile time, see include/hw/xen/xen_common.h. You could #define the right emu_mask depending on the hypervisor. > --- a/hw/xen/xen_pt_config_init.c > +++ b/hw/xen/xen_pt_config_init.c > @@ -1333,7 +1333,7 @@ static XenPTRegInfo xen_pt_emu_reg_msi[] > .init_val = 0x0000, > .res_mask = 0xFE00, > .ro_mask = 0x018E, > - .emu_mask = 0x017E, > + .emu_mask = 0x007E, > .init = xen_pt_msgctrl_reg_init, > .u.w.read = xen_pt_word_reg_read, > .u.w.write = xen_pt_msgctrl_reg_write, > @@ -1387,8 +1387,8 @@ static XenPTRegInfo xen_pt_emu_reg_msi[] > .offset = PCI_MSI_MASK_32, > .size = 4, > .init_val = 0x00000000, > - .ro_mask = 0xFFFFFFFF, > - .emu_mask = 0xFFFFFFFF, > + .ro_mask = 0x00000000, > + .emu_mask = 0x00000000, > .init = xen_pt_mask_reg_init, > .u.dw.read = xen_pt_long_reg_read, > .u.dw.write = xen_pt_long_reg_write, > @@ -1398,8 +1398,8 @@ static XenPTRegInfo xen_pt_emu_reg_msi[] > .offset = PCI_MSI_MASK_64, > .size = 4, > .init_val = 0x00000000, > - .ro_mask = 0xFFFFFFFF, > - .emu_mask = 0xFFFFFFFF, > + .ro_mask = 0x00000000, > + .emu_mask = 0x00000000, > .init = xen_pt_mask_reg_init, > .u.dw.read = xen_pt_long_reg_read, > .u.dw.write = xen_pt_long_reg_write, > > > >