Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp71296rwd; Fri, 26 May 2023 15:11:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5RZpIW2Y0rcgFZMVbx+k4ztnV9aIB6YUwrnn5O0Kqso2a5AMAQK0D7AttzumQTv6W4ZnpG X-Received: by 2002:a17:903:2094:b0:1ae:3dcd:30fc with SMTP id d20-20020a170903209400b001ae3dcd30fcmr3549367plc.11.1685139073764; Fri, 26 May 2023 15:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685139073; cv=none; d=google.com; s=arc-20160816; b=szxLFZlP+Msk8QaAnKl3hkoBWaF4QAbcHuphcvLBbx3fEbgG9KE7iOEjOvn+kH0q9i K/lNCHy7lLmr2uOWUZvNmUqGZQ77UQWqZL3uhrme4+HeSh4DWFzkVW/6RnuXDkoCFov9 mAjDazV5zTurO+tanZoE5tZIu1TkIMoLbM7aILfbHFJkC6pJO2SpIvs3GZrAFWiD+fgB 3bO2dL2Z74e1fnNlwkwHMevR3LdEEKMDzKeBgmtCiyqnqB2/t4G7JhCjIvsOHTnk0opR e862gCSfm7WWKSpUtkYTKhrXqDyMQBKq5KUQw82QVEs01W/hlyXkCfl61Gz7jbWDTJky eKOw== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9SXKm9WVJdtwNy/nwrEMmSWiLy49rMJg/Ig3C2AtQos=; b=y7/H/GLN1LaobFwKcdxWpDlIcINcmzcmowQ/rbcTVdQTisV+C3jqptz+625wno0s4L iRAEwQ1no5GlFJB1lQcXS+2QjdhJWeC7PDO7y9/a0TEWyGcQ8fOMXmvUoXFNrbdBQlP8 Qg9/NKV4Fyv3qIEIakFHhLmGfsTMqRYQYrMYF3LjGll+RVdwBvkfxik5b1H8XI82J5EC 4w0OLp/Ysp5dpS12Pta018aH7BSr3NPCcjbQp24F+S6tIXGmdLuPSiedZL50+7u64SJ6 RwkgbzCAHUckxxqdsep0xpCqyap7Jd4zi3chFwx9Lsloz5vwH2n5ImB8tROk6yK60sC5 Ck0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IgOW90pR; 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 d18-20020a170902ced200b001a1d987fe28si5426113plg.405.2023.05.26.15.10.58; Fri, 26 May 2023 15:11:13 -0700 (PDT) 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=IgOW90pR; 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 S229977AbjEZVR2 (ORCPT + 99 others); Fri, 26 May 2023 17:17:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236236AbjEZVRY (ORCPT ); Fri, 26 May 2023 17:17:24 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D06B9BC for ; Fri, 26 May 2023 14:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685135841; x=1716671841; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jvczHAS3VHMKx9c3PkNvEtFNL1bha8QOhxzfjqa/32Q=; b=IgOW90pRrtVLC7l3erPJRr79ofoQUuIbpLQEGp5gWFdOHLN7gacodLTp FCToTRBAjQDwJcxllGZYiMcOR1aVZ15zxxEFkhD7Q0Cld3bHnE+ooZndJ oDmK29dGgbHWw5ga7xlGHzzJowqA11s8uzKrbbBx6xXgvv028JrjCRbst RKmE2CmX4ZCjv+C8ivHfC1vxkAt5fe+YB2dhEXURNdxNDoev6pCnouHJm +iu6r+9KofqnuyCLHpT2kFTKRe1NA7NOK00k/FMZKvLwCIrzVwzyiU2dI ypfQaBVkZ1O3MNJtBrC2o4YLH1KxJ/SnswcmUa9gZCH4QtG6bPQrSQ5lp g==; X-IronPort-AV: E=McAfee;i="6600,9927,10722"; a="343803602" X-IronPort-AV: E=Sophos;i="6.00,195,1681196400"; d="scan'208";a="343803602" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2023 14:17:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10722"; a="775209657" X-IronPort-AV: E=Sophos;i="6.00,195,1681196400"; d="scan'208";a="775209657" Received: from ggreenle-mobl1.amr.corp.intel.com (HELO [10.212.214.91]) ([10.212.214.91]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2023 14:17:20 -0700 Message-ID: Date: Fri, 26 May 2023 14:17:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] x86/lib: Do not use local symbols with SYM_CODE_START_LOCAL() Content-Language: en-US To: Nadav Amit , Borislav Petkov Cc: Jiri Slaby , Thomas Gleixner , Ingo Molnar , Dave Hansen , X86 ML , LKML References: <20230525184244.2311-1-namit@vmware.com> <38e24fd4-9213-229d-9919-7ae3bfb113bb@intel.com> <24E47178-C177-425F-A8EF-CFFAE22597D4@gmail.com> <20230526155336.GAZHDWAFi1FRqq83TP@nazgul.local> <0F07EEDB-8A3F-4224-9FF1-43A5300B1B8B@gmail.com> <20230526204559.GAZHEahxxnQaHhSUul@nazgul.local> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 5/26/23 14:10, Nadav Amit wrote: >>> I did not ask to make them global. Just to keep them as local after >>> linkage in the executable, like all other functions in the kernel. >> Ok, not global. But local and present in the symbol table: >> >> 105185: ffffffff81b89330 17 NOTYPE LOCAL DEFAULT 1 bad_get_user_clac >> >> And again, this helps how exactly? > Allowing debuggers, tracers, disassemblers and instrumentation tools to > work the same way they work as they work with any other piece of code in > the kernel. > > I personally work on code instrumentation and this makes my life hard for > no good reason. > > [ Perhaps the question should go the other way around: why addresses of > code in these functions should not be mapped to any symbol? ] Nadav, is there a chance you could give us a real-life example of how this affects you as an end user? What's a specific tool that you were using or a specific problem that you were trying to solve where these local symbols caused a problem? How would the global symbol have helped? I can certainly _imagine_ some, but I'm curious what you saw that prompted you to send this patch.