Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2951953ybt; Mon, 22 Jun 2020 11:04:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwA4SnmM3kpZ86XtSa+P0rNrK+NaoALMAXOhqtF5JuJc+F6AR5BizCJQbyusuk2KsWm+ZX X-Received: by 2002:a17:906:148b:: with SMTP id x11mr17613498ejc.282.1592849045869; Mon, 22 Jun 2020 11:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592849045; cv=none; d=google.com; s=arc-20160816; b=nMcmlQQM+S1OCnmZlsYgVrAurKpaFVcw/A18oF7/Q1JZ1t2Ly38/uJr5gAoXjzqElo QneGEy8p1bIZD9Y70yOn7sBh3ju3pSH5f75gAUnEQWsuVdtkIZ2ViD+aD5iitwWmnZYL OVNVpboXMJ41wd48Uuj//GTH2i/kggyuwnbX0kUsVUbPwADbFeNIzKp1ulpKugzmR96e osRsv3BIhFtgZ2C7Es5C03OQhxTGD5ifIyBSoGBV9L44b3BqwdbEsXMySLCQ2HerX+oE 2oJBiH8Yz660MYeTQBaUG8fcns7s4mC9IMsZCr+Fkt4CT8MVHv4CA+kXSo/449XuPlAk Vm6Q== 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:dkim-signature; bh=EiPE/eywHM8Zlh7BqbyFgYnaqP2KFeRz5sUsSupRbV4=; b=TX163rEItqe/4wiaVXzb1aEk/IfMozbUvOWXgY74MhfglE6a8SmxlmxxbOMFHoH+bW gjX8V7ZJkY3JqOo1/3Rvpkr1b/68OWoKZccSBZhJJam2AzSI9dO8iTHivTLz4uRpt0nX eMdz36jBjd6EOg40ejfdFOcYf5oY1bUQItoWexX6MDOK+pe+Ku9xtqBmvU7iwW1sfOtF XHdYO+iSDqf5qMqPUQqQSWQZ1LQQdXwbqU1UNhDN34z9oFO7rosphyh38ZSP3UU+nGbJ loFmgzlQg4LICzdw7ymj4s1EXsf8wNILJd+XOU9cMgDCDzOZMeMvMvuvQ85Wc+ig0yM4 SV2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LapND8sO; 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 a7si9522191ejx.184.2020.06.22.11.03.43; Mon, 22 Jun 2020 11:04:05 -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=LapND8sO; 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 S1730234AbgFVSBw (ORCPT + 99 others); Mon, 22 Jun 2020 14:01:52 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:57786 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730046AbgFVSBv (ORCPT ); Mon, 22 Jun 2020 14:01:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592848910; 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=EiPE/eywHM8Zlh7BqbyFgYnaqP2KFeRz5sUsSupRbV4=; b=LapND8sO7FclfJ1RNrt/YIeiOmBCL+6K1h2vaEXk1eqK/e/oYXbM60G160mA2unzoECWHG d9mBU0LDPP1W+UVSYx7OPXaXNGhhEZJm6CkHGsJsNCu5/ckUuz7ovx9+g7WH33l8cdm1gw d/QBvN7rnwr4Y0uiE09mVwu1CBNOhEg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-5BBtAU7yNJOmbneYzdf6rA-1; Mon, 22 Jun 2020 14:01:48 -0400 X-MC-Unique: 5BBtAU7yNJOmbneYzdf6rA-1 Received: by mail-wr1-f72.google.com with SMTP id i10so7451355wrn.21 for ; Mon, 22 Jun 2020 11:01:48 -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=EiPE/eywHM8Zlh7BqbyFgYnaqP2KFeRz5sUsSupRbV4=; b=MfYYNoirMqdUw/xVOtj1eGmhNrf9agzMjjh5lj53VIRWgZsgtsI5cGPK4dYatXZ1Sf 02BuOsfHzJhZf6HMQIYvDcgbQEUzcxTGqFS8URpI6oWVFDTZGx5CdmTPYmBIly93v7ZE V2jT+8l5Fve4UiU9KF/A3SDCdCrj9StHK+hGtlWCCrPF894ff+KTFGwB1BcRFqAe2JjD l55BgNGPojqux4TQvS8elBGW74FM4R7EKkGkHfKVvvS6LOgrzEpcQp4abiNHpXjxGyjC bmagarcp6TsYfriluoLjViPMLvWKUVpMi46hEyZCSmQlCrZzyzINWenvryLqwY3yc/qK 3gQA== X-Gm-Message-State: AOAM531Gf9Ql1cXchrIY5r5d7qMpdkpLyznLV1wDWhJ+gtLpW6t1RpKL jglLRv71PLUZRT7YiPKgltaxdutWvQzjhsUUjh2MVrgY06t4FO+GLVFdD598oVP6rCbHu+c34ks gCGMn2jVMctkvtBO3KxiM82Om X-Received: by 2002:adf:e80a:: with SMTP id o10mr20912742wrm.185.1592848907194; Mon, 22 Jun 2020 11:01:47 -0700 (PDT) X-Received: by 2002:adf:e80a:: with SMTP id o10mr20912729wrm.185.1592848906985; Mon, 22 Jun 2020 11:01:46 -0700 (PDT) Received: from [192.168.10.150] ([93.56.170.5]) by smtp.gmail.com with ESMTPSA id c5sm380556wmb.24.2020.06.22.11.01.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jun 2020 11:01:46 -0700 (PDT) Subject: Re: [PATCH v2 00/11] KVM: Support guest MAXPHYADDR < host MAXPHYADDR To: Tom Lendacky , Mohammed Gamal , kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vkuznets@redhat.com, sean.j.christopherson@intel.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, babu.moger@amd.com References: <20200619153925.79106-1-mgamal@redhat.com> <5a52fd65-e1b2-ca87-e923-1d5ac167cfb9@amd.com> <52295811-f78a-46c5-ff9e-23709ba95a3d@redhat.com> <0d1acded-93a4-c1fa-b8f8-cfca9e082cd1@amd.com> <40ac43a1-468f-24d5-fdbf-d012bdae49ed@redhat.com> From: Paolo Bonzini Message-ID: <4ed45f38-6a31-32ab-cec7-baade67a8c1b@redhat.com> Date: Mon, 22 Jun 2020 20:01:45 +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: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/06/20 19:57, Tom Lendacky wrote: >>> In bare-metal, there's no guarantee a CPU will report all the faults in a >>> single PF error code. And because of race conditions, software can never >>> rely on that behavior. Whenever the OS thinks it has cured an error, it >>> must always be able to handle another #PF for the same access when it >>> retries because another processor could have modified the PTE in the >>> meantime. >> I agree, but I don't understand the relation to this patch. Can you >> explain? > > I guess I'm trying to understand why RSVD has to be reported to the guest > on a #PF (vs an NPF) when there's no guarantee that it can receive that > error code today even when guest MAXPHYADDR == host MAXPHYADDR. That would > eliminate the need to trap #PF. That's an interesting observation! But do processors exist where either: 1) RSVD doesn't win over all other bits, assuming no race conditions 2) A/D bits can be clobbered in a page table entry that has reserved bits set? Running the x86/access.flat testcase from kvm-unit-tests on bare metal suggests that all existing processors do neither of the above. In particular, the second would be a showstopper on AMD. Paolo