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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 3F01FC4363A for ; Fri, 23 Oct 2020 17:43:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0A3821582 for ; Fri, 23 Oct 2020 17:43:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KIE4pJRH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751733AbgJWRnY (ORCPT ); Fri, 23 Oct 2020 13:43:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34231 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S462052AbgJWRnY (ORCPT ); Fri, 23 Oct 2020 13:43:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603475002; 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=+Zu0LYwVSmEJWNT4NqggQbfAbgnLBnqlkd3v5H5H25w=; b=KIE4pJRHNWCgVK+SvyR8zeX5o5CYiOjapBmdiPtSJLMMLWZ81ugZ2JvYtTPH3XrdsxkIQR 5L4/PbiyKaX0wyZoW0EThoVGZcSAcaE8apCiOO66Ifr+fnkBILnG6W1UbfjRGSU0Ue/Yhr ZzbrKe+vwbU7u2SQvMb3drTY9zdGibA= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-496-vmBY33sJMvq2sPNWTTflYw-1; Fri, 23 Oct 2020 13:43:20 -0400 X-MC-Unique: vmBY33sJMvq2sPNWTTflYw-1 Received: by mail-wr1-f70.google.com with SMTP id r8so851400wrp.5 for ; Fri, 23 Oct 2020 10:43:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+Zu0LYwVSmEJWNT4NqggQbfAbgnLBnqlkd3v5H5H25w=; b=O1X4bT9DFVkrwGMPP7rbKpngGkI4T/Rp3kdGb5W8ZBjAx9UursviS6KRSfE5D+WefA k13RqD9642WxMEV3wel1X1xKHTTuWMRK60LPQ7WT/7Q07dc1kbha1ZobKxEUTf7rekps PdUATLQt/suusu/w6xtRK4voq5RzuLY4AWaXq0BjiknrMLUTLTrYnQYmvHZ7XiHKR2Dh Wl+btuhuWwBuyByWUuw2DZEf1DWhW5hCkKoGL/VwAkHkviIeHZIPL4IXxsZgXJ+aqCyN hng28Ge9pBVDYTtZCXl+397vBlYTP/JLf7qhEwxt3CH3bD53NdJ8kA62nixmcULkaWxb /APw== X-Gm-Message-State: AOAM533TkGyE/FZm6nYch7TJNqqjzbQBzusSlieA7ZGWn0/iPLnI6+P+ AmEt5dIXKrF/d1S27Wedu6mHRaQICvRGWxhEUU3hum/sZp7F81aIBdNIUilaZthlPcLBU7ww/FB 3ERkNexldmPyerMDEcddrGyi8 X-Received: by 2002:a1c:f719:: with SMTP id v25mr3424368wmh.186.1603474999601; Fri, 23 Oct 2020 10:43:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzwLsjkrDGdSh7CSlvmu3j7iiAz0uw3JwPZ5xYVRGX9FuRPgyfsFUeWf1AGU9SEtDN9fpA5w== X-Received: by 2002:a1c:f719:: with SMTP id v25mr3424358wmh.186.1603474999410; Fri, 23 Oct 2020 10:43:19 -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 p21sm4586588wmc.28.2020.10.23.10.43.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Oct 2020 10:43:18 -0700 (PDT) To: Jim Mattson Cc: Sean Christopherson , Mohammed Gamal , kvm list , LKML , Vitaly Kuznetsov , Wanpeng Li , Joerg Roedel References: <20200710154811.418214-1-mgamal@redhat.com> <20200710154811.418214-8-mgamal@redhat.com> <20201023031433.GF23681@linux.intel.com> <498cfe12-f3e4-c4a2-f36b-159ccc10cdc4@redhat.com> From: Paolo Bonzini Subject: Re: [PATCH v3 7/9] KVM: VMX: Add guest physical address check in EPT violation and misconfig Message-ID: <4463f391-0a25-017e-f913-69c297e13c5e@redhat.com> Date: Fri, 23 Oct 2020 19:43:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/10/20 19:23, Jim Mattson wrote: >> The information that we need is _not_ that provided by the advanced >> VM-exit information (or by a page walk). If a page is neither writable >> nor executable, the advanced information doesn't say if the injected #PF >> should be a W=1 or a F=1 fault. We need the information in bits 0..2 of >> the exit qualification for the final access, which however is not >> available for the paging-structure access. >> > Are you planning to extend the emulator, then, to support all > instructions? I'm not sure where you are going with this. I'm going to fix the bit 8=1 case, but for bit 8=0 there's not much that you can do. In all likelihood the guest is buggy anyway. It would be possible to only do the decode part of the emulator to get the PFEC (matching the GVA from the vmexit to the memory operand, for example, and retrying if the instruction is unexpected). Then one would only need enough VEX/EVEX parsing to process the decoding. Paolo