Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1574126pxa; Thu, 20 Aug 2020 15:05:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybMUyfcB+B2Hryn6budwmlDLYo3oS7VvNz9LYm42wzLHdJ0QzlmiKZB7lp8j44YyD04QP0 X-Received: by 2002:a50:e0cf:: with SMTP id j15mr656578edl.285.1597961131687; Thu, 20 Aug 2020 15:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597961131; cv=none; d=google.com; s=arc-20160816; b=tSjS1YZ6nQiLXgpMR/wRmgCoaSo5dAqwNkkTRa4r4HS8Oz5uw/PRoQ14NL49kNRjxD UfvrBNAU7QFWY12hl7Hl46AIAGfCpMpMPl1i3d2UZyafbc9NA0Y/9siHIwEw24j6lGd9 /wOfTC/12MEU3LsiJWgGMmH63HKlp815xk8jTbwhM8o7I359XxofoDpIkWqBaJ7X6KJ1 kiUSrTUCYBSaM8yKtiyO6v20uiNsOGlsvLY61iud+N+op98V+YNv9awrKV/VPyP6D8wp aSf3FHpqfffRts/pJg6WtjNiwPliKX/oBusyYBc3MBJiTFcoSLSN9AK1pvcgzS/JtvsJ l0Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JYwHUMqrgisA2MC9phgyUn1/pNwWsiB0gxz1VRA/k7U=; b=vtoeU5zja5geIQEhNdcWCa1IMojn1PeljlbQEMC/EOKvRDj9LS/M5Esz3Po2sCwbhe dYMugSEaKhpHtOvznKaYR4l7rg65DYck5hFKvgBs/JpZgOwb+X1sMs0pwZZQ8gUzD5lg YD86c2/JJCoi/g6FgCjqDXwyzUY5Wfdk6PhXnLWO3kkPRGqwfFgjLR4njTSr9olYSrE0 Kib2lOEv6hk61YN/lA7z3OKUDGEhRCGd8Az9X4sdw7PmQrUuTl9AjKBYZtBAx5/9tTmN HwmYF7bRCZRk/MPDztTSS5infPM7+ql3moD5b4Yi6h5UVQCWccDumTBiueCyFLmWaQRs WucQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qRTJ34s9; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si1959518ejd.324.2020.08.20.15.05.07; Thu, 20 Aug 2020 15:05:31 -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=@google.com header.s=20161025 header.b=qRTJ34s9; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbgHTVoL (ORCPT + 99 others); Thu, 20 Aug 2020 17:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgHTVoJ (ORCPT ); Thu, 20 Aug 2020 17:44:09 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E4FC061385 for ; Thu, 20 Aug 2020 14:44:08 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id a65so26104otc.8 for ; Thu, 20 Aug 2020 14:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JYwHUMqrgisA2MC9phgyUn1/pNwWsiB0gxz1VRA/k7U=; b=qRTJ34s9UkOAnZaN8ZPr0d9ptggsR0srmk4FHFiwxaPgrwPW65Uv4h8OJZMvJEcN4k atZXkG4wSxcl+XsWGOvXHY7lWD3jNyIpWol1leSAgdXjtxxffsJDaov4iQEjpoq1lf02 OePZRyyoMmNKPmwP4/WNNuafraSZD/dPy1S+zycbpE1tr8OkfpA3JtUqhBT8YJ1/MJA0 wplcl5+UQ8Y8vjlefu7xs+DRfdyS9fqSXXH9YnlYK3zHAtaROi2l1OzNOgnFjfGj+NI5 rtpSrST4mPzyNubWEsIrkhHCQa38sJr6cz/40TvVG/c0xfFAsO3fC8MtFvw24bxxLrXS Zurw== 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=JYwHUMqrgisA2MC9phgyUn1/pNwWsiB0gxz1VRA/k7U=; b=DcGiSwnG0h+VT4NEPBOfAUn+257zrTqx2l/OW289unYLmH+NuIzhtwNatHueaAQLow GzfGxElJgHbKMhvoC6XmV9qnAOOYtHg0KrJpvT5BELn2bVp0S0iKpfge3o6fW6THaqKx wh8h+5eGtyUcAEBjt11htr3oq1St6LBnMJcZ8dfga7ZKQy+pU9s+qdnmmNjO9CU05fIi +BQhoGhTa4GQEagPlt01OHGtmXn7IRauxsDbK2l9K/jQL4nAd2s0NnaGOfzoAbflYp6l IH9hK52tyT1GkyihJlZkbmfB1Bx7+/PwgmONpCyXkaCAAbYObBEwMqwFP9mURvjfwin+ JlPA== X-Gm-Message-State: AOAM532iaK5FD+UMbfVoj2qMxl+zyL3XC+kmLCdZoHWYKyMXrn1ITO3M Q6oug/JwxLV442SgUW9+MTtm3bPe/O0mcgdF05ldIA== X-Received: by 2002:a9d:65ca:: with SMTP id z10mr513440oth.295.1597959847966; Thu, 20 Aug 2020 14:44:07 -0700 (PDT) MIME-Version: 1.0 References: <20200820133339.372823-1-mlevitsk@redhat.com> <20200820133339.372823-5-mlevitsk@redhat.com> In-Reply-To: <20200820133339.372823-5-mlevitsk@redhat.com> From: Jim Mattson Date: Thu, 20 Aug 2020 14:43:56 -0700 Message-ID: Subject: Re: [PATCH v2 4/7] KVM: x86: allow kvm_x86_ops.set_efer to return a value To: Maxim Levitsky Cc: kvm list , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Ingo Molnar , Thomas Gleixner , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Sean Christopherson , Joerg Roedel , Wanpeng Li , Borislav Petkov , Vitaly Kuznetsov , Paolo Bonzini 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, Aug 20, 2020 at 6:34 AM Maxim Levitsky wrote: > > This will be used later to return an error when setting this msr fails. > > For VMX, it already has an error condition when EFER is > not in the shared MSR list, so return an error in this case. > > Signed-off-by: Maxim Levitsky > --- > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -1471,7 +1471,8 @@ static int set_efer(struct kvm_vcpu *vcpu, struct msr_data *msr_info) > efer &= ~EFER_LMA; > efer |= vcpu->arch.efer & EFER_LMA; > > - kvm_x86_ops.set_efer(vcpu, efer); > + if (kvm_x86_ops.set_efer(vcpu, efer)) > + return 1; This seems like a userspace ABI change to me. Previously, it looks like userspace could always use KVM_SET_MSRS to set MSR_EFER to 0 or EFER_SCE, and it would always succeed. Now, it looks like it will fail on CPUs that don't support EFER in hardware. (Perhaps it should fail, but it didn't before, AFAICT.)