Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp258566rdb; Tue, 31 Oct 2023 06:53:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFz8THCvmqI4PMkxPxsM3ljsnBnCkZWrXZvLLDAv+Gjp2euDo47ZhIqd66TV4liJmTo2ixv X-Received: by 2002:a05:6a21:4881:b0:181:15:5755 with SMTP id av1-20020a056a21488100b0018100155755mr1774437pzc.56.1698760408828; Tue, 31 Oct 2023 06:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698760408; cv=none; d=google.com; s=arc-20160816; b=o21Ip5mNlmj2N/XSx9xNQOYPVmOJc1KTBzMl63i9yaNXs7HTX9K/3QdmNE2w1QOtVX 4LPxqzWkkNzfqsBaey2cOS6DZ8fhR6ipUucSjO73+QE7KlSQaiLE3cGvlA4VMXZNdOnr qKLT8gYHhGcaDh3lUortOr1rZ9vuJ43P+WcbgnPEfmla1uaOpaeVHMKv5iaShuyzsk9V A3Qycxxvf4LoO0t+nRQWsOCd5HZL35Rufa4uMVsQdw17/DwJI3madHiUdqd2fdH4hU0t CaWc8AW66GtupvUWW7tUZw9/PAs5I7N/PsO0RwANeoevDChofpQeRiy7aa9YEToP3LLS xQHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=jyfeFHbIswD8KcW4wbEpSP3VGif91nEjOxQUTEf1mjs=; fh=oZWvHMCxdWMBGJrBGXGMWt+HYv96K9CzAmwSC1hrNRM=; b=bgIRQS/3EMUuATJcgsJVvW6O+2+NwQrGqgp+O1DqpvqhBSQLhm0uio0HVQa+T2+r50 mqtwDHWgXwzknVLumJeLMUZSvT0BqhWyEZX+mS56M4xP3ZWlGm/R7BjNlax8biR4JRAq aP0DrqN6mZClJ8LEcT/oFHKIK7sTMh5ZfJJY8YQ5xCQiUwLbcfiRAN9AVTgi/FNE7TTk Jlf+cnLi03b5zzksESMEMOtcv7/5bn4T3mLFGOANUqp69tMML1/0xU2mb1WVNEL1C6AM ARoxJumF8WpZdzdHzIYDH3h8V0H43fEUdj9RRObtd3ECjxoYuw7BXvWBPfOLtTa64L15 nWUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JCBGLL72; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id n18-20020a170902d0d200b001c9c3f327e1si1038691pln.191.2023.10.31.06.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 06:53:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JCBGLL72; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CADB580A97FD; Tue, 31 Oct 2023 06:53:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344671AbjJaNxR (ORCPT + 99 others); Tue, 31 Oct 2023 09:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344635AbjJaNxQ (ORCPT ); Tue, 31 Oct 2023 09:53:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01F6ED for ; Tue, 31 Oct 2023 06:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698760394; x=1730296394; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=oLrtBJmqmIjD3apK2wW4wGdJbZ7D3m4xt72mk4HRYr8=; b=JCBGLL72hbYOVVE8GtTiDoVcy9lbpGi/nulsBbrHNGi1Gay7trLlwhnh c832SIeq3CJR6MoTbN+gKGMYtn/nC8MW69cx6mktIWo4SNJWVKRKkEilz NhIh4BigyRDJDvFNc2FYpCe18vljBLA07aoCamXtERxW+pBnKhJK6VeNu NKBQPOp+5OGmxQZG67cA4rUIb24EKdg6JHfpC7aoRc0H3Cgj0UAtR0Mcp 7boLsO3G1Gw7nnfqKKT2tXhiVfMPRNTdLSnxGjKq+bW15Wu1n5wIr8KBd 9waYWBzawI3NT2zxB/2kZeq7gsJRsuKL+riuFSbN+x8TofNi5FpGS1e5P A==; X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="452569247" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="452569247" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 06:53:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10880"; a="764245222" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="764245222" Received: from johanyu-mobl2.amr.corp.intel.com (HELO [10.212.132.79]) ([10.212.132.79]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 06:53:10 -0700 Message-ID: <2b345b1c-73ce-4719-812f-ce638f665f77@intel.com> Date: Tue, 31 Oct 2023 06:53:09 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86: Let AS_WRUSS depend on X86_64 Content-Language: en-US To: "Jiri Slaby (SUSE)" , bp@alien8.de Cc: peterz@infradead.org, linux-kernel@vger.kernel.org, Yu-cheng Yu , Rick Edgecombe , Dave Hansen , Kees Cook , Mike Rapoport , Pengfei Xu , John Allen , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org References: <20231031102111.32142-1-jirislaby@kernel.org> 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/A7T2j5RwXIlcmssqIjBcxsRRoIbpCwWWGjkYjzYCjgsNFL6rt4OL11OUF37wL QcTl7fbCGv53KfKPd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eQDdjpgHsj+P2ZDeEKCbma4m6Ez/YWs4+zDm1X8uZDkZcfQlD9NldbKDJEXLIjYWo1PH hYepSffIWPyvBMBTW2W5FRjJ4vLRrJSUoEfJuPQ3vW9Y73foyo/qFoURHO48AinGPZ7PC7TF vUaNOTjKedrqHkaOcqB185ahG2had0xnFsDPlx5y In-Reply-To: <20231031102111.32142-1-jirislaby@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 06:53:26 -0700 (PDT) On 10/31/23 03:21, Jiri Slaby (SUSE) wrote: ... > Provided the wruss instruction is 64-bit only (and used in pure 64-bit > X86_USER_SHADOW_STACK), it has little sense to have AS_WRUSS=y set on > 32-bit. > > Therefore, make the whole test dependent on X86_64 to ensure it's set > only on 64-bit. ... > config AS_WRUSS > def_bool $(as-instr,wrussq %rax$(comma)(%rbx)) > + depends on X86_64 > help > Supported by binutils >= 2.31 and LLVM integrated assembler What's the downside to just leaving this alone? This patch just seems wrong logically. Suppose some deranged person wanted 32-bit shadow stack support. They'd have to go hunt this down via trial and error instead of just enabling X86_USER_SHADOW_STACK. Granted, that would take one crazy person five minutes to figure out why their .config is broken, but it still seems wrong. It's especially wrong without a comment because it logically reads something along the lines of "WRUSS is only available on x86_64 configs". A better way to do this would be: config HAS_SHADOW_STACKS depends on X86_64 config AS_WRUSS ... # Avoid setting AS_WRUSS on configs that don't need it: depends on HAS_SHADOW_STACKS config X86_USER_SHADOW_STACK bool "X86 userspace shadow stack" depends on AS_WRUSS depends on HAS_SHADOW_STACKS But that honestly doesn't seem worth it because (circling back to the first thing I wrote...) I don't really know what the benefit is to doing this in the first place.