Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp267845rdb; Tue, 31 Oct 2023 07:06:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3HgZFRfSiGhWAc02pmfLpJTJSF34CyfQvus9XBAjKJ+yw6CAOZoDMWHsjK7z4M3o9yfWq X-Received: by 2002:a17:90a:c7c7:b0:27d:10b1:5deb with SMTP id gf7-20020a17090ac7c700b0027d10b15debmr9846934pjb.31.1698761181528; Tue, 31 Oct 2023 07:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698761181; cv=none; d=google.com; s=arc-20160816; b=HF5DsSm3CVGQEbyPeyJeSH0NgKsJAqPpFFRAnyUOTeSParQsvgfQLK7pdjrIBiG1u6 LSxqGS+WZHpbFYG2Efw8fLRxxYDf0zd5YsuIxdGZTR4fnkAzYeN8po0sh/0YNe8o6xSI I/Kz/WmL8A/5SGf7yxMq39w7TUTj3a2/qoxvSKap5ayE6NbN93MD0qq4NOVM4UnvqxY1 hw90En4EkedVlWNJJsBYyg2jydv5qyMhH/G+p3LSXyxAY6AMBwV9NAMFPOLfk7HmrzoF oDfGHtD1iyUJUzfkfPdSTmg1h3+LnyyVyJhtrMQBptFdRKyVVV13VQWJou0FfonwoO6s 59Rg== 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; bh=i/iBDemj5iD48Dwp+0TNRzwUY7I+bvfnQkaiGrk0dhI=; fh=7uE3ftS0CK5VG3oSIvm/ja0JnR/f3DxfLmRLZR5I4vI=; b=HA+af3bf5MvtXTJ42Smy6vxC4gVm2HtouqY/dryoN2tCvm1N8qZGj7V8CFZM3gWuAq OBKJXvRaWdch8Df8qs/AIw9jF021TsgH4wcxymPvfFWaanA/+lN9YmDlnsGOolcaVHiX IoIjJt223eg5f6wNgPL++mXL2lPQNiJCEzr8OijjSxJ2Urb2RMfqsdc46nviNfm/VstF SbC/Su2D5TALFZhxsURoS9COEdOmWegF/YnkCYKiiTsJWO4pFDhnD82Fyy2cJSurujhB swEnx28UxilkGtQrvAAAous7vkrIDYum0sB59t9RxWiafRisNRoEakPxYzVOEHqELvYh FT8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m64-20020a633f43000000b005784ab1c4afsi1091844pga.736.2023.10.31.07.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 07:06:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CE2AC802F706; Tue, 31 Oct 2023 07:06:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231383AbjJaOGB (ORCPT + 99 others); Tue, 31 Oct 2023 10:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343903AbjJaOE1 (ORCPT ); Tue, 31 Oct 2023 10:04:27 -0400 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB804F1 for ; Tue, 31 Oct 2023 07:04:24 -0700 (PDT) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4084b0223ccso44213945e9.2 for ; Tue, 31 Oct 2023 07:04:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698761063; x=1699365863; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=i/iBDemj5iD48Dwp+0TNRzwUY7I+bvfnQkaiGrk0dhI=; b=CJQgs8FM85Td+rJe+UW5ejy+qUfRTmIJfleFxppSlhQ7WAW50OkOXimkALCLh/3bNR 0Ew5HWmoKA+kekEkj3ZwJXOlUIGs1TBDtiDX3jjsA2SO2Ohh0rUzD2MHPusLLh6JDXtC CWxDGxzaOyG4MDE2KNFyKz8qftiOdAmJFmpw7moPJx7hMZtSgXH05B+IPE2CtltrpLA1 +8+I/mZRAQxHU/pY0GZ8ReedqNmU7Lw11D1Xr1pA00dqrDzLunDqWw9WOwSfWAQpnN+d L+4/k+vTcUbGf4EfSkNwPfB8rEaeVpK5n3bER3RtUWA2StxrPOQVfzs+sflvqzWK90Kk PnQA== X-Gm-Message-State: AOJu0YyZqcCp3yTWaTvvNmnViCyw1SSBHjrzq2wFPi0DaEw7iqTywSS7 bnAYu/2rDR540CJUkVxjTHVi6ooPvkw= X-Received: by 2002:a05:600c:4750:b0:408:3d91:8251 with SMTP id w16-20020a05600c475000b004083d918251mr10364781wmo.5.1698761063137; Tue, 31 Oct 2023 07:04:23 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c475500b00403b63e87f2sm1864176wmo.32.2023.10.31.07.04.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Oct 2023 07:04:22 -0700 (PDT) Message-ID: <786d3451-e3ac-4868-8d8b-28f106e13407@kernel.org> Date: Tue, 31 Oct 2023 15:04:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] x86: Let AS_WRUSS depend on X86_64 Content-Language: en-US To: Dave Hansen , 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> <2b345b1c-73ce-4719-812f-ce638f665f77@intel.com> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3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Rb+/tJ98 f/bIWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <2b345b1c-73ce-4719-812f-ce638f665f77@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 31 Oct 2023 07:06:18 -0700 (PDT) On 31. 10. 23, 14:53, Dave Hansen wrote: > 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. All wrussq, rax, rbx can never be right on 32-bit anyway... > 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". Which is right, or what am I missing? > 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. Again, to avoid nonsense in 32bit configs produced by oldconfig (as I noted in the commit log). thanks, -- js suse labs