Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3366899pxf; Mon, 5 Apr 2021 10:08:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUn7Z/K5jguBtgx1gNPJYZWy2PiOCi3OE9zYVC3x2NlgUjKPOOp6ToGaCMnthF6mEva5XD X-Received: by 2002:a05:6638:218f:: with SMTP id s15mr24804138jaj.58.1617642516542; Mon, 05 Apr 2021 10:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617642516; cv=none; d=google.com; s=arc-20160816; b=aBKJIOhkPlTjxTKj6gceeGfo3e3TYwjuq8UA7R04kEySXTvn88dV2f3JOzPt3ZGH7e yOcjCsS+Axde/5PQWr8Z9emRf2rjj/kzvzbi5Xv3gp+HbF9LaBXGp9WZPCfRxSIq56xE 3kMBd7OGr3LLTkngzjboFYPLr9ptjjCYIN0AEeJshl2Ges9gaVJS2hIx6Ce3pFC95Nyg aaW1k6vUKr+8cty9VE6i/m5QtznmBerMhlkhHt+JdW90YM9kvOtgpHyhX3PVcR5XCQ2k wJjc+6BoiUOvn5oBXC+uO4eb3R8F+j7iAIjfRMweouYS9OCzNqEA9Z06POwih0BdBIWq ZoqQ== 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=nk0oLsVkl+Ol/vueWUEirsrjhsGucllJqNjrsIcPGeF/w24iols1UT2p/ZjD8u5JeT 1VsFxOXU08SHiT0++aUjMIv04TGfTXJtIuDFNlIF8dBc6wDLiZAgBRptQIjamg0jFn4h PKpuwgdoML3v83l4rsfUeWd7IP+P0iL3WWnAcKeBgYBrx1Va7ggiOKyoNWAKb1GItSiR BZ9MeiudNKZ+6uODw2MhfTjoIcCuZrgypWwBoWurHC2vy/lFA17kVCpL/2cwcoRxGAnt YZZCheMfY2nVLNvrWM2tqNXK9p649WbXfgZG1VvMQhYiFJ0Zy2OULQnbTbJGbahCw+NG x0Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xXwJ4abR; 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 s11si16014454jam.7.2021.04.05.10.08.24; Mon, 05 Apr 2021 10:08:36 -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=xXwJ4abR; 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 S240851AbhDEJTO (ORCPT + 99 others); Mon, 5 Apr 2021 05:19:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:34254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240150AbhDEJOt (ORCPT ); Mon, 5 Apr 2021 05:14:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26DEA611C1; Mon, 5 Apr 2021 09:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617614083; bh=VmbfD/sW3PbcnzlK0CAiDiO0oijK/xUFWNYbsKk/sX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xXwJ4abRGKlRaB9kVwBtoWWW6D1XSqJ5HBG8StmQB0W+G3R13bETYuIgrEsYptrN3 zgLXeBfKQXPHCuJ/eJgYRpSjQePnza130V1gtt/o6Md8HCgrhOiD266rsKmd9wzaNb bwjbQ2coHztuZstFFd5kePA+jOt2rD/o2pz7040E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov Subject: [PATCH 5.11 078/152] xtensa: move coprocessor_flush to the .text section Date: Mon, 5 Apr 2021 10:53:47 +0200 Message-Id: <20210405085036.796747972@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085034.233917714@linuxfoundation.org> References: <20210405085034.233917714@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)