Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2355588imw; Wed, 6 Jul 2022 04:42:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vRGfM0LgAhMEVc4HWSGFydXTl+y7r+btRTQO1nI5iRuqtz3dT6bR7jMeQPrDVJmMvXcVPs X-Received: by 2002:a17:90a:bf03:b0:1ef:8fca:282c with SMTP id c3-20020a17090abf0300b001ef8fca282cmr15567436pjs.219.1657107778738; Wed, 06 Jul 2022 04:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657107778; cv=none; d=google.com; s=arc-20160816; b=Poq4oUiEHqL5lbGr3RAshoU2+yMHp/EUxnUblkep3VACVKzKqvd7wjxhgm5E3qtoh5 zn/2DIWIxVnPoVZo6DRAXvUkku+4JVLQOnLdz8V0iSmyOtrZpxo4RsBNAiXa57afvb+7 w/1slPopZmNZDTcNkXh4TkumO/7skKBOCHgRpdTjGmvfazMpAKuAyj+/j76hdJavwaeB 1OouZanhvod5s09Q5+dfERkzfQV2/iGwKbiPSRQiz3Cei2yl5OajTdLM8ZA3/bsT8R5U Jk37Xr8sZ8oM36bQZHNURl8wOWSeRvfy9PdNXVgSv56XZwYdNEnzqjQZ0zcibZxRymAS q1SQ== 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 :message-id:date:subject:cc:to:from; bh=hvRY8iCbhCYt9bawXUPsyKPV0wegO0NAGYlSoAgfzWU=; b=WzTJeeB+kG/HrjQufRA0LC1oYG4AsaW17CwQlGOmiwndvP6euViq3wzt8wGyKOzbF7 YsKXA+4USYEEzYBCPk9Io9VWat3CT6dAe+7cxjbrEHveLTfExngZm8w26oOAB9MGTQU4 4gDtPuJcmwPF8AOLDY9Yhq0Pu8p0klU9w8Y9kq6alxYNQzseKHcKpHP9XC8SwydIt9tB ZujXLJji0lZrh5lzZ/g6GY2BEL5xQ3u9828Ot0ZSTSBzIlCuvO9WkwPEK4TfZlLvN5DY ijoj2UPNM1rGYWVCyl1jfJgOPUFFWmjiRcH9/waoCO6bMG9dFfG+VW9sklG5Ggm3ulGP sZnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm5-20020a656e85000000b003fd55602efasi7039088pgb.362.2022.07.06.04.42.46; Wed, 06 Jul 2022 04:42:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232563AbiGFL3v (ORCPT + 99 others); Wed, 6 Jul 2022 07:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbiGFL3u (ORCPT ); Wed, 6 Jul 2022 07:29:50 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C550925C49 for ; Wed, 6 Jul 2022 04:29:48 -0700 (PDT) Received: from lingfengzhe-ms7c94.loongson.cn (unknown [192.168.200.1]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxKeEicsViT60MAA--.38242S2; Wed, 06 Jul 2022 19:29:39 +0800 (CST) From: huqi To: Huacai Chen , WANG Xuerui , Jiaxun Yang Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Qi Hu Subject: [PATCH v3] LoongArch: Remove vcsr in loongarch_fpu Date: Wed, 6 Jul 2022 19:29:37 +0800 Message-Id: <20220706112937.1218573-1-huqi@loongson.cn> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9AxKeEicsViT60MAA--.38242S2 X-Coremail-Antispam: 1UD129KBjvJXoWxZr47uw4rZr13Aw15XF1xGrg_yoW5GF15pF ZrZrn7GF4rWFn3JFyDt34kWrWkJ3ZrGw1aga4aka4fCr47Xw1UWrWktFyDZFyjqa1rK3y0 gF1rGw1SqF1DJ3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: pkxtxqxorr0wxvrqhubq/1tbiAQATCV3QvPxZJgAmsP X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: Qi Hu The `vcsr` is not used anymore. Remove this member from `loongarch_fpu`. From 3A5000(LoongArch), `vcsr` is removed in hardware. FP and LSX/LASX both use `fcsr` as their csr. Particularly, fcsr from $r16 to $r31 are reserved for LSX/LASX, an using the registers in this area will cause SXD/ASXD if LSX/LASX is not enabled. Signed-off-by: Qi Hu --- V3: - Modify commit message to conform to the format. V2: - Add more details in the commit message. --- arch/loongarch/include/asm/fpregdef.h | 1 - arch/loongarch/include/asm/processor.h | 2 -- arch/loongarch/kernel/asm-offsets.c | 1 - arch/loongarch/kernel/fpu.S | 10 ---------- 4 files changed, 14 deletions(-) diff --git a/arch/loongarch/include/asm/fpregdef.h b/arch/loongarch/include/asm/fpregdef.h index adb16e4b43b0..b6be527831dd 100644 --- a/arch/loongarch/include/asm/fpregdef.h +++ b/arch/loongarch/include/asm/fpregdef.h @@ -48,6 +48,5 @@ #define fcsr1 $r1 #define fcsr2 $r2 #define fcsr3 $r3 -#define vcsr16 $r16 #endif /* _ASM_FPREGDEF_H */ diff --git a/arch/loongarch/include/asm/processor.h b/arch/loongarch/include/asm/processor.h index 1d63c934b289..57ec45aa078e 100644 --- a/arch/loongarch/include/asm/processor.h +++ b/arch/loongarch/include/asm/processor.h @@ -80,7 +80,6 @@ BUILD_FPR_ACCESS(64) struct loongarch_fpu { unsigned int fcsr; - unsigned int vcsr; uint64_t fcc; /* 8x8 */ union fpureg fpr[NUM_FPU_REGS]; }; @@ -161,7 +160,6 @@ struct thread_struct { */ \ .fpu = { \ .fcsr = 0, \ - .vcsr = 0, \ .fcc = 0, \ .fpr = {{{0,},},}, \ }, \ diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/asm-offsets.c index bfb65eb2844f..20cd9e16a95a 100644 --- a/arch/loongarch/kernel/asm-offsets.c +++ b/arch/loongarch/kernel/asm-offsets.c @@ -166,7 +166,6 @@ void output_thread_fpu_defines(void) OFFSET(THREAD_FCSR, loongarch_fpu, fcsr); OFFSET(THREAD_FCC, loongarch_fpu, fcc); - OFFSET(THREAD_VCSR, loongarch_fpu, vcsr); BLANK(); } diff --git a/arch/loongarch/kernel/fpu.S b/arch/loongarch/kernel/fpu.S index 75c6ce0682a2..a631a7137667 100644 --- a/arch/loongarch/kernel/fpu.S +++ b/arch/loongarch/kernel/fpu.S @@ -146,16 +146,6 @@ movgr2fcsr fcsr0, \tmp0 .endm - .macro sc_save_vcsr base, tmp0 - movfcsr2gr \tmp0, vcsr16 - EX st.w \tmp0, \base, 0 - .endm - - .macro sc_restore_vcsr base, tmp0 - EX ld.w \tmp0, \base, 0 - movgr2fcsr vcsr16, \tmp0 - .endm - /* * Save a thread's fp context. */ -- 2.36.1