Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp271232ybg; Mon, 1 Jun 2020 00:30:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvq1iahrjaEYHi6dkv4vE+biXnkOOnPK726z+F2IM4e8u5uzkaJjTqGxMNTZwnfA6aRDQD X-Received: by 2002:a50:e04c:: with SMTP id g12mr20363141edl.74.1590996620900; Mon, 01 Jun 2020 00:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590996620; cv=none; d=google.com; s=arc-20160816; b=xd2tImJyKZvyW064bWuDU+N+90225Fy+54tv5RPR1xSy1eiULj/iMuV//FRzWBx6/c fiThkcvbVAXyQhesj6FqTwGTcwa256ICFWECyqgjBme+Soz9pYf24qENG+ZeeRJQyYgN AOcmcdQGW1ypFZ9dolz7J8U1my3aWS2GLa3+gw36flbCzhFVdqKRw9b+zkxCl+wOKdFX fPQvuDs5aLHof/tf7ZxuPpx5/aO2/SxUH6owZLUNVOWPzH7CNYh0+0+nZ+TxxzG+487T XesB8TuA5L6s896DgEKFSE7ubDvIYssixFEiS8HWYREnUxwIgRo2spDbVBjuA0yxV/+2 KRYQ== 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:to:subject:dkim-signature; bh=rBGnBe9nAKzVkNp1oiiFdwiEMaoCXpO5GvmbNaHYZEA=; b=uxEIBRk6fd6qYFiuLjw4be2Zs3XoubfMZkeR9ElSNP/1luN0EivPPXaQBtXgaUm48r vu1zrL0oyEnM81J+49yVyOBR8ORDqSCfedBCCFb+s+noxbkb48hldexORj5yiSUevPXf gG5XZSdZr3kZ8tXWi0neGhZLggeJm7JIQXH2Cel16GQ0NqBzvdjrslsBbVmqcVe5n60N DEPhIoRdVEXD4/wnYcBs7shdVNCgPKyNQ5XKjDdSEjxg33rhxySB+d9Sj9jcFSW27hUl sKuQ8CQQg1QXwRAl83GjpxkF48S3i4CMsw76pIZ8BoC/QaH11y5sjA6/fuI0m2LO3NUJ TPWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TPAb6mEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cd26si10353131ejb.136.2020.06.01.00.29.58; Mon, 01 Jun 2020 00:30:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TPAb6mEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbgFAH2O (ORCPT + 99 others); Mon, 1 Jun 2020 03:28:14 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:59927 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgFAH2N (ORCPT ); Mon, 1 Jun 2020 03:28:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590996491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rBGnBe9nAKzVkNp1oiiFdwiEMaoCXpO5GvmbNaHYZEA=; b=TPAb6mEogHV8+LfFHYuWbjNvmV9d4ksqqjyF1uNY6Vc+nYTCls6/ZxjkZrxTxca6Grc45h /D4ghTlq4i6YJTziyMKZX+yJ9t3hDXFST8D2MzGWBdLl7mBiCEAd3xL3Clmud5H7IGYpOa bsPAUxMqb+vg2RZydnu3zkZTrOIJAJA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-301-LI45Nma3ORuBC8qQqJnGLg-1; Mon, 01 Jun 2020 03:28:09 -0400 X-MC-Unique: LI45Nma3ORuBC8qQqJnGLg-1 Received: by mail-wm1-f71.google.com with SMTP id g84so2347223wmf.4 for ; Mon, 01 Jun 2020 00:28:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rBGnBe9nAKzVkNp1oiiFdwiEMaoCXpO5GvmbNaHYZEA=; b=Get8yLt0M61j768u68kP1SCMkf6QbIeP12NPcQMkweZFHm9A34ob2J7x3RGqlxwrq4 6rjDx1N1zSzpCabA1gNNkfNyjywhkwOUmMGlefQa3xqlloA3SIwxNTeu0kkuRyXbApWv NgmRmsAcBlUUDRnhCSg7pykcMsTdLb3BCuRuHkTEDZwaimtBR4yjHFDdzPlUi9EkIJQc /zc2SydBpUE8RU+tslkE6/CpetJcAd+YC6G0UOYbq/1nzhQpSwEXgju1pJf1ac73ITJg KEe5UHOVeJxu0Q+u1UDtcO62vS66J6L+GtMy/pC4Sh15WFPMXxSFbgIgZarODZNrUuQQ FeSA== X-Gm-Message-State: AOAM5319fXw33epC7DVx7mSLMkEGXYvZnW904WpXe48AUJ6aiW+j40Us /CDkb6HXsCN/tRmgoxSBZL1p7TY/NyqxoPzKtfCDxTtdz9eYUYGomJnT7d6Jy9ok+ptxnF4cJXK hFfaLOn77N+IKIgjGkooTszfz X-Received: by 2002:a05:600c:1:: with SMTP id g1mr19913786wmc.142.1590996488357; Mon, 01 Jun 2020 00:28:08 -0700 (PDT) X-Received: by 2002:a05:600c:1:: with SMTP id g1mr19913773wmc.142.1590996488118; Mon, 01 Jun 2020 00:28:08 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:e044:3d2:1991:920c? ([2001:b07:6468:f312:e044:3d2:1991:920c]) by smtp.gmail.com with ESMTPSA id i74sm19645977wri.49.2020.06.01.00.28.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Jun 2020 00:28:07 -0700 (PDT) Subject: Re: [PATCH 25/30] KVM: nSVM: leave guest mode when clearing EFER.SVME To: Krish Sadhukhan , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20200529153934.11694-1-pbonzini@redhat.com> <20200529153934.11694-26-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <9319ccf9-c318-40e8-7d56-df0e32617430@redhat.com> Date: Mon, 1 Jun 2020 09:28:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/06/20 04:26, Krish Sadhukhan wrote: > On 5/29/20 8:39 AM, Paolo Bonzini wrote: >> According to the AMD manual, the effect of turning off EFER.SVME while a >> guest is running is undefined.  We make it leave guest mode immediately, >> similar to the effect of clearing the VMX bit in MSR_IA32_FEAT_CTL. > > I see that svm_set_efer() is called in enter_svm_guest_mode() and > nested_svm_vmexit(). In the VMRUN path, we have already checked > EFER.SVME in nested_vmcb_checks(). So if it was not set, we wouldn't > come to enter_svm_guest_mode(). Your fix is only for the #VMEXIT path > then ? No, it's for KVM_SET_MSR. Paolo