Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp898268pxp; Wed, 16 Mar 2022 20:34:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCwHfFGxbue5+9Ojcee3NY99llYug4hS4/M+0qq9HPX570JJlcjRIqVcZr++NbshOEAPDK X-Received: by 2002:a05:6a00:21c5:b0:4f7:2e26:d142 with SMTP id t5-20020a056a0021c500b004f72e26d142mr2362332pfj.83.1647488077509; Wed, 16 Mar 2022 20:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488077; cv=none; d=google.com; s=arc-20160816; b=Klq6DNREyE26OPjSjqX0cVpSQ60bON99KqD+T6AEpjwAizNm7XsWZ5eBR0jbVHK1Wi eBY1ox/oN5w6XwIrBM8HGsY2KC+HwaFczOH2SfMQwhoJP4YPl+Qrwbcbt4ihBgJAbrz1 6VeByKg0PaJtLXjhF6cGAyI5QGKBQeEYEe0Gfdh3oQRIaIhtHDWW53ZhBRCaGscKdOzn OEK+3MAlwstHTrDufSdhc0f5kDofCzNWLMKhR4Hsn3VB4C6qjwe3rikfqnJ1UGnWpwTe 8yFtvDdDKFxL8d99OcYh5BfVPdYGwu7+lOkbV0ovbXebDqdH1RAkp2iUaxvDVIRMWVHE 0cmw== 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=XCXMhctspS14CSj3bDVJKa2fECrychRdoSVtouYxm4M=; b=iqUvO9wS8PevYDDijI4LmvQutasZSPdvRXP7frDNYO6UMefiPvEvnQ2pQhsvWzwAO5 QkSmQwSC1PdDtjazCyBeR0IZs76Nl39HvxdiV+tr2zTxH+ZCjYmVYJRfhj/z3uOvv9e7 TOx6yGiH85GsyGCfY92gVxfJRiR9chY1r8SAo5El/9M1kQYgmtZD7qU8HKlnMnWirpqz Ob1he/7nhqk8dEYGwg1NFEqE6T0c6/vCfeq7mzslIukUCMNEO7rvLi6z7tVsjekwEwTe NsSqiXw+2XEYNI/ZRdr4wiST8z31E/selywOg58MuTc7fDIGoHQEUHhObeDU27fdIZ6N 8H8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gvCiEX8y; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k7-20020a63ab47000000b003816043efd0si913301pgp.453.2022.03.16.20.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:34:37 -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=@gmail.com header.s=20210112 header.b=gvCiEX8y; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D51B46653; Wed, 16 Mar 2022 20:30:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350796AbiCPJOd (ORCPT + 99 others); Wed, 16 Mar 2022 05:14:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243385AbiCPJOc (ORCPT ); Wed, 16 Mar 2022 05:14:32 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF2135C865; Wed, 16 Mar 2022 02:13:18 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id g19so3162141pfc.9; Wed, 16 Mar 2022 02:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XCXMhctspS14CSj3bDVJKa2fECrychRdoSVtouYxm4M=; b=gvCiEX8yBD3meY306RCIl71Jm7P82zrMmlnCtQJjT6DEdTuYtXTEldQsFLVWKqE+Mu ZtCa5nI04kKPT7cX+pT8ScPknFLQvA8Rc3j3Yj1SMCz/NwSQzpt0GxTqrWPry83YzDlR 3UZTthKjfD1PTlvxHwxBxHqKSw04cqYgFrAVvFS+yN0bw502gRKUESXAvtz70OlORqyx XSAzIkCEZzwJqmDbRRf7Jj8TuHru2IZIV4V5Vv5YGhaMuo7DMvd8LPWEfqr2eXKjx+l1 MSWtAV7UxtEMq40F8uaHeFHxvETuojm86zA9jDrfAuTO9RiihvCa0w+RvsJIBrtYSMDc p+oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XCXMhctspS14CSj3bDVJKa2fECrychRdoSVtouYxm4M=; b=w8RwC2QoPihAIn46qgtnNcNp6avRypkjDsuuFAg8N2D81bQIYD7HUHliG+S60I6qdV TL5SgOhxjhf16unRobog/PQfrDc1Cf85pcrjLuZufuWx4ytv40Zny19JYTlBZm7R/zOO 8GQiD60Mj8PkNwXWV4dGwfI6MgNo5hg9Dm6QWJIE4biAT6tTqGOIHuXLgn5Pgt3VqAb4 D8ZLIJ2a49kcT6MGvKHARc4LnYIUP1gj9z1aHcOy9MJnrTSQzkoOk1AZvlk733z/uiUU 8Y8KS1xumWNdtlSRmuAe3zIBaX+a0YMkZ7CH0ZASWSXWSOPDx1LKcTprYacOHjHB1g0M Bfsg== X-Gm-Message-State: AOAM531th/4ncruhiHUfvc/xaHjtxgs1bIKa8/0+BCYBdn2tfJY/f6RK YNOgIQrUdu0be74BAETh1iM= X-Received: by 2002:a63:235b:0:b0:380:5d91:6cc with SMTP id u27-20020a63235b000000b003805d9106ccmr27530271pgm.183.1647421998215; Wed, 16 Mar 2022 02:13:18 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:6282:e9e2:394e:c94e]) by smtp.gmail.com with ESMTPSA id t7-20020a056a0021c700b004f7916d44bcsm2219510pfj.220.2022.03.16.02.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 02:13:17 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov , stable@vger.kernel.org Subject: [PATCH] xtensa: fix stop_machine_cpuslocked call in patch_text Date: Wed, 16 Mar 2022 02:13:11 -0700 Message-Id: <20220316091311.2173309-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, FROM_LOCAL_NOVOWEL,HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 patch_text must invoke patch_text_stop_machine on all online CPUs, but it calls stop_machine_cpuslocked with NULL cpumask. As a result only one CPU runs patch_text_stop_machine potentially leaving stale icache entries on other CPUs. Fix that by calling stop_machine_cpuslocked with cpu_online_mask as the last argument. Cc: stable@vger.kernel.org Fixes: 64711f9a47d4 ("xtensa: implement jump_label support") Signed-off-by: Max Filippov --- arch/xtensa/kernel/jump_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/jump_label.c b/arch/xtensa/kernel/jump_label.c index 61cf6497a646..0dde21e0d3de 100644 --- a/arch/xtensa/kernel/jump_label.c +++ b/arch/xtensa/kernel/jump_label.c @@ -61,7 +61,7 @@ static void patch_text(unsigned long addr, const void *data, size_t sz) .data = data, }; stop_machine_cpuslocked(patch_text_stop_machine, - &patch, NULL); + &patch, cpu_online_mask); } else { unsigned long flags; -- 2.30.2