From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 9073E37DAD5 for ; Sat, 1 Aug 2026 11:44:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785584679; cv=none; b=ewlcVhk2CSZMgeYZob9yF2MABRb2eDxkgHN/M99S5D6Ku0J/c9YRCnN/5Pjff3og7wmqASsxwpwVJZcaIyLif+dyZtehyRDlEWaA1qsvJ9n3eKLFiygehx0TPaYhiF8tRtStnPImLuNIphCyR0pYtjjYygn+xhhRDOuHFN7qGNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785584679; c=relaxed/simple; bh=IpYAzFxHcdQAns7dLGmxjqP9LAC5I3ODedDhQjuHNfE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rsKu0p5kJK+zGH3B4ILOtVNiwrsTODxFhkfQOs9+LuEdffjK/L4ciyKbkaP6D4iAxFI3OmBoqVA6yPY1R+V4Ph7FUChHqKp93LfbGl2cm40xyev6lgUzPi7pqlvCyaSC+73E7E6qvpjQd+lH/dM+2+cKKi58DjTsyzgcOSyrenA= 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=c1YSRklr; arc=none smtp.client-ip=209.85.128.51 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="c1YSRklr" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-49558ce01afso4551285e9.1 for ; Sat, 01 Aug 2026 04:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785584674; x=1786189474; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=PC1Ejus+MdBDGbZJkDKqwUV4T/oWh+GHHv2bOjHRb0A=; b=c1YSRklrcH/hoPEQRUC5U3xSp6nrnAkPDCEIQkurZMNiyjeU+cVu9MrrTljcte8Zj+ JMEg5SB2AaICYvGBe41w12tK78UDp5y4KbmgNbDC7WtzxEE2CwGUkUA5kEauuFLt8R6M wJjdMDZhNHnvXTFzdibLwzWpUAf94VZog8+7kjJo2MTKmRKOMw1YOaO19p1J5U0Ys4uE x7vy5SsOUmrV4NFbRmh7MUunw5RSSh84onDWwY6WXnE0vZjjm7yx0ZXlDIhIROf7AnUT Nc1wA1EH5vB/Iu3AmbpsTyeaObfwmG2Mu3Q3YodFdyQZ/JhkXMpcKVEmlNf/0lGivQuL zRtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785584674; x=1786189474; h=content-transfer-encoding:content-type: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 :content-type; bh=PC1Ejus+MdBDGbZJkDKqwUV4T/oWh+GHHv2bOjHRb0A=; b=sIdYg1oPLdAABuU/3+oxIJrXbEmQv02nDVY6/Mez7p7QR6nuz23NiajbbWZQx+TutO 2LpuTQplS45W0Ud6aw2+hWcoxkKE6KwsuGzCbfMcin+HPKDAeFsdxoIBhCnViAzIRLJ0 wB05gsu/zwJyU8DpgnyRODZdFtWH3hWE/Gt+8xiu6n9BlbK55zjW8hvQ4tAWotkPRPrN hj+HqZ1sDaAdGtElFyigFzP09V3oj9YAot+cdUHwzEq7Bu8lzq2CwBttwuKnSBXqT915 EiO8W2VJKD75HH3FrugnxXvqj1sHu2/07p4M5cYlZnuYB5xpnqT1rCN4J/wQcGMQxfB0 l8ig== X-Gm-Message-State: AOJu0YxGex1+JBW7gHpwpR/a5pfAAdKbGHVO9R9usrGQQCSzhN0k/ykH imC+zC8+y1HGBGX2J93oaYfFEMx5k0OiOBK/+xyNImsEYO6jFgQVlRGkkf9xOjO3Ytw= X-Gm-Gg: AR+sD12+r98108Jecs7FDh3E/dYobYaCEGf5w23vnG+UGTau6iXGxm1mw3pj2XSvsA0 ZKvgS5lyluSjdpZrq2ZTXzyDWC8XTFkTQXQLlG6QTvnxbK7rNSOdEa2Mzm27mBKD5uW7Cx3Lo4r CR8snjSY1RqqJT73BwKlKVvEDs56tqbGW+nVhLNcccPRg1Vd3Ffsi0OgnBIoBXTl4ba2Bk2YzPD CrR+uEIIrvYrm8LQnJtQMqKg3yw/9ApfdWpRD+wP/CqvcRGpd9rDBHgIUB/FAo7KFJJF65r7syY gDupaPwXh7LGozV8i3wLI+Z3uw0D/qnDRt3bC3ACtQfQU/THgr3s4LUf52ZG47d73HprnYVEO3e /UXjQYZKRdUDzWcmG2YYxNGDCTCig2BHxJflDpGCdNr3psOMnewaeCtc2LlgcCjdJR+xYm7EyQZ hWI6eh57TjxZV+2Qu8z99VI4YplAds4uCQ1UkHyMgktkySCCS4q6hU59ZUa1YotKr1VMt+cjyWI WYCFCfBMAZvzW+6FDNgUFf7Kg== X-Received: by 2002:a05:6000:2284:b0:47f:93b9:d071 with SMTP id ffacd0b85a97d-47fd72c68b8mr6844535f8f.19.1785584673805; Sat, 01 Aug 2026 04:44:33 -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-47fd42d91bfsm15461523f8f.15.2026.08.01.04.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2026 04:44:33 -0700 (PDT) Date: Sat, 1 Aug 2026 12:44:29 +0100 From: David Laight To: "Chang S. Bae" Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, Omar Avelar , stable@vger.kernel.org, Miguel Ojeda , Nathan Chancellor Subject: Re: [PATCH] x86/build/64: Prevent native builds from generating APX instructions Message-ID: <20260801124429.45d03af7@pumpkin> In-Reply-To: <20260708211435.402426-1-chang.seok.bae@intel.com> References: <20260708211435.402426-1-chang.seok.bae@intel.com> 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, 8 Jul 2026 21:14:35 +0000 "Chang S. Bae" wrote: > Omar reported this broad concern to me, when resolving a separate issue > with his custom module. CONFIG_X86_NATIVE_CPU=y allows builds to > opportunistically emit APX instructions when the build host supports APX > since commit: > > ea1dcca1de12 ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'") > > The kernel is not yet prepared to use APX internally. For example, there > is no context-switch support for general in-kernel use of the extended > GPRs. Isn't this a just a big compiler bug? Much like when AVX support was added, -march-native needs to check that the operating system is saving the registers not that the cpu supports them. I'd have thought that would be true even if the code is actually destined to be part of a different kernel - the compiler doesn't really know what the code is being compiler for. David