Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4688652pxj; Wed, 12 May 2021 10:56:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCgKghhB+pN3bi3TnlsmfrfurIyCKni9KEJM+S9FNgwEm9bRGTFqPeavliFK8XhMk6li6P X-Received: by 2002:aca:f5c5:: with SMTP id t188mr26755320oih.25.1620842172955; Wed, 12 May 2021 10:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620842172; cv=none; d=google.com; s=arc-20160816; b=HmkW8671MLdx2w4RpEYu3BO8apzK+N8/bgEOqFaAlkcSBEQOaSJ3OAbcXfIY6WsIvp oSmGQRkECcpqm59so7RCGozDxV0ohJUeUfhaoI8MidF/ggu4mJ2u32jDIvcqHB228BIF 2ZdeAlfF94oRi9GlTqC9t813f01VFLilQrFok1ahiwXF1s/rpeoJKySOJSH1mN0qkkwh IFTIjPPxD1YeozMvY5oDo8JFXRQowlUGGpNaj0sAQh7BwexzmkRk0Ta7Tc3EJp2ERmyW 4h6pTdS7s8RHavrO3jO7oQzB0yXwJFe1gWt7aWk3q211FPH37ryWX5LevXEFCGkOwBs6 M5Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/0X58j7/TAcR/6ydoMQr78dKigX0U3Iwk3UeXo3z7hE=; b=bj/s2sOH42LF5MDkJ4zWxUN3chL7tfIFktibtCqX97Hm59YpbPAVrISPrCcqSRhLvQ FwCadY1lbiIs/EuYY5w9w5PwrZ+9YVWcCsXabgZFGTYTIm6Yh7KSrKe1wkYM87ntdt6h xOJh+Wu7ZZz2v2N/Bri2N/lWIsJ+GgHb54r9SXDN6ZA4sTPn6YPTf3FKzSbRDuhfAqJq Fb5uMYo15oPvVKzTTfKw9qltV4exXLlYU8rgn5bZU9J8wBMQGJgdNySOtw5iVckGpMPh TbMCOmzzTwK/vsruMDY1wYWw9PENwZ0OwBZ+vhZYVSkDjZEic3cE6CBqHSHShIf3j/d+ SUaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=m3FkKJtC; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w75si662549oie.115.2021.05.12.10.55.59; Wed, 12 May 2021 10:56:12 -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=@alien8.de header.s=dkim header.b=m3FkKJtC; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240900AbhELRzZ (ORCPT + 99 others); Wed, 12 May 2021 13:55:25 -0400 Received: from mail.skyhub.de ([5.9.137.197]:43374 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238323AbhELQYp (ORCPT ); Wed, 12 May 2021 12:24:45 -0400 Received: from zn.tnic (p200300ec2f0bb80077d55d62652951c8.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:b800:77d5:5d62:6529:51c8]) (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 7E2BA1EC0473; Wed, 12 May 2021 18:23:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1620836614; 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=/0X58j7/TAcR/6ydoMQr78dKigX0U3Iwk3UeXo3z7hE=; b=m3FkKJtCFmkZ0gJVjd9JdKC3IotegfXp85I2WiSv2lbm3mvKMFuExkVUUTDXwQC5Gn31Gp 8ogIClxXx7noylqZmMsBEO6JGz9wGoYegx1hNCSAcYrGI/H44XdpuvQfWZkkMHGDENIx+f sJKF3O2PjMFOzMfJhr6Xi2c2iH0jTIg= Date: Wed, 12 May 2021 18:23:27 +0200 From: Borislav Petkov To: Sean Christopherson Cc: Ashish Kalra , pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, joro@8bytes.org, thomas.lendacky@amd.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, srutherford@google.com, venu.busireddy@oracle.com, brijesh.singh@amd.com Subject: Re: [PATCH v2 2/4] mm: x86: Invoke hypercall when page encryption status is changed Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 03:51:10PM +0000, Sean Christopherson wrote: > TL;DR: I think the KVM hypercall should be something like this, so that it can > be used for SNP and TDX, and possibly for other purposes, e.g. for paravirt > performance enhancements or something. Ok, good, I was only making sure this is on people's radar but it actually is more than that. I'll let Tom and Jörg comment on the meat of the thing - as always, thanks for the detailed explanation. From my !virt guy POV, I like the aspect of sharing stuff as much as possible and it all makes sense to me but what the hell do I know... > 8. KVM_HC_MAP_GPA_RANGE > ----------------------- > :Architecture: x86 > :Status: active > :Purpose: Request KVM to map a GPA range with the specified attributes. > > a0: the guest physical address of the start page > a1: the number of (4kb) pages (must be contiguous in GPA space) > a2: attributes > > where 'attributes' could be something like: > > bits 3:0 - preferred page size encoding 0 = 4kb, 1 = 2mb, 2 = 1gb, etc... > bit 4 - plaintext = 0, encrypted = 1 > bits 63:5 - reserved (must be zero) Yah, nice and simple. I like. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette