From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 D071478F3A for ; Thu, 25 Jun 2026 08:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782374786; cv=none; b=rk3MI0wHEFiL7VKiTtucdpZCHczCM59x0bxAEb7UNPSLLSgm103hjDixubQ5locKWRcDYoj2LXlYN116tTzdpEVSLssM1kyjrE+IzJesSUWHE/JK9VCEAlVlC7QNwEZ2hcI+I8FR/e6wY5IYfUn0nhBEDcfiVkTfzg8mWThlcuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782374786; c=relaxed/simple; bh=QXjQH/buTcExDsjHMgakhzt8g8gkCM9esJ+xjiUHEYI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c2Ly11XTp7YUo2eSlCjtaR5h/CXJPerczNxRgDWdzJscV6Ok+E3aAItiVrYk/ovOnd4CQRQHYaNY84L0Lx00KuS19btJd402ofJ4BaON7R5L0p3Ti04yVWCykqkPBFzZbwPhUIzu5QTfUxeJR9oPLoqvveHQocDV2U9tM04JmwM= 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=O0Vezr4p; arc=none smtp.client-ip=209.85.218.52 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="O0Vezr4p" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-c08922c23ebso332965266b.0 for ; Thu, 25 Jun 2026 01:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782374783; x=1782979583; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=lDnOaXCiWv96jSUBbBWKHEoVhfgL164bVFcPRzDH7PQ=; b=O0Vezr4pXWbuQWE5r0n4398Jv8LkAuiQiB2Hvxrjpr95Bdk25ndVlU6mEfozNA5d6O QFRp2KCC6cAkKJ4IecTtQKrrs9d6cOyOuz573NxtBt8mvpsIUgA+HnQ+Ao03eYSAaT80 OkWLfB9iPKgEp92lgAqxMCvWGetcGyjJ1YlGV3sU8M7eulgKefTbQhXXmzqsgB+8CrmH ItC1Tuqo1BrpQxrRmToYY1pEmsPDBumLK6NGEsFsaGTcKue30Kv31pPJRUqFqVru2wlm HsB3y1TdoUKuhqaQ7TujBCsmJa7qAsnxQB7qALKcjvWN1aGkrJBSRciKlghT78weUXK6 3cVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782374783; x=1782979583; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lDnOaXCiWv96jSUBbBWKHEoVhfgL164bVFcPRzDH7PQ=; b=fc1z+1VViVnfcPxnreZuXluIpUdoWWllAay0nfvMhFOuDopWA9AX8Fy0QOt07Ak1oJ AtpyDNMKZ1i2ayiLCNT53shu6eXiyVWEa/e2MQVo7AkN3lC5jd/E1eWbH7zAqKHZX/iC DqvUZTRE9n5qYnyx+GBQY3d7v/heAIjQOpQshsE1TEekcsM4IliI5C27uTGZ+dPfDIDF LLB8S+aDHqGmmqp/atbI+vldznB9JUUWmizALotND8F/e/odf/fGR766oZlklPNOvuUO H8gisfhN42etJU+1pJzgKgP4WuU0Z5wHrWpDWJ/ScXzaMcsZdPsaJbgZLDS6muxjSrRS MH4A== X-Forwarded-Encrypted: i=1; AHgh+RrRs/i2S7fFNZymT7dmxWmzDPjhPRGbT51oVOienDlh2fdYzCs+IUdzoMJ6v3lyJTsprLA6ROJUoXlqxsM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxz8Uo0ddYOxFClyEImjnPr3/GBBiCNCIOFxnIvZyascXto0kJm MLqMFfFO9hK0AJGL+wmT/OaUUAjuKvdNcY+uW0ufqEAiUdZ6IalMbtt6 X-Gm-Gg: AfdE7ckQhypCgj6Jqu/FmTNJNqztPsvk9y3SsZCY77NKMYJMsZsdqgfkg7yAFeUq0I+ z54KRxKGkdjOb/kvdAOCXPqcI8LRe0nCh7Jig9aEIgBJNNBCBv24CW06HcTphUfMR2fCAmKafr+ 1ZbUi/gg+IreEVAkTQSVN9jl3qo/1HoYV6CCw71yLn3SCx9wEWvgQ+BO1EZ2IEmzu9+bloV1417 HMyJxjtNGoVBYM+EFGeU6Jd36XO6yGm0ga/c2yZ5Ney91kOhW9pgPk8ZI7aopDsrzYqTc6BePc2 rb+uSLKD3lsg3s0AY/jlUPE5xK7QqdioSvYGzWiS15pUA3lB0byQo0WQMmD+MqT5z04rblHTrTJ QzF89X2uzjNtOh8v5ojxO1gxBPJUZ1JUEN9MxDNr0ByXmL2VBIvrm5o5ehJqw6cjFav249UEZaL RuCdxdg2fKlQZvpiV6NVr5wdNeVuyCFkzPjWaSfilevOb4C6N4eg== X-Received: by 2002:a17:907:9810:b0:bc3:7b0f:91ea with SMTP id a640c23a62f3a-c1205d9862cmr77761466b.19.1782374782801; Thu, 25 Jun 2026 01:06:22 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46c221d93cdsm16538250f8f.18.2026.06.25.01.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2026 01:06:19 -0700 (PDT) Date: Thu, 25 Jun 2026 09:06:17 +0100 From: David Laight To: Nathan Chancellor Cc: Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Ard Biesheuvel , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, stable@vger.kernel.org Subject: Re: [PATCH] x86/boot/compressed: Disable jump tables for clang Message-ID: <20260625090617.4f3f68bf@pumpkin> In-Reply-To: <20260624221739.GA7516@ax162> References: <20260623-x86-boot-compressed-disable-jt-clang-v1-1-575fccd58107@kernel.org> <20260624093848.GA48970@noisy.programming.kicks-ass.net> <20260624221739.GA7516@ax162> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 24 Jun 2026 15:17:39 -0700 Nathan Chancellor wrote: > On Wed, Jun 24, 2026 at 11:55:10AM +0200, Ingo Molnar wrote: > > > > * Ingo Molnar wrote: > > > > > > > > I'm sitting on a patch to unconditionally disable jump-tables for > > > > x86_64: > > > > > > > > https://web.git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=x86/syscall > > > > > > In particular: > > > > > > https://web.git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=x86/syscall&id=76612388fe7aa41a8eb88f890d451bc17255eda0 > > > > Side note: since arch/x86/boot/compressed/Makefile constructs > > its own KBUILD_CFLAGS, so a change to that Makefile will still > > be required to universally apply -fno-jump-tables and work > > around this Clang optimization in the decompression code. > > Right. I had intentionally kept my change scoped to clang to be less > controversial but in the face of Peter's series, it makes sense to do it > for all compilers like Ingo suggested. I have no preference for how we > proceed here. I don't mind sending a v2 with something like Isn't this solving a different problem? Jump tables are disabled for the kernel build to avoid speculation of mispredicted indirect jumps. Here they are needed to stop the compiler output containing 'things' the restricted environment can't support. Someone building a kernel for a local machine may want to disable all of the mitigations to avoid their associated costs and also enable jump tables to avoid the cost of all the mispredicted branches in the comparison tree. David