From patchwork Wed Nov 15 09:19:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhaotianrui X-Patchwork-Id: 13456427 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E28B863C4 for ; Wed, 15 Nov 2023 09:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 958ECFC; Wed, 15 Nov 2023 01:32:21 -0800 (PST) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8CxbesjkFRlWjw6AA--.46619S3; Wed, 15 Nov 2023 17:32:19 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx7twhkFRlq99CAA--.16093S2; Wed, 15 Nov 2023 17:32:17 +0800 (CST) From: Tianrui Zhao To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , Huacai Chen , WANG Xuerui , Greg Kroah-Hartman , loongarch@lists.linux.dev, Jens Axboe , Mark Brown , Alex Deucher , Oliver Upton , maobibo@loongson.cn, Xi Ruoyao , zhaotianrui@loongson.cn Subject: [PATCH v1 0/2] LoongArch: KVM: Add LSX,LASX support Date: Wed, 15 Nov 2023 17:19:19 +0800 Message-Id: <20231115091921.85516-1-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Bx7twhkFRlq99CAA--.16093S2 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== This patch series add LSX,LASX support for LoongArch KVM. LSX: LoongArch 128-bits vector instruction LASX:LoongArch 256-bits vector instruction There will be LSX,LASX exception in KVM when guest use the LSX,LASX instructions. KVM will enable LSX,LASX and restore the vector registers for guest then return to guest to continue running. Changes for v1: (1) Add LSX support for LoongArch KVM. (2) Add LASX support for LoongArch KVM. Tianrui Zhao (1): LoongArch: KVM: Add lsx support zhaotianrui (1): LoongArch: KVM: Add lasx support arch/loongarch/include/asm/kvm_host.h | 12 ++++ arch/loongarch/include/asm/kvm_vcpu.h | 22 +++++++ arch/loongarch/kernel/fpu.S | 1 + arch/loongarch/kvm/exit.c | 36 +++++++++++ arch/loongarch/kvm/switch.S | 38 ++++++++++++ arch/loongarch/kvm/trace.h | 6 +- arch/loongarch/kvm/vcpu.c | 88 ++++++++++++++++++++++++++- 7 files changed, 199 insertions(+), 4 deletions(-)