Message ID | 20230629075538.4063701-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 k13csp9477820vqr; Thu, 29 Jun 2023 01:19:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7tGYUUHCh9aOwfHhqqw7UWRpbUBtItpt01OuzG4yJFzqfPcfOJljpa58/tIe/zCcVMbI2d X-Received: by 2002:a17:902:ecc6:b0:1ae:1364:6086 with SMTP id a6-20020a170902ecc600b001ae13646086mr44941441plh.2.1688026772942; Thu, 29 Jun 2023 01:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688026772; cv=none; d=google.com; s=arc-20160816; b=buD14hDbs8RvO5fsH/YT2QqCuktig1vu1W+ws6V9fLe2UXNC75UpjXvjh67T6ms3Jk awdNzej5lhfXFhyWFoSz5Fz8qbnkL06RNSzkK4XkuuxEewgQ6JUCQR9st65zRxZiI2l/ IW2I9pu489GbwgulwYbibNlvgPoPYBdw08SaqFgs4kFjO1dOoB/gzw/RbyLLY+F8sHRq RihsbHFRk8zXibml3Q1BdjBVx0Q8rO3tEqwhbSdmHyC9tHUZf0gaHxfEztmfM7i/1tUM g0nGCuSwHovViJMrJZ70o2DCFgPBhf2Hu292EDAVsI3nxiFAU5IeS1qIqTwupB7QM+y5 4JFA== 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=5MymQ7GIBp7zNXW64cKeokietRhKQkEhpOBaNYPDGGU=; b=rPKl0n8MDqmM/yHjKw7PSkuAYxlt1a4AMAmlCTkCdiKKmxOZS614lwcY2fPiVwrjVt 7DI301aGL1FFdNshMI5BKNhTws2M7XHMZwR/MlJ3z7RboOOa6w2qWE3fnlwOt5AloRzj tVF5elU5D7Vv6wyfFhFdfmif0F+uKc7QVhyItNWohLfKeSqx2IjfsJ1hN6DFUvPwArzk JrPWa6K2Nwj6CPLqRzdfl1uwYeYyESEyb37U2FhH4LQZ5buCSoGDX8RE7C4zP+mjed3H 9IyxdzsMutyL8zIGGlMRtK/Thak6vnh6GXcraQZP2iDBfVmOxcCS3OxG/xTWYmwr6d5z W1Uw== 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 w2-20020a170902e88200b001b7fa0f052dsi8954754plg.484.2023.06.29.01.19.19; Thu, 29 Jun 2023 01:19:32 -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 S232745AbjF2H7C (ORCPT <rfc822;ivan.orlov0322@gmail.com> + 99 others); Thu, 29 Jun 2023 03:59:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231626AbjF2H4a (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 29 Jun 2023 03:56:30 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D0AE3AAF; Thu, 29 Jun 2023 00:55:51 -0700 (PDT) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxhMQBOZ1kAcUDAA--.6285S3; Thu, 29 Jun 2023 15:55:45 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxzyP6OJ1kYGYQAA--.18424S12; Thu, 29 Jun 2023 15:55:44 +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, hejinyang@loongson.cn Subject: [PATCH v16 10/30] LoongArch: KVM: Implement vcpu ENABLE_CAP ioctl interface Date: Thu, 29 Jun 2023 15:55:18 +0800 Message-Id: <20230629075538.4063701-11-zhaotianrui@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230629075538.4063701-1-zhaotianrui@loongson.cn> References: <20230629075538.4063701-1-zhaotianrui@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8AxzyP6OJ1kYGYQAA--.18424S12 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?1770024361372172425?= X-GMAIL-MSGID: =?utf-8?q?1770024361372172425?= |
Series |
Add KVM LoongArch support
|
|
Commit Message
zhaotianrui
June 29, 2023, 7:55 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;