Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3063722pxf; Mon, 5 Apr 2021 02:07:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTaa/tug9rHR74LwC3/88YpmtdE7sr38GNhKpSm/xVY9Xx1t2uga2gS1DKE4zXvycoBy0M X-Received: by 2002:a92:6a0b:: with SMTP id f11mr18905294ilc.211.1617613629806; Mon, 05 Apr 2021 02:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617613629; cv=none; d=google.com; s=arc-20160816; b=t+qEGbC+/TIaWicFRRsAIwLkBO9pt5LjQfS9krFNUXcGCacLo/q44zLReyRhoVgpDb 4wNAscYbfvos0x8FS1Z9RMSGLL9zlv4Ed+xInoBsmAwEe1rWLMrL93A0y+Ny8fnos4WK LkRdHoMbMZIDpQNDrsACBT737lXWUbv9YTTQz5HsAj/GQXaY//a6D9X3gYg7V9o+0tJ2 eB8V99MVJUDswnyP6CoymP/KqFO6sxGcETI7jUuJDe4MIZEB1Xz9ISuItgDAndJqGRwc 450faSq5uwDCEYGwur6qeGK9XNVesc+w3J+kAz4pL7FpVjtB/91vQRQ5TpR5/mexlSt7 0YOw== 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=afVzwNJnxCVcfKCLX8Z7MinWM46yCkqjy7ANk+tS4D4=; b=gBF0CDzKwWAmHRpdd6fnbq3QTK1XrCW17xZbIkR/3RR79FArm72UEDTRPt7XJnvOex ER/amf5RQsh7oENycN1cFsEvOi39AgIDHERF6dHpC7iQUOalrqv6vx8gEdne3VgoVjTj QNbEB80h4kA1ACvKhRsMqz7InhQkE1HhxPjQqH04+fxsOIc/AqluLsAk35VZMDo4S9rR GYm7JYVT/ZslBBSG2292sDe+szaYYgsZfvCHoBLKHhvA8Gb3S7oJijmqe9nS95k8sQSL eD/3x1a5Mnj3ri6I6xa+odjSwBxYdULxM0AP0lRPLt2B71U9MiRa0z4FY1vkt76olX7A 9o6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Z/5Wc7xh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si13300212ilv.25.2021.04.05.02.06.57; Mon, 05 Apr 2021 02:07:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Z/5Wc7xh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237936AbhDEJGJ (ORCPT + 99 others); Mon, 5 Apr 2021 05:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238171AbhDEJEc (ORCPT ); Mon, 5 Apr 2021 05:04:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD0E061393; Mon, 5 Apr 2021 09:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617613467; bh=VPepH3lB+07aJUU/cQb9TTP85ctGPdDGJmNYxrLsNT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z/5Wc7xhR4p0BONnAioPG+/37ShKUE/YLY2KNhv7i4w2hqlgOK+FUwZ749WgTc+ls YdHjqbNcRPZ6ts6JnYZwVlgGH8PDbcE2WdiAiPFh0XHYlJLYOPmtGQfqNLibl9nJSl Kwq95cVb8P/Jehu+pzYKvS/2QEtKzMwV6JM58IL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 5.4 46/74] xtensa: move coprocessor_flush to the .text section Date: Mon, 5 Apr 2021 10:54:10 +0200 Message-Id: <20210405085026.233495857@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085024.703004126@linuxfoundation.org> References: <20210405085024.703004126@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Filippov commit ab5eb336411f18fd449a1fb37d36a55ec422603f upstream. coprocessor_flush is not a part of fast exception handlers, but it uses parts of fast coprocessor handling code that's why it's in the same source file. It uses call0 opcode to invoke those parts so there are no limitations on their relative location, but the rest of the code calls coprocessor_flush with call8 and that doesn't work when vectors are placed in a different gigabyte-aligned area than the rest of the kernel. Move coprocessor_flush from the .exception.text section to the .text so that it's reachable from the rest of the kernel with call8. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/kernel/coprocessor.S | 64 ++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 31 deletions(-) --- a/arch/xtensa/kernel/coprocessor.S +++ b/arch/xtensa/kernel/coprocessor.S @@ -109,37 +109,6 @@ .previous /* - * coprocessor_flush(struct thread_info*, index) - * a2 a3 - * - * Save coprocessor registers for coprocessor 'index'. - * The register values are saved to or loaded from the coprocessor area - * inside the task_info structure. - * - * Note that this function doesn't update the coprocessor_owner information! - * - */ - -ENTRY(coprocessor_flush) - - /* reserve 4 bytes on stack to save a0 */ - abi_entry(4) - - s32i a0, a1, 0 - movi a0, .Lsave_cp_regs_jump_table - addx8 a3, a3, a0 - l32i a4, a3, 4 - l32i a3, a3, 0 - add a2, a2, a4 - beqz a3, 1f - callx0 a3 -1: l32i a0, a1, 0 - - abi_ret(4) - -ENDPROC(coprocessor_flush) - -/* * Entry condition: * * a0: trashed, original value saved on stack (PT_AREG0) @@ -261,6 +230,39 @@ ENTRY(fast_coprocessor) ENDPROC(fast_coprocessor) + .text + +/* + * coprocessor_flush(struct thread_info*, index) + * a2 a3 + * + * Save coprocessor registers for coprocessor 'index'. + * The register values are saved to or loaded from the coprocessor area + * inside the task_info structure. + * + * Note that this function doesn't update the coprocessor_owner information! + * + */ + +ENTRY(coprocessor_flush) + + /* reserve 4 bytes on stack to save a0 */ + abi_entry(4) + + s32i a0, a1, 0 + movi a0, .Lsave_cp_regs_jump_table + addx8 a3, a3, a0 + l32i a4, a3, 4 + l32i a3, a3, 0 + add a2, a2, a4 + beqz a3, 1f + callx0 a3 +1: l32i a0, a1, 0 + + abi_ret(4) + +ENDPROC(coprocessor_flush) + .data ENTRY(coprocessor_owner)