Message ID | 20230626084752.1138621-11-zhaotianrui@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7342051vqr; Mon, 26 Jun 2023 02:06:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7n9fRhfgG4FzGxzmu8o+OwvULIzznLd0IuX4++woY8F+mG7KFD90gqm7QsdF4W3n6NcrlU X-Received: by 2002:ac8:5acc:0:b0:3fd:e17e:9468 with SMTP id d12-20020ac85acc000000b003fde17e9468mr32691421qtd.37.1687770378801; Mon, 26 Jun 2023 02:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687770378; cv=none; d=google.com; s=arc-20160816; b=qpYRZP3VstAailzY33WBeV6T7NSx/slzPdxj8zkQP439igUkQ/FtEoSdRPh6AV+aUJ Fs7yrtgNG43rqDuB+xL+iVj8VaIe2iZVyK+qJA1gUr+T0fv6aD7qAHX5NxiYKWHOmwiW Mw/+tT9lSceiZCWQF6W/H8Qyxh72nQUz+NS5jxmZFhC14uuGA4+F/QUXOW4r2mMvTFjy KqRQD1U5jvszQa5SQH5axDpiGmENSKnPqrgg7RpFe67shw5WHeLTP9jaBS6alHwupXij Ne0c0V9fqzSA13iEA/5CTjLq8pq8cVSdrCyvIG2qCduRk5uSvCL8d9vZ/L5YROQ9nF5D Odfw== 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=SFHHL1Usbc2ulhSNpzToS2kEdMTCuQiHDlVJeYDQvrY=; fh=FJJE1KfQOXNgUCxk/Gxke8tBG9gBLo3aFI+sNzAMBeU=; b=cI2FV0oPw2XBA4q7AsoBpF0B579USEROPXuoNFT/t7kfFIz+P/eL7U4TYhrPZpS0NK vvCCbHNC1nFAs9strKI3IZlEoT/+X45Tbku4ge7OP1DozXiPCiuG4I6E3+jzAdDIJLkF qYRbDj3H6Oe3Uxh8EA0vYJKflv5X5e1pt99m4kYkcqqVNt+ib5Pw81KEsEkwJc6+/BAr PXTBBACh3OTUD6hrwgQLl3l5iDnoxXpZuPs753Zgj9VODa408X9yRGTc76aOrU6n5p5V 4k2PjoxJ+CT7Ja9Il7gAvPm9QM8TL74sJFfTWTe1NvTvHO+nkNA18bxGLC/2atetPTba azHg== 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 z9-20020a656649000000b0055785aa5282si5071189pgv.81.2023.06.26.02.06.06; Mon, 26 Jun 2023 02:06:18 -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 S230318AbjFZIsg (ORCPT <rfc822;filip.gregor98@gmail.com> + 99 others); Mon, 26 Jun 2023 04:48:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbjFZIsE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Jun 2023 04:48:04 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 13952E48; Mon, 26 Jun 2023 01:48:02 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxQ8S_UJlkkjQCAA--.3333S3; Mon, 26 Jun 2023 16:47:59 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxxsy5UJlk4hQJAA--.19269S12; Mon, 26 Jun 2023 16:47:58 +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, tangyouling@loongson.cn Subject: [PATCH v15 10/30] LoongArch: KVM: Implement vcpu ENABLE_CAP ioctl interface Date: Mon, 26 Jun 2023 16:47:32 +0800 Message-Id: <20230626084752.1138621-11-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230626084752.1138621-1-zhaotianrui@loongson.cn> References: <20230626084752.1138621-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Bxxsy5UJlk4hQJAA--.19269S12 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769755513203112849?= X-GMAIL-MSGID: =?utf-8?q?1769755513203112849?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
June 26, 2023, 8:47 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 b0cce413762d..da97b77da8eb 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;