Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2474022rdb; Wed, 15 Nov 2023 01:32:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnEZvSAhtkUFRWvRC/qC9YoPick0Y0WTUrfeTh1++vjjxqPVAtEqvwLzzuqvK/bLH5/wAo X-Received: by 2002:a05:6358:724c:b0:168:df94:8dbc with SMTP id i12-20020a056358724c00b00168df948dbcmr6801848rwa.26.1700040748157; Wed, 15 Nov 2023 01:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700040748; cv=none; d=google.com; s=arc-20160816; b=OpCV6qY8pMQ/+GLG5z57EQ0CWgO+T+BaIK+44uLYwFMEGeJk+GPHBj4HOrkdN3I7+s J5LlhH35z8Cs8E2FEPPSzKmddlVEmIYivpXwpawqD6oRRXAO9ya70D9QXcybuJJGs6oO 5nRcYat/2m+9Ivkrl078WrDiLhcU5mTVcum7hbOyOFVEF9C4Dt+prx/qmZkI0Ophzf63 xUySh7/dZYps0G6tw4AdGCil8byaDa0twehr1KTz8Jk+cp519kzYUHNimi1mKoEaWZCC 4sxu/icGuptnzFWQYLXfvMYjXRA0ZgdDx3NDTrP8nIc4a4A5EHG5xWyHKoYSton3adHa dCEg== 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=372wV1xeghaSh8M0pW9PwF7/eazjZbpyu+oVfYgiYcA=; fh=ejoaVAUUbBXsA/6jM/beuI9xCYtV2osdR9SpI7hjY84=; b=rvkuoTMEpE/yFtTQRzr2WlQFNTp/lm0iiVFuEM9RTsx7Rq5aMXLd9+tXoYSsG22G21 xsvfx+CSxxWAD7Vz4bJiqpe826PkMy++kYm6gRERl3jAtMfrjMCw4B6h0RaXEM/Hi/vE KWPLy5NewFvK3RCTE8Q7xgO8+ilm+hEB0qH+xnLf3mBr7MeGCxVS8txkqu9Wo/DQIwey HGqFc1q2FEeZ9vIG2BmHF82HlRLVPolFieOaQkq4HrnwsTpF+zGT+5q1q18s6Dmrqki2 Saal1o69WgjcaJHG2UXJyReLIF/VDcldCpbZqrM3sj0dApUhBsPSxkgyXoq4orv1vCcs J8hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b13-20020a6567cd000000b005859e22461csi10131323pgs.817.2023.11.15.01.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:32:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B463C81389AD; Wed, 15 Nov 2023 01:32:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234730AbjKOJc0 (ORCPT + 99 others); Wed, 15 Nov 2023 04:32:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234680AbjKOJcZ (ORCPT ); Wed, 15 Nov 2023 04:32:25 -0500 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 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Bx7twhkFRlq99CAA--.16093S2 X-CM-SenderInfo: p2kd03xldq233l6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 01:32:26 -0800 (PST) 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(-) -- 2.39.1