Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3326222pxf; Mon, 5 Apr 2021 09:06:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP8m99Yvra8S22pZvdRKpNAOOYut62qEDNgh4Y9EG0kVsA/Lm0VRaHhUMfpi0zcJJlD4O7 X-Received: by 2002:a17:906:1408:: with SMTP id p8mr28588783ejc.89.1617638762786; Mon, 05 Apr 2021 09:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617638762; cv=none; d=google.com; s=arc-20160816; b=Zx/BGx6lPvIn3YoYbTsvPhyjep9BaQ2WuSD9RY3jwAI7TOf7yGk1j9+1DQ99Bf86hq mEX1WA+LmypNKdLQawTu3c+LYMBBXofDdjyyGQZ2Ae8H4xlh525z3NB+NeEpiPY95VWx ttOQMUcicy7nA0lH19vHNK7Mot2bKy6DwWreBn/K4cZiGaAEpH6qckneaizG3YUXbz41 1ZuoGyjh8dg3RBe8hV1B3s6jfzlSg0/aaSb6sB5+saRPv9oYpJyCZhHo6flOZ3BqQjF3 +YK2z9eE+AhX1zgk6s1lF3Z13u6FjIdnZCIB6h0av1/YYycR0VeLmUYJGDd6BFE6OeRf +k4A== 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=a+GWzhQDN9bgsVLUgvFFmBrM3o4BpwTBBI408Wa4xfg=; b=E43wGKzFAeWWR/RyM1CenWmMycDJaTgqrpblHsZHudvjlE3UZvdaWoP5D5ZnccpDQH JV63H36T9aOH8PqRPYzqJZfmeYbMwOaFMSZuwOktF84q8AHmYBvaeUWJtPRNZV6Y6qba i9xQsWeXc05Bz6uXeXQm+GTzoY2i6LnE3F7Ahn9F2gsia5FRu+ELxhecCo2kVDFFQdow MUpxmzyTkezdLpKTyVUPmEBVTOZVGNg50Panqrdk8+n296SICCDI0ZlkIKg3T9WMcRRA BqmQGOvSEzb23DY2PngXTeqWA74WGd3j36vrAYf+vsUT/Ar67tH8oRZWGbymypnQFSrS Ragw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NasALZww; 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 b5si929561edw.380.2021.04.05.09.05.38; Mon, 05 Apr 2021 09:06:02 -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=NasALZww; 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 S238978AbhDEJLk (ORCPT + 99 others); Mon, 5 Apr 2021 05:11:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:54480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238589AbhDEJIl (ORCPT ); Mon, 5 Apr 2021 05:08:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 59C4F613AD; Mon, 5 Apr 2021 09:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617613715; bh=VmbfD/sW3PbcnzlK0CAiDiO0oijK/xUFWNYbsKk/sX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NasALZwwlKdGfNAwjZQlewR+dmi6SiY+ACaxymqiyRYbRVS1YK9sF8e5XjG9K0b1A Dp820iwpurplSMcg6d1LSTxouJzJEgmYMXTSTswj67R9w77GxajVYCw5za5Lj97CCd RcQF0Vij/uzmbhok1EPiCwD1PsjjBefkxItYnt+4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 5.10 064/126] xtensa: move coprocessor_flush to the .text section Date: Mon, 5 Apr 2021 10:53:46 +0200 Message-Id: <20210405085033.182899262@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085031.040238881@linuxfoundation.org> References: <20210405085031.040238881@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 @@ -100,37 +100,6 @@ LOAD_CP_REGS_TAB(7) /* - * 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) @@ -245,6 +214,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)