Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1310521lqt; Fri, 7 Jun 2024 14:33:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXag7GNkIBPwxH8r4u6O0EmlnuQfQlpoMQCBIpd5KVltQUI585l9usBoz6TYGvl19eRuTdSD+kQFWBxb/mGIvUPfK6NSwsyj3uMO83zoA== X-Google-Smtp-Source: AGHT+IFjk1HYFicXC3VpLwoAfFrLy5PcvUvac9IC0NkbzsEkioRwgzBwfbDKe6Wkr0CuBMQBzWYR X-Received: by 2002:a05:6a20:918c:b0:1a7:23ae:4421 with SMTP id adf61e73a8af0-1b2c56e56c2mr11012316637.24.1717796021677; Fri, 07 Jun 2024 14:33:41 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de20831ce5si3711046a12.162.2024.06.07.14.33.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 14:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=s1lmgsdF; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-206775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F2541B227F0 for ; Fri, 7 Jun 2024 21:33:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC04E155341; Fri, 7 Jun 2024 21:33:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="s1lmgsdF" Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2045.outbound.protection.outlook.com [40.107.236.45]) (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 EE6C517BB7; Fri, 7 Jun 2024 21:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.45 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717796011; cv=fail; b=SAARsnDbwo5GhS8t93DflhS7cdaX7rhzN4asebNFd1mhyUIE45+QzjVUHnP62qPAVrgHbCa9qXedTv8dJVMjNwdvenFuWig30mJ2LjCeJ9PTFew4UzbLVx/BRuW5WS0nkTZ6Z57wZ3On58YHbP0rXUjfvcDzfEHYqprxfiWqRcY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717796011; c=relaxed/simple; bh=rHjj1PVhZEqcOXDphIkhFX/joJ5uQvwvq84OD+kolLM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=EBbtty8v7v+4Y+LLgFtvjXbUTWeCukRRaCWCW7s5buCoya3uAPy64PsIvbDuFw2aAMAeOPphoXFFYe1jT8oC5Byx+zm6Hh6G1n4r2/nQ0VW4ZWZec0h1KOHTkzFiJvBMLZK/ORHkJK3DJS7ugZdJdtbfIc9hZgwam9BOJnKn13U= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=s1lmgsdF; arc=fail smtp.client-ip=40.107.236.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0tQHsBw1TY2Jii8dzJhwt8HZqQtiVPFRLcRfzNmGT14J6g5Hxy0x3D0rIC7tIGzpxFfxO9aINLjVplvP9I7s1fJ0ntt/rfsFbPsN67y7b534/EJJV8slGMaAi9w9c/BtwDvGfb5BRNHoNTIVSPmN9UR5mAStAzMu/o1htaeml9p7Xp9G0uDZZ2c/d9bGgqFfDA180gdfoFzy+3xkZUlU3iqzfs5tPm1b+E4mmCj+hqNlfdUNdGjBJw2E5q0w17PaewtKxtGwY/2yOD3nmErEKBroq4ueBGAheESO3WPeXCftdYxhL94IzEkjdD3hZ+SLOd8JS4B19qWeOls2Sz8RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KVEowPcblSSBfo7DGzDRNbVmmjU4jWlyAbZ9WXxflgI=; b=Tj/Z9R0GgJ+eeY9G4sQc6gFpH7E+h020aa9o5W95wBMHyzEfwTWH7XUGy6OwuiGfpmcBTNHZ9fvJgg9xPtsMWMs7KYyIdeK4Mx2YQKk634qQ6XpFET9GVhTZkOcWofk3DCVk5nw+S+Ej6rI0wPky3QeSW2zI8HGyEeBQk44x7adx80upGq/V4WWRLIgFyRNbYZWzeym8BgsaQTJParHlmdFm0QkiZ82wvxKEGjaItvNEGWqAGj6+9Mf96ntLdkEG9o2JqMIRCndMSS06IZT2C6dK4zuF22RyFvPqb2r2v4aIFzzktA1l/GrgvsQ0geJ0bEbC4HWEfVicWdXH9YBtog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KVEowPcblSSBfo7DGzDRNbVmmjU4jWlyAbZ9WXxflgI=; b=s1lmgsdFYIXPh75E5AmFQE/8FfEtK/xN3pQe/9p/nuRLBzqZsWZV6cOE/SvZOVe5PzPudd2J/YXGvYw5yWMUUBy7UMCfJv2mAr++LCPIdM6JF0zxRHRZE8NlvEobEVbBlktha22DVuPXKDsni5QK4/p7pnOUBsKuOYGWZ1PNdBw= Received: from PH0P220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::17) by BL3PR12MB6452.namprd12.prod.outlook.com (2603:10b6:208:3bb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Fri, 7 Jun 2024 21:33:26 +0000 Received: from CO1PEPF000042AA.namprd03.prod.outlook.com (2603:10b6:510:d3:cafe::72) by PH0P220CA0028.outlook.office365.com (2603:10b6:510:d3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.21 via Frontend Transport; Fri, 7 Jun 2024 21:33:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000042AA.mail.protection.outlook.com (10.167.243.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Fri, 7 Jun 2024 21:33:26 +0000 Received: from quartz-7b1chost.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 7 Jun 2024 16:33:24 -0500 From: Yazen Ghannam Date: Fri, 7 Jun 2024 16:32:59 -0500 Subject: [PATCH 1/2] RAS/AMD/ATL: Fix MI300 bank hash 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: 7bit Message-ID: <20240607-mi300-dram-xl-fix-v1-1-2f11547a178c@amd.com> References: <20240607-mi300-dram-xl-fix-v1-0-2f11547a178c@amd.com> In-Reply-To: <20240607-mi300-dram-xl-fix-v1-0-2f11547a178c@amd.com> To: Yazen Ghannam , Tony Luck , Borislav Petkov , Muralidhara M K CC: , , "Yazen Ghannam" X-Mailer: b4 0.13.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000042AA:EE_|BL3PR12MB6452:EE_ X-MS-Office365-Filtering-Correlation-Id: c3d8bac9-ec9b-4cf1-f62c-08dc87397736 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|36860700004|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?B?S2RGVmpVTTlxN0MvRUFHWS9MMXZ2K3dOMkhD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RlNmMkk4ODZJODdvNzlKMG4vdEU4OHdvdWhwaFRY?= =?utf-8?B?MG1HOVpEQm12d0V4bUFYUnpSY3R1UTNXOENNUmFhaStqd0E9PQ==?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400017)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 21:33:26.1025 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3d8bac9-ec9b-4cf1-f62c-08dc87397736 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000042AA.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6452 Apply the SID bits to the correct offset in the Bank value. Do this in the temporary value so they don't need to be masked off later. Fixes: 87a612375307 ("RAS/AMD/ATL: Add MI300 DRAM to normalized address translation support") Signed-off-by: Yazen Ghannam --- drivers/ras/amd/atl/umc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/ras/amd/atl/umc.c b/drivers/ras/amd/atl/umc.c index 59b6169093f7..5cb92330dc67 100644 --- a/drivers/ras/amd/atl/umc.c +++ b/drivers/ras/amd/atl/umc.c @@ -189,16 +189,11 @@ static unsigned long convert_dram_to_norm_addr_mi300(unsigned long addr) /* Calculate hash for PC bit. */ if (addr_hash.pc.xor_enable) { - /* Bits SID[1:0] act as Bank[6:5] for PC hash, so apply them here. */ - bank |= sid << 5; - temp = bitwise_xor_bits(col & addr_hash.pc.col_xor); temp ^= bitwise_xor_bits(row & addr_hash.pc.row_xor); - temp ^= bitwise_xor_bits(bank & addr_hash.bank_xor); + /* Bits SID[1:0] act as Bank[5:4] for PC hash, so apply them here. */ + temp ^= bitwise_xor_bits((bank | sid << NUM_BANK_BITS) & addr_hash.bank_xor); pc ^= temp; - - /* Drop SID bits for the sake of debug printing later. */ - bank &= 0x1F; } /* Reconstruct the normalized address starting with NA[4:0] = 0 */ -- 2.34.1