Received: by 10.223.176.5 with SMTP id f5csp626323wra; Fri, 9 Feb 2018 04:44:04 -0800 (PST) X-Google-Smtp-Source: AH8x224UANLs2BsbWrd+v2gWKn7cAv5pItraW2j+9RlY4ep8YDA3lIIQgSpr2zS5rZEubS/arMfZ X-Received: by 2002:a17:902:6c:: with SMTP id 99-v6mr2472058pla.409.1518180244086; Fri, 09 Feb 2018 04:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518180244; cv=none; d=google.com; s=arc-20160816; b=aHKaN1F9QSgt6YVPojm4+doJmbqd+FkG88o4Qev59t5TVv9go3Y2fv6hbdmx+jwmtD 455oGf5e7m42ej5I8hqzQyGnw8VqyHs9L9W1py9RskGglfFJkLZ9Uax4BvUlKBZD0CYQ UYBynYojFKeiZ/Zvhh0RHl+d2KTpnvhR/vIbW5LPLUzCe638INybJhUy+LbEG5sOWTDS 1mE2gh3EIQAVOUu7OkHoDmRNyigUB99LxIZYMmvvWjl5hAbz+s408eULOhetxHfig3YI onLnd50SEQPnPLjLA/UN71a/LOQ6SUVZTDfCMjvIGu5AIHDAYN8wKNGPWHL0ZjYOOnkg /VSg== 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:from:references:cc:to:subject:arc-authentication-results; bh=R4X1GW44Usb0kqoRP8fdesEDRmcbtFEba9ThdzH6U2k=; b=CHpxj5gk96UHd1k3foa5U1HeyT2ByuUch+2N9m+reqAX0EO6gFzvlIlG38oiDZAFaG M/IzrkEZ0yIwAh/cbiMsyVbGsP1Ivk78BJs4EwwNAhFqKauLkiM+1VSPkynSOgbZ6N2R RVxGUE10MjetGkgGhp0j5K0Vc3o4pElCvpw1ZFoGzqdJWP0PmsV8Vg6VKRaO1yRrX02w hpH1x7ajDD83ySUDOxlJJZQSahAoVfJ/kzLGgdzPnRRpan1nRsYdAKqHgC2A+Aq4JjsL R4B9NwQovf4bpWNbz/WU12zs7NWhEF88Wdr/4u11JAitmNHLrZY5HsPLYB5Wz/9ravhL Z6NA== 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 b61-v6si1514305plc.265.2018.02.09.04.43.49; Fri, 09 Feb 2018 04:44:04 -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 S1751057AbeBIMm4 (ORCPT + 99 others); Fri, 9 Feb 2018 07:42:56 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58936 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750945AbeBIMmy (ORCPT ); Fri, 9 Feb 2018 07:42:54 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65A8EEAE8B; Fri, 9 Feb 2018 12:42:54 +0000 (UTC) Received: from [10.36.117.203] (ovpn-117-203.ams2.redhat.com [10.36.117.203]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32E5F101041E; Fri, 9 Feb 2018 12:42:53 +0000 (UTC) Subject: Re: [PATCH] KVM: X86: Fix SMRAM accessing even if VM is shutdown To: Xiao Guangrong , Wanpeng Li , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Dmitry Vyukov 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> From: Paolo Bonzini Message-ID: <0aedd0e5-f5eb-54d8-6f77-e7a12c65fed5@redhat.com> Date: Fri, 9 Feb 2018 13:42:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <9034fe13-26c4-ee72-5b94-19aa8fc11efc@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 09 Feb 2018 12:42:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 09 Feb 2018 12:42:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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