Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3953593pxy; Tue, 4 May 2021 13:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW3mFntL7W6eKG5grA3rDsV9q1jmF9jYKwYq4Js1l67w9uMOFadHOSwIs2xtcaHxr5Ii+G X-Received: by 2002:a65:6a4c:: with SMTP id o12mr24796550pgu.371.1620161928931; Tue, 04 May 2021 13:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620161928; cv=none; d=google.com; s=arc-20160816; b=c3fh5jWEGyWbHMpTl4uQMfWc/bruth2TxmV8J1ZL8mSN3x/dHQq9y2zZzlIS/Klr1i 2lX0qFTpFj8dFJJLKjdV5gDBH6wSjSk2Oar/MLvgnJ+iaEgjERFFRZnCpV6cC63+HFPG ZKlSZ4rKsXhzURQ8LgQnqIQ6BTkut7q9AqLJgH9KqYjrQcgh/k6epMFMm32vxHU7QTS1 Ia0lZZd0NrKIxGN4/pwlLd0PXxfu1Q8jDflWLabtH65PeaSwhu6U1GcipFyVcwnKv5xE 8zc7zqN7gOAwEK/9jyw7tVT93/AKBn3BjMEiR1e0qx9UWcYxKDCU3o4gAAwtmpbhEVMV R2dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=GEOG2LrQF2aVluADfXxyAse1VlnB/ZrzEuAypGjwwE8=; b=bURnij7eSBZgP61bQF4C0jdXFWS6OvnaNZdiCE+6X501FbvX0GaXFZrr6NJi5HdaKi E7Vu5Jus97kbuJtHkcV4QeDlEkCdmnF0jA8EGTzO76DcNkozgyVdnrASl5u4fXdjWMzp fwzP6g/BnLqD69SIvQ9f19zInvQxD69Vg1eeArOP8euNLGA7BgmA5iqCIgM2VLaFYxQA K2HqP6Gr3WZ4EAhWm8R45bRgYUH3VQV2DfE4zGaUAd3SMVgXlRS4sxCwYap9lQVIan5w oeiO4iuMUuw/vJ1dGeYFST3yegdXXPwTEHU/HYA+Cz+4TpnxzXpEtOA97FeMqBLfJNPa KbBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OVXTaN/P"; 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 cv1si2468689pjb.137.2021.05.04.13.58.33; Tue, 04 May 2021 13:58:48 -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="OVXTaN/P"; 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 S232539AbhEDU5a (ORCPT + 99 others); Tue, 4 May 2021 16:57:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32098 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbhEDU53 (ORCPT ); Tue, 4 May 2021 16:57:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620161793; 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=GEOG2LrQF2aVluADfXxyAse1VlnB/ZrzEuAypGjwwE8=; b=OVXTaN/PFFreBJ77zsG5oxOEVAz1f7y21LHAXrdPfbiM1ZKXip33i3Y9P94Rat6j3J3Ni5 givze/nlqbCm+PuGQTVC9ujP69Db0Z7xHlHvX8GO6J8RwAfGy7QfeV2/s1bqqExB6H6SzV ga9ldPqdOi3PTHO/bpkR4Al6RizL0I8= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-2IGEn0GoMReUMni0cerH3w-1; Tue, 04 May 2021 16:56:32 -0400 X-MC-Unique: 2IGEn0GoMReUMni0cerH3w-1 Received: by mail-ej1-f70.google.com with SMTP id n9-20020a1709062e09b02903a5f7e2caf4so2545362eji.19 for ; Tue, 04 May 2021 13:56:31 -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=GEOG2LrQF2aVluADfXxyAse1VlnB/ZrzEuAypGjwwE8=; b=EvBKmg8raJoI6nHrbUXyF3alX6zGEbSO/yhg3aJPLP2UQ8lVWZjMFlCJTRh1BAAxS0 QH/I+Rp3MN4NObFSrQAp8PM1O2YaQHoEvJqUybBDSdk8f7pfcCzG3hBNQVVWjXweIhXR aJYn6f3mly+5iN6G5dglA6oHxJqAiLnP+zz0ubX3u0mRdQu6gUXWw2dWc4ZM4oS6Fm9q 2tKmEIiR3+rn5neXjCRBnv2HXFU4tHgElmdmYIZ73djDpOlBaZFNWD5KMaryVB+Vh0an zxpENeEarxDfzkJEgKbluXYGucVOxu+ED+Wm6Cn/3o6WlUV/rkLdhIFjyEImhua069Ls 4Yew== X-Gm-Message-State: AOAM53399HyeRAbIowZTmpqZoOrHPQj2DvjKLxQRvTB4+dyz+j/DkJHL vRjhcLubq2bN3XLR2gEQesXbkREwmb6DYZDw4ow2lY9pFM6WwdlgUyvPOgGMq3xpplqMd5BHoLB xhNJ+vp7lEWiSxkZ48DYvsMyz X-Received: by 2002:a50:9e0b:: with SMTP id z11mr28449862ede.228.1620161790882; Tue, 04 May 2021 13:56:30 -0700 (PDT) X-Received: by 2002:a50:9e0b:: with SMTP id z11mr28449848ede.228.1620161790715; Tue, 04 May 2021 13:56:30 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e? ([2001:b07:6468:f312:5e2c:eb9a:a8b6:fd3e]) by smtp.gmail.com with ESMTPSA id k5sm14839855edj.84.2021.05.04.13.56.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 May 2021 13:56:30 -0700 (PDT) Subject: Re: [PATCH v3 2/2] KVM: X86: Introduce KVM_HC_PAGE_ENC_STATUS hypercall To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, srutherford@google.com, joro@8bytes.org, brijesh.singh@amd.com, thomas.lendacky@amd.com, ashish.kalra@amd.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , x86@kernel.org References: <20210429104707.203055-1-pbonzini@redhat.com> <20210429104707.203055-3-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <55db8e64-763b-9ecc-9c9a-6d840628e763@redhat.com> Date: Tue, 4 May 2021 22:56:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: 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 04/05/21 22:33, Sean Christopherson wrote: > On Tue, May 04, 2021, Paolo Bonzini wrote: >> On 04/05/21 19:09, Sean Christopherson wrote: >>> On Sat, May 01, 2021, Paolo Bonzini wrote: >>>> - make it completely independent from migration, i.e. it's just a facet of >>>> MSR_KVM_PAGE_ENC_STATUS saying whether the bitmap is up-to-date. It would >>>> use CPUID bit as the encryption status bitmap and have no code at all in KVM >>>> (userspace needs to set up the filter and implement everything). >>> >>> If the bit is purely a "page encryption status is up-to-date", what about >>> overloading KVM_HC_PAGE_ENC_STATUS to handle that status update as well? That >>> would eliminate my biggest complaint about having what is effectively a single >>> paravirt feature split into two separate, but intertwined chunks of ABI. >> >> It's true that they are intertwined, but I dislike not having a way to read >> the current state. > > From the guest? Yes, host userspace obviously doesn't need one since it's implemented through an MSR filter. It may not be really necessary to read it, but it's a bit jarring compared to how the rest of the PV APIs uses MSRs. Also from a debugging/crashdump point of view the VMM may have an established way to read an MSR from a vCPU, but it won't work if you come up with a new way to set the state. Paolo