Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10250051rwl; Wed, 11 Jan 2023 17:08:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXtIWp3hIvxMmT3FFkLJLmTHe52VBhlCAe71VAxhJ00E2WuidduDHsv8JeJ4wFEJ6+dOOiL9 X-Received: by 2002:a17:907:cbc7:b0:846:ccf3:d901 with SMTP id vk7-20020a170907cbc700b00846ccf3d901mr78964239ejc.52.1673485718975; Wed, 11 Jan 2023 17:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673485718; cv=none; d=google.com; s=arc-20160816; b=llG8Z/CBhv/K5bWKOKpLjPMXPv0/Qe2WRuQ7fKFL2gqIzNhGAXUvsS3/FXCJNbS57j PJvdhnUBI4+xJ0F3x0vBXdGdkjS6MdqivO2zn2ujC+1S6GYGmD0XRlzLsyOKRRCCjeFW WWD2p8bamtXtv/nUJZjyhFWsng4rrRlFItRxcrjvUXKOgkNcQRyKssXwl5glu/UZ1/iS /CRmr2tArLJL4M1wnlX5BWM+7/2AXZx3yHp65mu50+7ZmuBJD6vZZDatazabUWS1DHBM TwQPGGiKGYcVwMvkui2QG1VEETFmSv4fjPXPCgW4GYXgMn7kSRhKDl6Eo3F2ujCLPdQI 7LNg== 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:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=KCNcjWJ/v/flIoT8zIQzyjj7kIb7y63temg9efCdp8I=; b=eBzQuddFPWOsA7HFnFgz+SlOSsNv9YPrfh1e9PwP5p8lziqKNSfBU7/9Cj74rWrzQl c7J/cxjkZsDBeT7liepH3UH26EyUFJeyGYXWqQYMKuwX1BoZb4r9Ke09zXB/acY5J8uf Z6rfMhH5k3XYuhd27M9rFWcpJOHZGy0u0XEg0LH6SNu8bm9scPFJFAGlHex600E5BFxP aKbk9R+JUvirjkITDG0Fnwc4AdkeoZIYEMd0hyPVbuXpe67cumONqeRw0BDaHiVKN4iT IeHAybuFkcPDAmj/czkuPlzEcZ67kt/VGRq0b6zkxcNZKIkkK1F5LSdf/gVgDJjKXFzM tHGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cmWvtN0G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc3-20020a1709078a0300b0078d20d71475si18446865ejc.413.2023.01.11.17.08.26; Wed, 11 Jan 2023 17:08:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cmWvtN0G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236408AbjALAiW (ORCPT + 52 others); Wed, 11 Jan 2023 19:38:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236151AbjALAhm (ORCPT ); Wed, 11 Jan 2023 19:37:42 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A021321B5 for ; Wed, 11 Jan 2023 16:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673483838; x=1705019838; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=uvTtI0+JLwbZwSZxGjTtYzW69JAatAaXwTfluvqaRes=; b=cmWvtN0G5KK4gkvI+rt60lE9WxRIsmuMFo5zutFS+fC/7yG7CiaggPEM WM1n/lY0jJS9rJzi0XqnFDLyHSjh/7MR8bz2JbgTvhvvERVp3ttVx1vkv +sS/3ObkXlq3xZ9BzB38rc99CtojgXALyfZLQr0YybN0r7dAUTrP6oS3u /kBvo4GSt+TeJcCisUUPE9PNoVvcAO3Xe48Zfm/bdxmTF7ddQ5MhOOhip CDgrJihwlPIFHCdpfi+OF8O6scyduZtpYiXH4nzgNS+ehBVQCRafE1RcT Nw5AFZgj0OOjBketXKYJJfe972WBKsmy6PwneXnzNsGwxEarEAeRzFhoq g==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="388044178" X-IronPort-AV: E=Sophos;i="5.96,318,1665471600"; d="scan'208";a="388044178" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 16:37:18 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="650928855" X-IronPort-AV: E=Sophos;i="5.96,318,1665471600"; d="scan'208";a="650928855" Received: from pchoi7-mobl1.amr.corp.intel.com (HELO [10.212.194.225]) ([10.212.194.225]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 16:37:17 -0800 Message-ID: Date: Wed, 11 Jan 2023 16:37:17 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH 3/7] x86/cpu: Disable kernel LASS when patching kernel alternatives Content-Language: en-US To: "Chen, Yian" , Sohil Mehta , linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Dave Hansen , Ravi Shankar , Tony Luck , Paul Lai References: <20230110055204.3227669-1-yian.chen@intel.com> <20230110055204.3227669-4-yian.chen@intel.com> <693d8332-3b86-3dcf-fc87-5c3a08a752db@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/11/23 16:27, Chen, Yian wrote: >> It seems we are implicitly relying on the on stac() and clac() >> calls that are added for SMAP. Have you tried running with SMAP >> disabled i.e "clearcpuid=smap"? >> > Yes, I tested with clearcpuid=smap. It works by accident, then. clearcpuid=smap means that the kernel should be running as if CPUID.(EAX=07H,ECX=0H):EBX.SMAP[bit 20]==0. STAC/CLAC should #UD in that case. The only reason that it happens to work is that STAC/CLAC apparently actually continue to work even if CR4.SMAP==0. I'm actually a _bit_ surprised by this, but I bet there's a good reason for it. In any case, please just make LASS dependent on SMAP. It's the right thing to do on several levels.