Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp997955rdb; Fri, 2 Feb 2024 10:07:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsLtYvkQ5wxaIadRCNB5ymW9hCf5LdZtARpP20Wg1RPA0u71OZ111GETc+FOocHTEeww3s X-Received: by 2002:a19:ee18:0:b0:511:f41:dff6 with SMTP id g24-20020a19ee18000000b005110f41dff6mr3762418lfb.37.1706897241070; Fri, 02 Feb 2024 10:07:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706897241; cv=pass; d=google.com; s=arc-20160816; b=aObUNEq5Xb5Qy3I7VRhLeRnaEu1BB9hylh+k/elUZ6+0G0T5hZ3Xiy7hUU9uzleqxa 0ALcC6fNvXVWpWo1EJaHKwKGJ0Q3ZRPyigEbKYraoUv8vCV2eSWII3UtjLYvEbeH3miq /JswEFK464vCETbjYrjsjPSzRZAUNnU3HkDLOyB/ewUHtl/T69c7vsLNSAEQdQUrpr42 i/OTeF0SA47Tbo30vRtcA9e8fZk2r9c4hIXfz418t6iO1SveWpehMzUW7OT6vaeAJ1tx plcTCt8NlSEZmuzQ7Me3rmhgqrvp5T82xCbpUOSS6Qudd72NL/cR/ahZL8ytPjkdO5/C biPg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=uVRplVyrc9nYcvh+2WwM6XgSY33Nf8X5Ft1+PR+SGLM=; fh=2DIgblXO3/vFCOzdpm2Bb8LDBUwUnNRORHjkBAa2smY=; b=j9VqUkdZPissUOFGTPpVFEwOHwc+bj7agrLIz6/WwAMIgNnT2HV1O6glYYqoJ2frRf SPFM4iWzCezMClm0HXGVPv2SG5cpgH+5cDCKtNlzMt/4/q9QAzsXKidGTSkxWyV6VH52 G02t+AP3YyUEaFq8dTMTrLry2ln0OWTzG+Z1kOS76i+HYTSycKgFQh5F+ZG7KgGdayDx 1c0qayJLQP4S/hFnX1pt8udAocwbv6Pdn2BViTf9H72XUr4q1vFjMWpbgIfnQTyUzCH2 DqCW7Rs120G49jASZ84iQRNZPHol8o7dZsKXXhdKnaReQSpbOJ6rQdGi/TSh0q/YpA/c tvEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=z4c1jWNV; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-50293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50293-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVwzb7Q1kgjrWu5JiukpS5gYd/KBzYM/vUpHYZd2igOS0SpaL+1ezup2gWWmJqn/ARUZk5eoiOvrJoD57jn3yRiB3AwT+YE13/YBLpSdA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d26-20020a170906345a00b00a35991e5071si1056836ejb.843.2024.02.02.10.07.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 10:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50293-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=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=z4c1jWNV; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-50293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50293-linux.lists.archive=gmail.com@vger.kernel.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 CBDC01F22F7E for ; Fri, 2 Feb 2024 18:07:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F1A9414C59D; Fri, 2 Feb 2024 18:07:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="z4c1jWNV" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 8133614AD1B for ; Fri, 2 Feb 2024 18:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706897233; cv=none; b=DtR0+2fIMvVfWjCXv9/fJpwOGTHHWGlX2pas9DoJ9I1RH2JfIKCBNAQmeubeC+Le9TjMJPl/1ApeAS+3pN+TDrpm099UyfEyIDE7VfH7vjgB3yxmOhzw9Hh5+8O4BYe85PLoyuRbziKJkUGWe710CMSDE5KxDx3h/KVMML4Agv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706897233; c=relaxed/simple; bh=Tnhv8sNX/QnVZcJ58iesaELBYEexgiSK1O7CkAZ6Cnk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FTo13qA9io3QVrlLib6P+Kdz1nw4H/qA88+7Oy1uuscC37kM+TjiwVSlsn6jbozKSIU6Wxnx/dPFfgoSSezbVdLy4pqlB8TxytQDlIGUguaPrJ1WYyB8Z0BBac3VDK6jv275Q7O7xMVRVR/p+loZjJdi/YWycIS74R7xLm7gZ10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=z4c1jWNV; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6dfeb8e70d5so953668b3a.3 for ; Fri, 02 Feb 2024 10:07:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706897231; x=1707502031; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uVRplVyrc9nYcvh+2WwM6XgSY33Nf8X5Ft1+PR+SGLM=; b=z4c1jWNVM2WV3H/qQ9Ajl2op3jSmkqVUgppdaFrmzOCQaCueHb3+czFsUYXXy7t4VV GzImGD7TF9zdDYoLfDBYyPIDp24tX2oCeoB1XpjPALVs0zfG6pOqYHCaJ6dzWTXBDETV V9bomfwt8OJv2bXf15wVP/EZVdyac7eBgi7z88vkAu0xWefu1YETCSXAsF3kFXDf4QYJ RPfUQ+wd24Qq2yTq2UgZVv19557Pa4cehILC2VsO5Ut3J7Snfoat0ZWx6c6DX/k7kqkn Rwi0ga2UwzpjLBO5fzpdUxXrQbX8s0aUDGQYNwed4DoSwFopZS/9JoYpbllq4LTT3Clo g22Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706897231; x=1707502031; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uVRplVyrc9nYcvh+2WwM6XgSY33Nf8X5Ft1+PR+SGLM=; b=Uw5VUST68lrxdD5/ZHsp5fd43H4aDQxdmn5FProH1igE+4aDy1Ifu3HYW4gnjO6ZOD X048izQTjaZdLDsR4jb5wz3mKEkHG/LrOKmaiV4c+YHow5BhS5VdG2QeSXivMrD7LPet G1Ut1Ofy2/R3aTxW2SkeNqsN41v0sdj8RIJG6z4KM8ePmac713xYhfzBy9cRJT+22diL QJeSDUySgMuy5V6x84sOP47yOcV8Eqyy4pscgyMv32TWI+/d68W2efMPClYLLNZkxFDe d1cAG9M2vmiqBHyYC0qXygPF1Pq5ZgNrss8r99QFZoNsk/ovPHWH1xDEoKDWcgaesCHo YpkA== X-Gm-Message-State: AOJu0YzKeJg7e0Jt4QWG1qhDcH4r0wwB53cSGqkxmDGsz/6iLjnn0XIi QDhMgBkUI91/q5os60QJf2kmhLSdpAk6oJ6FIfdUsY8VLEz/qvfis3elyyGrUB8= X-Received: by 2002:aa7:8895:0:b0:6dd:8891:c4 with SMTP id z21-20020aa78895000000b006dd889100c4mr10813749pfe.25.1706897230894; Fri, 02 Feb 2024 10:07:10 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCV5IZ51+bmx0aGfXOAVxSYK/DIV7nwJoXATKClGG9L55mbhsg0f2xhaPbM5gDVgWuvaSDmKn0b8kOFbrtm4RnU2XbBlR8L/qiFduUki1lgDESJzNlNH57tXCv0N0ylOqjMvYeakFqb9CRxWqDhSXbbu7ZT5W38mJVsH5UZAmZfUY/IF7uwD0n7aPGNH6cmaj5qsfLMYix37h8yGxZUtRW/zg+Z0ykChA6kFdHB6au4p8DQiEzPsZg5BtsDXHcuHCd8KpNFzQlgpL7pN Received: from abrestic.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id s26-20020aa78d5a000000b006ddd31a701esm1989267pfe.19.2024.02.02.10.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 10:07:10 -0800 (PST) From: Andrew Bresticker To: Ard Biesheuvel Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Andrew Bresticker Subject: [PATCH v2 0/2] efi: Fixes for EFI_MEMORY_SP memory on RISC-V and ARM64 Date: Fri, 2 Feb 2024 10:07:02 -0800 Message-Id: <20240202180704.808766-1-abrestic@rivosinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Two small fixes to enable the use soft-reserved/special-purpose memory (EFI_MEMORY_SP) with dax_kmem on RISC-V (and ARM64, I think, though I don't have a platform to test it on). Patch 1 fixes a trivial integer narrowing bug. Patch 2 prevents adding memblocks for soft-reserved memory so that it can later be hotplugged by dax_kmem. Tested on a RISC-V platform that presents a range of EFI_MEMORY_SP with Bjorn's MEMORY_HOTPLUG series[0] applied. [0]: https://lore.kernel.org/lkml/20230512145737.985671-1-bjorn@kernel.org/ v1->v2: address comments from Ard Andrew Bresticker (2): efi: runtime: Fix potential overflow of soft-reserved region size efi: Don't add memblocks for soft-reserved memory drivers/firmware/efi/arm-runtime.c | 2 +- drivers/firmware/efi/efi-init.c | 19 ++++++++++--------- drivers/firmware/efi/riscv-runtime.c | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) -- 2.34.1