From nobody Mon Oct 6 06:29:00 2025 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 603832441AA for ; Thu, 24 Jul 2025 23:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753400232; cv=none; b=THKJiZCBM0dgAHCtfjsiyViky+CYq9ovQ26e2++cZsCMnBCvgX6PplChmmtjQK28/olzPB0Nw1NNKHAVwMKp/BGnPi50jlJA3o76nDKkVEeIDgLG4g9ZBqH/fevxjsN3WKe4DdeJZ7ahLVLwUEcpSutmiKGvi+7e+nn9OKFA3lU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753400232; c=relaxed/simple; bh=h7Os8p1r034RH4lkAG8aM6UqzQvcIU6v8/5QpRCRTlU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bE6OLhOMnxLkv/7dVGJHwcwQHqfUZOyZiHOou0NMtCpk/8eS3H3MDPxb0443rk9U/euDJd0E+4DqM52WPB4ezjORbC3No1mZk5LvBmuG49LsRzWVMcQ/bF+k8avFF4kB+sJnJNuuISDC+5EvmlEwgDASugkr/f5js2U/6n76Uck= 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=tP36yNMh; arc=none smtp.client-ip=209.85.214.174 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 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="tP36yNMh" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2353a2bc210so15112515ad.2 for ; Thu, 24 Jul 2025 16:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1753400230; x=1754005030; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CG5iG7HEmzaJkQJOJy5GwPyyfPnsO8eGyVBmIiBheIs=; b=tP36yNMhuKZ9NHW/7VHU6Fr9um42pka75oOtwsXVAH3IJFdbQg+ajG3vp5Br2iBABO ckAeG6TIA3A4iCOZdg2LH9wYxm3clrelhvpUyHFV3By7FF9nJxCyVOQouOKsJsvLYWVf Pkl18jg4qiog2x0af1crMtJdVFpSHaI7SetxRNfLunRmcFX2mU4wxmY8R92IT3oLTWSv hrevLBQ+dhxvDEOaqDBYRPhMsTD896NBbxfqsjXQ62/XS+Cyg7HG9xu/rkj/vkHR5wly 5v5C3B0Ekf5WjsiFrhcDg9DelsE+40jr9yhei+oGUDCUns6XS1E/8IeeZRGtUNrRd29B j5dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753400230; x=1754005030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CG5iG7HEmzaJkQJOJy5GwPyyfPnsO8eGyVBmIiBheIs=; b=XjjHAO3y5znZ+5xzb8I+OgCh6hb5m50RT+7p61nwUEiNcCuJCz6DecaAq1sD21CI/s +X7NiBDeGVfm0lqSNIiv8dCc6XAMKRz20/8wFTM4JQWTs8ZSLUpMZj/ONvThHKMBWEu7 /ROqSceazss7Xx4mEux4qRXd/li9qnGzHN0I8nf6sjirhHzDT4eF4TDFEptvOsmI6WRl Ly3Ft0woVIkH1uMbbBVX++2lSdwcvPa9qx9pCmRhJAX+1EL7SUIXIOq1/zZ7Bg887amu S+JENt8sKEFMOHSS18YNeKhjF40v9cOB33u8E6ShijdVRFm9qjlMeBEutqW6pVeLKxLY kPVw== X-Forwarded-Encrypted: i=1; AJvYcCWFx5/xGvlvzvfOKqT5N2lIm5GLKWU3RYiGdQZkjHctUDPpQzc0JrlPkvjXDFT157BK5Va7nia60mI8VOk=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0J9dUIfWASAmd70e6d9qDLwmtVfnZ1hnlf2ZKBjl7fhvnQRXN 4AQxMk2PrHHsroochhH55tQbnRXP9IaTlGjmEJ/TzURwsW78nAcK6RU9KpOvh0q0BKY= X-Gm-Gg: ASbGncvxpDiubgPmnVBRkWPAMmQo1NPgo7l+eJ1umDYSMYFCF+zipVET2+7OI8GChqf /S4QKazKansun4BFi+zcJ4jxP5591oVwPNdp7UK4DH/MeecIykIwDQ5tE78OMrsIGEO6mk2Rhh7 kUgCgGa/KwVPk287YtNiF3C3TAcWv8RTOQUnUjva/ZImeGr436oNiWR6EhbeQi7H9IVQUZPMcQ9 oVOYAcEkC3GbpC94oN3R29vJn8wEXWSBGdQ2Bwpoh/ARrMpmFRBNsU1AxbvXbJqd4ksHOlPPDve +U3G+G77VkUDEMGPULLpwKUdpbu0u3TpdJK7tnzk+sRkSu7SfhsPoEAo3KMJLuNhxM66Unp8y1T Yyh+jMGWkjmTOI/Ff+i6PZwAFM/u2aBdc X-Google-Smtp-Source: AGHT+IFimijtxboQ83ruW5Lf/Edn+u8E7CK8azktAcnwGUUTAe1++zEjf4xwnHFBVkfDbfBbAK27Uw== X-Received: by 2002:a17:903:2a84:b0:238:2990:6382 with SMTP id d9443c01a7336-23f980de085mr106900615ad.0.1753400229626; Thu, 24 Jul 2025 16:37:09 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23fa48bc706sm23598685ad.106.2025.07.24.16.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jul 2025 16:37:09 -0700 (PDT) From: Deepak Gupta Date: Thu, 24 Jul 2025 16:36:55 -0700 Subject: [PATCH 02/11] riscv: update asm call site in `call_on_irq_stack` to setup correct label 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: quoted-printable Message-Id: <20250724-riscv_kcfi-v1-2-04b8fa44c98c@rivosinc.com> References: <20250724-riscv_kcfi-v1-0-04b8fa44c98c@rivosinc.com> In-Reply-To: <20250724-riscv_kcfi-v1-0-04b8fa44c98c@rivosinc.com> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Nick Desaulniers , Bill Wendling , Monk Chiang , Kito Cheng , Justin Stitt Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-mm@kvack.org, llvm@lists.linux.dev, rick.p.edgecombe@intel.com, broonie@kernel.org, cleger@rivosinc.com, samitolvanen@google.com, apatel@ventanamicro.com, ajones@ventanamicro.com, conor.dooley@microchip.com, charlie@rivosinc.com, samuel.holland@sifive.com, bjorn@rivosinc.com, fweimer@redhat.com, jeffreyalaw@gmail.com, heinrich.schuchardt@canonical.com, andrew@sifive.com, ved@rivosinc.com, Deepak Gupta X-Mailer: b4 0.13.0 Call sites written in asm performing indirect call, they need to setup label register (t2/x7) with correct label. Currently first kernel was compiled with `-save-temps` option and normalized function signature string is captured and then placed at the asm callsite. TODO: to write a macro wrapper with toolchain support. Signed-off-by: Deepak Gupta --- arch/riscv/kernel/entry.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 2660faf52232..598e17e800ae 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -389,6 +389,7 @@ SYM_FUNC_START(call_on_irq_stack) load_per_cpu t0, irq_stack_ptr, t1 li t1, IRQ_STACK_SIZE add sp, t0, t1 + lui t2, %lpad_hash("FvP7pt_regsE") jalr a1 =20 /* Switch back to the thread shadow call stack */ --=20 2.43.0