From patchwork Tue Jun 17 11:28:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 360447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 950A9140079; Tue, 17 Jun 2014 21:28:56 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1WwrZL-0008QF-6D; Tue, 17 Jun 2014 11:28:51 +0000 Received: from mail.tpi.com ([74.45.170.26]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1WwrZE-0008Oc-RF for kernel-team@lists.ubuntu.com; Tue, 17 Jun 2014 11:28:45 +0000 Received: from [10.0.2.8] (host-174-45-39-7.hln-mt.client.bresnan.net [174.45.39.7]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mail.tpi.com (Postfix) with ESMTP id 3F7B6359780; Tue, 17 Jun 2014 04:29:04 -0700 (PDT) Message-ID: <53A02669.5080608@canonical.com> Date: Tue, 17 Jun 2014 05:28:41 -0600 From: Tim Gardner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Stefan Bader Subject: APPLIED: ACK/wcmnt: [precise] [PATCH] SRU: KVM: x86: emulate movdqa References: <539D8970.3080704@swortex.com> <539F08F7.50803@canonical.com> In-Reply-To: <539F08F7.50803@canonical.com> Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 1c11b37669a5209bd11fb857a103634afef971e8 (KVM: x86 emulator: add support for vector alignment) 49597d8116ad70aabb598e606b218ddd9315b0af (KVM: x86: emulate movdqa) - -- Tim Gardner tim.gardner@canonical.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCgAGBQJToCZpAAoJED12yEX6FEfKfzAP/Ayk6c2YRUjtKXgUBpIgxXy6 y1HgAsz/JguyTWJpX3SwTWTH33PmR075hWvtDUZxsH2bO1gHOK3W01beI4U6X7JU /JLD5+usZ4fl45PWuvqu1q1Ojz7jbgFoxrQJYL7UwvffVl6VF5JvowxMupQ++BH6 A/f3/mjLMn19+aoHHBMDX9+6D3xz7FXzgmMFbiyG+qX336WRFLSbLao7LNDPg3oK cv4ASfM55rnYRjnbGq0HrHE0P+KQ+bIZzL5hp0kEimysGfwDUG5VVGSiKoRxi1SS 5U1dzo5wCrrKrjaagT2sfMG0GzkGQOaDRnx/sNltadpraw/CKL7EbeOrD03zCMJj kEshM+z1cj3AOEL8NVPCRDawGIzENZANvQrgUokKmhOJAsM5TA40guA4ezGvLMOr aP/zbJswDnYkXwry41KEdQKWT8Yxq8zuev/aCNJgjidJ8SIWkVKyW9qX4U1ta1Ll cpCHeVrUBeGXFYXX4rh8m26IQUVtaAVnkEz0Pz1ig9ehRWLzAm6Cgeft5455z5Q0 pCZFlg2kX3emYvtCAUAWraxP3stCqAXkQkC2Z/4GmjFVFTl1QSUAmd9oxyOqWiiw w6E/CzqFlaIrvo1bVkR9MvsB6YFIXyRDXAT/mvXl1YTcARq9Vth9TBPnCys1YnQN agTOOB1LM3LCJCV8dqu1 =kh+2 -----END PGP SIGNATURE----- From 7466b7472743a42ba139723d3018fc55476ce40d Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Mon, 9 Apr 2012 18:40:00 +0300 Subject: [PATCH 2/2] KVM: x86: emulate movdqa BugLink: http://bugs.launchpad.net/bugs/1330177 An Ubuntu 9.10 Karmic Koala guest is unable to boot or install due to missing movdqa emulation: kvm_exit: reason EXCEPTION_NMI rip 0x7fef3e025a7b info 7fef3e799000 80000b0e kvm_page_fault: address 7fef3e799000 error_code f kvm_emulate_insn: 0:7fef3e025a7b: 66 0f 7f 07 (prot64) movdqa %xmm0,(%rdi) [avi: mark it explicitly aligned] Signed-off-by: Stefan Hajnoczi Signed-off-by: Avi Kivity Signed-off-by: Marcelo Tosatti (cherry picked from commit 49597d8116ad70aabb598e606b218ddd9315b0af) Acked-by: Stefan Bader Signed-off-by: Anton Nayshtut Signed-off-by: Tim Gardner --- arch/x86/kvm/emulate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ef83fa4..92b93d7 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2703,7 +2703,7 @@ static int em_rdtsc(struct x86_emulate_ctxt *ctxt) static int em_mov(struct x86_emulate_ctxt *ctxt) { - ctxt->dst.val = ctxt->src.val; + memcpy(ctxt->dst.valptr, ctxt->src.valptr, ctxt->op_bytes); return X86EMUL_CONTINUE; } @@ -2731,12 +2731,6 @@ static int em_mov_sreg_rm(struct x86_emulate_ctxt *ctxt) return load_segment_descriptor(ctxt, sel, ctxt->modrm_reg); } -static int em_movdqu(struct x86_emulate_ctxt *ctxt) -{ - memcpy(&ctxt->dst.vec_val, &ctxt->src.vec_val, ctxt->op_bytes); - return X86EMUL_CONTINUE; -} - static int em_invlpg(struct x86_emulate_ctxt *ctxt) { int rc; @@ -3190,7 +3184,7 @@ static struct opcode group11[] = { }; static struct gprefix pfx_0f_6f_0f_7f = { - N, N, N, I(Sse | Unaligned, em_movdqu), + N, I(Sse | Aligned, em_mov), N, I(Sse | Unaligned, em_mov), }; static struct opcode opcode_table[256] = { -- 1.9.1