Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8E57C433E3 for ; Fri, 17 Jul 2020 08:16:34 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE9FB20737 for ; Fri, 17 Jul 2020 08:16:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE9FB20737 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jwLXX-0006Yd-2n; Fri, 17 Jul 2020 08:16:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jwLXV-0006YY-24 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2020 08:16:17 +0000 X-Inumbo-ID: c8e8de42-c805-11ea-b7bb-bc764e2007e4 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c8e8de42-c805-11ea-b7bb-bc764e2007e4; Fri, 17 Jul 2020 08:16:16 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D9AB3ADF0; Fri, 17 Jul 2020 08:16:19 +0000 (UTC) Subject: Re: [PATCH 1/2] common: map_vcpu_info() cosmetics To: Julien Grall References: <2a0341c7-3836-a8c0-9516-b6a08e2720ec@suse.com> <20200716114128.GO7191@Air-de-Roger> <03a4d446-c26b-f171-57fd-a1eb13dad6c0@suse.com> <20200716144219.GQ7191@Air-de-Roger> From: Jan Beulich Message-ID: <7b9dc9b2-e117-6bbb-05a7-e82c4529e5e7@suse.com> Date: Fri, 17 Jul 2020 10:16:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , xen-devel , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 16.07.2020 18:17, Julien Grall wrote: > On Thu, 16 Jul 2020, 17:01 Jan Beulich, wrote: > >> On 16.07.2020 16:42, Roger Pau Monné wrote: >>> On Thu, Jul 16, 2020 at 01:48:51PM +0200, Jan Beulich wrote: >>>> On 16.07.2020 13:41, Roger Pau Monné wrote: >>>>> On Wed, Jul 15, 2020 at 12:15:10PM +0200, Jan Beulich wrote: >>>>>> Use ENXIO instead of EINVAL to cover the two cases of the address not >>>>>> satisfying the requirements. This will make an issue here better stand >>>>>> out at the call site. >>>>> >>>>> Not sure whether I would use EFAULT instead of ENXIO, as the >>>>> description of it is 'bad address' which seems more inline with the >>>>> error that we are trying to report. >>>> >>>> The address isn't bad in the sense of causing a fault, it's just >>>> that we elect to not allow it. Hence I don't think EFAULT is >>>> suitable. I'm open to replacement suggestions for ENXIO, though. >>> >>> Well, using an address that's not properly aligned to the requirements >>> of an interface would cause a fault? (in this case it's a software >>> interface, but the concept applies equally). >> >> Not necessarily, see x86'es behavior. Also even on strict arches > > it is typically possible to cover for the misalignment by using >> suitable instructions; it's still an implementation choice to not >> do so. > > > I am not sure about your argument here... Yes it might be possible, but at > what cost? The cost is what influences the decision whether to support it. Nevertheless it remains an implementation decision rather than a hardware imposed restriction, and hence I don't consider -EFAULT suitable here. >>> Anyway, not something worth arguing about I think, so unless someone >>> else disagrees I'm fine with using ENXIO. >> >> Good, thanks. >> > > -EFAULT can be described as "Bad address". I think it makes more sense than > -ENXIO here even if it may not strictly result to a fault on some arch. As said - I don't consider EFAULT applicable here; I also consider EINVAL as too generic. I'll be happy to see replacement suggestions for my ENXIO choice, but obviously I'm not overly happy to see options re-suggested which I did already say I've ruled out. Jan