From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 1571A39B4A5 for ; Mon, 27 Apr 2026 08:39:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777279193; cv=none; b=Lop5pe0K9Os2IFlupF83yDJOioGDZpv1JWNaVuDuuL6UIBhxbwuWd+Wpbwn8lrPTYm6BzY+K+Lxn/bm4UgJmx5AdDrX+hE/k6JHi52wGiWLABNL9S8J1xhcy3/y7MmZfojkT/lUD2S231M+I16QnZNy0tyx0VfH05QsWk64sx88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777279193; c=relaxed/simple; bh=8VkYf4oej+1NJIsr42kCIdqMEirKvkfOijKLfIgkJYE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=i2lEzal4jmvGaawhE1/lLKrBVzC2b2xmvVkxD4i9FkwWEh7t8/zeSfJ9TGLQObSl8DgLrJGdLR4PuwvNlarqy8+abtXttPRjH0mZpZ39jGE0VTzG3nMBfdqU0/O9oomRvpbHqeGD7Szu67U0Qy2oeLIHgDq6F92TgQGrP1LHJPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hev.cc; spf=pass smtp.mailfrom=hev.cc; dkim=pass (2048-bit key) header.d=hev-cc.20251104.gappssmtp.com header.i=@hev-cc.20251104.gappssmtp.com header.b=TA2HuvVD; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hev.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hev.cc Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hev-cc.20251104.gappssmtp.com header.i=@hev-cc.20251104.gappssmtp.com header.b="TA2HuvVD" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-35d99031e4eso6799890a91.1 for ; Mon, 27 Apr 2026 01:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hev-cc.20251104.gappssmtp.com; s=20251104; t=1777279191; x=1777883991; 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=l2khddAE4U1nIPfkSKNCb9MwtuVNtnWHE+Vf+vbXZFk=; b=TA2HuvVDRrTqqVVTJKkfhGfaQUO+D1SHd/IimW7YT84WR38XiSx6aH2ER+y4fbesna QZ2Oqng59H57izRZqNdkHun/y9DioBHLWERzt1Ksp/MqNQvPNddopqItQmTBuxhSn0ZD wzSS9tqQYyqo5lgkmj7vUkz5gRlS0IuxvOZoSTsn3rbNy3aM9fqHW9cQaC+xgqdA2sGJ Pgu8NHV9zS61mlJuuJ0eVgFRyXsECD8gC4Zz2Ln+j4mAtmTN0wlLybgNpFzVPtbgMKeH aFbyqRR9BzHNMWQfd4mfJZhclvkaefhGyUTTyunQT/cl2uGPtN+H+wsR7sVBFvqb6bJR ZJfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777279191; x=1777883991; 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=l2khddAE4U1nIPfkSKNCb9MwtuVNtnWHE+Vf+vbXZFk=; b=AzLVHH9/HpTWiNx2Fe96Y50ADtzOOJ7Dno273CeoVzb5qpd189o1mTmnp52Jf0p5H6 FAA45eNbu8bsWgdWOAi8VVFDsnPIi2FxrJWIv5w4gogfxw8BboDEEkST6ouWsK8hBDi1 bUgY59Ata5RY9mCpWNJ0IJJzLkjj/abnTP6TuZlguM/vamMY5MzpkJEohB/wtM0qt4D/ p/XX4pei/3478ixP+XcfeygIXKwBw/m6NAw5fgPQfGsB3K8OrGx2RvZ0nF5b1JmRMRN3 jWZg8AgS03xmmsAvr2P2ugTetky7lgaLUGugjiajieK5WqpPSft1gVOjOHHHmvLQeFLs WelQ== X-Forwarded-Encrypted: i=1; AFNElJ+2sAL/2W4Q2FslRLBhgJ5rsT61UCw7uvNdDfFaZInrCvIU7GQsNrb/lh0e0YVuFrVau75CPCn9I7Cz0AE=@vger.kernel.org X-Gm-Message-State: AOJu0YxDNMLoa5Jh8WOMLxT1UZKgr8tt4/w/kQ3pGHfXFqSE8cnHA7BE iqRV/WY/cf2UJrsEGxiU9fC6NcyHjJnHTE1GRrcbhaKmT1SZlOqqrK0r1Pxwn868te4= X-Gm-Gg: AeBDietsBeEMZVkkNdz+BQNd4Tl/iNamdx4/PQDPpE5xFsyvSX0lxPYYsje1+yZm+8R xrczQ5Tja9EodiOMcic7zT9blHuBgQLTh35/C/+/uRwe2uhgp0SamhUmVacOPDGaZrtocaRhFFn jTedDEA+UPBHjmMOnF4Fe7zCJLff3FW5uApYVMHBb07qWGRXd3BH3CMmau4oECME3I2xlNoakHm tztgXtWW1/gIuqE2/LKxfjm26gnPbRiKzYD+7UqpVlAfiiKTDtAMRXsAGa0q/LlY2Z4afRoATm2 YvNn0g2QueFHVSooIS1EYSl+rFhpsTI5D7eOBf3bKRtoJ128cZoDyhDX9tHVLhuB9bQmi00cQlc UzUiX2mXezPHDM3iWS/afFioeXORutBG6rHRWvvPwIm0zL1FaDBPCNUXYeJzsQhGcReyxOEFYOk pUqQ8mpmzb/8Y= X-Received: by 2002:a17:90b:350f:b0:359:8e5e:43de with SMTP id 98e67ed59e1d1-3614049358emr44701147a91.22.1777279191383; Mon, 27 Apr 2026 01:39:51 -0700 (PDT) Received: from xpc ([2400:8902:e002:def5:7882:53a7:6a48:4d11]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5fab4049bsm276063105ad.77.2026.04.27.01.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 01:39:51 -0700 (PDT) From: WANG Rui To: Ard Biesheuvel , Huacai Chen Cc: Ilias Apalodimas , WANG Xuerui , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, WANG Rui Subject: [PATCH v2 0/2] efi/libstub: Ensure instruction cache coherency after kernel relocation Date: Mon, 27 Apr 2026 16:39:28 +0800 Message-ID: <20260427083930.36324-1-r@hev.cc> 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 Changes since [v1]: * Move efi_cache_sync_image() after check_platform_features(), matching arm64. The EFI stub relocates the kernel image by copying it to a new memory location using memcpy(). On architectures where the instruction and data caches are not automatically coherent, the copied instructions may not be visible to the instruction fetch unit without explicit cache maintenance. This series adds the missing call to efi_cache_sync_image() in the generic relocation path, and provides a LoongArch implementation using the ibar instruction to ensure instruction fetches observe the updated contents. [v1]: https://lore.kernel.org/loongarch/20260427034451.717817-1-r@hev.cc WANG Rui (2): efi/loongarch: Implement efi_cache_sync_image efi/libstub: Synchronize instruction cache after kernel relocation drivers/firmware/efi/libstub/loongarch.c | 5 +++++ drivers/firmware/efi/libstub/relocate.c | 1 + 2 files changed, 6 insertions(+) -- 2.54.0