Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2242860imm; Thu, 20 Sep 2018 09:54:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYA9Iekj7MsXm1fGhdicx88AGW4OYJqvJlX7oWEqcKQQc6d7sbhrub/tJLJGL70XScOPiMZ X-Received: by 2002:a65:60cf:: with SMTP id r15-v6mr38104852pgv.41.1537462460632; Thu, 20 Sep 2018 09:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537462460; cv=none; d=google.com; s=arc-20160816; b=uU4WvT0buiZtX9HGkEkcQulKurtqftaCUbNSKACpYk6OsLJQdlxE0lqbD1EuOPBzSb BLPr3Z+n83ygmXTK822j4JO1k6b5g01m4RZfTnsVd0wsZpSy5ltN0aDwv0hpLv8yqxrj 6zJ1lj7kQbFIorNbTd1cw1eHnra/1NZUiW4OcEN+3MSWR59DBy8AWACyWdbF6+q6rZBA q/AP3fVwGSRCJZk7faOlPQxdItS8xF2G07IIsM9MnmpgHaWY1GvqjWn9gFkQar2JT/L1 7XPQwayyYdxXgdFgu5P6Y3pgJKQ4nV5u8Ptix0zLMQMNMSNQOek9N0Hllm7qzDTm5DGk Arug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:references:cc:to:from:subject :dkim-signature; bh=PjR3RWbux8VhpN6TnGbyCACKkFB45t0D6se3yoin9WQ=; b=bfS1dqwUYu2StYKh5/e2ODby44eHxvkURYntsvXiNK1kLuvhwIOc/7m3qLs6uMdaG5 DFOvlmERydWNFQeooVFb+C+G9JLrvDiXkUoztSVYVsSzjP4F7LNSIrnscXRcD8/JQuxL 0mawmf+8797c2V4kOZXHcs16tUHG/xfaFv0+xknhOluWS8U+HNYs3eH7o8e8+wG7g7Kq 4PsTE2+OtOdSytSeot9PEKn78Z4CWbJSUW5cCjpMyqPRPApMPawDz89xgvkhlMuM+X+l +0LzaqxYsoZjtk9g6HrOieUcrY2i/tA2FmU+a6kJL8t/0RGUOHKdnAPabfG8LprC8k+A 0M9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=o+vu5Dr4; 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 z73-v6si23546610pgd.471.2018.09.20.09.54.04; Thu, 20 Sep 2018 09:54:20 -0700 (PDT) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=o+vu5Dr4; 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 S1730919AbeITWiW (ORCPT + 99 others); Thu, 20 Sep 2018 18:38:22 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40028 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbeITWiW (ORCPT ); Thu, 20 Sep 2018 18:38:22 -0400 Received: by mail-wr1-f65.google.com with SMTP id y8-v6so6475586wrh.7; Thu, 20 Sep 2018 09:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PjR3RWbux8VhpN6TnGbyCACKkFB45t0D6se3yoin9WQ=; b=o+vu5Dr42h0EnIUiBTueZleRUcxzsqEhzf6bObOrRy9PUy7iIXRPklrYlUKAnpF4td tjRDhdW5w8MmdOa5g7aSdR7anRCdWaSXdqNOAn86S6G5WYqarM897+EsuoCXqGc6Zj9M zm9K/YbcXM4g6lWc/LZBx1DnKGYiGmP2yMsmQ69vXPFsL98GVhBGyqJAWYt7SqCqx45e iIS2WxAWbF1AwJ+SpbOnE4In0W0caAIEekPax655Sw4FE78gtBtXU23yrLqqrkQBH+6a bLEdJ1pe/1gtQL6won+NQOA5tX5zXBWvqMU5TE2ntUucXRHZcjD4TZnV/AIdPaaJw47m YbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=PjR3RWbux8VhpN6TnGbyCACKkFB45t0D6se3yoin9WQ=; b=IbEZJbyaRitv+bAISR19BLNYZpO596aYFaYso5ejlt7AIx+sRtO38Ijdjftg9TQa7e SJDAuhG0AaMuD4MjEnOG/zU3E1grYUhtNkjOLdxooDZUn/rIb0+kQFGk84l/dbv0Na0N vROZKb5b8vACN0vROpKnkrxHjvSgr3PUf2vheJnE3kTJqUq2sZWsj3ZPgy6USDmQ5zrP eVXJvS88p0Y3KDHZNvWkfKiVrH3to2VAqrctBmI4SUDN/rpJyPz1kGEONIQ4zB3TzlbC fcqEFYpX+p9KbXfvW7/lwYP6jOvS6O0GfGZV28ThIbe9z6sMepWOnkRQDbt0ebcbWoxx 3lNw== X-Gm-Message-State: APzg51ACq9ba1Y4eYNWcH4Jtrt2Je8pv9r1CykTxvanWUnsNW58Sqqyf kmy7OD9JxX6igv/sy/7YleOMeiWI X-Received: by 2002:adf:d110:: with SMTP id a16-v6mr34866389wri.17.1537462437160; Thu, 20 Sep 2018 09:53:57 -0700 (PDT) Received: from [192.168.10.165] (94-36-187-248.adsl-ull.clienti.tiscali.it. [94.36.187.248]) by smtp.googlemail.com with ESMTPSA id 127-v6sm3362421wmb.30.2018.09.20.09.53.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Sep 2018 09:53:56 -0700 (PDT) Subject: Re: [PATCH] KVM: x86: fix failure of injecting exceptions in x86_emulate_instruction From: Paolo Bonzini To: Yi Wang Cc: rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, xu.xi8@zte.com.cn References: <1536220964-8412-1-git-send-email-wang.yi59@zte.com.cn> <9835d255-dd9a-222b-f4a2-93611175b326@redhat.com> Openpgp: preference=signencrypt Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd wEv1/Aj1DgUH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0hUQE4r8ZbGRLn52bEzaIPgl1p/adKfeOUeMReg/CkyzQpmyB1TSk8lDMxQ zCYHXAzwnGi8WU9iuE1P0wARAQABwsEzBBgBAgAJBQJUQnHuAhsMAAoJEH4VEAzNNmmxp1EO oJy0uZggJm7gZKeJ7iUpeX4eqUtqelUw6gU2daz2hE/jsxsTbC/w5piHmk1H1VWDKEM4bQBT uiJ0bfo55SWsUNN+c9hhIX+Y8LEe22izK3w7mRpvGcg+/ZRG4DEMHLP6JVsv5GMpoYwYOmHn plOzCXHvmdlW0i6SrMsBDl9rw4AtIa6bRwWLim1lQ6EM3PWifPrWSUPrPcw4OLSwFk0CPqC4 HYv/7ZnASVkR5EERFF3+6iaaVi5OgBd81F1TCvCX2BEyIDRZLJNvX3TOd5FEN+lIrl26xecz 876SvcOb5SL5SKg9/rCBufdPSjojkGFWGziHiFaYhbuI2E+NfWLJtd+ZvWAAV+O0d8vFFSvr iy9enJ8kxJwhC0ECbSKFY+W1eTIhMD3aeAKY90drozWEyHhENf4l/V+Ja5vOnW+gCDQkGt2Y 1lJAPPSIqZKvHzGShdh8DduC0U3xYkfbGAUvbxeepjgzp0uEnBXfPTy09JGpgWbg0w91GyfT /ujKaGd4vxG2Ei+MMNDmS1SMx7wu0evvQ5kT9NPzyq8R2GIhVSiAd2jioGuTjX6AZCFv3ToO 53DliFMkVTecLptsXaesuUHgL9dKIfvpm+rNXRn9wAwGjk0X/A== Message-ID: Date: Thu, 20 Sep 2018 18:53:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9835d255-dd9a-222b-f4a2-93611175b326@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/09/2018 18:30, Paolo Bonzini wrote: > On 06/09/2018 10:02, Yi Wang wrote: >> In order to fix a page table walk issue, commit 6ea6e84309ca >> ("KVM: x86: inject exceptions produced by x86_decode_insn") check >> if variable ctxt->have_exception true and inject the exception. >> Unfortunately, ctxt->have_exception is set to true only in function >> x86_emulate_insn(), which won't be called before invoking >> inject_emulated_exception() in the 6ea6e84309ca. >> This patch fix this issue. >> >> Signed-off-by: Yi Wang >> Reviewed-by: Xi Xu > > Queued, thanks. Do you have a testcase for this? Unqueued, sorry. The hypercall test from kvm-unit-tests fails. A VMCALL on the "edge" of canonical address space, i.e. at 0x7ffffffffffd, raises a general protection fault before this patch and a double fault afterwards. Paolo