Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3981871rdg; Wed, 18 Oct 2023 11:12:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYBwE6EclcstG3UKyUWRT/gqbTsw+b9jijnEGa/s4YGoWRSh9R3hFgGVftQVHC/QrsxxXZ X-Received: by 2002:a05:6a00:99d:b0:6b5:ec98:427d with SMTP id u29-20020a056a00099d00b006b5ec98427dmr6271449pfg.17.1697652722700; Wed, 18 Oct 2023 11:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697652722; cv=none; d=google.com; s=arc-20160816; b=B0amX+ve2kafB+i9gqyKEp4YD+4yZYeDfMoU8Hca7qlMZwmxTmejrlE7l1i42FctKz wge2RElSC9+/Vku1gT9ZDfb+8g9RbkbVtR8/g+REI3i0eMsFkfU58BFdV3TVqOzPgPN1 XU1JUOq/0pURPNFT8+VGrK38IVCIhS99fA5dsWEeKlCl64XmXlI5aepEXRFGQKGvjTIM 8tcT4Lp7tqMJMCr+bpx1M+0NUs4OWXw8+fsEeghC3C47KxPSbg/Rvv/23DLNr3qA7gdW cb2bcxvRWAAxEYSsxmNQXdcyYt2bXSIwnHS+ocNpILWQBTZ6XezKOCxRiKZarVrUEBTw 9CEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AG805s5rglsAs2sFJw1WGAFX/DsGdyuOOy8APS0Kxyc=; fh=3hMqaci1aSMG0AFmuDTcNcT9Fdla45I/j/Dj+Dy/pas=; b=ePQ6+w1wUwU9M6upyw3xaVOmmfrIMw/J6SDbfAaEueEJXftuEoOB5nu10nNZ/z8f8o PKSVpUvFnp+giFSJ4cj7ipSyEajA4NFwWq5BegkU8HiDWfjitxKjYPGMBsFqxOkI4wTe aU6uuEmRhHYBl1ALEc2pZzE2UuN0dYTtR8qusBsbBSgPHOTH671t6ji3gHD1eXrcGSSd Xv/Hhb5XgmcogBckzmmi6AWF4IFTLHOoUBgmZIYzSl6QEQFj3zQnsLycQfs/vKZL6T08 NEDdiqTS9U9nnmTtr5BL3S+l7+5DJZBleU4GF3QgYA5wKy3JVEDufsggugFu/etdd9RQ pz+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=U0bC6VDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id h65-20020a636c44000000b00578b487825asi2539562pgc.208.2023.10.18.11.12.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 11:12:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=U0bC6VDv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DF43F812E378; Wed, 18 Oct 2023 11:11:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231848AbjJRSLs (ORCPT + 99 others); Wed, 18 Oct 2023 14:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbjJRSLq (ORCPT ); Wed, 18 Oct 2023 14:11:46 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A0798 for ; Wed, 18 Oct 2023 11:11:45 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-991c786369cso1147005466b.1 for ; Wed, 18 Oct 2023 11:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697652703; x=1698257503; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AG805s5rglsAs2sFJw1WGAFX/DsGdyuOOy8APS0Kxyc=; b=U0bC6VDvtRp02dUm3kTChDofZ7J6okSongRSWcBVrV8fLJ1MDvtmje8X9eSMvEUOeG enyb8yqzEVdrlgF+G1u3FVsgtBY3dXLWOtGh2SO11/AqPuiRZLqSWw3InNZt2XVIR0G2 IXzh3ALbdYKUYCgyeCpuZo4PBPGImZXEyr+Bc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697652703; x=1698257503; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AG805s5rglsAs2sFJw1WGAFX/DsGdyuOOy8APS0Kxyc=; b=MYgXf0G05WZJHh+ALOUCKrcvhjkckaYu1+dAaVh/wycM9V4FGZYxaWvR091GEZHrj7 JHKqOCLsEkSSFVDOsZ4ZP2qYSCX3z5KCPStwkU5J9tliX1OLxyNb4PR1IwoNN3IJ7nMZ h5+DQFWY6PRS9YbuHZAHaRsmq2E1DzqNqERPQzFGMa1ZPs2w75vVsr2Jy2+YFTJYLEoN 76Edimn4ZT1emD7Ry6ncKE6GaupgSKgHe45xc3lTHXX6pKogrX4pVoFdBuHNqu2eimjQ xFFm1ldp5UYRCNzg9bIC4r9e7w4lG09i5xVd+VDCF6+6SXa1Dk6CAVCRIhcm2IPzlzaP cAUA== X-Gm-Message-State: AOJu0YxeNP6SVfeLucFlS6xaW9b+zxf0CXwmb0iLGvpKM6ljor9EP5EC nTePO9zUNSJuhcJqBzm8QZ6B/8MwdLfOEypMKvpv1a+4 X-Received: by 2002:a17:906:ee8c:b0:9be:466c:1824 with SMTP id wt12-20020a170906ee8c00b009be466c1824mr43609ejb.11.1697652703476; Wed, 18 Oct 2023 11:11:43 -0700 (PDT) Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com. [209.85.208.54]) by smtp.gmail.com with ESMTPSA id fi10-20020a170906da0a00b0098669cc16b2sm2106461ejb.83.2023.10.18.11.11.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Oct 2023 11:11:43 -0700 (PDT) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-53db1fbee70so12060275a12.2 for ; Wed, 18 Oct 2023 11:11:42 -0700 (PDT) X-Received: by 2002:a17:907:3e1a:b0:9b6:f0e2:3c00 with SMTP id hp26-20020a1709073e1a00b009b6f0e23c00mr14573ejc.71.1697652701886; Wed, 18 Oct 2023 11:11:41 -0700 (PDT) MIME-Version: 1.0 References: <20231010164234.140750-1-ubizjak@gmail.com> <0617BB2F-D08F-410F-A6EE-4135BB03863C@vmware.com> <7D77A452-E61E-4B8B-B49C-949E1C8E257C@vmware.com> <9F926586-20D9-4979-AB7A-71124BBAABD3@vmware.com> <3F9D776E-AD7E-4814-9E3C-508550AD9287@vmware.com> <28B9471C-4FB0-4AB0-81DD-4885C3645E95@vmware.com> In-Reply-To: From: Linus Torvalds Date: Wed, 18 Oct 2023 11:11:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() To: Uros Bizjak Cc: Nadav Amit , "the arch/x86 maintainers" , Linux Kernel Mailing List , Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H . Peter Anvin" , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 11:11:59 -0700 (PDT) On Wed, 18 Oct 2023 at 10:23, Uros Bizjak wrote: > > In processor.h, we have: > > static __always_inline unsigned long current_top_of_stack(void) Yeah, but that is never used multiple times afaik. I think it's purely for things like WARN_ON_ONCE(!on_thread_stack()); in the entry code, for example. So I guess it can use the same infrastructure, but I doubt it matters in any practical way. Grepping around for it, it looks like the 32-bit code has some stale commentary: * Reload esp0 and pcpu_hot.top_of_stack. This changes * current_thread_info(). but that seems entirely bogus. We historically picked up current_thread_info() from %esp, but that hasn't been true in ages, afaik. Now it's all based on 'current'. Linus