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=-12.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 60F65C48BDF for ; Fri, 18 Jun 2021 10:32:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B3506124C for ; Fri, 18 Jun 2021 10:32:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233657AbhFRKen (ORCPT ); Fri, 18 Jun 2021 06:34:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45201 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233749AbhFRKeR (ORCPT ); Fri, 18 Jun 2021 06:34:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624012328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hfAvw0hgq0EhOtnnmtyXispMmzn0udfGL2kHrYegWv0=; b=AaZ4T/gKtA9YLc3UFA2R7YuDmiuLM8KOOmYzo2ljdS8Z0dRJ3OevZCDA6IzWdlnxhmyLX1 +hgQZuKlzDhHqzfNmGXNj6XQDgjhSecmEPUTNT6451DBr/7ghH8I9n50tVL0klSXrtz6dq ix/54dbkBLH7lMrJbfx53QAJCsfrJg0= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-537-oMgRDa_7OdK-sOXH8kRaqA-1; Fri, 18 Jun 2021 06:32:07 -0400 X-MC-Unique: oMgRDa_7OdK-sOXH8kRaqA-1 Received: by mail-ej1-f69.google.com with SMTP id lt4-20020a170906fa84b0290481535542e3so1881538ejb.18 for ; Fri, 18 Jun 2021 03:32:06 -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:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hfAvw0hgq0EhOtnnmtyXispMmzn0udfGL2kHrYegWv0=; b=Ki1d3V3T1syhnA42zY2HLKCFIieo2mqJfp9pK6rPXJ97Md51Dw5F1gXAr4zJlNtBkK 1mREyfLs1w7ijpJ656pC3ieSXzSwZSlKtoIGLVDZGS26RtnPgm/U3ktIShM2PijZOLIj 5uJh/O7oheNFIGDJf6A6T1NV6lziwPsK7/VTHLRWaHBUr78oQh8puLNh28Niuek09XwR 7YvrZv+Gk0zZ5o0/8XJrEDBhJfRu/w/qbF4C4zXmAxrgoyH1KfujBN5xjMlzgX0MRECE q0bsCaR50QrcCx06TfwGKzWwLP8NQ4i9mam4+rChEz2f9UIqBFAuWpB4pONiatfYbm45 9fqg== X-Gm-Message-State: AOAM5317E/oU+4b+VLO3HunKO/JUgeBRBXpE6UFTzHyUyfODeNYWg/Mu dvcIgkSeMkMk6xMy9PEtNnVKGwnPRqODsygdHTgLiQXFGYT6/JEfHygzuHGCKy37K4kZFOOFqrw MrTcBtrt4bd+f+KgCOenMgVAsczuoKasaPVIkmwsIA+LXyusy1HUN/U2esjVEn3K24V9gjGmrnT Ac X-Received: by 2002:a17:906:6d59:: with SMTP id a25mr2090262ejt.83.1624012325584; Fri, 18 Jun 2021 03:32:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxSSyuG/lp7VKy9v50YMmn7y8mIz2ZyCGQj3rEnS1eNbeDJb9F7YHyHC8OBkKI0VatG7L01w== X-Received: by 2002:a17:906:6d59:: with SMTP id a25mr2090238ejt.83.1624012325419; Fri, 18 Jun 2021 03:32:05 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id o5sm5925198edq.8.2021.06.18.03.32.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Jun 2021 03:32:04 -0700 (PDT) Subject: Re: [PATCH 0/4] KVM: x86: Require EFER.NX support unless EPT is on To: Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210615164535.2146172-1-seanjc@google.com> From: Paolo Bonzini Message-ID: <388739c8-6881-8fa7-2025-53b9a464c4cb@redhat.com> Date: Fri, 18 Jun 2021 12:32:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210615164535.2146172-1-seanjc@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/06/21 18:45, Sean Christopherson wrote: > KVM has silently required EFER.NX support for shadow paging for well over > a year, and for NPT for roughly the same amount of time. Attempting to > run any VM with shadow paging on a system without NX support will fail due > to invalid state, while enabling nx_huge_pages with NPT and no NX will > explode due to setting a reserved bit in the page tables. > > I really, really wanted to require NX across the board, because the lack > of bug reports for the shadow paging change strongly suggests no one is > running KVM on a CPU that truly doesn't have NX. But, Intel CPUs let > firmware disable NX via MISC_ENABLES, so it's plausible that there are > users running KVM with EPT and no NX. > > Sean Christopherson (4): > KVM: VMX: Refuse to load kvm_intel if EPT and NX are disabled > KVM: SVM: Refuse to load kvm_amd if NX support is not available > KVM: x86: WARN and reject loading KVM if NX is supported but not > enabled > KVM: x86: Simplify logic to handle lack of host NX support > > arch/x86/kvm/cpuid.c | 13 +++++-------- > arch/x86/kvm/svm/svm.c | 13 ++++++++++--- > arch/x86/kvm/vmx/vmx.c | 6 ++++++ > arch/x86/kvm/x86.c | 3 +++ > 4 files changed, 24 insertions(+), 11 deletions(-) > Queued 1-3, thanks. Paolo