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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 392C9CD8CAC for ; Tue, 10 Oct 2023 18:11:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C111040AA5; Tue, 10 Oct 2023 18:11:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C111040AA5 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 6ZoVk3P3Tmgo; Tue, 10 Oct 2023 18:11:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 6F35540111; Tue, 10 Oct 2023 18:11:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 6F35540111 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 41E1CC0039; Tue, 10 Oct 2023 18:11:45 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id AFB1EC0032 for ; Tue, 10 Oct 2023 18:11:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7DF7F402F4 for ; Tue, 10 Oct 2023 18:11:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7DF7F402F4 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 oZu301tCcPN8 for ; Tue, 10 Oct 2023 18:11:42 +0000 (UTC) Received: from 8.mo576.mail-out.ovh.net (8.mo576.mail-out.ovh.net [46.105.56.233]) by smtp2.osuosl.org (Postfix) with ESMTPS id 5076F40111 for ; Tue, 10 Oct 2023 18:11:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 5076F40111 Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.146.32]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 8A7E3267AB for ; Tue, 10 Oct 2023 18:03:39 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-rfnfq (unknown [10.110.103.92]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 26EE71FE7B; Tue, 10 Oct 2023 18:03:39 +0000 (UTC) Received: from RCM-web2.webmail.mail.ovh.net ([176.31.232.109]) by ghost-submission-6684bf9d7b-rfnfq with ESMTPSA id GIhHCPuRJWW7fgAACGw8uA (envelope-from ); Tue, 10 Oct 2023 18:03:39 +0000 MIME-Version: 1.0 Date: Tue, 10 Oct 2023 21:03:38 +0300 From: =?UTF-8?Q?Jos=C3=A9_Pekkarinen?= To: Peter Gonda Subject: Re: [PATCH] kvm/sev: make SEV/SEV-ES asids configurable In-Reply-To: References: <20231010100441.30950-1-jose.pekkarinen@foxhound.fi> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <8fd78d002d84f3164eb5a9337e694fa1@foxhound.fi> X-Sender: jose.pekkarinen@foxhound.fi Organization: Foxhound Ltd. X-Originating-IP: 23.128.248.14 X-Webmail-UserID: jose.pekkarinen@foxhound.fi X-Ovh-Tracer-Id: 10519001355388888742 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrheehgdduudekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepggffhffvvefujghffgfkgihoihgtgfesthekjhdttderjeenucfhrhhomheplfhoshorucfrvghkkhgrrhhinhgvnhcuoehjohhsvgdrphgvkhhkrghrihhnvghnsehfohighhhouhhnugdrfhhiqeenucggtffrrghtthgvrhhnpeekhfeguddufeegvdelgedtvdffgeehvddtkeevkeejvedvgeeitdefleehtdeitdenucfkphepuddvjedrtddrtddruddpvdefrdduvdekrddvgeekrddugedpudejiedrfedurddvfedvrddutdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlqdhmvghnthgvvghssehlihhsthhsrdhlihhnuhigfhhouhhnuggrthhiohhnrdhorhhgpdfovfetjfhoshhtpehmohehjeeipdhmohguvgepshhmthhpohhuth Cc: x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, seanjc@google.com, dave.hansen@linux.intel.com, linux-kernel@vger.kernel.org, mingo@redhat.com, bp@alien8.de, pbonzini@redhat.com, tglx@linutronix.de, 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" Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" T24gMjAyMy0xMC0xMCAxOTo0OSwgUGV0ZXIgR29uZGEgd3JvdGU6Cj4gT24gVHVlLCBPY3QgMTAs IDIwMjMgYXQgNToyMuKAr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Assassin 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 1CFE0CD8CAE for ; Tue, 10 Oct 2023 18:03:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343501AbjJJSDs (ORCPT ); Tue, 10 Oct 2023 14:03:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233412AbjJJSDr (ORCPT ); Tue, 10 Oct 2023 14:03:47 -0400 X-Greylist: delayed 16423 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 10 Oct 2023 11:03:41 PDT Received: from 5.mo583.mail-out.ovh.net (5.mo583.mail-out.ovh.net [87.98.173.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85B2A94 for ; Tue, 10 Oct 2023 11:03:41 -0700 (PDT) Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.146.143]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id A354E2838D for ; Tue, 10 Oct 2023 18:03:39 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-rfnfq (unknown [10.110.103.92]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 26EE71FE7B; Tue, 10 Oct 2023 18:03:39 +0000 (UTC) Received: from RCM-web2.webmail.mail.ovh.net ([176.31.232.109]) by ghost-submission-6684bf9d7b-rfnfq with ESMTPSA id GIhHCPuRJWW7fgAACGw8uA (envelope-from ); Tue, 10 Oct 2023 18:03:39 +0000 MIME-Version: 1.0 Date: Tue, 10 Oct 2023 21:03:38 +0300 From: =?UTF-8?Q?Jos=C3=A9_Pekkarinen?= To: Peter Gonda Cc: seanjc@google.com, pbonzini@redhat.com, skhan@linuxfoundation.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH] kvm/sev: make SEV/SEV-ES asids configurable In-Reply-To: References: <20231010100441.30950-1-jose.pekkarinen@foxhound.fi> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <8fd78d002d84f3164eb5a9337e694fa1@foxhound.fi> X-Sender: jose.pekkarinen@foxhound.fi Organization: Foxhound Ltd. X-Originating-IP: 23.128.248.14 X-Webmail-UserID: jose.pekkarinen@foxhound.fi Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10519001355388888742 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrheehgdduudekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepggffhffvvefujghffgfkgihoihgtgfesthekjhdttderjeenucfhrhhomheplfhoshorucfrvghkkhgrrhhinhgvnhcuoehjohhsvgdrphgvkhhkrghrihhnvghnsehfohighhhouhhnugdrfhhiqeenucggtffrrghtthgvrhhnpeekhfeguddufeegvdelgedtvdffgeehvddtkeevkeejvedvgeeitdefleehtdeitdenucfkphepuddvjedrtddrtddruddpvdefrdduvdekrddvgeekrddugedpudejiedrfedurddvfedvrddutdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepkhhvmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhht Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 2023-10-10 19:49, Peter Gonda wrote: > On Tue, Oct 10, 2023 at 5:22 AM 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. >> If the user request SEV-ES to be enabled, it will >> find the kernel just run out of resources and ignored >> user request. This following patch will address this >> issue by making the number of asids for SEV/SEV-ES >> configurable over kernel module parameters. >> > > All this patch does is introduce an error case right? Because if the > BIOS hasn't actually configured those SEV-ES asids and KVM tries to > use an SEV as an SEV-ES asid commands to the ASP will fail, right? > > What happens when you try to create an SEV-ES VM with this patch, when > the BIOS hasn't allocated any SEV-ES asids? It still doesn't enable SEV-ES since the cpu exposes min_sev_asids as 1, and there is a check to bail out in the hardware setup function, so definitely this is not fixing anything. I may not being understanding something here though, since my BIOS doesn't seem to have any options nor hints about SEV-ES, so I'm not quite sure it really does something to provide the functionality. For the records it is a Supermicro H11SSL-NC. Thanks! José.