Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3907111rdg; Wed, 18 Oct 2023 09:13:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/rvR3ZmXdMojZCLT7IJqfBb0TKem2mhwDPh2oUw5J9NC102iARrVQu5RPD1psQydHCS+g X-Received: by 2002:a17:902:facf:b0:1c7:36ff:1feb with SMTP id ld15-20020a170902facf00b001c736ff1febmr6563639plb.17.1697645597064; Wed, 18 Oct 2023 09:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697645597; cv=none; d=google.com; s=arc-20160816; b=SGzP1rNRad0NM64Ol84G8Im6bR4OgBNg4h8u/bcSP39Gib60AyVEZw4ErggDIC8uyz uYveptcn53pEWXYLZDDku+Ex6qyAyjickj1qy7o/dL1nGY8RrJx/ano2A95jFN+vQJEl gBwqC9rLZn/h2LjhCPVALkTMcKg6NDY2yJHtqY3DlHYaxB236MOI43IG+BIatZgBrZZm 2CmBppVHdmOHNGT3gZ5nfyRQGajZSW9kT22auBZewCTNdLs0QZmsH6C0Wqc9cPi1aHXO AVwvdEiVN/5lATRBrBKly3foCikstOerf77w1tVN1nDwL+S8CNfGqJOpTgXhGzJcezD5 TDyA== 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=jbMhSSWsQ+uhHrbV00NqRePiqwZmI16mBjqyZxPVZCI=; fh=3hMqaci1aSMG0AFmuDTcNcT9Fdla45I/j/Dj+Dy/pas=; b=uhptAdvDJTFZUJcQDYMdNRSHxC2Oj9RIYHPzjqKeF2xEB2mDUaH1Hv35t8qp5nWLrw oduzs8oY6janyJVo2/57twYBvzZSOhIIkrsHn6j23pb3PVBGfBHmVL15WXhbLe4qpqhk gY1sBsG1ILXHZoNJ8Pgej21G/hIYU9PulQDC76wBcUqybJHkYmQhe44zjkdtN0VgBEGq /87Q8UbiCZ4RCzccn7qTUQy5fi/QBieuBPNU2atpaXCn7dLHBIhz+Pk7UDBY9aZctav4 ffUpyBM6JZ4GL9nwWUm4+Tds7aNVlgh9zrUwfxAGzKF9NvMjBvoIUjlxvV+qn6EjeINt QQjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=duRQoe58; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m5-20020a170902db8500b001b6ae9f8bb1si177076pld.75.2023.10.18.09.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:13:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=duRQoe58; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id C6A398038DBE; Wed, 18 Oct 2023 09:13:14 -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 S230233AbjJRQNJ (ORCPT + 99 others); Wed, 18 Oct 2023 12:13:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjJRQNH (ORCPT ); Wed, 18 Oct 2023 12:13:07 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F17DD9F for ; Wed, 18 Oct 2023 09:13:05 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9b2f73e3af3so1081495166b.3 for ; Wed, 18 Oct 2023 09:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1697645584; x=1698250384; 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=jbMhSSWsQ+uhHrbV00NqRePiqwZmI16mBjqyZxPVZCI=; b=duRQoe58yIL4nUhvhfsHaJZOWnboCu7qWHTHjBa/1wssq5+lhnAt1ob6EmkjENxvlE nPfBNSEWt705Ns3PUE2yRYb+09ZMeaMD3AbFet2Di0H8jPPqLWs6UdwdIdd3SOzu4Kic epHLiqBGZlB9swu+axZNMMNlD5m7/OXD9BIK4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697645584; x=1698250384; 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=jbMhSSWsQ+uhHrbV00NqRePiqwZmI16mBjqyZxPVZCI=; b=s7agNXSKlB/U06e51AFA0QUOsKNvRt3GXVnC6SEP+r/4KSwuqie5AtjtgDc2txpaZP vZTpkpJo1ndeAv0Pt2GkWGrh19Y99JuL0r5/THa0v2smJ3us0eDRy44Q22RgZmSYoWxm P0yNJK1wiCwIbrUpggJPw/AngMYllptj3wcG0SUHLd822TfBBFlx/2olaxUqj4wTmBXH jCP8AV7dgzIR/aFhnIj86+as4DUjI2MVuaIFiJVmNtI1LsC3QU63D/jpyFSGFSsuQEG7 j9D6rpCsAXkLZc2KaDvEIh3bEnrtCEQLv3ylf4o/oFp4cCgYGVtGCmWTYyhvTOp04+I8 BteQ== X-Gm-Message-State: AOJu0YwGjpTE8jZAtSqF1eeVKdMSrNXL9ftwZ/YD1CXQvAkEXB+bf71Q Ja86bG+wwkX6+YCZS00rjvzLGdK+DkWiQ04Dg0ZJnB7x X-Received: by 2002:a17:907:61aa:b0:9c6:64be:a3ac with SMTP id mt42-20020a17090761aa00b009c664bea3acmr3145826ejc.49.1697645584304; Wed, 18 Oct 2023 09:13:04 -0700 (PDT) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com. [209.85.218.52]) by smtp.gmail.com with ESMTPSA id n27-20020a1709062bdb00b009829d2e892csm2037015ejg.15.2023.10.18.09.13.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Oct 2023 09:13:03 -0700 (PDT) Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-9b2f73e3af3so1081488466b.3 for ; Wed, 18 Oct 2023 09:13:03 -0700 (PDT) X-Received: by 2002:a17:906:eecd:b0:9c3:cefa:93c0 with SMTP id wu13-20020a170906eecd00b009c3cefa93c0mr4181923ejb.38.1697645582806; Wed, 18 Oct 2023 09:13:02 -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> In-Reply-To: From: Linus Torvalds Date: Wed, 18 Oct 2023 09:12:45 -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 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]); Wed, 18 Oct 2023 09:13:15 -0700 (PDT) On Wed, 18 Oct 2023 at 06:15, Uros Bizjak wrote: > > Attached is the prototype patch that works for me (together with > Linus' FPU switching patch). That looks reasonable, but I think the separate compilation unit is unnecessary, and I still absolutely hate how that const_pcpu_hot thing is declared twice (your patch does it in both current.h and in percpu-hot.c). How about we just do the whole alias as a linker thing instead? So the same way that we just do jiffies = jiffies_64; in our arch/x86/kernel/vmlinux.lds.S file, we could just do const_pcpu_hot = pcpu_hot; in there. Then, as far as the compiler is concerned, we just have DECLARE_PER_CPU_ALIGNED( const struct pcpu_hot __percpu_seg_override, const_pcpu_hot) and the compiler doesn't know that it's aliased to anything else. And please do that declaration in just *one* place. Linus