From mboxrd@z Thu Jan 1 00:00:00 1970 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 C39223358D6 for ; Thu, 7 May 2026 23:23:41 +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=1778196223; cv=none; b=aqMwjmHbJEmjnWtLN8ezYEzX03tnAuQ4cS8uYQP2qRjsyXv+IXI+BbzQ1NhUw0zVxcxpV1jn6T8NIzYVWIoxs5rEketLhXN0D6z+7wWfGCmisl5V1wsu9/pOWyaRAJT634A51mPsURqkfgmMF3teuqOYpTKOiDbMS/G4FGmz7+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778196223; c=relaxed/simple; bh=1KJ2Bvoc6iZawqaQ7SOjwiQHPzA9sUFrhqqMHlRQJLg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=U/2zRfYuto01ZmyMN6q1ZkAJLMQFxZV8LexdzEVOxdHrJ4CSyY+qcVXnHpAYAn3OhCCLcmahU+/zFdqA/R+7fvVFa8oP8wFVlSfoxV6WRUB62oF8xRH7nxRAg9E5GJvk7Zdx7tf41OWtT2UqRZH6SrrEPBmSqWmC9mfUHpw5MDo= 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=HsX4Kc4P; arc=none smtp.client-ip=209.85.210.172 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HsX4Kc4P" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-83975e992e1so690357b3a.2 for ; Thu, 07 May 2026 16:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778196221; x=1778801021; 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=cGtvlVlMdfXez+6h1mKwdTb1HqPOhxq8X9+6dMnsoCs=; b=HsX4Kc4P58y3GcRBh1Ge65VmW/s7fMxk3EvR6/nWM/2omtrhhqxsQvczSXr3/ukVkE wOVjeLNJyj6lbU0wgd1ayPyiKYoLunr0OTYEaBD1Y2yKV/Ig+pckm+Ls6Etbljyhe+AT ghAPdq033whJzZlo+a4GlvQZcuxQn416KAgskvrHOq1myog2SoWOAUb7Dbd3QrbwcOac 7L3Gefir2asMr9SEI2MrS5QgKBGp/bTwURBB0ycwLOqPqzupug0u3IkfctIZystXEuZw mN2SrHISi2uwv2mWzgEe0oZo6ium8d3LgevuwPWdk5W6sdxGXIFhk/H4SQoePt4gATSq SNtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778196221; x=1778801021; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cGtvlVlMdfXez+6h1mKwdTb1HqPOhxq8X9+6dMnsoCs=; b=dtJnJy6gvq6t2oJJDI2QILrvHuNoK6Vwu5zCDv9MtK8FsxExTlHd416JktU1xhEigz qxXUX1Pl1u2iIXlilfkXWo/+YKhjrBpfm0Y46SnjA/vq0yFVtNeUpR1mB0tmfeuwkYbm vXMcieQ1Ys0yzBX+htQAOjHaa26FEqRxVXr5f0oyP9y7D1oT+RHrFfP436t9oPJCHkMr GByJAPb3vcjOA3VAI221nKf/v9n0uLmr+F1e2lSWf5Q2bSlnILwzrceCMFQVsgk2EsFz ka33aLs5Tgi00SSYsS3mefzSF2+iHHBWTQDGuala/9XQvSGIjEyUQ17aE1IQdKnfFtmZ w6RA== X-Forwarded-Encrypted: i=1; AFNElJ/Co346bbOeLFINV0apk52mHxNo45W5bz+4UKEc1AEhl+OgQSDDKdXf319SvdR1v3DaltWLGxmVOyK+KEY=@vger.kernel.org X-Gm-Message-State: AOJu0Yz9ROJKuBbVFPldSSXgwCiVqnOdoRZFgexGJ99wNbVF/WSX7KIw f1do9c8Qj3FR5tAaF/ygUz7jnONXWKNKvOYjmdYGala/bTL6uonpwySX X-Gm-Gg: AeBDiesmvDgQ5J0/I9CtwAW880ltYbEm+rGv/wrA0MjhOnACzVtE9IHzhIsCXzFv2Jt 67N51KkenZR79R+wihzg8QR55NyYUArKYvCpXWqFNAs7h7BWIv23svt148qfK2Xl2cQTBD/REzs VB1pHSbXJ2Cue9IDgwJ0u0M4iOef7p7U9CmYKFTqpiY7SDCXG/i2UmuVU1+OyVQnwjSfGhKq7m/ bLg08X8DVsmMCbPuxeCZzi7YaHuJyCTbVdYt5Ns5/tx2C5L0fq8cgEDcW6l3PFOGRPSlAvF6b5Q vGg0uHRa12zYVXvwhdF+nWePH/kAPloC40OD3h23uNiZWtEjuSd9qFcNxRoyDv3RT7GdlIKRZa5 G2waPGummWe1wB5kb6mvHpC4ZwnJ9gFC18jVRYZByatbdowmC2x233U314sqNh+yp6vDj2oGFD9 PygXuAh+4kF1hbWoydBC0LpZNEV546hxeWVj9Epb+g9dlygA4pP+HfUKaAi5K/vdJpeTgAOIaMK EcNTUOTJJH8ThF5LN+bNpG/34/Zha+8YVk= X-Received: by 2002:a05:6a00:1a0a:b0:83c:c55f:6dee with SMTP id d2e1a72fcca58-83cc55f6fd4mr867107b3a.11.1778196221065; Thu, 07 May 2026 16:23:41 -0700 (PDT) Received: from ryzen ([2601:644:8000:5b5d:7285:c2ff:fe45:8a32]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-839659487afsm9527213b3a.18.2026.05.07.16.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 16:23:40 -0700 (PDT) From: Rosen Penev To: linux-mips@vger.kernel.org Cc: Thomas Bogendoerfer , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org (open list), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Subject: [PATCH] mips: cps: Assemble jr.hb with an R2 ISA level Date: Thu, 7 May 2026 16:23:23 -0700 Message-ID: <20260507232323.489383-1-rosenp@gmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A MIPS allmodconfig built with LLVM can select CPU_MIPS32_R1 together with MIPS_MT_SMP. In that configuration clang invokes the integrated assembler with -march=mips32, and the MIPS MT path in cps-vec.S fails to assemble two jr.hb instructions: arch/mips/kernel/cps-vec.S:376:2: error: instruction requires a CPU feature not currently enabled arch/mips/kernel/cps-vec.S:490:4: error: instruction requires a CPU feature not currently enabled The earlier jr.hb in the same file is already assembled inside a .set MIPS_ISA_LEVEL_RAW scope. The two failing sites are reached after popping back to the file's base ISA level, so LLVM correctly rejects them for an R1 target. Wrap those jr.hb instructions in the same ISA-level push/pop used by the working site. This keeps the MT code unchanged while making the required R2 hazard-branch encoding explicit to the assembler. Assisted-by: Codex:GPT-5.5 Signed-off-by: Rosen Penev --- arch/mips/kernel/cps-vec.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S index 2ae7034a3d5c..70413c816eb0 100644 --- a/arch/mips/kernel/cps-vec.S +++ b/arch/mips/kernel/cps-vec.S @@ -373,8 +373,11 @@ LEAF(mips_cps_boot_vpes) .set pop PTR_LA t1, 1f + .set push + .set MIPS_ISA_LEVEL_RAW jr.hb t1 nop + .set pop 1: mfc0 t1, CP0_MVPCONTROL ori t1, t1, MVPCONTROL_VPC mtc0 t1, CP0_MVPCONTROL @@ -487,8 +490,11 @@ LEAF(mips_cps_boot_vpes) li t0, TCHALT_H mtc0 t0, CP0_TCHALT PTR_LA t0, 1f + .set push + .set MIPS_ISA_LEVEL_RAW 1: jr.hb t0 nop + .set pop 2: -- 2.54.0