From xen-devel-bounces@lists.xen.org Wed Sep 18 09:10:02 2013 Received: (at maildrop) by bugs.xenproject.org; 18 Sep 2013 08:10:02 +0000 Received: from lists.xen.org ([50.57.142.19]) by bugs.xenproject.org with esmtp (Exim 4.80) (envelope-from ) id 1VMCpm-0005M2-7i for xen-devel-maildrop-Eithu9ie@bugs.xenproject.org; Wed, 18 Sep 2013 09:10:02 +0100 Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VMCn3-0000ln-Rt; Wed, 18 Sep 2013 08:07:13 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VMCn2-0000lg-Kd for xen-devel@lists.xenproject.org; Wed, 18 Sep 2013 08:07:12 +0000 Received: from [85.158.143.35:4066] by server-3.bemta-4.messagelabs.com id 40/8A-08835-F2F59325; Wed, 18 Sep 2013 08:07:11 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1379491630!4033152!1 X-Originating-IP: [130.57.49.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTMwLjU3LjQ5LjI4ID0+IDQ4MDU=\n X-StarScan-Received: X-StarScan-Version: 6.9.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14873 invoked from network); 18 Sep 2013 08:07:11 -0000 Received: from nat28.tlf.novell.com (HELO nat28.tlf.novell.com) (130.57.49.28) by server-12.tower-21.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 18 Sep 2013 08:07:11 -0000 Received: from EMEA1-MTA by nat28.tlf.novell.com with Novell_GroupWise; Wed, 18 Sep 2013 09:07:09 +0100 Message-Id: <52397B4C02000078000F43F7@nat28.tlf.novell.com> X-Mailer: Novell GroupWise Internet Agent 12.0.2 Date: Wed, 18 Sep 2013 09:07:08 +0100 From: "Jan Beulich" To: "Fabio Fantoni" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part6053063C.3__=" Cc: George Dunlap , Andrew Cooper , Keir Fraser , xen-devel Subject: Re: [Xen-devel] [PATCH] libxl: Remove qxl support for the 4.3 release X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part6053063C.3__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> On 16.09.13 at 16:10, Fabio Fantoni wrote: > Il 05/07/2013 18:59, George Dunlap ha scritto: >> On Wed, May 29, 2013 at 11:25 PM, Andrew Cooper >> wrote: >>> On 29/05/2013 08:43, Ian Campbell wrote: >>>> On Tue, 2013-05-28 at 19:09 +0100, Keir Fraser wrote: >>>>> On 28/05/2013 17:51, "Ian Jackson" = wrote: >>>>> >>>>>> George Dunlap writes ("[PATCH] libxl: Remove qxl support for the = 4.3 >>>>>> release"): >>>>>>> The qxl drivers for Windows and Linux end up calling instructions >>>>>>> that cannot be used for MMIO at the moment. Just for the 4.3 = release, >>>>>>> remove qxl support. >>>>>>> >>>>>>> This patch should be reverted as soon as the 4.4 development = window opens. >>>>>>> >>>>>>> The issue in question: >>>>>>> >>>>>>> (XEN) emulate.c:88:d18 bad mmio size 16 >>>>>>> (XEN) io.c:201:d18 MMIO emulation failed @ 0033:7fd2de390430: f3 = 0f 6f >>>>>>> 19 41 83 e8 403 >>>>>>> >>>>>>> The instruction in question is "movdqu (%rcx),%xmm3". Xen knows = how >>>>>>> to emulate it, but unfortunately %xmm3 is 16 bytes long, and the = interface >>>>>>> between Xen and qemu at the moment would appear to only allow MMIO = accesses >>>>>>> of 8 bytes. >>>>>>> >>>>>>> It's too late in the release cycle to find a fix or a workaround. >>>>>> Acked-by: Ian Jackson >>>>> It could be plumbed through hvmemul_do_io's multi-cycle read/write = logic, >>>>> and done as two 8-byte cycles to qemu. This would avoid bloating the = ioreq >>>>> structure that communicates to qemu. >>>> Are you proposing we do this for 4.3? I'm not sure how big that = change >>>> would be in terms of impact (just that one instruction, any 16 byte >>>> operand?). >>>> >>>> Of course even if we did this for 4.3 we don't know what the next = issue >>>> will be with QXL. >>>> >>>> Ian. >>> Furthermore, AVX instruction emulation would require support for = 32byte >>> operands. I don't see the multi-cycle logic scaling sensibly. >> Andrew, Keir, Jan, does any one of you fancy taking this on for 4.4? >=20 > Is there someone that can add full support for SSE on hvm domUs? > Thanks for any reply. Mind giving the attached patch a try? Jan --=__Part6053063C.3__= Content-Type: text/plain; name="x86-HVM-emul-split-large.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-HVM-emul-split-large.patch" --- a/xen/arch/x86/hvm/emulate.c=0A+++ b/xen/arch/x86/hvm/emulate.c=0A@@ = -438,6 +438,7 @@ static int __hvmemul_read(=0A {=0A struct vcpu *curr = =3D current;=0A unsigned long addr, reps =3D 1;=0A+ unsigned int = off, chunk =3D min_t(unsigned int, bytes, sizeof(long));=0A uint32_t = pfec =3D PFEC_page_present;=0A struct hvm_vcpu_io *vio =3D &curr->arch.= hvm_vcpu.hvm_io;=0A paddr_t gpa;=0A@@ -447,16 +448,38 @@ static int = __hvmemul_read(=0A seg, offset, bytes, &reps, access_type, = hvmemul_ctxt, &addr);=0A if ( rc !=3D X86EMUL_OKAY )=0A return = rc;=0A+ off =3D addr & (PAGE_SIZE - 1);=0A+ /*=0A+ * We only = need to handle sizes actual instruction operands can have. All=0A+ * = such sizes are either powers of 2 or the sum of two powers of 2. Thus=0A+ = * picking as initial chunk size the largest power of 2 not greater = than=0A+ * the total size will always result in only power-of-2 size = requests=0A+ * issued to hvmemul_do_mmio() (hvmemul_do_io() rejects = non-powers-of-2).=0A+ */=0A+ while ( chunk & (chunk - 1) )=0A+ = chunk &=3D chunk - 1;=0A+ if ( off + bytes > PAGE_SIZE )=0A+ = while ( off & (chunk - 1) )=0A+ chunk >>=3D 1;=0A =0A if ( = unlikely(vio->mmio_gva =3D=3D (addr & PAGE_MASK)) && vio->mmio_gva )=0A = {=0A- unsigned int off =3D addr & (PAGE_SIZE - 1);=0A if ( = access_type =3D=3D hvm_access_insn_fetch )=0A return X86EMUL_UN= HANDLEABLE;=0A gpa =3D (((paddr_t)vio->mmio_gpfn << PAGE_SHIFT) | = off);=0A- if ( (off + bytes) <=3D PAGE_SIZE )=0A- return = hvmemul_do_mmio(gpa, &reps, bytes, 0,=0A- = IOREQ_READ, 0, p_data);=0A+ while ( (off + chunk) <=3D PAGE_SIZE = )=0A+ {=0A+ rc =3D hvmemul_do_mmio(gpa, &reps, chunk, 0, = IOREQ_READ, 0, p_data);=0A+ if ( rc !=3D X86EMUL_OKAY || bytes = =3D=3D chunk )=0A+ return rc;=0A+ addr +=3D = chunk;=0A+ off +=3D chunk;=0A+ gpa +=3D chunk;=0A+ = p_data +=3D chunk;=0A+ bytes -=3D chunk;=0A+ = if ( bytes < chunk )=0A+ chunk =3D bytes;=0A+ }=0A = }=0A =0A if ( (seg !=3D x86_seg_none) &&=0A@@ -473,14 +496,32 @@ = static int __hvmemul_read(=0A return X86EMUL_EXCEPTION;=0A = case HVMCOPY_unhandleable:=0A return X86EMUL_UNHANDLEABLE;=0A- = case HVMCOPY_bad_gfn_to_mfn:=0A+ case HVMCOPY_bad_gfn_to_mfn:=0A = if ( access_type =3D=3D hvm_access_insn_fetch )=0A return = X86EMUL_UNHANDLEABLE;=0A- rc =3D hvmemul_linear_to_phys(=0A- = addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);=0A- if ( rc !=3D = X86EMUL_OKAY )=0A- return rc;=0A- return hvmemul_do_mmio(= gpa, &reps, bytes, 0, IOREQ_READ, 0, p_data);=0A+ rc =3D hvmemul_lin= ear_to_phys(addr, &gpa, chunk, &reps, pfec,=0A+ = hvmemul_ctxt);=0A+ while ( rc =3D=3D X86EMUL_OKAY )=0A+ = {=0A+ rc =3D hvmemul_do_mmio(gpa, &reps, chunk, 0, IOREQ_READ= , 0, p_data);=0A+ if ( rc !=3D X86EMUL_OKAY || bytes =3D=3D = chunk )=0A+ break;=0A+ addr +=3D chunk;=0A+ = off +=3D chunk;=0A+ p_data +=3D chunk;=0A+ = bytes -=3D chunk;=0A+ if ( bytes < chunk )=0A+ = chunk =3D bytes;=0A+ if ( off < PAGE_SIZE )=0A+ = gpa +=3D chunk;=0A+ else=0A+ {=0A+ rc = =3D hvmemul_linear_to_phys(addr, &gpa, chunk, &reps, pfec,=0A+ = hvmemul_ctxt);=0A+ off =3D = 0;=0A+ }=0A+ }=0A+ return rc;=0A case = HVMCOPY_gfn_paged_out:=0A return X86EMUL_RETRY;=0A case = HVMCOPY_gfn_shared:=0A@@ -537,6 +578,7 @@ static int hvmemul_write(=0A = container_of(ctxt, struct hvm_emulate_ctxt, ctxt);=0A struct vcpu = *curr =3D current;=0A unsigned long addr, reps =3D 1;=0A+ unsigned = int off, chunk =3D min_t(unsigned int, bytes, sizeof(long));=0A = uint32_t pfec =3D PFEC_page_present | PFEC_write_access;=0A struct = hvm_vcpu_io *vio =3D &curr->arch.hvm_vcpu.hvm_io;=0A paddr_t gpa;=0A@@ = -546,14 +588,30 @@ static int hvmemul_write(=0A seg, offset, = bytes, &reps, hvm_access_write, hvmemul_ctxt, &addr);=0A if ( rc !=3D = X86EMUL_OKAY )=0A return rc;=0A+ off =3D addr & (PAGE_SIZE - = 1);=0A+ /* See the respective comment in __hvmemul_read(). */=0A+ = while ( chunk & (chunk - 1) )=0A+ chunk &=3D chunk - 1;=0A+ if ( = off + bytes > PAGE_SIZE )=0A+ while ( off & (chunk - 1) )=0A+ = chunk >>=3D 1;=0A =0A if ( unlikely(vio->mmio_gva =3D=3D (addr & = PAGE_MASK)) && vio->mmio_gva )=0A {=0A- unsigned int off =3D = addr & (PAGE_SIZE - 1);=0A gpa =3D (((paddr_t)vio->mmio_gpfn << = PAGE_SHIFT) | off);=0A- if ( (off + bytes) <=3D PAGE_SIZE )=0A- = return hvmemul_do_mmio(gpa, &reps, bytes, 0,=0A- = IOREQ_WRITE, 0, p_data);=0A+ while ( (off + chunk) = <=3D PAGE_SIZE )=0A+ {=0A+ rc =3D hvmemul_do_mmio(gpa, = &reps, chunk, 0, IOREQ_WRITE, 0, p_data);=0A+ if ( rc !=3D = X86EMUL_OKAY || bytes =3D=3D chunk )=0A+ return rc;=0A+ = addr +=3D chunk;=0A+ off +=3D chunk;=0A+ gpa = +=3D chunk;=0A+ p_data +=3D chunk;=0A+ bytes -=3D = chunk;=0A+ if ( bytes < chunk )=0A+ chunk =3D = bytes;=0A+ }=0A }=0A =0A if ( (seg !=3D x86_seg_none) = &&=0A@@ -569,12 +627,29 @@ static int hvmemul_write(=0A case HVMCOPY_un= handleable:=0A return X86EMUL_UNHANDLEABLE;=0A case HVMCOPY_bad= _gfn_to_mfn:=0A- rc =3D hvmemul_linear_to_phys(=0A- = addr, &gpa, bytes, &reps, pfec, hvmemul_ctxt);=0A- if ( rc !=3D = X86EMUL_OKAY )=0A- return rc;=0A- return hvmemul_do_mmio(= gpa, &reps, bytes, 0,=0A- IOREQ_WRITE, 0, = p_data);=0A+ rc =3D hvmemul_linear_to_phys(addr, &gpa, chunk, = &reps, pfec,=0A+ hvmemul_ctxt);=0A+ = while ( rc =3D=3D X86EMUL_OKAY )=0A+ {=0A+ rc =3D = hvmemul_do_mmio(gpa, &reps, chunk, 0, IOREQ_WRITE, 0, p_data);=0A+ = if ( rc !=3D X86EMUL_OKAY || bytes =3D=3D chunk )=0A+ = break;=0A+ addr +=3D chunk;=0A+ off +=3D chunk;=0A+ = p_data +=3D chunk;=0A+ bytes -=3D chunk;=0A+ = if ( bytes < chunk )=0A+ chunk =3D bytes;=0A+ = if ( off < PAGE_SIZE )=0A+ gpa +=3D chunk;=0A+ = else=0A+ {=0A+ rc =3D hvmemul_linear_to_phys(addr= , &gpa, chunk, &reps, pfec,=0A+ = hvmemul_ctxt);=0A+ off =3D 0;=0A+ }=0A+ = }=0A+ return rc;=0A case HVMCOPY_gfn_paged_out:=0A = return X86EMUL_RETRY;=0A case HVMCOPY_gfn_shared:=0A --=__Part6053063C.3__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part6053063C.3__=--