From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C63D6C2D0C8 for ; Thu, 26 Dec 2019 02:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98B08222D9 for ; Thu, 26 Dec 2019 02:35:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s17YA35e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726960AbfLZCfW (ORCPT ); Wed, 25 Dec 2019 21:35:22 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:44093 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbfLZCfW (ORCPT ); Wed, 25 Dec 2019 21:35:22 -0500 Received: by mail-ot1-f66.google.com with SMTP id h9so28265396otj.11; Wed, 25 Dec 2019 18:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wFW6PwbhpwDHaE85ZcsN3eRZyhhib4+0nJ3fxwBkdbQ=; b=s17YA35ez9d8oUT+5ziW2uwqnJZChzC2qjILhPLVrrr/W66l4jWJ4NtZlpatnZ7pq6 RZiXcd5CoW5OIxEcpjbLJ8M5b/EO/CUbGinvNb+HG3lqSRhHigsIFA4YhdTbgmmWNzAX 4fTRcKQD+SEFXBSz+WzxVfHxBkReFcIzvt1iP4s3xxWaGnuV/t7Z6FlvLHWzQsrKzs6V 0qjrxkspMs87NIsqAR+zCQrrIFXBogAfQ6IPBhHfJTyW31e6KV4WCVJryY8orNT4Xsy4 xzFtNagzYJ1INykIzBlMf85YX+ZGuijJ3iEUzf/hlYJy/RO2sBozaBb5Vjh1FVvNDWwo J7Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wFW6PwbhpwDHaE85ZcsN3eRZyhhib4+0nJ3fxwBkdbQ=; b=hAYD1/tSZruxEdLHoJnxgJ+Eam6ZRoYiuSTPl5tlz2/KVywfX1iPnd0CQUCprESKD7 0gboVF3i6ofzifTNIlU+FuB8W/EIqLZPkfLvX840BsTl8WMHa7/bDJ1u5rUzYQW+WE32 lZWUW8V1n8o/j8ZQ7Dn0kWvtYmwx53x1lQW7U8QukRFjdy49tfbgY+imuScQC0+CePlY 7dylBJrT4WGpceZgNDEX5cXsA3W9cDw+SqHsuivSs0kH71lFRrVhhiH/oxFd7ZK1uIyH q3ktxHVwfKSItzetVSgSiCz9qER/aTudALkt0hNOEyeAFxK5cV24PjggnwNKsKc09iJ1 jyYQ== X-Gm-Message-State: APjAAAXGuvcRleieqYhgjU1YrddORlJIesHuV4Rloll9yVbDKvZbLvZG G+XF+n6cv0JsqETFFPydavD35/N176h4KTfRln8= X-Google-Smtp-Source: APXvYqzjQ9A4fSZzWSQxhzMu/0DJgsol6AAfnQuDXNE+o0GkXwGevSZyeXV8daR4RwyxU5KmhpiLHYiJj//zCdFAWuo= X-Received: by 2002:a9d:3f61:: with SMTP id m88mr31944549otc.56.1577327721351; Wed, 25 Dec 2019 18:35:21 -0800 (PST) MIME-Version: 1.0 References: <5744632b88b44369a68c0b0704bfb48e@huawei.com> In-Reply-To: <5744632b88b44369a68c0b0704bfb48e@huawei.com> From: Wanpeng Li Date: Thu, 26 Dec 2019 10:35:10 +0800 Message-ID: Subject: Re: [PATCH] KVM: nvmx: retry writing guest memory after page fault injected To: linmiaohe Cc: Liran Alon , "pbonzini@redhat.com" , "rkrcmar@redhat.com" , "sean.j.christopherson@intel.com" , "vkuznets@redhat.com" , "wanpengli@tencent.com" , "jmattson@google.com" , "joro@8bytes.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "hpa@zytor.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Dec 2019 at 10:32, linmiaohe wrote: > > Hi, > > Liran Alon wrote: > >> On 25 Dec 2019, at 4:21, linmiaohe wrote: > >> > >> From: Miaohe Lin > >> > >> We should retry writing guest memory when > >> kvm_write_guest_virt_system() failed and page fault is injected in handle_vmread(). > >> > >> Signed-off-by: Miaohe Lin > > > >Patch fix seems correct to me: > >Reviewed-by: Liran Alon > > Thanks for your review. > > >However, I suggest to rephrase commit title & message as follows: > > > >""" > >KVM: nVMX: vmread should not set rflags to specify success in case of #PF > > > >In case writing to vmread destination operand result in a #PF, vmread should not call nested_vmx_succeed() to set rflags to specify success. Similar to as done in for VMPTRST (See handle_vmptrst()). > >""" > > Thanks for your sueestion, I would rephrase commit title & message accordingly. > > > > >In addition, it will be appreciated if you would also submit kvm-unit-test that verifies this condition. > > I'd like to submit kvm-unit-test that verifies this condition, but I am not familiar with the kvm-unit-test code yet and > also not in my recent todo list. So such a patch may come late. It would be appreciated too if you could submit this > kvm-unit-test patch. :) Hmm, did you verify your own patch? Please give the testcase.