Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2388557lqp; Sun, 24 Mar 2024 17:14:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWI8p6Ji+1C/2pTqlVvK3Xy2kRiKPG2cKxRc7Y1rP9Mc1Thzoc59bGyuMl8+rF6ZANIx7NA9iN11VcrDjijU0Ay4qZYqTKKrQURK4BRgg== X-Google-Smtp-Source: AGHT+IG/WBiSR2AapQTm1stWJx3hatYN5oZNtPU1fMNcRuVc4axmuree0NORo5fHf9wpZgiYLB/e X-Received: by 2002:a05:6830:12c1:b0:6e6:73eb:d87d with SMTP id a1-20020a05683012c100b006e673ebd87dmr6381086otq.2.1711325645296; Sun, 24 Mar 2024 17:14:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325645; cv=pass; d=google.com; s=arc-20160816; b=O2iBROO/O9Zu6YHddopxyjl2mNIyDPKaZN0wR3oePChBvn25nvDnWgq/cqcimmSYEx hA595lRvOncNI/q0ukzL3VmIDFKlFAsVjWgs5tFBS+IlFfyxUE0vBxw7rFRPOEWpVOSv 0VQXcC3HnX5R3RkxPvE5/fGsdq/8MR8wbxIYSKNFsYgdvBpcGpQHPd460gcVywF4xJro aNoxESWQPZTni9SQ3IHrKbfcFK+qY0nQukPTKMFGuGdswb6gZow6smrXdBss1urLF92q nlfC/8LUu+k1kgIWLQczdUWhceCFy/IinZrNmFhHKBCnRwfYdV+7hB7jxhNjd9WOYO+Q s6mg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=frsNN99I3Rpb7BLix/xRr7sMC3Wg7RPs0YLXrXdTc2I=; fh=eKLn4LiBGF61U96YE1Hogq7Imk+8uoGFWiVH93rCSJ4=; b=pLok4E5xSmEiMBzKbJ/kczY/WNAvE/yTrM2ey6jMqvV9maLvnGFvflw91+UQTn28hf DbzYWSaIuiQBYpNeKRbuo2yR8JhJ/ophoCxtltlFHNGvJr0zwP6mzekObYDe8k7gS8el fgmiCc/pV2cMcbaSNbI+IsWNCZq8RjUQf+s8n7H0dQd96csKiW47tnCf4rFJ5IQKtJPy 4AWqf/bborDD7QNn44Y196z3SMc2v/JbkhqXG3Ejq0k49HT12AilU4Zp6PMsPmngxzG8 o0k7SVh3ZmFEoA2kWQ9lBbsOzh6/K3Z/iCTHQBtfi771jXJli5GEssWHAuEHT3smptTV gc1g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sk412bDo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113340-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r18-20020a63d912000000b005cf60fc5fc9si6228492pgg.274.2024.03.24.17.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:14:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113340-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sk412bDo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113340-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113340-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B8E082802A7 for ; Mon, 25 Mar 2024 00:13:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 938B5198329; Sun, 24 Mar 2024 22:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sk412bDo" 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 AB51F19830A; Sun, 24 Mar 2024 22:42:21 +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=1711320141; cv=none; b=kTQesHKbsq0tlQrmUFybAEqoNkYhy2CULPVIz24rFfMwiUHCgeIbH4i6pQsL5rpoauC/ldS/0DG6e8yEphRYXDK6/CCgVEUYbRQRPgmJeXVHnDVMvfYXLXcRlYCUVqiFVh3ZBY1mVfbZI98qf2i7RAp3FlOB/7EJXZXOpapeMSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320141; c=relaxed/simple; bh=jyV1TX5A+7iSqnqRUOa2/4OWZvNsUm6BFOPjlQ3iHEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Evyn9ExWUCj3DzXUC/B8odQcGaq1whgUVKRj0er+cEHYZHLPot9LCr2O/uEyLA5AmVz7HViHOjZZa/jljO+fDBpa8x8MBfPEG3EhdmDjSh9wvFN+8vMcXJOzth+mGQUo1G2XCXH3hT9isBddtplwJyaB+TkAHdHnc29Iy+J0KPU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sk412bDo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A11C2C433F1; Sun, 24 Mar 2024 22:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320141; bh=jyV1TX5A+7iSqnqRUOa2/4OWZvNsUm6BFOPjlQ3iHEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sk412bDogM13Zwm+Y947/pW3jq5ZjkYsLP+CPALFVBApWZabrjASnRYyKa5/wCUy6 b/rtUAqnZ1HbNOrZGXqBpXy5fRmuUjK7iz6t6zD87YVNXJttkiXEFnKfkRPnYGSrUX de/2E8+RU/ZG2WQzZGvQuV9xqE4sD8VshSi+J+I2zGD4ecPZZnKICA4WQwqpTYZ/2b 5w0ld5Cus4CHqOlNQZSsstiLiZldG4vXNhqylhINmiHZNMKcWej7elbw6Xj4bLt4cK 0VsZM/mYeQ+Yg2n6Dnu6rd1r1WRZeDwy5f903Cizhv0fi1os3qGHJi/AHoDjmM+RnR 6gr2AszshAJKg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Piggin , Geoff Levand , Michael Ellerman , Sasha Levin Subject: [PATCH 6.8 449/715] powerpc/ps3: Fix lv1 hcall assembly for ELFv2 calling convention Date: Sun, 24 Mar 2024 18:30:28 -0400 Message-ID: <20240324223455.1342824-450-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Nicholas Piggin [ Upstream commit 6735fef14c1f089ae43fd6d43add818b7ff682a8 ] Stack-passed parameters begin at a different offset in the caller's stack in the ELFv2 ABI. Reported-by: Geoff Levand Fixes: 8c5fa3b5c4df ("powerpc/64: Make ELFv2 the default for big-endian builds") Signed-off-by: Nicholas Piggin Tested-by: Geoff Levand Signed-off-by: Michael Ellerman Link: https://msgid.link/20231227072405.63751-2-npiggin@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/ppc_asm.h | 6 ++++-- arch/powerpc/platforms/ps3/hvcall.S | 18 +++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index e7792aa135105..041ee25955205 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -201,11 +201,13 @@ #ifdef CONFIG_PPC64_ELF_ABI_V2 #define STK_GOT 24 -#define __STK_PARAM(i) (32 + ((i)-3)*8) +#define STK_PARAM_AREA 32 #else #define STK_GOT 40 -#define __STK_PARAM(i) (48 + ((i)-3)*8) +#define STK_PARAM_AREA 48 #endif + +#define __STK_PARAM(i) (STK_PARAM_AREA + ((i)-3)*8) #define STK_PARAM(i) __STK_PARAM(__REG_##i) #ifdef CONFIG_PPC64_ELF_ABI_V2 diff --git a/arch/powerpc/platforms/ps3/hvcall.S b/arch/powerpc/platforms/ps3/hvcall.S index 509e30ad01bb4..59ea569debf47 100644 --- a/arch/powerpc/platforms/ps3/hvcall.S +++ b/arch/powerpc/platforms/ps3/hvcall.S @@ -714,7 +714,7 @@ _GLOBAL(_##API_NAME) \ std r4, 0(r11); \ ld r11, -16(r1); \ std r5, 0(r11); \ - ld r11, 48+8*8(r1); \ + ld r11, STK_PARAM_AREA+8*8(r1); \ std r6, 0(r11); \ \ ld r0, 16(r1); \ @@ -746,22 +746,22 @@ _GLOBAL(_##API_NAME) \ mflr r0; \ std r0, 16(r1); \ \ - std r10, 48+8*7(r1); \ + std r10, STK_PARAM_AREA+8*7(r1); \ \ li r11, API_NUMBER; \ lv1call; \ \ - ld r11, 48+8*7(r1); \ + ld r11, STK_PARAM_AREA+8*7(r1); \ std r4, 0(r11); \ - ld r11, 48+8*8(r1); \ + ld r11, STK_PARAM_AREA+8*8(r1); \ std r5, 0(r11); \ - ld r11, 48+8*9(r1); \ + ld r11, STK_PARAM_AREA+8*9(r1); \ std r6, 0(r11); \ - ld r11, 48+8*10(r1); \ + ld r11, STK_PARAM_AREA+8*10(r1); \ std r7, 0(r11); \ - ld r11, 48+8*11(r1); \ + ld r11, STK_PARAM_AREA+8*11(r1); \ std r8, 0(r11); \ - ld r11, 48+8*12(r1); \ + ld r11, STK_PARAM_AREA+8*12(r1); \ std r9, 0(r11); \ \ ld r0, 16(r1); \ @@ -777,7 +777,7 @@ _GLOBAL(_##API_NAME) \ li r11, API_NUMBER; \ lv1call; \ \ - ld r11, 48+8*8(r1); \ + ld r11, STK_PARAM_AREA+8*8(r1); \ std r4, 0(r11); \ \ ld r0, 16(r1); \ -- 2.43.0