Message ID | 20230720062813.4126751-11-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2933768vqt; Thu, 20 Jul 2023 00:05:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlHUJAAO0IgE4W2jdoxsoY+0qVmjDZFUpCztca6AYfwMxRzDg5u4ZQSZFTfQ33DJoFpYH+E3 X-Received: by 2002:a17:907:6d91:b0:986:d833:3cf9 with SMTP id sb17-20020a1709076d9100b00986d8333cf9mr1918771ejc.39.1689836728287; Thu, 20 Jul 2023 00:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689836728; cv=none; d=google.com; s=arc-20160816; b=Jqfme/AbsLrKoDN+DzPR/EDom99HTVTGpySuzmh3UfrZOdmmtlALw5NA+hSpV+SUIe nPkpPNBK+iN1u9By34vo3cQdgqiefIqhWKkS4xSCgGwGxgpX4f/IAP7YiGy/luA81ljl zPO995dfJoN4avEOEAMvTm/1IXgjJLR4zgJw3v3iEIaTP0WCt/mki7qax5pRguN25q2G DhpQrUBi6WcX48j0X42XxxzgZmDh6jTBjE4d4ewSkunvf393/9WpNXxNS0YkgkkFjMmD 87HjLq75CNC4jsl9vr5uZg3EP7cywSwef8Epsu6glugHm1byg0Mk2e5fev7AdOOW6JYI gvVg== 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; bh=jnzItaTaLG3+5jlpgsdmIpr0Uoh/rhmQJod7H0b6sl0=; fh=vBXozhnPXwSB3DJhjnKWz3f6luaN/KxHDpM6/QeZg4o=; b=tP7ValZsiruQjIg9CB9X6BQYMjEPN/SB+KAZgDBLcbMduYWWkCghueg/uO/96Qchk5 S4KKcSXPY1Aa1lMxRD1ZTV5oCUJp2/wKCQLPnaQ1pnu6YOwpuVvLC8ciHve6lROqtF5Z vcjqaSRqOohHxVE17xP8TW5UyIZOL4KTdhzOyIbRY8OLSTLu51pBkAByUv88cByM4ISt 69inC3RkgMe3jvdNbGX3lenLmmybr471e0KEjbziVNF1Q/tM4BzbiT/gzqfnbgl/Y4JX r8CRMMk+jdEg2P5w7GMcb6WVSFxys+cXX2xMEKeYhRr/0enEG6A5DFbAnoGtEuKPqVOG osdA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k21-20020a1709063e1500b00992d730e99dsi256420eji.494.2023.07.20.00.05.04; Thu, 20 Jul 2023 00:05:28 -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 S230248AbjGTG2s (ORCPT <rfc822;assdfgzxcv4@gmail.com> + 99 others); Thu, 20 Jul 2023 02:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbjGTG2Y (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Jul 2023 02:28:24 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C96D2115; Wed, 19 Jul 2023 23:28:22 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8BxHOsC1LhkXY0HAA--.14222S3; Thu, 20 Jul 2023 14:28:18 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxvM7907hkHU81AA--.16059S12; Thu, 20 Jul 2023 14:28:18 +0800 (CST) From: Tianrui Zhao <zhaotianrui@loongson.cn> To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini <pbonzini@redhat.com>, Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <kernel@xen0n.name>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, loongarch@lists.linux.dev, Jens Axboe <axboe@kernel.dk>, Mark Brown <broonie@kernel.org>, Alex Deucher <alexander.deucher@amd.com>, Oliver Upton <oliver.upton@linux.dev>, maobibo@loongson.cn, Xi Ruoyao <xry111@xry111.site>, zhaotianrui@loongson.cn Subject: [PATCH v17 10/30] LoongArch: KVM: Implement vcpu ENABLE_CAP ioctl interface Date: Thu, 20 Jul 2023 14:27:53 +0800 Message-Id: <20230720062813.4126751-11-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230720062813.4126751-1-zhaotianrui@loongson.cn> References: <20230720062813.4126751-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8CxvM7907hkHU81AA--.16059S12 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, RCVD_IN_DNSWL_BLOCKED,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771922236848717191 X-GMAIL-MSGID: 1771922236848717191 |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
July 20, 2023, 6:27 a.m. UTC
Implement LoongArch vcpu KVM_ENABLE_CAP ioctl interface. Reviewed-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Tianrui Zhao <zhaotianrui@loongson.cn> --- arch/loongarch/kvm/vcpu.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c index 5a6d0735afa1..a61f6000a07d 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -186,6 +186,16 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) return 0; } +static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, + struct kvm_enable_cap *cap) +{ + /* + * FPU is enable by default, do not support any other caps, + * and later we will support such as LSX cap. + */ + return -EINVAL; +} + long kvm_arch_vcpu_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { @@ -209,6 +219,15 @@ long kvm_arch_vcpu_ioctl(struct file *filp, r = _kvm_get_reg(vcpu, ®); break; } + case KVM_ENABLE_CAP: { + struct kvm_enable_cap cap; + + r = -EFAULT; + if (copy_from_user(&cap, argp, sizeof(cap))) + break; + r = kvm_vcpu_ioctl_enable_cap(vcpu, &cap); + break; + } default: r = -ENOIOCTLCMD; break;