From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (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 E766023B7 for ; Fri, 30 Dec 2022 11:28:01 +0000 (UTC) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B87981EC0622; Fri, 30 Dec 2022 12:27:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1672399679; 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:in-reply-to:in-reply-to: references:references; bh=Rc57ZPovDpq235rKCZ5fF1N14hn+t2Wcm4W4m/D7lWo=; b=a/zY+elMZ2XEfVyrjInY4d4UfNOwEbEpG6OT37YjBnYGgH1Je2hg5szpaBBD98O69ELr5P uS8nNzGeh3jxWcAv5xsB0bXxCZ4s24+yc+5Lt6A4jhft1OUbo2aArW6W9nd/98oVdIQe+7 rqQNYCw4GIhU5mIbxVDQjFSuBmVD8to= Date: Fri, 30 Dec 2022 12:27:55 +0100 From: Borislav Petkov To: Michael Roth Cc: kvm@vger.kernel.org, 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, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.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, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org, ashish.kalra@amd.com, harald@profian.com Subject: Re: [PATCH RFC v7 05/64] KVM: x86: Add 'update_mem_attr' x86 op Message-ID: References: <20221214194056.161492-1-michael.roth@amd.com> <20221214194056.161492-6-michael.roth@amd.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221214194056.161492-6-michael.roth@amd.com> On Wed, Dec 14, 2022 at 01:39:57PM -0600, Michael Roth wrote: > This callback will handle any platform-specific handling needed for s/handle/do/ > converting pages between shared/private. > > Signed-off-by: Michael Roth > --- > arch/x86/include/asm/kvm-x86-ops.h | 1 + > arch/x86/include/asm/kvm_host.h | 2 ++ > arch/x86/kvm/mmu/mmu.c | 10 ++++++++-- > 3 files changed, 11 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/kvm-x86-ops.h b/arch/x86/include/asm/kvm-x86-ops.h > index efae987cdce0..52f94a0ba5e9 100644 > --- a/arch/x86/include/asm/kvm-x86-ops.h > +++ b/arch/x86/include/asm/kvm-x86-ops.h > @@ -133,6 +133,7 @@ KVM_X86_OP(vcpu_deliver_sipi_vector) > KVM_X86_OP_OPTIONAL_RET0(vcpu_get_apicv_inhibit_reasons); > KVM_X86_OP_OPTIONAL_RET0(private_mem_enabled); > KVM_X86_OP_OPTIONAL_RET0(fault_is_private); > +KVM_X86_OP_OPTIONAL_RET0(update_mem_attr) > > #undef KVM_X86_OP > #undef KVM_X86_OP_OPTIONAL > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > index 92539708f062..13802389f0f9 100644 > --- a/arch/x86/include/asm/kvm_host.h > +++ b/arch/x86/include/asm/kvm_host.h > @@ -1637,6 +1637,8 @@ struct kvm_x86_ops { > int root_level); > int (*private_mem_enabled)(struct kvm *kvm); > int (*fault_is_private)(struct kvm *kvm, gpa_t gpa, u64 error_code, bool *private_fault); > + int (*update_mem_attr)(struct kvm_memory_slot *slot, unsigned int attr, > + gfn_t start, gfn_t end); Does this one want to return bool too? I guess I'll see later... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette