Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1237132lqb; Thu, 18 Apr 2024 04:27:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUG7Hc7FdGu1uZ1GcAgs1ETfe1vK48CWviQKku/eltiEEK23hBAMx7b+anDQu1RfVbBjEeWClTxiBz5GueAi4aAEw6LhLkTdzxgDB2i2w== X-Google-Smtp-Source: AGHT+IFDuOu+8HPqsyZloRdIQ5bCCr6j32lR5JXdx/rI9akET8zj42GKCO0kGLDbVeh05Py1N3Ov X-Received: by 2002:a05:6a20:7f95:b0:1a3:a039:d11b with SMTP id d21-20020a056a207f9500b001a3a039d11bmr3129033pzj.24.1713439659061; Thu, 18 Apr 2024 04:27:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713439659; cv=pass; d=google.com; s=arc-20160816; b=PV2wx6R69bz118lOzXSEYR6LvvMMl2YxRzvaSRcsomrp5thgmEMoin5Qw4lXG+hQ6L aI4gfLnlAFLuRffL+75cJdA5HlixnjyhOcYLhgsqReHwwYm/LhAPpIGUJyBos7S82Vwl GITMDS2E0GUcEDe8HXFNE9EnL8vsdrnqQkYryltct2jmyP9m33Yg3yd1L6KnXPSmcfJq TP5dUcbOz6HM7RE9ml10J9lTG3+6/Eqi7bXtl6vZuxRc0hCcpo9+n5hzEP7O3+5yMwFs a44zpNFa/S6TEePuBrpv0qjaa3vCBtWiUZ9s4ThBMN/C7cv1uuCpH9SavHH1o5ZRM2DS UTJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=554fH9Cd7MwhrlcujjseGkWqSlH0FyRp9PRDR7JpJZ4=; fh=+UlVuxkyeNkk+EZxIt4+bpuRqIqQ6b2WkBWhBSzU3HA=; b=WbO+JfjaRvj+aENrj54uxCJ42Gn8SSEMHjyBQqXxZdoMxHP6GMlIhmeE/7CX6kKLUP w0SkdvXNGZvosIkOklYoHd+VLOaXu42lhVHcNMssN3BqsDH4JAI73Mvr40t3tZa6m0Wt r/32weCsDa1XdwZ+gltO/vZoGwSLAChe//C3oqX3a3GApUs7ly5cOgbpw9WEGaNntm/6 lOsvz8GAVbVXbCJTxw7fBqC8v8iA10ekxxJF/C80lxxxzSbucKx3hqs+GcHNZDGGjvJf Ps7udPjlHNPiQCCbW/bTpkxBfP6+szUL+JHgqsj58s3oSqBe5DbN7X9WxlXkVjnF8Ts6 hFFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ekqcJ5F3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-149965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s5-20020a637705000000b005f76c621e4asi1240522pgc.732.2024.04.18.04.27.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:27:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ekqcJ5F3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-149965-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149965-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A6EDC283C0E for ; Thu, 18 Apr 2024 11:27:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D49715E7E5; Thu, 18 Apr 2024 11:27:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ekqcJ5F3" Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3941315DBD6; Thu, 18 Apr 2024 11:27:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713439651; cv=none; b=YwpAFuB63x5oncbE1OnXNMvHGhNAxIFISUxqe96gCNof8oAi+cxisRG9uZUd3k8mnxfDm2yduy3b1wqdOcmcs+BwL5aNqV0+XzQzs2Pz/uyUNNLPqAuzDOBa+LWhUVVi/NRyYyeMLsTba+tYYZt8KbCYvIXTiQvF8S2hWtTlMLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713439651; c=relaxed/simple; bh=zYiLdrEVejpU8szBAhDTQgAKOfNea1cTA7YCvvFRdlk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aQnlZzVFefWPml8BZTu/nyLbUPLLU+sELu//sJl1XANjHsbjSp3sFVCoZUQULyf3MEfMXyKmmyGCvYQm1VtuKOpd3YexZ9sSwzRsFKO7l6/Vw0len7lKd6yiXBggDcKnQiVwSEvZPpd8zTcCue/rVpp+Dl+BRvpMhxToh3otv3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ekqcJ5F3; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6eb7d1a5d39so414685a34.2; Thu, 18 Apr 2024 04:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713439649; x=1714044449; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=554fH9Cd7MwhrlcujjseGkWqSlH0FyRp9PRDR7JpJZ4=; b=ekqcJ5F3Ubg3gx+Y8Na7uDX6TSGlQ1SHM+DLncB6J+TbuD8ZDvu461Ak/mp438e58A ObaOyb+d8o1HgeLycfgeZbsiLniVb0Dht9/uxNp49WwcTCpjASZUVHWdCIN51cGsPe8t m57aCX2yPSFTv7TK7kD9heT/YPq9wftf4AGRl8K7UY3v4WdmL0axG8R877Mi/m4dTDfh r1Lq9rFx60yvxbnnM67waj7ZBjyrj5aC4NJCYLy8YN2qWgB1GhNkhoHm2wDdj89wa/H0 9zwAxbI8Sj3m1+tLLaMgA/8VvJXrli+6sy0GCTCKPmAVYMcHMAvJPdKG1A7Z+tB+I2dH b7DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713439649; x=1714044449; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=554fH9Cd7MwhrlcujjseGkWqSlH0FyRp9PRDR7JpJZ4=; b=MoFVak/DGQCAup/TK2mOjvvWXfvWc+krXZqEDhThMTBxMcfHpXPvO2xrKxRu+KYOOn L5b9fvEzcaGdxH/avKG/SX2NHJ2cwExaRs9/UBZP9bPRjQ7iDC8liZt1KGdfrpN8jljS 4yJsbBkMmHg7f1iz/zGp/p6KJTYWMFcCmoic60Raq5AMOp1t4TlA4copjfJScYPVWLa6 uGE8X7hFcqZURwhWRbgBVcSE+sNKVVpN4CbRDP0mjTsykaLjuojdYDtZdQIUSBEFlVhM +DhXBLZQFIuZxy5C0gXI/vTjoR/bkIN1HzfkHVnwYQRbO+xQszyqBktUCjFUa5vpK0sV 66Ng== X-Forwarded-Encrypted: i=1; AJvYcCUqGqY3Xfh+vRLpJsZiTQLKu7xLSJEg9RJAIwAup/LpeWUYwFG4dHaD4NmXp63JbC25vh2Tx36uHSWmDLmbRiKbN/QmSPOItylWtuHiVotOAgtpu7CyMO5/iBDm4YSIhntsu4nVOqetGRlgowrFKJD8zw== X-Gm-Message-State: AOJu0Yzh31mPQZUdCn22MxhV3Wqey1mQyGgpJiHNAUmVmJYMPptZGoTU VNt6nLVyAGh2SIyc+EXsglmCav8Bp9p1PkC3SckdoxQzhLVwDDco X-Received: by 2002:a05:6830:928:b0:6eb:7a4b:a56e with SMTP id v40-20020a056830092800b006eb7a4ba56emr3253986ott.23.1713439649108; Thu, 18 Apr 2024 04:27:29 -0700 (PDT) Received: from ?IPV6:2600:1700:70:f702:9c77:c230:a0ba:a1a1? ([2600:1700:70:f702:9c77:c230:a0ba:a1a1]) by smtp.gmail.com with ESMTPSA id v3-20020a05683011c300b006ebab994655sm303698otq.43.2024.04.18.04.27.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Apr 2024 04:27:28 -0700 (PDT) Message-ID: <1071ea83-7919-469a-ac5b-3209fe9e018c@gmail.com> Date: Thu, 18 Apr 2024 06:27:28 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] platform/x86/amd: Don't allow HSMP to be loaded on non-server hardware Content-Language: en-US To: Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Naveen Krishna Chatradhi , Carlos Bilbao , "open list:AMD HSMP DRIVER" , open list , Mario Limonciello References: <20240416182057.8230-1-superm1@gmail.com> From: Mario Limonciello In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/18/24 04:04, Hans de Goede wrote: > Hi, > > On 4/16/24 8:20 PM, Mario Limonciello wrote: >> From: Mario Limonciello >> >> If the HSMP driver is compiled into the kernel or a module manually loaded >> on client hardware it can cause problems with the functionality of the PMC >> module since it probes a mailbox with a different definition on servers. >> >> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2414 >> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3285 >> Signed-off-by: Mario Limonciello >> --- >> v1->v2: >> * use pm preferred profile instead > > Thanks, patch looks good to me: > > Reviewed-by: Hans de Goede > > Mario, should this go in as a fix for the 6.9 cylce, or is > this for-next material ? (I'm not sure what to do myself) The main risk with this patch is if there are servers that previously loaded amd-hsmp no longer working because of a BIOS bug to exporting the incorrect profile. I think this is quite unlikely but not non-zero. To at least give some time for anything like that to be raised I feel this should go to for-next. Ideally I do want to see it go to stable kernels after we're all sufficiently happy though. Random bug reports to me like the ones I added to the commit message get raised mostly by people who compile their own (stable) kernels and enable all the AMD stuff because they have AMD hardware. So how about we target for-next, but also add a stable tag for when it gets merged in the 6.10 cycle? > > Regards, > > Hans > > > > >> --- >> drivers/platform/x86/amd/hsmp.c | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c >> index 1927be901108..102a49c3e945 100644 >> --- a/drivers/platform/x86/amd/hsmp.c >> +++ b/drivers/platform/x86/amd/hsmp.c >> @@ -907,6 +907,17 @@ static int hsmp_plat_dev_register(void) >> return ret; >> } >> >> +static bool hsmp_supported_profile(void) >> +{ >> + switch (acpi_gbl_FADT.preferred_profile) { >> + case PM_ENTERPRISE_SERVER: >> + case PM_SOHO_SERVER: >> + case PM_PERFORMANCE_SERVER: >> + return true; >> + } >> + return false; >> +} >> + >> static int __init hsmp_plt_init(void) >> { >> int ret = -ENODEV; >> @@ -917,6 +928,11 @@ static int __init hsmp_plt_init(void) >> return ret; >> } >> >> + if (!hsmp_supported_profile()) { >> + pr_err("HSMP is only supported on servers"); >> + return ret; >> + } >> + >> /* >> * amd_nb_num() returns number of SMN/DF interfaces present in the system >> * if we have N SMN/DF interfaces that ideally means N sockets >