Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp339386rwb; Thu, 10 Nov 2022 01:21:51 -0800 (PST) X-Google-Smtp-Source: AMsMyM7NJAwEbnhIXZp/tO0vxOZCzQUeMb+6LXMxMfi+t5+i3fR9qfgy6kwdofZpM9rr0uAitbGS X-Received: by 2002:a50:bb27:0:b0:461:a7f8:c8c7 with SMTP id y36-20020a50bb27000000b00461a7f8c8c7mr1881881ede.325.1668072111102; Thu, 10 Nov 2022 01:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668072111; cv=none; d=google.com; s=arc-20160816; b=NhDODy5epVK77AFzzlOewdkFpNJKpfpkeEtf0H+PRTiqF3lIMN3Tzt+JZu2rJpdPiX MybhHZXrzhXcjTfzM/+eiaG6XULEiC/4jVUJscwMXSYCjbHUrJfJyNBoci2RiSAF6tr/ 5pJP4AM5JkUdXKm3l2K0WrhRxxfCkmLVB+2N2kp2hXEcCIFP4OqF7G+Vu27jajpJSeX1 JO5jWteQ/CE8THJ7AnuZF8tx/C14YDlbd6vKW7zLr+5R7hwAO3C5K3IP2VeMUn5bEN0u MihZLK7bL60s9R7EM6liJAgYOfFegINgCUy/oks2gzb5CP1ahp2QYHBrA6xU4ZlXgL8i G4sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Op8P6TOhSTkI0Hw7ShIPubcI7qhXU4xJVLOd8tRKgxo=; b=O1qzh9Jp493KcVAYSAHads7GMQGMLwd/ToKfQvjb3FrPST6bGzW+WcXDdcEgAakZSl uUPKO/rUPFQShqgJYNqkl09k2mtrwqJS8+dI8mdc+e4fAIeEc+RG0kTOxrw0sPzXiWAR 2g1gcb+bgbbmJ5aJGi667kWEMCDru5rR05IOH64QCKsrHbqAkI5q7PZKAw9IGpPYYL/W dlKZ3QE3wVeqj2TxFyhMu9bHpMghLbg3kqj65naF9UMZL8Qfsn2QQw4X3jA+DnRAgGs0 sd0iNO4IHxsM7/YG2/E3sQwVlC7V2ZGiTykS2hojSYjLwRnJ9XhtoUeRUUmjxpLgVTV9 gTsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eddClnw6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rv14-20020a17090710ce00b007820aa60dc3si13232574ejb.74.2022.11.10.01.21.28; Thu, 10 Nov 2022 01:21:51 -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=@gmail.com header.s=20210112 header.b=eddClnw6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232750AbiKJI0Y (ORCPT + 92 others); Thu, 10 Nov 2022 03:26:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbiKJI0U (ORCPT ); Thu, 10 Nov 2022 03:26:20 -0500 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B0F21EED5 for ; Thu, 10 Nov 2022 00:26:19 -0800 (PST) Received: by mail-pj1-x1044.google.com with SMTP id d13-20020a17090a3b0d00b00213519dfe4aso983632pjc.2 for ; Thu, 10 Nov 2022 00:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Op8P6TOhSTkI0Hw7ShIPubcI7qhXU4xJVLOd8tRKgxo=; b=eddClnw6IpCqsFupjDOEtKiB+3YFzl0JqMRPz6yOic//pXTtr1Vm+xkpvaK5BkOAEq 2TlfbhZgPthE+eFiJTo1P/jTFpOklEjludWJx7IoEX5BT0oAzUsiFNnMF32/Go5hOaaC sg9u/od4Q6lryEu0zrzhWV/H+qcfo8Z2prs/InBBiglfe3B727D7dxsSGOaFkGSs8n7L H5/VGEpZisxubpl92e1PAOG2WfV1cTmTQHNBMimXsjbAXAXQVL+Vs6DpiH9as5SerrsY psYA59gQunDV0Ti9I8kH+N7qLlNPBxsfg4oiUx1Do8gR11qzm9uZHucCPPoNO+2iWaGV sayg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Op8P6TOhSTkI0Hw7ShIPubcI7qhXU4xJVLOd8tRKgxo=; b=4JajLXvAWWynEDlbLdXJ4ZadaCnJzw2CKxzZBIP4yw6DLiskX0DIvmZJzSSUwP/YR5 5NJfpb3UyYv+h/yyuPCNHcjQGvFHvcx2ULahvwO+9df+tuEH762fp9DxKx6PR3xBIlfF R+e2+niQZMkzKr/5DlIMOqJSTRDfpsCgB0cnsTxKoCTy6INBQDpUwMaKm9B3+X6y/Y3i otVUEJF/pHm2dlll1UVcA8nOh3qg9ru0r+7rm9Mn9EJ+DHsPmHeAstsuUFNr7+i19JTR XolRkyi+vjWSLVXLK5SNtIRNI4i49yq7qevRZ0sX/DUOStwVgf8tRJ9LYl+crAp0zNUl jiAQ== X-Gm-Message-State: ACrzQf1sItheFy0F8u1hQWQS30iGDpp8fKcWhLzQzeIvvFWbv0fs21Ff Z4z8G6bDgatIJKYluSGWqwPIatOZCUs33g== X-Received: by 2002:a17:902:b581:b0:186:fb90:1151 with SMTP id a1-20020a170902b58100b00186fb901151mr64032745pls.43.1668068778627; Thu, 10 Nov 2022 00:26:18 -0800 (PST) Received: from localhost.localdomain ([2406:840:dc37:cbd2:a67b:c975:e566:74]) by smtp.gmail.com with ESMTPSA id nm13-20020a17090b19cd00b0020087d7e778sm2522656pjb.37.2022.11.10.00.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 00:26:17 -0800 (PST) From: Genjian X-Google-Original-From: Genjian To: frederic@kernel.org, paulmck@kernel.org Cc: linux-kernel@vger.kernel.org, zhanggenjian123@gmail.com, Genjian Zhang , k2ci , kernel test robot Subject: [PATCH] context_tracking: Use arch_atomic_*() in __ct_user_enter and __ct_user_exit Date: Thu, 10 Nov 2022 16:24:43 +0800 Message-Id: <20221110082443.4069161-1-zhanggenjian@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 From: Genjian Zhang vmlinux.o: warning: objtool: __ct_user_enter+0x45: call to __kasan_check_write() leaves .noinstr.text section vmlinux.o: warning: objtool: __ct_user_exit+0x3f: call to __kasan_check_write() leaves .noinstr.text section noinstr cannot have atomic_*() functions.because they have explicit instrumentation.Switch to arch_ prefixed atomic operation functions to avoid the explicit instrumentation. Reported-by: k2ci Reported-by: kernel test robot Signed-off-by: Genjian Zhang --- kernel/context_tracking.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 77978e372377..a09f1c19336a 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -510,7 +510,7 @@ void noinstr __ct_user_enter(enum ctx_state state) * In this we case we don't care about any concurrency/ordering. */ if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE)) - atomic_set(&ct->state, state); + arch_atomic_set(&ct->state, state); } else { /* * Even if context tracking is disabled on this CPU, because it's outside @@ -527,7 +527,7 @@ void noinstr __ct_user_enter(enum ctx_state state) */ if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE)) { /* Tracking for vtime only, no concurrent RCU EQS accounting */ - atomic_set(&ct->state, state); + arch_atomic_set(&ct->state, state); } else { /* * Tracking for vtime and RCU EQS. Make sure we don't race @@ -535,7 +535,7 @@ void noinstr __ct_user_enter(enum ctx_state state) * RCU only requires RCU_DYNTICKS_IDX increments to be fully * ordered. */ - atomic_add(state, &ct->state); + arch_atomic_add(state, &ct->state); } } } @@ -630,12 +630,12 @@ void noinstr __ct_user_exit(enum ctx_state state) * In this we case we don't care about any concurrency/ordering. */ if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE)) - atomic_set(&ct->state, CONTEXT_KERNEL); + arch_atomic_set(&ct->state, CONTEXT_KERNEL); } else { if (!IS_ENABLED(CONFIG_CONTEXT_TRACKING_IDLE)) { /* Tracking for vtime only, no concurrent RCU EQS accounting */ - atomic_set(&ct->state, CONTEXT_KERNEL); + arch_atomic_set(&ct->state, CONTEXT_KERNEL); } else { /* * Tracking for vtime and RCU EQS. Make sure we don't race @@ -643,7 +643,7 @@ void noinstr __ct_user_exit(enum ctx_state state) * RCU only requires RCU_DYNTICKS_IDX increments to be fully * ordered. */ - atomic_sub(state, &ct->state); + arch_atomic_sub(state, &ct->state); } } } -- 2.25.1