From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5543ACD8CA2 for ; Tue, 10 Oct 2023 15:09:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CEB0341C53; Tue, 10 Oct 2023 15:09:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org CEB0341C53 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2gzynC8nPfxx; Tue, 10 Oct 2023 15:09:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id C443E408C9; Tue, 10 Oct 2023 15:09:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C443E408C9 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A4CB6C0039; Tue, 10 Oct 2023 15:09:15 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 07F5EC0032 for ; Tue, 10 Oct 2023 15:09:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D7A6940B08 for ; Tue, 10 Oct 2023 15:09:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D7A6940B08 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2emdTZYqJP5w for ; Tue, 10 Oct 2023 15:09:13 +0000 (UTC) X-Greylist: delayed 4187 seconds by postgrey-1.37 at util1.osuosl.org; Tue, 10 Oct 2023 15:09:13 UTC DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8BCF840432 Received: from 3.mo584.mail-out.ovh.net (3.mo584.mail-out.ovh.net [46.105.57.129]) by smtp2.osuosl.org (Postfix) with ESMTPS id 8BCF840432 for ; Tue, 10 Oct 2023 15:09:13 +0000 (UTC) Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.143.183]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id BB60B258FA for ; Tue, 10 Oct 2023 12:20:03 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-nrnbc (unknown [10.110.103.46]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id BE0761FEC1; Tue, 10 Oct 2023 12:20:02 +0000 (UTC) Received: from RCM-web10.webmail.mail.ovh.net ([151.80.29.18]) by ghost-submission-6684bf9d7b-nrnbc with ESMTPSA id OdwFLHJBJWXSDQAAjjGCXQ (envelope-from ); Tue, 10 Oct 2023 12:20:02 +0000 MIME-Version: 1.0 Date: Tue, 10 Oct 2023 15:20:02 +0300 From: =?UTF-8?Q?Jos=C3=A9_Pekkarinen?= To: Paolo Bonzini Subject: Re: [PATCH] kvm/sev: make SEV/SEV-ES asids configurable In-Reply-To: <5c19c422-41ad-430b-664c-15f3e2087922@redhat.com> References: <20231010100441.30950-1-jose.pekkarinen@foxhound.fi> <2023101050-scuff-overstay-9b43@gregkh> <5c19c422-41ad-430b-664c-15f3e2087922@redhat.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <0c73f3ee77afe22879fbbed8a34f838f@foxhound.fi> X-Sender: jose.pekkarinen@foxhound.fi Organization: Foxhound Ltd. X-Originating-IP: 192.42.116.173 X-Webmail-UserID: jose.pekkarinen@foxhound.fi X-Ovh-Tracer-Id: 4716113239035455142 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrheehgdehtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeggfffhvfevufgjfhgfkfigohhitgfgsehtkehjtddtreejnecuhfhrohhmpeflohhsrocurfgvkhhkrghrihhnvghnuceojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqnecuggftrfgrthhtvghrnhepkefhgeduudefgedvleegtddvffeghedvtdekveekjeevvdegiedtfeelhedtiedtnecukfhppeduvdejrddtrddtrddupdduledvrdegvddrudduiedrudejfedpudehuddrkedtrddvledrudeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlqdhmvghnthgvvghssehlihhsthhsrdhlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdfovfetjfhoshhtpehmohehkeegpdhmohguvgepshhmthhpohhuth Cc: x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org, mingo@redhat.com, bp@alien8.de, tglx@linutronix.de, seanjc@google.com, linux-kernel-mentees@lists.linuxfoundation.org X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Err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wgc28gSSB0cmllZCB0byBmaXggaXQgdGhpcyB3YXksIGJ1dAphbnkgY29tbWVu dHMgb3IgaWRlYXMgZm9yIGltcHJvdmVtZW50IGFyZSB3ZWxjb21lZC4KCiAgICAgVGhhbmtzIQoK ICAgICBKb3PDqS4KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X18KTGludXgta2VybmVsLW1lbnRlZXMgbWFpbGluZyBsaXN0CkxpbnV4LWtlcm5lbC1tZW50ZWVz QGxpc3RzLmxpbnV4Zm91bmRhdGlvbi5vcmcKaHR0cHM6Ly9saXN0cy5saW51eGZvdW5kYXRpb24u b3JnL21haWxtYW4vbGlzdGluZm8vbGludXgta2VybmVsLW1lbnRlZXMK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85569CD80BD for ; Tue, 10 Oct 2023 12:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231794AbjJJMgA (ORCPT ); Tue, 10 Oct 2023 08:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231641AbjJJMfy (ORCPT ); Tue, 10 Oct 2023 08:35:54 -0400 X-Greylist: delayed 947 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 10 Oct 2023 05:35:52 PDT Received: from 14.mo561.mail-out.ovh.net (14.mo561.mail-out.ovh.net [188.165.43.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C3FAF for ; Tue, 10 Oct 2023 05:35:52 -0700 (PDT) Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.138.83]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id AD7D0286BF for ; Tue, 10 Oct 2023 12:20:03 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-nrnbc (unknown [10.110.103.46]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id BE0761FEC1; Tue, 10 Oct 2023 12:20:02 +0000 (UTC) Received: from RCM-web10.webmail.mail.ovh.net ([151.80.29.18]) by ghost-submission-6684bf9d7b-nrnbc with ESMTPSA id OdwFLHJBJWXSDQAAjjGCXQ (envelope-from ); Tue, 10 Oct 2023 12:20:02 +0000 MIME-Version: 1.0 Date: Tue, 10 Oct 2023 15:20:02 +0300 From: =?UTF-8?Q?Jos=C3=A9_Pekkarinen?= To: Paolo Bonzini Cc: Greg KH , seanjc@google.com, skhan@linuxfoundation.org, dave.hansen@linux.intel.com, kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, tglx@linutronix.de, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] kvm/sev: make SEV/SEV-ES asids configurable In-Reply-To: <5c19c422-41ad-430b-664c-15f3e2087922@redhat.com> References: <20231010100441.30950-1-jose.pekkarinen@foxhound.fi> <2023101050-scuff-overstay-9b43@gregkh> <5c19c422-41ad-430b-664c-15f3e2087922@redhat.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <0c73f3ee77afe22879fbbed8a34f838f@foxhound.fi> X-Sender: jose.pekkarinen@foxhound.fi Organization: Foxhound Ltd. X-Originating-IP: 192.42.116.173 X-Webmail-UserID: jose.pekkarinen@foxhound.fi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 4716113239035455142 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrheehgdeglecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeggfffhvfevufgjfhgfkfigohhitgfgsehtkehjtddtreejnecuhfhrohhmpeflohhsrocurfgvkhhkrghrihhnvghnuceojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqnecuggftrfgrthhtvghrnhepkefhgeduudefgedvleegtddvffeghedvtdekveekjeevvdegiedtfeelhedtiedtnecukfhppeduvdejrddtrddtrddupdduledvrdegvddrudduiedrudejfedpudehuddrkedtrddvledrudeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepkhhvmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheeiuddpmhhouggvpehsmhhtphhouhht Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 2023-10-10 14:40, Paolo Bonzini wrote: > On 10/10/23 13:35, Greg KH wrote: >> On Tue, Oct 10, 2023 at 01:04:39PM +0300, José Pekkarinen wrote: >>> There are bioses that doesn't allow to configure the >>> number of asids allocated for SEV/SEV-ES, for those >>> cases, the default behaviour allocates all the asids >>> for SEV, leaving no room for SEV-ES to have some fun. > > In addition to what Greg pointed out (and there are many more cases > that have to be checked for errors, including possible overflows), why > is it correct to just ignore what's in CPUID? I'll check if I can use cpuid info to improve this for v2, I just noticed my cpu advertises sev_es but the kernel doesn't activate it despite of the kvm_amd parameter being set, so I tried to fix it this way, but any comments or ideas for improvement are welcomed. Thanks! José.