Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp221593pxk; Sun, 30 Aug 2020 00:24:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlGWYLY7j0aPaGXUFxOzR6UzFAWJtNAl/2far6uXu5zZdmOw0IyGitZ0KqQrCPsHvVfNvi X-Received: by 2002:a17:906:a293:: with SMTP id i19mr6855919ejz.523.1598772289793; Sun, 30 Aug 2020 00:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598772289; cv=none; d=google.com; s=arc-20160816; b=qJgwrDo7dqSCeb+Ci6qpC2J8nUFe5uBHJ+V11FUffkCkcACdHPQiKxyPIUPDnpREDK 9+repvW8U4MCZN9iCVyJTK5lQmlOhLPGT1f8vS+U4Ur90+6vbGxHx41WHkN67qcyCm4J dgRQfRBxaM9Nv6smMhc9cl2gbpL09hEf/bOpIpt7hW/R2+NaZgqHA+Ot0HIHTiQdgg4v IsW/drTmOth3HW54m3mKXysvjAdzV8bEsKwWEKx9o6PTUllc6U2Jln28WcCXRZLog6HL OcIDaJIFaadFk6bJeVH9tPCCoHjrESq6DdsU5PIYYN14Sez4mddhM/YUW4W4FHFqvPbo Fs0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=M3wJxs9YTILX8YbqBDU5PNyFoIaL1cAkA+DLcmOUgp8=; b=ocA/NNnR9rdaqgawLes/4jdFgtSpGsci72GoaFm690QxsQJ9KdWcDl3d3tHAelbOF0 lEZlzjsEB2rSflSfa2/IyZ8Pnj6iYRCuFZcOV1ARJoL06FiT9m76im9r4IxW5uQ+oRMv ZEgEySe3lmQZHgKWlmiko5gd+vHD8e/7kWY87BvT5T4hDPMs/pczBtIh107lQsF52zDU MITNvFA87iehZJk3wAQs96ifbQa5xi0drKdTn4x88prA1x1+gQgXVbIiDiVgV3o946of oNCIWqOxchHpGXSNH8aLLPjZ7OMfN/ujcI9vBIBA5DwIshVELArkK+q+z8eSvWmjJHVS 8jag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Dej4xrrF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ju9si3464423ejb.266.2020.08.30.00.24.24; Sun, 30 Aug 2020 00:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Dej4xrrF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726565AbgH3HXr (ORCPT + 99 others); Sun, 30 Aug 2020 03:23:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:59308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726459AbgH3HXq (ORCPT ); Sun, 30 Aug 2020 03:23:46 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 59F3B206FA; Sun, 30 Aug 2020 07:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598772225; bh=km28S5CzZd+At7Y+4S9PG+dHmU5CXJCtMAWKdL1fxBg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Dej4xrrFN62W8cFGVEBlUkZK/4CsbMBrz2dE21RgprMb3qSYwvDEJEBApM4vJ2hhT frwLI0HzBLGDLiJvADhAKj3DDpG2teZf1oCjyfae7YJp43pH2iRFeFJmzCpxV+q4fr CqXH0NVoUwIreII9lgMcIYY3u7k9FpiupNG8ZKhw= Date: Sun, 30 Aug 2020 09:23:42 +0200 From: Greg Kroah-Hartman To: Shuo A Liu Cc: linux-kernel@vger.kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sean Christopherson , Yu Wang , Reinette Chatre , x86@kernel.org, Zhi Wang , Zhenyu Wang Subject: Re: [PATCH 06/17] virt: acrn: Introduce VM management interfaces Message-ID: <20200830072342.GA110796@kroah.com> References: <20200825024516.16766-1-shuo.a.liu@intel.com> <20200825024516.16766-7-shuo.a.liu@intel.com> <20200828102738.GC1470435@kroah.com> <20200829110436.GF13723@shuo-intel.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200829110436.GF13723@shuo-intel.sh.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 29, 2020 at 07:04:36PM +0800, Shuo A Liu wrote: > Hi Greg, > > On Fri 28.Aug'20 at 12:27:38 +0200, Greg Kroah-Hartman wrote: > > On Tue, Aug 25, 2020 at 10:45:06AM +0800, shuo.a.liu@intel.com wrote: > > > + default: > > > + pr_warn("Unknown IOCTL 0x%x!\n", cmd); > > > + ret = -EINVAL; > > > > Wrong error value here, right? > > Right, it should be -ENOIOCTLCMD. It could, but really, just return the correct error for this, to prevent the core from having to do the conversion. The reviewers at Intel who should have read this before submitting it, know the correct value to return for an illegal ioctl, please go ask them. > However, i found many instances in kernel drivers return -EINVAL for no > ioctl command support. :) Then they too are wrong. No need to add known bugs before the code is accepted. See the comments above the is_unrecognized_ioctl() in block/ioctl.c for all of the details and why -EINVAL is not the correct thing to do here. thanks, greg k-h