Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp92140rdg; Tue, 10 Oct 2023 05:20:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhxDCrSmQMEF0775LhDDccfda0am5opW7Y47cXPMuWknCzrn0VGu7gjn4I18s2OTRkOhAY X-Received: by 2002:a05:6a20:258a:b0:161:aef5:6395 with SMTP id k10-20020a056a20258a00b00161aef56395mr22363053pzd.24.1696940412076; Tue, 10 Oct 2023 05:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696940412; cv=none; d=google.com; s=arc-20160816; b=UKzUkOZtmKa471iu3JWGVLWx8W4y+5gHQs5UwE9C4tZWGOdZdFyInejUw6qIf5Ar2V YYZtjJW9KeF9BjHzzIosSy//pzuvOWbl0K02AHJqlpvcso29I8iyjFnZDsjV9yCK9I7w itygKaC+ryYMaxQeGEAzJ4E+Ma3kyy0pWs/swZ1FPeNa+lRj+X4nwKAreS6VLliSg0Xr f+tqpz/jksiX6JyrGoB7ZPhvKfnCPQarkNRb3XHVe5up7s/cMJz7hnAUjBuT7l12bU3I IvV+9NO61AYcqWB6Wpn5bamM5TcY8BOMHlvnpTs1qIkMSE4odtRde662CG7yqlbBQUe4 IAxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :message-id:user-agent:references:in-reply-to:subject:cc:to:from :date:mime-version; bh=GyjjGINI19FdI+0ijB88JfMZDsFZecJI89fkEjZ5Wp4=; fh=X/jdEIzsXstPMDTaBs5gsKasxiSBAYLh5RymkNXY7N4=; b=Pi6k6DFMhpuvJh6VpiNlvd+ecf9pt85qkzvshU+Zh3BqIRey1s+aHvRLMljdA6XNA3 61Ku7UnWrV9bQ0vXiG5p4wyd4V/VCiz5MlxlVf73KCwIQrChXDM51OJV07IiQlPERpWA Jg20c3v//gMjEMs9TFfRUCSy5esHO1GnbuUeawzoJYYC+LqpvxhfchGzXgCUgu4pTo/K CcKxv/+Ocuz5iLGbOi1ps9uVGdMXPi9jfwsxG9LqcbmuMYnmlhwG7pquk6Q+RBVY5GTO D+VfxYJwxrD4QxwO57R7Aqs6jTXW17cwQrexVMAe0bSA1etkPY2Bv3GyRUpS57oVO7pU dvxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id p65-20020a634244000000b00577ae8b603fsi11611540pga.314.2023.10.10.05.20.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 05:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4F82081668AC; Tue, 10 Oct 2023 05:20:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231719AbjJJMUJ (ORCPT + 99 others); Tue, 10 Oct 2023 08:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231714AbjJJMUH (ORCPT ); Tue, 10 Oct 2023 08:20:07 -0400 Received: from 1.mo560.mail-out.ovh.net (1.mo560.mail-out.ovh.net [46.105.63.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C90859D for ; Tue, 10 Oct 2023 05:20:05 -0700 (PDT) Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.20.96]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id B15B128910 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: gggruggvucftvghtrhhoucdtuddrgedvkedrheehgdeglecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeggfffhvfevufgjfhgfkfigohhitgfgsehtkehjtddtreejnecuhfhrohhmpeflohhsrocurfgvkhhkrghrihhnvghnuceojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqnecuggftrfgrthhtvghrnhepkefhgeduudefgedvleegtddvffeghedvtdekveekjeevvdegiedtfeelhedtiedtnecukfhppeduvdejrddtrddtrddupdduledvrdegvddrudduiedrudejfedpudehuddrkedtrddvledrudeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhoshgvrdhpvghkkhgrrhhinhgvnhesfhhogihhohhunhgurdhfiheqpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 05:20:11 -0700 (PDT) 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é.