Message ID | 20230817125951.1126909-11-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1320340vqi; Fri, 18 Aug 2023 04:12:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfeGTPjWB+BNqcmSJbc7uNkRByCXuWWr2eZguiBNgLbZopkCaCTVXIbHCEjl/HRMaReqWp X-Received: by 2002:a17:906:210a:b0:994:3207:cddd with SMTP id 10-20020a170906210a00b009943207cdddmr1483924ejt.34.1692357154437; Fri, 18 Aug 2023 04:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692357154; cv=none; d=google.com; s=arc-20160816; b=x5ZeyPbNg4AUZKNiVr91MgHuVva1Keoeqpqp+/FQQMeN7yU772PPo92UJPuZcuGqzO tkEKuzD8lQO5REQbM1/A0cJo+mxDhN4Cnxo8jIuZx5U+jmq7WcF6qfCr6vgUJyLirhZt XW2xrMXKwVPP8yFYypfgUp3hQ1v2U7e65GnegFbeqr841EqqBQZPsdsTIxsvjATcXxfU sYI1D/MA57kpES28Zgec6Sy/2Qz5dvjRLpWlUtGveKfJrrY5J90Qb19II6PKtFCPH7Yj mbQa6WRlxYqRn5gAU7HwpLp+SRPWZW71H2AUjOwr0zNGeNkQYF7C1mW5iKuEpPTPl/Lc ODCQ== 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=MMTa3pLxEuHHoA34iOU8V7J13IxCnJDBrNXBXN+6n5U=; fh=vBXozhnPXwSB3DJhjnKWz3f6luaN/KxHDpM6/QeZg4o=; b=WLa1mYdpgqtmta2hLyU1m1ylr1RH779k9LykagPIxlc1e5dqYWy2MRWm1ZXEgGhpJY sagyw8yl/NxFhjk5/uwT/SSbQLQ4XDZCtmUonwvnIT9xKMPJPiQm08Yv+ZjNfO27NSws 2TtL9FHpvKdgzOS5301tR6Nz7KZzZamaBkHqBFqFZfjQaxBV5gZMfaM2LiRjJwIim6FS TD1oj4yQjyY3fI0V//QDLeNzd8AlcguntNWoT/0GP27bmtt9Vj96X9Oxa+FG24PNVhJy JXNqvXIKC4cEUjMr+lRzsFL3VBUVr2WNefNYGSyxYOVRt115N0+1upxzmIQSliJpBqnS f+4w== 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 bg4-20020a170906a04400b0099de8c4bc27si1168858ejb.410.2023.08.18.04.12.09; Fri, 18 Aug 2023 04:12:34 -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 S1351303AbjHQNAn (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Thu, 17 Aug 2023 09:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351096AbjHQNAH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Aug 2023 09:00:07 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DE7BD30E8; Thu, 17 Aug 2023 06:00:01 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8BxbOrMGd5kC4YZAA--.25130S3; Thu, 17 Aug 2023 20:59:56 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxniPIGd5kmchcAA--.55665S12; Thu, 17 Aug 2023 20:59:56 +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 v19 10/30] LoongArch: KVM: Implement vcpu ENABLE_CAP ioctl interface Date: Thu, 17 Aug 2023 20:59:31 +0800 Message-Id: <20230817125951.1126909-11-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230817125951.1126909-1-zhaotianrui@loongson.cn> References: <20230817125951.1126909-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxniPIGd5kmchcAA--.55665S12 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 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: 1774565095818714226 X-GMAIL-MSGID: 1774565095818714226 |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
Aug. 17, 2023, 12:59 p.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 f17422a9429d..be0c17a433fc 100644 --- a/arch/loongarch/kvm/vcpu.c +++ b/arch/loongarch/kvm/vcpu.c @@ -187,6 +187,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) { @@ -210,6 +220,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;