Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3437567rdg; Tue, 17 Oct 2023 15:07:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeta9D9mOTtROyKGZqBzk8vEG3XTr3YbasO/a4IE2Qnemyyyrag/oLiZPkThKF9ZLFjniN X-Received: by 2002:a17:902:bd09:b0:1c9:d6f8:1908 with SMTP id p9-20020a170902bd0900b001c9d6f81908mr3393789pls.9.1697580428211; Tue, 17 Oct 2023 15:07:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697580428; cv=pass; d=google.com; s=arc-20160816; b=YdzSzQe+2wau5kHorsXCGK4O6qpL+UACNrd44r9bzL+MT+lSeQ531qZBZU+YC0aqVU UovgPlF36TIPAdGm+rlcX9TZSeIy+eGVUPMcXn1vPUemoAwwQFrWP97h647B70/qfupi HbW72aqv4UMfT+uugJhadsBHjmU6mdqpOvhibslXTcu8d5zHxQvDVnsS50tsIn5cJL7l jEeFhqUYtkLFJj+TLHhW8Af5SNZRb8aND5RQph5z2Wm/7Kjj2BMaYI04w0Cjyv7mlNdS VZfJeGUXNnR9IHSPhXvuO+cJ3CzZLAsn2JVzaAD81nXvOfeXCbcAVQ52OxIh7+tGiApZ GdXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=2f7KdOSQD5rQ9bjlMkRdypU6RgtWOUaYCAgMu2x8ZaM=; fh=FBuCwIpxDFOuStwTOW+jYExl1Bs0RUKxmY2CkC1xYs8=; b=yJa/0034lKWmCILCELg8nn0W7cjRNMNpUJpJNj/UACCBiZ/wMt7kn/1OvR1MNxPaX0 znnhH6UpzcIaqgEjf5rEjCh6Q7I63YRXlqKXoTrGkpxhBDK0LHPDMJ0IF8mOot+J1StL qvLFtSb+cJYfi668xhg0U31Ld6EbmYBT9YdZ98lclnLI5JZbwuXBAIPMhhFtzE6c1rm8 +8UsIZwuz9o6ZeRRTEQ/gEg7+XYLrjjWg+v0jOYJ2tmHcO+aGtzHxpCO6d1ZmycAHPXx tnRGAAaeFM0Dd3Pqa1LX8uhmyRauAqXjNcFkE4bK42zwHpBLbXuPlxSq9myZ7ujWE68c sLAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=LhxaMAea; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p11-20020a170902a40b00b001c61073b06bsi2498746plq.427.2023.10.17.15.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 15:07:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=LhxaMAea; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CFF1A802D0C9; Tue, 17 Oct 2023 15:07:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234693AbjJQWG7 (ORCPT + 99 others); Tue, 17 Oct 2023 18:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbjJQWG6 (ORCPT ); Tue, 17 Oct 2023 18:06:58 -0400 Received: from DM4PR02CU002.outbound.protection.outlook.com (mail-centralusazon11013001.outbound.protection.outlook.com [52.101.64.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EBF495 for ; Tue, 17 Oct 2023 15:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lp4pgn/TQr2annnefCXUCZnvGeXrpBVJKmEeaSrd+lhGpFzx+c6Q1OmFrCv5he1RHdo7dLV3j3V4wbpdeVJhEr1YsdG7N0Ghp/axRklVy/qgKhdM6PVamAq4hzuRFeJuxCwQZCiuXxrT8M9TWzNepY2Tgyb5BrFFRtkHEL/Mti1DrLYLfkoBa1OQhgG4UJWHsqyu7JK63c75mZ6BVOrEmlDm2I+7L1FZWkHRh3s7T9oCxroeJ7L0hxXyVLZ6B1bkeiGrJspF80ZVkdlL6z2Yg8hN7TSCYyLrcsflkKzN3HXIp6aPOsTz8pAd3GyyCZhstQhXFwOKzHjJWKysuSz/Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2f7KdOSQD5rQ9bjlMkRdypU6RgtWOUaYCAgMu2x8ZaM=; b=beUhCCH2+NyHaMMG98RVvGdnpMra1pfjOO1xzdXvuxRsyYyc973OsYMGawicwiMcsMMvqLvgeY2OY6yT6+GvbA2Bfug8RDJJsaUilhj9USeOS2Y0Iu8kwNR3Quv/NAFxbCpWSiECSW3J9afKX73Sl17bsFadFhOORE0NBWito7mrGfjnrqalzBeKpJgiGZ6gpsaCkiZTyNEddMgUIU+s9dk212IBZ4uKIX36OJrSY+uwOlktNxcZRYM1NHEOr5Wm8+AOyE518t2xbLQcVLb1MHZHOCR6P4YH16/f5NCY+1N/FbGqNZyMfLsqGYjlGT2IZptWveDpwVXh56PSog9z7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2f7KdOSQD5rQ9bjlMkRdypU6RgtWOUaYCAgMu2x8ZaM=; b=LhxaMAeaRurXLdDugYquScALYqV+SqC2gVHF256hIdymuZmZ1LfpMq7KKEWgWXXUVmEXiOGPXJX4+TO6QISaSQGFWkFgIKFCncC6JFU5l82Q3JYOkc3L+pxcD5rlqgmN3V6zjE4vrMRs9Fl7FaVlcWZ6uG+tTUhfps8rc1DJ+WE= Received: from BY3PR05MB8531.namprd05.prod.outlook.com (2603:10b6:a03:3ce::6) by SA3PR05MB9761.namprd05.prod.outlook.com (2603:10b6:806:31b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Tue, 17 Oct 2023 22:06:51 +0000 Received: from BY3PR05MB8531.namprd05.prod.outlook.com ([fe80::e6fb:726:9aa2:fa13]) by BY3PR05MB8531.namprd05.prod.outlook.com ([fe80::e6fb:726:9aa2:fa13%6]) with mapi id 15.20.6886.037; Tue, 17 Oct 2023 22:06:51 +0000 From: Nadav Amit To: Linus Torvalds CC: Uros Bizjak , 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 Subject: Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() Thread-Topic: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr() Thread-Index: AQHZ+5jZGZywpkB5zE2yxvhqDFo/FrBDSECAgAAOE4CAAAQxgIABoxnfgAAgI4CAAAYlgIAHqOMRgAAI04CAADzyiIABTsvzgAADAQCAAB/hAIAADVOAgAADqIA= Date: Tue, 17 Oct 2023 22:06:51 +0000 Message-ID: <10930088-3B4E-4BED-896C-CA66AB196010@vmware.com> 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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3731.700.6) authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY3PR05MB8531:EE_|SA3PR05MB9761:EE_ x-ms-office365-filtering-correlation-id: 91da9525-4d2a-473a-fedf-08dbcf5d5da9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PUXNnoHHPSr10Z6JSvsSsRBimSMyTkr+f/aSoka6psFmbCvuK9/hx4KU7W1LUd+AmGlZ+wCD7I/3optnnRc1YUaOUc5d1oxJUpRx6JpSPUGUZxib3PRI+ClFAczTTsva0HP7POi7rzUFrMaacSXxWIqOsglrAdb+AqqpDSfKNwNTU3C61MYdRFz86h3fYZpTgS5Kr/9a+yFP8BLkg56k+s8sSqfBFl0q9z76laype93vaoUR9Xhs7QpDIcwtueYdtXsmBBaJzDQp8Z8Sp0X9CCbItWfe3qyuLDHhWtmpPQxfRqCd+95Lo33yl5vVINOH+GbJ+jg/xcpSIhbLIIDJFH7/AUMEztLbCosItoNdS45wod8CH6yej5uklFlQZfFecQ4Jgo3HFzvDDGagKyWvt0j/o6MmtlNZ1PYXGIQtQIa4PfMJlVNSUsVCv4E8UxKBXNR+UumdgP/Rnjy442Gd5sjTK+QIruPbQkrQIH3SEff1JSgNfzB69jpV6nsRukmHwoMf8W+8mEYABf+GKhxSOp4diVOZh0QonhE/rUJi2p53WDiFRlT5a8HIEs+4CRl23N6ciYGqAZTkwGLdUxri4HlIhhkpEVvbUbJ2244EmTR+P7D2aYqhDmEeUGp4XfYMikYXWJs0QJkQCxIYe/YsvEaxCML/EiM8wAzwDkHL8SP80YYsnelWzDb08RgGuHlkwpeayhMlaOzXgplgVSzIIA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY3PR05MB8531.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39860400002)(396003)(366004)(346002)(136003)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(53546011)(83380400001)(36756003)(26005)(5660300002)(41300700001)(8936002)(4326008)(8676002)(2616005)(86362001)(71200400001)(6486002)(38070700005)(122000001)(66476007)(2906002)(66946007)(478600001)(4744005)(54906003)(316002)(7416002)(91956017)(6916009)(66556008)(64756008)(66446008)(76116006)(6512007)(6506007)(33656002)(38100700002)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jZzmZgN7XSFR1Z4X6q8WwViakkPCTUHMDaPoLm9jzQj+WCgQ7cgiI0uYH8ik?= =?us-ascii?Q?sY9MlGO45A3dejOrGTDVMzMmi/pKhYdGgVTjeVK77qEN0Ol5PaRwDn5tZyEd?= =?us-ascii?Q?oyLWRc8pLg9vZJjQgk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ii?Q?9q6gjeSPJAYDV5n+yTCiH3VNV3KukvpNRyElCj0QLKaCZwASIx+UBvE0KrhV?= =?us-ascii?Q?yGhZqGx/jIEwTEQt+7DtBEsZ2VN5DZxXqLPF/2q5iv4rTbNx5DVOlbnV3lCh?= =?us-ascii?Q?aoPfiE0sXIekiVXv2KaO1nI/VeGogeXKqsYVEVwVrdIFFdXJCFhl6lcLpbIV?= =?us-ascii?Q?oqo1HLHmpw4nmboj5IQY4Ra7lbhZ+2Z/qt/BOCI4RpwcgyILzgcFKHUwc3aO?= =?us-ascii?Q?BujkkGcbnrb6OmW8xVsnv31+UvcKkCAsBSZM2zTU1+sfBNfIhSgImebcIhey?= =?us-ascii?Q?V9+yskbqxMQwqGKmKj0DtV37Ftjq9x7wFApXnaOL0eXFVB2U4hbzLUnOcU4I?= =?us-ascii?Q?hWDhUepKomHb0ldyAediFBbNlWlhg3JNMmE+SJ11i4xe6KA03UxQfrbYFo1/?= =?us-ascii?Q?wlRqPitz0G7kfrOWnJJ2ZLG4MeqXIlNbR4Ee9VnHOo/4R//IIsddArJMmhwA?= =?us-ascii?Q?bDbyagiketYxafPFtCxxsxY+vr58KTDsrLZk4QUWTEoZTiaa89/NwzEBGxA+?= =?us-ascii?Q?B+8L7HPvlAFOfJCDhPrZV+ZUoXEmj87N5z/+albY?= Content-Type: text/plain; charset="us-ascii" Content-ID: <1538DFED908F2E4699C3350A031E93D6@namprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY3PR05MB8531.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91da9525-4d2a-473a-fedf-08dbcf5d5da9 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2023 22:06:51.2810 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oWYg4UthisK5ysStkifSZ15nN13PvAXhtTPGxCfdpMNQDvVdUXHCK7evdA2QT7olUH6AxZF1PZc4njqsfFkODg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR05MB9761 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 15:07:06 -0700 (PDT) > On Oct 18, 2023, at 12:53 AM, Linus Torvalds wrote: >=20 >=20 > but none of this should even matter, because by the time we actually > *schedule* that thread, we'll set active_mm to the right thing. >=20 > Can anybody see what's up? Could it be related to exec_mmap() -> exec_mm_release() -> mm_release() -> = deactivate_mm() ? #define deactivate_mm(tsk, mm) \ do { \ if (!tsk->vfork_done) \ shstk_free(tsk); \ load_gs_index(0); \ loadsegment(fs, 0); \ } while (0) We change gs_index(), so perhaps it affects later GS reads. There is also t= his X86_BUG_NULL_SEG. Need to dive deeper; just initial thoughts though (i.e., = I might be completely off).