Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4385528ioa; Wed, 27 Apr 2022 02:38:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLDmPuVDidZGV3pQdWAjCem22WDvsgIuBzOk+OPLeilgDP079A4JFdH5zYeAH3stZ6gTqf X-Received: by 2002:a17:903:1d0:b0:15c:f02f:d2d6 with SMTP id e16-20020a17090301d000b0015cf02fd2d6mr20094199plh.77.1651052305924; Wed, 27 Apr 2022 02:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651052305; cv=none; d=google.com; s=arc-20160816; b=t9u7yXzNLyIOeGPqYBh0DRgy/15Yus89KGeWUVtrvP/nz2sq9mLM9J7Vk8C3vNnYhM V7DVHguT8hizseOc1IyP5hqC1fvsic6vAcQv1sZjSYQdnPEqeaqL9vJcyk6vmPVPX7of zEWLlXddwFwQwUnk6kkuakWX121d7ivik1kUH6Im0hIBQ0Or5AcdqQgpv85klw64I5LG wLjDlh7NnS+04YaZJ8cRGNZR3NVY+RKVNkNmvfGGK8+3ZSvrrlAtDqEHiA8+gUUElzkP HHaRL2y9/tdG1BGCL4HnhdE6MSVeWOY5PGPIDZydGXR5AvsMxcFksJ8VFDovmOeHmR+e 0C3w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/a4z1qcK4t4sdH+h4hDHMYpPV9XqORNatwRU8d1r1kQ=; b=lxI4CUIhGjre6hPaWI07szjkVuvGzeJqcuyqC0vh5n2nwhXux/WNxnPeZQjdgMX5am X8RlE+/f7hyen9UpFulhlnzUpt6h8aBTSyZ2LXO+4vZuvSmz3JyteZ6h+ef/yHHFYkwE kqw7sLmBu/UKjE3JQRnCCQwGv/g1P3aTpDw/xSHVfnPWUtCsliHjNYahvLqmgSVjkpwD z1euztKnTxOkLOtHh5H7LT17ytZbFevoSmj86MVseRJK2EAWiJM+W649uyDN8CDCfiSr A9RsepyrvzobLzypnGoK5tacQmh/TONCUOOHNdbuKdTKuE9cRew+NDgLNVhtg942+Hdk IW0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XFZJBce1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b15-20020a65578f000000b003ab4190c4f9si1013448pgr.854.2022.04.27.02.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:38:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XFZJBce1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BADED2642; Wed, 27 Apr 2022 02:15:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347464AbiDZJOR (ORCPT + 99 others); Tue, 26 Apr 2022 05:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245512AbiDZIwS (ORCPT ); Tue, 26 Apr 2022 04:52:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 673A5D5557; Tue, 26 Apr 2022 01:40:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0561F604F5; Tue, 26 Apr 2022 08:40:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 169C9C385A0; Tue, 26 Apr 2022 08:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962448; bh=I7E4f3rFKZQ0HQraiuVyxk/qYySAiRYvtrWeIKvVc1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFZJBce1zmlyWPWF59zjCtk0uR3wh5CZlFLQyIG2XIhvLNoTEwZ5LRu/HGjMKTQe3 ISZNHkuGIEg5rzrafX7VfJOk/LhxLACiW6yXCkJZ/pSAytVO5hAaw+Gbh5Oi87s09v qPdXoS2qURq6igt85JzsIDFi5rYpAsAnBqfdRS9g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 5.15 100/124] xtensa: fix a7 clobbering in coprocessor context load/store Date: Tue, 26 Apr 2022 10:21:41 +0200 Message-Id: <20220426081750.141678316@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 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 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 From: Max Filippov commit 839769c35477d4acc2369e45000ca7b0b6af39a7 upstream. Fast coprocessor exception handler saves a3..a6, but coprocessor context load/store code uses a4..a7 as temporaries, potentially clobbering a7. 'Potentially' because coprocessor state load/store macros may not use all four temporary registers (and neither FPU nor HiFi macros do). Use a3..a6 as intended. Cc: stable@vger.kernel.org Fixes: c658eac628aa ("[XTENSA] Add support for configurable registers and coprocessors") Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/kernel/coprocessor.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/xtensa/kernel/coprocessor.S +++ b/arch/xtensa/kernel/coprocessor.S @@ -29,7 +29,7 @@ .if XTENSA_HAVE_COPROCESSOR(x); \ .align 4; \ .Lsave_cp_regs_cp##x: \ - xchal_cp##x##_store a2 a4 a5 a6 a7; \ + xchal_cp##x##_store a2 a3 a4 a5 a6; \ jx a0; \ .endif @@ -46,7 +46,7 @@ .if XTENSA_HAVE_COPROCESSOR(x); \ .align 4; \ .Lload_cp_regs_cp##x: \ - xchal_cp##x##_load a2 a4 a5 a6 a7; \ + xchal_cp##x##_load a2 a3 a4 a5 a6; \ jx a0; \ .endif