From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 A7CC53A0E85 for ; Mon, 27 Apr 2026 08:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777279660; cv=none; b=WwY/QeU/nuOQukhS+FoAoA/aQQAqOsF1yeOmzCbVgNLoIe2pnST0pAYoVX6gMshdBYpmNZNVou9sBYIW4X4WcjKYCYfz3k3jgj9BeBIgBHU/r65or6QqiMHwKFfM7UXahdse3bSyHoDBdjpfoFrNIOaPpXgP+JymzWwnlmhn2JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777279660; c=relaxed/simple; bh=ud6229bzqFmsJw1B4jV51SEWrfqqWrMb4pJy+DI1Kls=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OD9Oo+ghandhgeCsotWZQwwGHM+KKagEkwqjV3lOP3BK0HpfKydQNQAy2wT03Yp61VjvAj4+G0wmEQyYuvGalaZWQcXzrrs2F7lZLVdenbeJQtxhZqZBO4nX8Q2kKZ3JH0DM7tRrDHPAKF3+toM00kpXOSoUKkrU2cm5fcD5Jqs= 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=pZlDMfKU; arc=none smtp.client-ip=209.85.214.173 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="pZlDMfKU" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2b788a98557so46686575ad.2 for ; Mon, 27 Apr 2026 01:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hev-cc.20251104.gappssmtp.com; s=20251104; t=1777279659; x=1777884459; 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=EbS5XqlTtlqCLLkuZnn42EvCeoWF8vUClWjJ8C+Uh3A=; b=pZlDMfKUArZtHIgh21BIn96/QH/2PCguT58eMgjBIZnXxRp74G/CwgYJqko8LMvm6X e90KH4JhCqoEMHjAOcyTlRg+FAVq+3V8Hf2A2llI1jefuG4CBSlVsllFnv5Y0qw0o9/L ogPucZd7pwxOi4n+Nw5IkE4ZsAHvml3yCAtYGkSSbUrDkjeRacE7R7W/Mq6CeEv99n81 GRNhsG3JpUGCLqyhZMEcTFPw7knYw/v8fVfMj+LtFSYpwUnhbLaSR79oRRKpDMNTHtrc MynVgMIsx9YyizFixZF7fXyPgeC30Qe6AubUIBN7P9AIqvc8iFemqQmWTpeeGj4WcEv/ J5+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777279659; x=1777884459; 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=EbS5XqlTtlqCLLkuZnn42EvCeoWF8vUClWjJ8C+Uh3A=; b=g21snpcy2xF/Lo0Ch5J/dzLUKxLgUzdGkA0FJ6x76eVM+Fwe98DHTEF0sWVL0ck4/P qRLiKjwODmjw501YYaolTdNyQFEl4p/QEHUk9Vt/23N3LDBPLIYiQZtM/xYzZuQdL3FU j5qkP7KHdU2imtkgpb984fr2s6IeHWQAq0CZtX7i6W3nkND8+4r1nYIrIkzLqaSw6hpG L2Kh7DIv7SqPspeUQsMc5pPQL5CNffGqhQ+nyCiXnpOCjUJ7SA1WRfO8lIO+Hjztvbs6 JpgQnOqM45f9Juqp47+Aq37MlH5v6vS7y0YMzsWn9m+ayWg3dchgDoktutN65CnK7LBi wqCg== X-Forwarded-Encrypted: i=1; AFNElJ8o6n8CWiKOgPM9AbsfR5gfEcMsoRjXM1Dh/khvyDikiks6ANsGvTZyf3Yf2hVNQtmHW99LdCp5l3ejGFY=@vger.kernel.org X-Gm-Message-State: AOJu0YzBd/C2GcYN8Vs+ct4vGcu+ZI6OTdA4WZVc3trGIjs/RlPE9iqH KsIZzFhnHEzXwF3JkowwatQgU57lGMG4WkgSJo22l2ZGcEjKoACEmr/KThZZnKAS/V0= X-Gm-Gg: AeBDiesRztJ9+txy1ulxwfsQQWLfeyVwjEIpoGfDjhoXPo2YlDVAmOYfvF/7vO2T6Hk 0NCdFdQ/Nl9HzpTz5mqxIguuoHj/l4udZf2B8k4dyfeXh9nFWq+fdOzeyZfQu1eH57xqKBXHjCJ 2iu4aTk0BUxJ48MN/vBD+surnB40rZH62RzoowutykpkZIZN2YrpTO+Rw3WGnQCgy8Y8fzVtI6y Q7ovJBo06hHCTJAQHKBM70jkMf5PmMt8LiM0bCep6rH2TjxGKxMwsbgy15BQJZYbpYGtRhlrFFg MGP1sI/ErJRw7Jl0in2x0xjurhGvQ2ZFoWjku39iM2DozoR1rH1Q3GXwwz/mzNlPVVxriDnNEi5 SReKe5mijgm1foPCReMlxlWaT50YfpNCpO96HE/ReTcQA6RQ3SIvFBDlMsimgn7iqiHD3PHYsne yLlGOiGPt8rdz+Do8dUCIEFQ== X-Received: by 2002:a17:903:3d47:b0:2b4:5b82:a8e3 with SMTP id d9443c01a7336-2b5f9f51e09mr293896815ad.24.1777279659118; Mon, 27 Apr 2026 01:47:39 -0700 (PDT) Received: from xpc ([2400:8902:e002:def5:7882:53a7:6a48:4d11]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5fab3a929sm291703215ad.72.2026.04.27.01.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 01:47:38 -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: [RESEND PATCH v2 0/2] efi/libstub: Ensure instruction cache coherency after kernel relocation Date: Mon, 27 Apr 2026 16:47:19 +0800 Message-ID: <20260427084721.40535-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. * Add "()" after function name in the subject. 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