Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp291595pxb; Wed, 3 Feb 2021 05:52:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNT0DGrZQYzdJ7KElQYVnqEwSObZmEDMY9LXGfwO6rRoMyLE+AVQ43d421YLRV7oIpT35S X-Received: by 2002:a17:906:f2ca:: with SMTP id gz10mr3217587ejb.285.1612360319832; Wed, 03 Feb 2021 05:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612360319; cv=none; d=google.com; s=arc-20160816; b=zmmdSnlBxWpdrxYO4QzyPEo2EVHGuhOUB9KLa563PcOyAUYkfCfT7wkwouBe4dmnp2 rkIpSjGJ0cgtiP+6pjLEYgEOIqNXgJn4LToVzsnb00sGYVDukGByd0HN4dXJHKihcEMd wbGzom+UxP7eVwfbvmkjstbkFpfPolcejflB04dQzjPto2Ll6waqpm5d3eOvD6EQir6F UrivH5dOH8akQhowQUV4OiXzHhMb/Tqhv/xNH0QvmR+Akk/XQUhbrUO+YxhVwacoObjd 2AYWBbXvwb5zD4Hk1bB/OgduepTqQ1sDunoXu2YfKGGS139LNB/jZdBSuG2+LzGumNX8 5xFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ixWddORKoaYrthshACLmMtNFF9M2B/k+cSY1qvjCNSo=; b=gbmxDakqvJOXsuj7b2aoR1hVp1EyEFR83cU96KnxXAFB1pdbqo8nbJPh9cny2s+HwR ToIVsI1d4HoHJARvHI0ZI3NhLIL4+Zm2HtI7dQUlfH99M5PbDfudBQike/3KUSEd71xC 45DzN3geEhG13ZgKrrgZLWc7lxIrpcAAySEaRNq5jb0x4fYEr2BxtN/nHjTuQBJ5QFTH oC8xeRFwDoPbNHt0v4XGDHmGqKb3/xo6dcUMsOJ4GaT0xnDCvPCE0VjZX+hfcOyCna+g dz5WgnzgsEx/Ni15CJktAnKv8zhucEOBVoLybW+XXGXFI0BP0bigknb1V+1h98Yxk0Gs vBQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sgAHl396; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o23si1425803ejc.395.2021.02.03.05.51.34; Wed, 03 Feb 2021 05:51:59 -0800 (PST) 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=k20201202 header.b=sgAHl396; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232138AbhBCNux (ORCPT + 99 others); Wed, 3 Feb 2021 08:50:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:49772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbhBCNuv (ORCPT ); Wed, 3 Feb 2021 08:50:51 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 428C364F74; Wed, 3 Feb 2021 13:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612360210; bh=T8QKz01mCo74ckdQQ6dLGoIrJyBA3kMHFWwx0BPy+GY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sgAHl396bC/vDbUnEo+D7kLbPdMDjJrXmC6r36iUQDBLpVAZvbk/m2dQlyDKD/foE whZY+3M7TOxM+0881KHrxVmAP8Tj9Xc5TDS30WixPnqYDV3EEkAYMR/O0S9XYxZPmI OS6unieQhRuLekg+MASqBzOn6Se0j+RtU8463mqShRuV6GH1Bi57tuamBbdM6ixq7Q 2jKc8TLsFRWweCJBR1qTtbLMDmFYy9atDrMCzOeoJBgRbNWO3IEzdyz9JBXX4RpUNR OzccRNDvbvT+PjaDwas5C0PLXvMzL8syYdhCWQX4dWEa+IWT2C3UX5w0nYD1keHeXH N4PIwssjd5Xuw== Received: by mail-oi1-f181.google.com with SMTP id n7so26731927oic.11; Wed, 03 Feb 2021 05:50:10 -0800 (PST) X-Gm-Message-State: AOAM532czPQIKo7fCaPg1iKxbaWovhMmQQPA/YurnlcOFROb12OiqHwP Xcm6YIwfahF2eMA+IvRtq4Cj0ji0q3SSA9vgxgU= X-Received: by 2002:aca:eb0a:: with SMTP id j10mr2098549oih.4.1612360209432; Wed, 03 Feb 2021 05:50:09 -0800 (PST) MIME-Version: 1.0 References: <20210120120058.29138-1-wei.liu@kernel.org> <20210120120058.29138-14-wei.liu@kernel.org> <20210202170248.4hds554cyxpuayqc@liuwe-devbox-debian-v2> <20210203132601.ftpwgs57qtok47cg@liuwe-devbox-debian-v2> In-Reply-To: <20210203132601.ftpwgs57qtok47cg@liuwe-devbox-debian-v2> From: Arnd Bergmann Date: Wed, 3 Feb 2021 14:49:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 13/16] asm-generic/hyperv: introduce hv_device_id and auxiliary structures To: Wei Liu Cc: Michael Kelley , Linux on Hyper-V List , "virtualization@lists.linux-foundation.org" , Linux Kernel List , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , "pasha.tatashin@soleen.com" , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Arnd Bergmann , "open list:GENERIC INCLUDE/ASM HEADER FILES" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 3, 2021 at 2:26 PM Wei Liu wrote: > On Tue, Feb 02, 2021 at 05:02:48PM +0000, Wei Liu wrote: > > On Tue, Jan 26, 2021 at 01:26:52AM +0000, Michael Kelley wrote: > > > From: Wei Liu Sent: Wednesday, January 20, 2021 4:01 AM > > > > +union hv_device_id { > > > > + u64 as_uint64; > > > > + > > > > + struct { > > > > + u64 :62; > > > > + u64 device_type:2; > > > > + }; > > > > > > Are the above 4 lines extraneous junk? > > > If not, a comment would be helpful. And we > > > would normally label the 62 bit field as > > > "reserved0" or something similar. > > > > > > > No. It is not junk. I got this from a header in tree. > > > > I am inclined to just drop this hunk. If that breaks things, I will use > > "reserved0". > > > > It turns out adding reserved0 is required. Dropping this hunk does not > work. Generally speaking, bitfields are not great for specifying binary interfaces, as the actual bit order can differ by architecture. The normal way we get around it in the kernel is to use basic integer types and define macros for bit masks. Ideally, each such field should also be marked with a particular endianess as __le64 or __be64, in case this is ever used with an Arm guest running a big-endian kernel. That said, if you do not care about the specific order of the bits, having anonymous bitfields for the reserved members is fine, I don't see a reason to name it as reserved. Arnd