From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: X86: Fix SMRAM accessing even if VM is shutdown Date: Fri, 9 Feb 2018 13:42:51 +0100 Message-ID: <0aedd0e5-f5eb-54d8-6f77-e7a12c65fed5@redhat.com> References: <1517984706-47244-1-git-send-email-wanpengli@tencent.com> <233cfca3-971e-c3c2-f0fe-b50dd69d2546@redhat.com> <5664ca7f-f391-0301-3a0d-666b73f17b15@redhat.com> <9034fe13-26c4-ee72-5b94-19aa8fc11efc@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Dmitry Vyukov To: Xiao Guangrong , Wanpeng Li , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <9034fe13-26c4-ee72-5b94-19aa8fc11efc@gmail.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 09/02/2018 04:22, Xiao Guangrong wrote: >> > > That is a good question... :) > > This case (with KVM_MEMSLOT_INVALID is set) can be easily constructed, > userspace should avoid this case by itself (avoiding vCPU accessing the > memslot which is being updated). If it happens, it's a operation issue > rather than INTERNAL ERROR. > > Maybe treat it as MMIO accessing and return to userspace with MMIO_EXIT > is a better solution... Yeah, that's what emulation would do (except if it's an instruction fetch, which will cause emulation to fail). I think it's a bug in the non-EPT #PF case that we return with -EFAULT. Paolo