Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp120191pxb; Mon, 18 Oct 2021 22:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhw548ji09CyB7bKKGRBYacYILGSUnbjgfkCPXEHsG8tjA0GxsRFexuiz50x8xWoxeR+QV X-Received: by 2002:a50:d4cd:: with SMTP id e13mr49970852edj.29.1634620784617; Mon, 18 Oct 2021 22:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634620784; cv=none; d=google.com; s=arc-20160816; b=WufhkwOX8ezUpDzDmy2PWK5sywb4G1YawNowStgTINwtrqiFck4SpPhFSkCn9lg9R8 XY5qzNj/cfh6YhAQ61H74FufjbdqDG5FlfocxxaAfqv++WjsvDanL0NME9Yt95idoafP pRa8ua04BFY43whetZ34+eXL/zmGXl3F0RogGnu4orZqxhZ7FbuUEGEHx92zjUEg8Jh5 mNUzXorhEJQaDbc8NFZgj9Q8cwbUhL23rqTvl63VoxJqq2qN9HtWpD8LFHLAWW2B9Ys1 4GgSM1L5ZFg0d9LUKKSqrOIaN8fmsbKkdc+Sh/SWreGT70qbFSCs45UzmWrIsI2SaWjq H/cw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6r9uuaSaQZOZcWbXapdVBGjLI4WO4y0f9iAtrk3atGc=; b=g9/weee4poHXIgx9XJctlddvJScJCQRcFnwjzKRbOR6GA0P5dQHrDSo+ikcJpKalQ6 bniyKSQXQMW2dPnmS5HagFEnDoXSksSdiLekJtbMnCxkz44Q5QkqcMb7lC3ND9Qafb0q OnYosJHky8255Mpo+ctV9ZtPGpa2QLdApdkDRzjXtWV9A6sQm6svML9yXfRH1bGDtARH ZLUcTbRmBAnwPScaeZ0jL6ou4MrN9dF1Inmjg7WLQLYor+R2w+ZAt4hfVj0+f57ztbbM 2g9yF3VJf6uuqto9Ev26/c14qoHx+1buuS12wL0T0zMkzdMW7IZNlESS9OZGu9gcisFM nlPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="MPLfyt/v"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si27884573edi.381.2021.10.18.22.19.21; Mon, 18 Oct 2021 22:19:44 -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=@gmail.com header.s=20210112 header.b="MPLfyt/v"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233049AbhJSFTu (ORCPT + 99 others); Tue, 19 Oct 2021 01:19:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232856AbhJSFTs (ORCPT ); Tue, 19 Oct 2021 01:19:48 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 651FFC06161C for ; Mon, 18 Oct 2021 22:17:36 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id i5so6618776pla.5 for ; Mon, 18 Oct 2021 22:17:36 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=6r9uuaSaQZOZcWbXapdVBGjLI4WO4y0f9iAtrk3atGc=; b=MPLfyt/v8S7RH7sSWL5jeNIK0PF5zQZI0s+K5bCajXyJt9/EiqTbo7UywNhzbWLNYg yi1p0PbpgrhjCC45XBw2WFvkZFSYd5GE71FHy0TA/Lqi/tlvAiNMNlkL4lcMGYyh6K4e q/h/LlGM6cTKBcmEjjVcul5yLeTvdoUUDdwjl5LO2jDZLZ6G6gT9LajxYxeo663W8+Qv iw4wsFsR+flRgqnbQcDuxi/p/3YwSq1TGSTvdKuORbCOWtKVi0rb2PZ9RdMlTAuHKavM B06tYzPv1mIEQAJMJZCrcUhweQMc2QSZ3qBzzb0WPZFrt22CQ2fWI4JN5x/LJhKk4i/L jtcg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6r9uuaSaQZOZcWbXapdVBGjLI4WO4y0f9iAtrk3atGc=; b=GVa12yXTD7VFEDSK0EWSOYoXXVQPRbHYTlnW2JkTwTQWU5RtMasqNy//GcXf1rWT70 3JUeifodG/mgx0LfjFrZvLHOYc7cutg/8ivrQKjJV+H0iC3QtdjohkXM+Zkn/17UYi97 U1QZLOfB4+EiTars/q+yfUmjMXDfqmc8NBW+N/yahlERRe3PZshKRjSuTGFhZWvD6dJp yKIRrQVKj7BQBMKXhdyLbIVLAMfXZJuhd2DUuvmb11CK0cRFrG7JK4wOK6v0WZRjB+4L G7u57zGL0BUTQO9sP4cP7NsA3jol7c7kys21Pd9VASkNx4YTr71zUu01s5rm29OIzJbh R5Zg== X-Gm-Message-State: AOAM533l8CsTdMeurCXzhsM8mZRDqsO7mIIE4ROAtXEeZveQboa1fb98 8SfQc7ngJtriPNGDFoPR+NDx1cI3TVM= X-Received: by 2002:a17:90b:4f88:: with SMTP id qe8mr3987153pjb.223.1634620655943; Mon, 18 Oct 2021 22:17:35 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:4171:83c2:8384:24c5]) by smtp.gmail.com with ESMTPSA id me12sm1168844pjb.27.2021.10.18.22.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 22:17:35 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov Subject: [PATCH 01/10] xtensa: move _SimulateUserKernelVectorException out of WindowVectors Date: Mon, 18 Oct 2021 22:17:07 -0700 Message-Id: <20211019051716.4173-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211019051716.4173-1-jcmvbkbc@gmail.com> References: <20211019051716.4173-1-jcmvbkbc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In configurations without window registers support the section .WindowVectors.text may never be linked. _SimulateUserKernelVectorException is a common handler for high priority interrupts, it does not belong in that section anyway. Move it out of that section and mark it as __XTENSA_HANDLER so it gets bundled with other vector helpers. Signed-off-by: Max Filippov --- arch/xtensa/kernel/vectors.S | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index 1a7538ccfc5a..0eed5aa82914 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S @@ -650,6 +650,25 @@ ENTRY(_Level\level\()InterruptVector) irq_entry_level 5 irq_entry_level 6 +#if XCHAL_EXCM_LEVEL >= 2 + /* + * Continuation of medium priority interrupt dispatch code. + * On entry here, a0 contains PS, and EPC2 contains saved a0: + */ + __XTENSA_HANDLER + .align 4 +_SimulateUserKernelVectorException: + addi a0, a0, (1 << PS_EXCM_BIT) +#if !XTENSA_FAKE_NMI + wsr a0, ps +#endif + bbsi.l a0, PS_UM_BIT, 1f # branch if user mode + xsr a0, excsave2 # restore a0 + j _KernelExceptionVector # simulate kernel vector exception +1: xsr a0, excsave2 # restore a0 + j _UserExceptionVector # simulate user vector exception +#endif + /* Window overflow and underflow handlers. * The handlers must be 64 bytes apart, first starting with the underflow @@ -680,27 +699,6 @@ ENTRY_ALIGN64(_WindowOverflow4) ENDPROC(_WindowOverflow4) - -#if XCHAL_EXCM_LEVEL >= 2 - /* Not a window vector - but a convenient location - * (where we know there's space) for continuation of - * medium priority interrupt dispatch code. - * On entry here, a0 contains PS, and EPC2 contains saved a0: - */ - .align 4 -_SimulateUserKernelVectorException: - addi a0, a0, (1 << PS_EXCM_BIT) -#if !XTENSA_FAKE_NMI - wsr a0, ps -#endif - bbsi.l a0, PS_UM_BIT, 1f # branch if user mode - xsr a0, excsave2 # restore a0 - j _KernelExceptionVector # simulate kernel vector exception -1: xsr a0, excsave2 # restore a0 - j _UserExceptionVector # simulate user vector exception -#endif - - /* 4-Register Window Underflow Vector (Handler) */ ENTRY_ALIGN64(_WindowUnderflow4) -- 2.20.1