Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2087749ioo; Mon, 23 May 2022 09:48:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytHXmW4e5OoiSlP5abGDfpRgU0tnXo4DdfCTyVy9ibsWUBQlh4IZbvXGAJYujUNd1vMMUP X-Received: by 2002:a17:902:ed42:b0:161:6643:419d with SMTP id y2-20020a170902ed4200b001616643419dmr24401786plb.58.1653324502030; Mon, 23 May 2022 09:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653324502; cv=none; d=google.com; s=arc-20160816; b=TB0HvflF5XzO4WHbhy6m5lzSOrKTYlkJpE9nOBpBUe8hdZLME/d3DEJWgS6Y19VRjJ MPFejYOupH4J2x8lwaO5G1WP3wG+2eAPyO378gmr8VXI5TnIO8b0EAZAJqSAEzbdmJMt XXeBEjKRz3CDBkNgK6OT9fI2jU1vrRrBFD9Hlmrepyd6/Pw/DNpr9laEIOMJqo4VYEX0 jYG8kly/5tRFP4wHm1zUWAhLysQkAysHkVFkklZPz2/RW6ETCKujXA+4C1e6osTTt96t izOyfRrqUXrdzFYK5U93aERGueGB4tC7iTUtKc9fU7aAAc3C43NP8uyRG+I8V83qTuG3 /iqQ== 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=FzQNwTi13ARFCJVSGCYihZ8rVSZ+bSBFvx/V3quqw0c=; b=fMV+zqpp+cdXRaYVzvIC05RSshfxN7YQEsChDRl+BCHuT6glDNsuAlOp8uAOLkBSaR rIF2tL+SiQx/WYsQ4HT46N8TaCLVg+FELlLGEHpUCwILitj1Knui6ckVgbAqbH4+Kk2i tIS+pdMe6OhDV1kGipzJpfINqLKoyihc6BcKmaCroaR+LA348sgR9b/ROy/8acq6ehFH vKL6BnqGb0TZEjQnIVLn0NDEXBue2Zzm3xng/S/aVc+ijpTW31pQ3i5b5U5UhRltNSCT eK0XW2C0Bcq/IU6RXj2pMPfx7Kac8ZFTngZ0s7W0rHozIInFDHv489uY61eocMA7I+dI EAMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=HNc6yecs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v8-20020a63bf08000000b003aa36aa1f45si10889303pgf.754.2022.05.23.09.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 09:48:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=HNc6yecs; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2513935861; Mon, 23 May 2022 09:47:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239093AbiEWQrt (ORCPT + 99 others); Mon, 23 May 2022 12:47:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238871AbiEWQrp (ORCPT ); Mon, 23 May 2022 12:47:45 -0400 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFC02313B3; Mon, 23 May 2022 09:47:41 -0700 (PDT) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24NG7i9Q020385; Mon, 23 May 2022 16:47:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pps0720; bh=FzQNwTi13ARFCJVSGCYihZ8rVSZ+bSBFvx/V3quqw0c=; b=HNc6yecs4gSb53mS9wiGIWdJY8+MxfWJCveeh+dnhs6PVeiHQ7+Zc1gcd+6xDn6cUuc+ 8E3GyLIe+Uv0s6o+//w78cgZnwQ0o71zrtcqP8A9GtrX2PnZM5mzIqNGJaNiarEKhXtj ySFGDL2UK/ExHmt5piVKfWaZjAKJ1GzG+h5xI8RzZYr4HrU4DQ7h4zBceHDs0Ih152gY V5rIx1GI1UIRZKhNDL8dq8GKbfixLFjrEQ+0UbtOr8CMDp4VmMRHyNLvSrRsJrbzhMCC qLzTKerP+IL7xDy3h+eDvIPWYKT37t0CTuUzGGpLCxGF5VRUwf56AUucYvpvO3tJODHA cA== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3g884f44q0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 May 2022 16:47:03 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id F33DC4F; Mon, 23 May 2022 16:47:01 +0000 (UTC) Received: from dog.eag.rdlabs.hpecorp.net (dog.eag.rdlabs.hpecorp.net [128.162.243.181]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 5FF374C; Mon, 23 May 2022 16:47:00 +0000 (UTC) From: Mike Travis To: Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Steve Wahl , x86@kernel.org Cc: Mike Travis , Dimitri Sivanich , stable@vger.kernel.org, Andy Shevchenko , Darren Hart , "H. Peter Anvin" , Russ Anderson , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH v2] x86/platform/uv: Dont use smp_processor_id while preemptible Date: Mon, 23 May 2022 11:45:21 -0500 Message-Id: <20220523164521.155872-1-mike.travis@hpe.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: AWsB_-ro9HKGeoA4AQdZCDpc7-9ZvM_B X-Proofpoint-GUID: AWsB_-ro9HKGeoA4AQdZCDpc7-9ZvM_B X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-23_07,2022-05-23_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 phishscore=0 clxscore=1011 mlxlogscore=999 malwarescore=0 impostorscore=0 adultscore=0 spamscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205230094 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 To avoid a "BUG: using smp_processor_id() in preemptible" debug warning message, disable preemption around use of the processor id. Signed-off-by: Mike Travis Reviewed-by: Steve Wahl Reviewed-by: Dimitri Sivanich Cc: stable@vger.kernel.org --- v2: Add Cc: stable tag --- arch/x86/platform/uv/uv_time.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c index 54663f3e00cb..094190814a28 100644 --- a/arch/x86/platform/uv/uv_time.c +++ b/arch/x86/platform/uv/uv_time.c @@ -275,14 +275,17 @@ static int uv_rtc_unset_timer(int cpu, int force) */ static u64 uv_read_rtc(struct clocksource *cs) { - unsigned long offset; + unsigned long offset, time; + unsigned int cpu = get_cpu(); if (uv_get_min_hub_revision_id() == 1) offset = 0; else - offset = (uv_blade_processor_id() * L1_CACHE_BYTES) % PAGE_SIZE; + offset = (uv_cpu_blade_processor_id(cpu) * L1_CACHE_BYTES) % PAGE_SIZE; - return (u64)uv_read_local_mmr(UVH_RTC | offset); + time = (u64)uv_read_local_mmr(UVH_RTC | offset); + put_cpu(); + return time; } /* -- 2.26.2