From patchwork Thu May 23 16:49:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 2608231 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1087540077 for ; Thu, 23 May 2013 16:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759855Ab3EWQtZ (ORCPT ); Thu, 23 May 2013 12:49:25 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:50156 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759844Ab3EWQtW (ORCPT ); Thu, 23 May 2013 12:49:22 -0400 Received: by mail-pd0-f170.google.com with SMTP id x10so2990489pdj.29 for ; Thu, 23 May 2013 09:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ZkswzmPe1DLYVbpIJim9vS1VNA8HSkvVY2ZtPcTd0/g=; b=dw5GU1PgVV1kjEB9xVQVlzDCWEognsyQ3xBVxMU3+jjigqVeLsK105MMV6xv4RWmaU /7XlpS70OT2YegGN+duz+h/05tKEA1FlaPS8UpKhb6L4Dpsu1j+IKIw2P39engO9mIPy fmvSiiC6adhg+BCJ+4YX91xVIdsJFVKIo5V9jnWhNZXqol+kP5npdk6FTFnRnxiDS9ch usCunC+/dkFOjkUQRasF7corQqUYjqlnbOHq8Q9CdMa+OdAZZz4NEwYyZe5E0KH9nORO huHmOA8jmKA3Dy88CGOITj518ksYZeRoB6CDn87dOnaMdEUM7pCnqVMDcqAiszWzTchf oKmw== X-Received: by 10.68.244.72 with SMTP id xe8mr14030859pbc.51.1369327762007; Thu, 23 May 2013 09:49:22 -0700 (PDT) Received: from dl.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id ea15sm13456564pad.16.2013.05.23.09.49.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 09:49:19 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id r4NGnG1Q028643; Thu, 23 May 2013 09:49:16 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id r4NGnGWK028642; Thu, 23 May 2013 09:49:16 -0700 From: David Daney To: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal , Gleb Natapov Cc: linux-kernel@vger.kernel.org, David Daney Subject: [PATCH v6 6/6] mips/kvm: Use ENOIOCTLCMD to indicate unimplemented ioctls. Date: Thu, 23 May 2013 09:49:10 -0700 Message-Id: <1369327750-28580-7-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1369327750-28580-1-git-send-email-ddaney.cavm@gmail.com> References: <1369327750-28580-1-git-send-email-ddaney.cavm@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: David Daney The Linux Way is to return -ENOIOCTLCMD to the vfs when an unimplemented ioctl is requested. Do this in kvm_mips instead of a random mixture of -ENOTSUPP and -EINVAL. Signed-off-by: David Daney Acked-by: Sanjay Lal --- arch/mips/kvm/kvm_mips.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/mips/kvm/kvm_mips.c b/arch/mips/kvm/kvm_mips.c index 3caa006..d934b01 100644 --- a/arch/mips/kvm/kvm_mips.c +++ b/arch/mips/kvm/kvm_mips.c @@ -195,7 +195,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) long kvm_arch_dev_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { - return -EINVAL; + return -ENOIOCTLCMD; } void kvm_arch_free_memslot(struct kvm_memory_slot *free, @@ -401,7 +401,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg) { - return -EINVAL; + return -ENOIOCTLCMD; } int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) @@ -475,14 +475,14 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, struct kvm_mp_state *mp_state) { - return -EINVAL; + return -ENOIOCTLCMD; } int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, struct kvm_mp_state *mp_state) { - return -EINVAL; + return -ENOIOCTLCMD; } #define KVM_REG_MIPS_CP0_INDEX (0x10000 + 8 * 0 + 0) @@ -801,7 +801,7 @@ long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) switch (ioctl) { default: - r = -EINVAL; + r = -ENOIOCTLCMD; } return r; @@ -829,13 +829,13 @@ void kvm_arch_exit(void) int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) { - return -ENOTSUPP; + return -ENOIOCTLCMD; } int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) { - return -ENOTSUPP; + return -ENOIOCTLCMD; } int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) @@ -845,12 +845,12 @@ int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) { - return -ENOTSUPP; + return -ENOIOCTLCMD; } int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu) { - return -ENOTSUPP; + return -ENOIOCTLCMD; } int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)