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 6298D22DFA4 for ; Mon, 27 Apr 2026 03:45:22 +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=1777261523; cv=none; b=YAKtb29lxhjyixuGPJFtJhnIBnZUC5KiNecj8iCWkG6g6MPSEjYzlMSghg8OieMGliKbjbAPitSnpC0CC+LgSQAYKYSjpfPrrcOyIQB05iJkwZ7apdtqdc49PftaaeHQSHAIQpLN3KBZrbwMwHrB7a0TzVQXR1YHOMcUhSwfTcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777261523; c=relaxed/simple; bh=Z8T81jPhfrem9chwe22i+fePhVQlA7ofKkkJOecRdnQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Uy8u2CUxkkGV9k9xhg8N6NW2+DbdfpaQuBFBSq/tOmf3Hl6GM+mJrdd65HeHrtysTesDqt9IatFJ9mIxzt4x8Vy8M6PPv4C9iQj8bQpQxU32YCKsmkOjxMFKFGeDNPsd3Ug892uCYH2u+qIKQeYXg7EY68l6eYh58kxe9i9m36s= 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=kKss+8qu; 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="kKss+8qu" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2ab39b111b9so39015045ad.1 for ; Sun, 26 Apr 2026 20:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hev-cc.20251104.gappssmtp.com; s=20251104; t=1777261522; x=1777866322; 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=olS8oKBz9uJQUERWBS12mc4yNCSnT/djHgFK88Ulfns=; b=kKss+8quHYcKAHcGBMJQCKTso3SIFdGXbPwh2CSHMn5g2P7l2RgpKKrKjzo/Apo+F9 TAnjhn3psaYis7MIh/ymXu+UFt2XAYnMBi1NxcUwxV6VziGAYUPnRSvaNKDEVOzX7bP/ fAm7KkVYS7ypdgS+KGxb31Dz4RODjJSIInD3VcLjY8bkZApQ85ZCtu6KCDA/ELwigBLS idbhKSJYw5iJqPcwJTnyY5aa0YdOqTZzoKlkJYzLmSt0zTPNwiL1FIWiwKmvKSRBduYu 1l6JfM3uu+fEIb7o6yxWdacf4vgcfUJUkU249LOP8oabb7lougfUeTjlwwHSfNI1P60d pr7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777261522; x=1777866322; 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=olS8oKBz9uJQUERWBS12mc4yNCSnT/djHgFK88Ulfns=; b=F2DHIyviT1fHeoStykx8iFG51LNH2Fztxb1m8KKZhgMtDuOgtTamo1ZMhPPOqXPELP pdrGu61LQ7J31DlXR+KiIl2fXx5oIEG2g/Ju3em3n6CF8kBbXT/NIhdKQQKwn6WkZ3mY PiFgXsEa+rqQtUOjuKu49u3sJB6n9yZifMmPdpDhcAMhAQzF3tsFAoGDjRJ3snSMiPjY nQitJEMD2hGwIyuKSTvqcGPQIWsNSBpHfIQ1xT/i58Svkmk4+d+ZieWJHTQ0cN8ZdkcY 3EmKtwAc79WBH37bqJgZ+zr7Y+oeUibjVN2GBTY7Zhtm4C/V5pMUaqQuMHJ32Yosy84e DC9g== X-Forwarded-Encrypted: i=1; AFNElJ89+4Ji2wuW5RwH+sw7YhUH3Ti3euJhWff1Qz0dMJBKbM/pUEUEbNYyXM4w2xM53jDaKaO8L4HaAd0Dwew=@vger.kernel.org X-Gm-Message-State: AOJu0YxXcg3uiugNaO3P2xccfeLJUQg37CQpytro0PEPUkbMM7DicLtG Tth83okaTLQgMU5yxjdlkNHst7tKXskmmlY1XWKvEb/lucgP+xRIsA8ZttfIPpJO/Lg= X-Gm-Gg: AeBDietsnXnrY0FDOwSkFa2stFhPCigXXOnXTpHkoPjQLFjrzuHLAHhI9dfCUiWJGh0 yHVKLJXmJvsphyAAOqaAwEBCL5m3XWE42rrI3O3ek+P8TQ/DMs/kWgD1/4WHdx4QIOF/uGfVcCf vFJc/AdRe9Ks/AQhCvN9d0TonpP7BBy1evNFOY/Kub+u6QeJ03ogElnAW9wyB931CJTCKt/6NJi Nt43lr65EHIgWyDYIkc1OvN5tAxdnw4hIZdp2OhgtakkRfXsYuOQCEjY1uPmvYqn7MOUlGCzdBl EekOC04iJJIJeDPZtGilH45LPk9fTgcJtDuzvE7V0PzbXm0qsZ9dgfjEA+aArjg6LW9Q1J7fi0V aacGvc2B6V/6MVrP2KyQUauQFlRTVYCkK214i4Dy53ZC4c6WrNqjQbQR/pjLkDzguJbdPjCQqh2 TxlLVsv85GY7kMrTrrtQc= X-Received: by 2002:a17:903:124a:b0:2b2:5515:661c with SMTP id d9443c01a7336-2b5f9f61603mr431091235ad.31.1777261521666; Sun, 26 Apr 2026 20:45:21 -0700 (PDT) Received: from localhost ([2400:8902:e002:de3c:3085:4d80:3614:2212]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5faa3073asm279061375ad.27.2026.04.26.20.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 20:45:21 -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 0/2] efi/libstub: Ensure instruction cache coherency after kernel relocation Date: Mon, 27 Apr 2026 11:44:49 +0800 Message-ID: <20260427034451.717817-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 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. 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