Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp392708rdb; Thu, 8 Feb 2024 08:48:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuZk+QLlrODtcaT8ekz0ssRNk7k1LmPq6OuKZQhS2zPaIMWNYuw9jdXc0ItKoV2rVWlRw/ X-Received: by 2002:a05:6a20:6f8f:b0:199:96a4:b6b9 with SMTP id gv15-20020a056a206f8f00b0019996a4b6b9mr102760pzb.38.1707410904127; Thu, 08 Feb 2024 08:48:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVkjVId4CttYB3CEUoomDlNh8p3ocowxSCvnE8slYjGNWCTymku3X63Y2HP3jWRKnkMrZYXUw1a1qipleeVBsTDAEMOfLKYV4k+aEk50Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r2-20020a17090aad0200b00296fb137edbsi1476175pjq.57.2024.02.08.08.48.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 08:48:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58373-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=YHOBkBql; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-58373-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58373-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4056D280D7A for ; Thu, 8 Feb 2024 16:48:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73A5D6D1CB; Thu, 8 Feb 2024 16:48:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YHOBkBql" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D9C52033E for ; Thu, 8 Feb 2024 16:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707410888; cv=none; b=ZH6b6NmgwhOdD+ozjqn+u5RORuXs9WdbFPYtnA7fQaHt4PlREI5e/lJvEQJS1eweBn9a8iVQyRSLGnukngCLYAsapzbIjean+HjmNeTaufWz0kJyiq/2QheNat5A/z1t1wyqGGl7dS1ynhV7HvPdMnVqPEqZK5euScMxGhFaGcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707410888; c=relaxed/simple; bh=UUPoFvJicdxCZfJIpk9ObS4wVT9FsFX53K2buLJ7Oew=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=Ao4iINAjyFFnsFwhbClrUso8dJBYY32UPR63aqWAxooDtXKTIVPnPG8DW1XdojTJ/HUzQZb/p0fjLcduc/LaTNW0XAdAVlgvTAqMqhg0n2AAqxR0OOKsh560fbmKHJV/LeNCaf9TbjoMfLp+VOnHlQTVdX1UUdpZjcbiSg1j/54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YHOBkBql; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707410887; x=1738946887; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=UUPoFvJicdxCZfJIpk9ObS4wVT9FsFX53K2buLJ7Oew=; b=YHOBkBqlZOyGnmfn9CSZ7nRVtdXhEQyzPlXh9pS6yGwSEqxgEf11XUOs kpTIKN6l5ya0RAG6Q5nS0Ds4D6KN9j5M3bXaaGJrviV1kAgbTcMo/G0g2 Sve09MN12ObCBPmu1/lWnKZ5lNxQ7VQN47w/b1V8aHMhsJ2NQHwn99Pj+ 6COMwjJR7iGtlMhlzvau5AZqZbeXqn9UhwzCIJHOR2knZMjnE8liwSRIn YBb3ucaQ+Oj8+1a44328HhZQAzmInQ3qsRS2oqFHQxAOCirH/jkO0ujjk 9szUDio8lnpgrORPsXceMO5sjpf3bbvbfj5nBukaX1i0gMeKnoYlczQmd Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10978"; a="1419476" X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="1419476" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:47:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,254,1701158400"; d="scan'208";a="6328886" Received: from tusharbh-mobl.amr.corp.intel.com (HELO [10.255.231.124]) ([10.255.231.124]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 08:47:48 -0800 Message-ID: <168b4e3b-8076-4fc3-92bc-fcd9f2b516a8@intel.com> Date: Thu, 8 Feb 2024 08:47:46 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] x86/asm: Force native_apic_mem_read to use mov Content-Language: en-US To: Adam Dunlap , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , "Peter Zijlstra (Intel)" , Arjan van de Ven , Wei Liu , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Jacob Xu , Alper Gun , Kevin Loughlin , Peter Gonda , Ard Biesheuvel References: <20240206223620.1833276-1-acdunlap@google.com> From: Dave Hansen Autocrypt: addr=dave.hansen@intel.com; keydata= xsFNBE6HMP0BEADIMA3XYkQfF3dwHlj58Yjsc4E5y5G67cfbt8dvaUq2fx1lR0K9h1bOI6fC oAiUXvGAOxPDsB/P6UEOISPpLl5IuYsSwAeZGkdQ5g6m1xq7AlDJQZddhr/1DC/nMVa/2BoY 2UnKuZuSBu7lgOE193+7Uks3416N2hTkyKUSNkduyoZ9F5twiBhxPJwPtn/wnch6n5RsoXsb ygOEDxLEsSk/7eyFycjE+btUtAWZtx+HseyaGfqkZK0Z9bT1lsaHecmB203xShwCPT49Blxz VOab8668QpaEOdLGhtvrVYVK7x4skyT3nGWcgDCl5/Vp3TWA4K+IofwvXzX2ON/Mj7aQwf5W iC+3nWC7q0uxKwwsddJ0Nu+dpA/UORQWa1NiAftEoSpk5+nUUi0WE+5DRm0H+TXKBWMGNCFn c6+EKg5zQaa8KqymHcOrSXNPmzJuXvDQ8uj2J8XuzCZfK4uy1+YdIr0yyEMI7mdh4KX50LO1 pmowEqDh7dLShTOif/7UtQYrzYq9cPnjU2ZW4qd5Qz2joSGTG9eCXLz5PRe5SqHxv6ljk8mb ApNuY7bOXO/A7T2j5RwXIlcmssqIjBcxsRRoIbpCw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7tuXdejgPMwgP7x65xtfEqI0RuzbUioFltsp1jUaRwQZ MTsCeQDdjpgHsj+P2ZDeEKCbma4m6Ez/YWs4+zDm1X8uZDkZcfQlD9NldbKDJEXLIjYWo1PH hYepSffIWPyvBMBTW2W5FRjJ4vLRrJSUoEfJuPQ3vW9Y73foyo/qFoURHO48AinGPZ7PC7TF vUaNOTjKedrqHkaOcqB185ahG2had0xnFsDPlx5y In-Reply-To: <20240206223620.1833276-1-acdunlap@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/6/24 14:36, Adam Dunlap wrote: .. > In particular, when compiled with clang and run as a SEV-ES or > SEV-SNP guest, the compiler would emit a testl instruction which is > not supported by the SEV-ES emulator What changed? Why is this a bug that we're only noticing now? The line of code that's modified here is from 2008. I assume that it's something new in clang, but it'd be great to know that for sure. Also, considering the age of the last commit to touch that line: Fixes: 67c5fc5c330f ("x86: merge apic_32/64.h") this seems like the kind of thing we'll want in -stable in case folks are compiling stable kernels with new clangs.