Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp686613lqz; Sat, 30 Mar 2024 14:35:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVOhIc5BR/Huukx6hdoFXfJhy2gJmnga4+jj/0YnfuV3Sh5BFjmQJKabNJgwJ3frJVP5lIoCxkm1lq9elQ0XU0kBKPXsMDGBCo/IGJjkw== X-Google-Smtp-Source: AGHT+IHbBRonH8m+n6uD5TkkTS5zVElo+JXkVM1w9H8gozwTPBhSxUKkDnPTJhb5zk7Z5vjVyeEl X-Received: by 2002:a2e:99da:0:b0:2d4:744c:24ab with SMTP id l26-20020a2e99da000000b002d4744c24abmr3339497ljj.27.1711834536579; Sat, 30 Mar 2024 14:35:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711834536; cv=pass; d=google.com; s=arc-20160816; b=d3cNII0DIFRVrhi9y/l610Iq8AAoqht+dCcw0XFbjKyUb4toixIJSyAujFMtDlpvC/ aYn9Azc17WeFnD2oCbqtOyQZLK7zRhak67QtIH4+QWQgtTqeRaGZVMnATAUHzfHBQLxu kFr1wv16B3aiXl9Lbsgr9rz+Aa8vGYDFUsdaBuHWxomfBi9HMdLk1Y4Xku5KUd4feFOf qThr39XQ3WGtbiP8pNh8DOa6expRRTbCR05Xa7Q+kUujku5whXLXFIyPTCkbJ0q9P+Zd WWUAQo7jQ/b7bW73nT1YWOuJWflYaDeg6PUBy8bNuXN26wKNfkS/ws5+iv7LMQG+c3ZJ E0wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=EwmuW/k3ZL7znVA8wS56lDlLW9BhS4TEVksrt7Me+Z8=; fh=DqJsEt92OgGBOGXRuzAsdGHJ15nUYE/JrBk61RxcoWk=; b=et4gpN9IOU5T7R96gqPTAWRelAusoB5Nan66f96ykU6PiKIg6GP6MWonJdeCOyZi18 dQRgkHjoMIv+wroDI9Y1pPnk90DDtwr9mdWY8g21BhFXdQRDgjrXuAnPFwtzb9wkuCDm 1EqIDiZfcb9VbV5C0yRZSsFZ13jtFgwr8rNkhC7Yuc+x/qrfwq1gqo9qXprghLB8fUk5 0fQ++EzirDxWeYOav6hATJgpwuq4cXRBskEk2bytl7IN4XumFudfNQ+nq4vc+lGOvdt8 We/rrjGYPvBgZC/FHwwWwzAe9mr2921rffRmdl7YoCRkcUYF390vCP052GlZBuY7EOPB oaZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PwZ9MZ1i; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-crypto+bounces-3135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3135-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fd5-20020a056402388500b005656776bf67si2992897edb.655.2024.03.30.14.35.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 14:35:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PwZ9MZ1i; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-crypto+bounces-3135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3135-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 205C51F21BCA for ; Sat, 30 Mar 2024 21:35:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 498451DFC6; Sat, 30 Mar 2024 21:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PwZ9MZ1i" X-Original-To: linux-crypto@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87E922AF06 for ; Sat, 30 Mar 2024 21:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711834530; cv=none; b=PgOkXF678W9FwFCPiVKah4oovIgBF8F/JnAjhXPQYadrFMw6s+c93/cpsFP4CCmpp1MvFGZ3gW9RNn4I1KSTSuDG7F8jluCx/viwZsut6QgyteFd/9Q4ZcCd99QNu5td4CEPW8NWs8LY4PcHkUUXf5KTi6LEdxRmTmIHMg205wk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711834530; c=relaxed/simple; bh=g0toAGCQtFi0G3GbWa0Q4HZPWv8jGtxInPF/JxlP71A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VDk1AdWfivfUlDYWWV0aeHeinK3zHP6Dwj3CQ2qewUTiR3JkY389d6bV/9E9OKg2J0ACGBw1DWYUPuF6lGvUnq274kQdBU+HYQaf3VVKagAkxwJnR9csNwkpG3T1KCpCWClj7sLvSTcqgcR3yTTn3MVnPc35I5YZ5/XMmBDm6Vc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PwZ9MZ1i; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711834527; 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:autocrypt:autocrypt; bh=EwmuW/k3ZL7znVA8wS56lDlLW9BhS4TEVksrt7Me+Z8=; b=PwZ9MZ1iyCAVzBUash6/9hnMVBP48I4GsfrdulDjf7X0dySw+dhCyQuoNF9cRn97oZnC0V cTOQYa0rlarrHCAeQS/Hszk96ip36xl7O644Vw+ylUW0h4uRIhxuKMLJ1NrVHXnq/yslBs rhet5l0+ntjKgvhS1bHVq1nOKnn3br4= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-597-UBr1dMo2OBao3coasgeSJA-1; Sat, 30 Mar 2024 17:35:23 -0400 X-MC-Unique: UBr1dMo2OBao3coasgeSJA-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5681b29771fso2713250a12.1 for ; Sat, 30 Mar 2024 14:35:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711834522; x=1712439322; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EwmuW/k3ZL7znVA8wS56lDlLW9BhS4TEVksrt7Me+Z8=; b=kpwxyFUqYeecCfbQoFu2U/Ua5qw/SLCrAg4DrZMom4Utjen+/Hv8fxlS2NszjL0764 Lg22QDkQYFo2V8TLInInTacQamyzvAdiiW/l+fREsy4nHoQc9cayYJNCX5HmUqKAaz0c m1UN/5tm6ea3vepQX7+MeEz+5LoP5Y+tJRKO2T2tbPITyZOUjNdUf2t5cHRAO32qS8ND boFuMo9SbnxtUVGO10M1OgG2zGeQthvN9B996/CQJ+YIo1JvujhtxLGK9a55Z/LNEVYP s+GgQBTIEOhsLgdGLC2IBIgjZSHWQgoK961MEuZujrww3Lgj6aFdr2OmZ11mvAGmaBFa z4eg== X-Forwarded-Encrypted: i=1; AJvYcCWE0tfK/u9nok79aQR0R+nL9nkCxH4IXe7/ail0UBP1W5Zv1I/BBv5RxxTK4VuJJB9Vopm7mxLNN2mBVQiivCrMhhPL9YcTH8G0712l X-Gm-Message-State: AOJu0YzcKcrW4oWg39HDo55zSf6XzGTsCk6fumvDf8z9zhmcEIyMEYB+ k4Sc5+qhHP0r/q6gl5yHb+cqP4PIu3wZc+VwrAryEu7eAWCTwncNh4kjzIhkM3EC1rmoejc/Eho JpIPP48OR2I3ifbf6SbScHd0TjF0Ayqp2wFNb6PbXqIfOxhPI503Boq0Ropu5QQ== X-Received: by 2002:a50:bb44:0:b0:567:23a2:5b1e with SMTP id y62-20020a50bb44000000b0056723a25b1emr4176642ede.23.1711834522683; Sat, 30 Mar 2024 14:35:22 -0700 (PDT) X-Received: by 2002:a50:bb44:0:b0:567:23a2:5b1e with SMTP id y62-20020a50bb44000000b0056723a25b1emr4176630ede.23.1711834522369; Sat, 30 Mar 2024 14:35:22 -0700 (PDT) Received: from [192.168.10.4] ([151.95.49.219]) by smtp.googlemail.com with ESMTPSA id cy14-20020a0564021c8e00b0056bf31fa2a3sm3688481edb.80.2024.03.30.14.35.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Mar 2024 14:35:21 -0700 (PDT) Message-ID: <4e89479a-e170-403a-b2eb-ce7b895e55a3@redhat.com> Date: Sat, 30 Mar 2024 22:35:17 +0100 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v12 23/29] KVM: x86: Implement gmem hook for determining max NPT mapping level To: Michael Roth , kvm@vger.kernel.org Cc: linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, seanjc@google.com, vkuznets@redhat.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, dovmurik@linux.ibm.com, tobin@ibm.com, bp@alien8.de, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, jarkko@kernel.org, ashish.kalra@amd.com, nikunj.dadhania@amd.com, pankaj.gupta@amd.com, liam.merwick@oracle.com References: <20240329225835.400662-1-michael.roth@amd.com> <20240329225835.400662-24-michael.roth@amd.com> From: Paolo Bonzini Content-Language: en-US Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun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ScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0 JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w= In-Reply-To: <20240329225835.400662-24-michael.roth@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/29/24 23:58, Michael Roth wrote: > In the case of SEV-SNP, whether or not a 2MB page can be mapped via a > 2MB mapping in the guest's nested page table depends on whether or not > any subpages within the range have already been initialized as private > in the RMP table. The existing mixed-attribute tracking in KVM is > insufficient here, for instance: > > - gmem allocates 2MB page > - guest issues PVALIDATE on 2MB page > - guest later converts a subpage to shared > - SNP host code issues PSMASH to split 2MB RMP mapping to 4K > - KVM MMU splits NPT mapping to 4K > - guest later converts that shared page back to private > > At this point there are no mixed attributes, and KVM would normally > allow for 2MB NPT mappings again, but this is actually not allowed > because the RMP table mappings are 4K and cannot be promoted on the > hypervisor side, so the NPT mappings must still be limited to 4K to > match this. > > Implement a kvm_x86_ops.gmem_validate_fault() hook for SEV that checks > for this condition and adjusts the mapping level accordingly. > > Signed-off-by: Michael Roth Reviewed-by: Paolo Bonzini > --- > arch/x86/kvm/svm/sev.c | 32 ++++++++++++++++++++++++++++++++ > arch/x86/kvm/svm/svm.c | 1 + > arch/x86/kvm/svm/svm.h | 7 +++++++ > 3 files changed, 40 insertions(+) > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c > index 87d621d013a4..31f6f4786503 100644 > --- a/arch/x86/kvm/svm/sev.c > +++ b/arch/x86/kvm/svm/sev.c > @@ -4443,3 +4443,35 @@ void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end) > pfn += use_2m_update ? PTRS_PER_PMD : 1; > } > } > + > +/* > + * Re-check whether an #NPF for a private/gmem page can still be serviced, and > + * adjust maximum mapping level if needed. > + */ > +int sev_gmem_validate_fault(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, bool is_private, > + u8 *max_level) > +{ > + int level, rc; > + bool assigned; > + > + if (!sev_snp_guest(kvm)) > + return 0; > + > + rc = snp_lookup_rmpentry(pfn, &assigned, &level); > + if (rc) { > + pr_err_ratelimited("SEV: RMP entry not found: GFN %llx PFN %llx level %d error %d\n", > + gfn, pfn, level, rc); > + return -ENOENT; > + } > + > + if (!assigned) { > + pr_err_ratelimited("SEV: RMP entry is not assigned: GFN %llx PFN %llx level %d\n", > + gfn, pfn, level); > + return -EINVAL; > + } > + > + if (level < *max_level) > + *max_level = level; > + > + return 0; > +} > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c > index b456906f2670..298b4ce77a5f 100644 > --- a/arch/x86/kvm/svm/svm.c > +++ b/arch/x86/kvm/svm/svm.c > @@ -5081,6 +5081,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { > > .gmem_prepare = sev_gmem_prepare, > .gmem_invalidate = sev_gmem_invalidate, > + .gmem_validate_fault = sev_gmem_validate_fault, > }; > > /* > diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h > index 3f1f6d3d3ade..746f819a6de4 100644 > --- a/arch/x86/kvm/svm/svm.h > +++ b/arch/x86/kvm/svm/svm.h > @@ -732,6 +732,8 @@ void sev_vcpu_unblocking(struct kvm_vcpu *vcpu); > void sev_snp_init_protected_guest_state(struct kvm_vcpu *vcpu); > int sev_gmem_prepare(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, int max_order); > void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end); > +int sev_gmem_validate_fault(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, bool is_private, > + u8 *max_level); > #else > static inline struct page *snp_safe_alloc_page(struct kvm_vcpu *vcpu) { > return alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO); > @@ -753,6 +755,11 @@ static inline int sev_gmem_prepare(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, in > return 0; > } > static inline void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end) {} > +static inline int sev_gmem_validate_fault(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, > + bool is_private, u8 *max_level) > +{ > + return 0; > +} > > #endif >