Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1336993lqe; Mon, 8 Apr 2024 06:20:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWE/MtApjQUPWMG91HK0SZbeWrgLwcUV4YWXwKvs1UXroo/u4W3r01Egx5TICfDc4VLEeFs9xdDwV9TewpqI4+htXNTEymJzrVX87vXiw== X-Google-Smtp-Source: AGHT+IEL7rgTGAccSaOjrHIy9Qhp5adb2FC3DscGoysMz5AgIAwueMy/mJm1oHXubH2H8vbxyHpF X-Received: by 2002:ac2:528f:0:b0:516:ace0:9a75 with SMTP id q15-20020ac2528f000000b00516ace09a75mr5523180lfm.23.1712582446843; Mon, 08 Apr 2024 06:20:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712582446; cv=pass; d=google.com; s=arc-20160816; b=pRdR9fweBeB5CeHR3rTChLDjGTltiFqQT4gvb/ZssnJJIzPuCLDeRROtwBi7BJ18Hw UuC3++s6XvWDrUgOgp1d67KUAPGVcD/CW2WWSpRBTbqXeXdN8kvQWMoDZrh2tOk8nzDp eGOq9vIk73Z8EfcMkxHcgUZ5x5eyGCv3lctwRJP5RWdMgOwZXGyEfV55oUWWS4bZ1NFf 1mbUbyqM6IxxyCJfJZWRcMI1yZCUrdsbp4HvYo6zspJnJ3ysKt+hWHkhrWg4DSJCi/1T kV5SmO1Ql31dkt/1U9GBzYmTbhujkMROY+ooDqs4NdlRAq/dax7gzKnfvv9XtsZJrl6V 6iTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=4amNcmn4lLi0WYE5E+oR82ocG02RwkiTm9yilva10+Q=; fh=1hTpj0rN8/zsq2dB1WjVz8BS0H4o2dii79JpXbOoWBw=; b=J7/LeuQdl8GgZfcMwqhBhBaMCS4zf9Pc4iaTTroKBYFSbFnocWTLatLnXj39+GPl4s qjKW2G0jcZToXlBCt60UXeXGbSfdv3FH0XKxanBRbB6wiRAin5erXpWbRX9zqtXWJlIo o1584iWO5VHEaSd5dH0WnHoKDMAkAAIPsekigf1+NMsdk775Il1bFJLentCxVulZUgqU bJrDlp/BE9ANMRMGJDcFD+AFIJb+jDv9FuYqRJbzIY5fHVikO1cTpTkaCoSDBZKTc6y2 zBhbdtRIvwbPNrHx1qD35jbqq+hN6OzWvk+89kl40atXt6I0p/jZsXVlftZTm4PfMyHe Hk5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JpDwv0c4; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-135419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i22-20020a05640242d600b0056e07cb0b74si3681682edc.365.2024.04.08.06.20.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 06:20:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JpDwv0c4; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-135419-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8CEEE1F22341 for ; Mon, 8 Apr 2024 13:20:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C244174BE8; Mon, 8 Apr 2024 13:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JpDwv0c4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D9D52757E3; Mon, 8 Apr 2024 13:16:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582189; cv=none; b=hRFXVRsi6khIRynWepwkB/kCQ2gM9TLx88ruwlFYsdoOwZb19gQhX5kJQYFu4oRtW34belCSxoH3FNjMXiLxicnmFChysLslsk0ZABa9QBYw8h/2mf1NCdFiz6GbJfd5a4vkQZF36rcjMei0ABub/KFSNXY8oSAE1Q5gpYoOlYA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582189; c=relaxed/simple; bh=06ni3DCbQ3ig9NBb3rJXHn1IFQkHFqei2QnMHNmMJ9k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QthGybNYlxGXaRJ6fNcxUn9vKxmNldD8KiWaxv/tg+8NnUHODMQuCalh+XRKg1pA41ObjcIEl5GcABl23MJyW1UAvW3b5HjwOMlWvE1Hz5+jsC47GZTrTmVk2PiuU9hSwXTT6KBcAMA4eRUVpsovqd1QIIzaAUYnU6ObZXP/T5k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JpDwv0c4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 572ADC433F1; Mon, 8 Apr 2024 13:16:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712582188; bh=06ni3DCbQ3ig9NBb3rJXHn1IFQkHFqei2QnMHNmMJ9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JpDwv0c40rj46UZFN8n7yHh3quugYciGDS0Uka5UM0wMkTyop0K/dgg8vH5DSk7jb qJ6LrxUYyrpf0++naXPrIGa3HUWwclxFX71sMX1t3xApqBuDgoMwBCwNZfmlvl9BWq u5fgF9b2vRXg/RnAaEad6X2Wvvi8vSKS5e9lV+/g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sean Christopherson , Paolo Bonzini , =?UTF-8?q?St=C3=A9phane=20Graber?= , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Mikhalitsyn , Sasha Levin Subject: [PATCH 6.1 085/138] KVM: SVM: enhance info printks in SEV init Date: Mon, 8 Apr 2024 14:58:19 +0200 Message-ID: <20240408125258.869451928@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240408125256.218368873@linuxfoundation.org> References: <20240408125256.218368873@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexander Mikhalitsyn [ Upstream commit 6d1bc9754b04075d938b47cf7f7800814b8911a7 ] Let's print available ASID ranges for SEV/SEV-ES guests. This information can be useful for system administrator to debug if SEV/SEV-ES fails to enable. There are a few reasons. SEV: - NPT is disabled (module parameter) - CPU lacks some features (sev, decodeassists) - Maximum SEV ASID is 0 SEV-ES: - mmio_caching is disabled (module parameter) - CPU lacks sev_es feature - Minimum SEV ASID value is 1 (can be adjusted in BIOS/UEFI) Cc: Sean Christopherson Cc: Paolo Bonzini Cc: Stéphane Graber Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Suggested-by: Sean Christopherson Signed-off-by: Alexander Mikhalitsyn Link: https://lore.kernel.org/r/20230522161249.800829-3-aleksandr.mikhalitsyn@canonical.com [sean: print '0' for min SEV-ES ASID if there are no available ASIDs] Signed-off-by: Sean Christopherson Stable-dep-of: 0aa6b90ef9d7 ("KVM: SVM: Add support for allowing zero SEV ASIDs") Signed-off-by: Sasha Levin --- arch/x86/kvm/svm/sev.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 3dc0ee1fe9db9..1fe9257d87b2d 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -2217,7 +2217,6 @@ void __init sev_hardware_setup(void) if (misc_cg_set_capacity(MISC_CG_RES_SEV, sev_asid_count)) goto out; - pr_info("SEV supported: %u ASIDs\n", sev_asid_count); sev_supported = true; /* SEV-ES support requested? */ @@ -2245,10 +2244,18 @@ void __init sev_hardware_setup(void) if (misc_cg_set_capacity(MISC_CG_RES_SEV_ES, sev_es_asid_count)) goto out; - pr_info("SEV-ES supported: %u ASIDs\n", sev_es_asid_count); sev_es_supported = true; out: + if (boot_cpu_has(X86_FEATURE_SEV)) + pr_info("SEV %s (ASIDs %u - %u)\n", + sev_supported ? "enabled" : "disabled", + min_sev_asid, max_sev_asid); + if (boot_cpu_has(X86_FEATURE_SEV_ES)) + pr_info("SEV-ES %s (ASIDs %u - %u)\n", + sev_es_supported ? "enabled" : "disabled", + min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1); + sev_enabled = sev_supported; sev_es_enabled = sev_es_supported; #endif -- 2.43.0