Received: by 10.223.164.202 with SMTP id h10csp4966243wrb; Wed, 29 Nov 2017 15:12:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ6H+388UTjvqQOBcNkDznOv+MteaRO6GRdCLysh9dDHFBt3Sbvf0d4doOebj7YmPCBsbRF X-Received: by 10.159.194.1 with SMTP id x1mr471382pln.235.1511997130229; Wed, 29 Nov 2017 15:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511997130; cv=none; d=google.com; s=arc-20160816; b=WnpqwH/wx1I35ds83ppW8aDJm7kGBc9RbBqyHGK5YzFT47j0InTWq9pVBE49197eg6 AWwkFcjVEkdJyX3/9BY3IGYR3rxl/9b/nEttChofgNrpQQyuNab9RDciVfm91njjoC0r dv+vqsnKqONB2LyyEMMs9W+6X5OFO4w2ubOw6XodmuOFSAh41jd0PPx73uEwL0NRVmWN 0Z5EbXd0BUzg+UAjtTRTkDvGdwJdlQEEq2Y/rhFN97rua4OHhd4fTBrs1En/Z6A+ur06 zTrC1++Bp5UUUb3pfQhxPUD1An9Urjv/pUvlc29uHJmTF8FaESAjK4GMvFsB6c7aydHW 4ieg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3xMkEcjRFeE/kpYsd60QjSAkElp471IscJVuYp8xQW8=; b=XrajDk7khFavYvChMyUxFz2tbifJ5NSR+/sgJcAQfTSiTuS7+20wWhEKym2J5dVoVD cV+x8WNGlJjvrviKUPttAkfufrU53RtZthYl2RYYNNpY9otzvxe2rMsfKlE6g5eakG0D XjgCSeZLgQDRXukBxwXIWS9RTKxHr+5QfIsQLV2eszCB6dppVHaLn6OjdpRoSKMk16ay pH1zKsNq4z87ejLx19ogfkFqxUe9lF3ZxM7KQO0XMVLs8I9/+auGmh6PTMMat+QVgPtH Vin9ceGgWxkjra7C3wAPdY6O8ygS4E54sfCbfRVhesum9fl7Y+/1UR0tXMLrol/ZcuWd YGtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z11si2001882pgc.454.2017.11.29.15.11.56; Wed, 29 Nov 2017 15:12:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752860AbdK2XKv (ORCPT + 99 others); Wed, 29 Nov 2017 18:10:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57334 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbdK2XKu (ORCPT ); Wed, 29 Nov 2017 18:10:50 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B14C5D5E9; Wed, 29 Nov 2017 23:10:50 +0000 (UTC) Received: from localhost (ovpn-116-19.gru2.redhat.com [10.97.116.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id D39395D964; Wed, 29 Nov 2017 23:10:49 +0000 (UTC) Date: Wed, 29 Nov 2017 21:10:47 -0200 From: Eduardo Habkost To: Paolo Bonzini Cc: Wanpeng Li , "linux-kernel@vger.kernel.org" , kvm , yfu@redhat.com Subject: Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn Message-ID: <20171129231047.GD3037@localhost.localdomain> References: <1510307378-97452-1-git-send-email-pbonzini@redhat.com> <4ff4d2f3-439b-2a8f-ef89-b2a1984e809d@redhat.com> <20171129114411.GA16634@localhost.localdomain> <4a61fa0a-a4ca-4c06-63c9-2b940eac2601@redhat.com> <20171129184216.GC3037@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fnord: you can see the fnord User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 29 Nov 2017 23:10:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 29, 2017 at 11:47:14PM +0100, Paolo Bonzini wrote: > On 29/11/2017 19:42, Eduardo Habkost wrote: > > The reproducer (not a full test case) is quite simple, see patch below. > > Great, thanks. I assume that the patch doesn't fix it?!? I was so convinced that it was impossible for the patch to fix the problem, that I forgot to test it. :) I will test it tomorrow and let you know. > > Paolo > > > Now, I've noticed something interesting when running the > > reproducer: > > > > If the test_fetch_failure() call happens before we touch > > pci-testdev through *mem (like in the patch below), we get an > > emulation failure like the one Yanan saw: > > > > $ /usr/bin/qemu-system-x86_64 -nodefaults -device pc-testdev -device isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device pci-testdev -machine accel=kvm -kernel ./x86/emulator.flat # -initrd /tmp/tmp.RCPjppRp8i > > enabling apic > > paging enabled > > cr0 = 80010011 > > cr3 = 45e000 > > cr4 = 20 > > KVM internal error. Suberror: 1 > > emulation failure > > RAX=0000000000000000 RBX=0000000000000000 RCX=0000000000000000 RDX=0000000000000000 > > RSI=0000000000000000 RDI=0000000000000000 RBP=0000000000000000 RSP=0000000000000000 > > R8 =0000000000000000 R9 =0000000000000000 R10=0000000000000000 R11=0000000000000000 > > R12=0000000000000000 R13=0000000000000000 R14=0000000000000000 R15=0000000000000000 > > RIP=ffffffffffffc08a RFL=00010002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0 > > ES =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] > > CS =0008 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] > > SS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] > > DS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] > > FS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] > > GS =0010 0000000000454d60 ffffffff 00c09300 DPL=0 DS [-WA] > > LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT > > TR =0080 000000000041148a 0000ffff 00008b00 DPL=0 TSS64-busy > > GDT= 000000000041100a 0000047f > > IDT= 0000000000000000 00000fff > > CR0=80010011 CR2=ffffffffffffc08a CR3=000000000045e000 CR4=00000020 > > DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 > > DR6=00000000ffff0ff0 DR7=0000000000000400 > > EFER=0000000000000500 > > Code=?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? > -- Eduardo From 1585442432614519439@xxx Wed Nov 29 22:48:48 +0000 2017 X-GM-THRID: 1583672192246103487 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread