Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp308747pxb; Wed, 3 Feb 2021 06:13:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCfU/QD316qAwMlqSemOyjpGKXNhR10SnI7pHZ0hObh8xYpgprzwIzWKrTA46Tc9cZTbI+ X-Received: by 2002:a7b:c1ce:: with SMTP id a14mr3097595wmj.24.1612361606716; Wed, 03 Feb 2021 06:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612361606; cv=none; d=google.com; s=arc-20160816; b=ErYnhKblD6YjgDzQEiJDSW1BFGfUNz2wGDA7D+8gucrujAFx6yNJK6B0F5vcyqhLXx 57RwVuixEO1lHFgO9796ti/u5ENXmvqp23U31ofzw55Yx1qc7D1vM/Uaj4fDH9zlOcDZ Agc8H7hf5zvZ3OdKhKgQH5hge4DDuBuoGSO8CXCdFGOJdFN3JNPjOfESlfO+WKaHa1Za j8b1KGde6NAoN3nRWlzv+cSuIeEMSWqrUcj6N1Hn776mmvRhyfTW+7X6avux7FrMhZcJ kqOcp/qDRJ5R/wcE48TwymlLzzI6z6sv8raW20+qjMzafgen5P7bjNOGpEiQPm80/P3a qG1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=A7NdKPFVZmzRdCrC5SRoIaasaHnznmEayh0x0PGuBTA=; b=RTvmpYLkF5UIrdvO9rMcDWxGRjFiTdfIFH/n7qeInCXJF18TWfQNx04GaS5M302Wz8 W5RQsCQFwu7qr72bTRSvR/dSuwmy3cwjIgxrwBvzIy16tXZPPPKGIpggdlJogvhErFz6 ebM8imGVo289ED0ARROFG73ETjJ5MRw1n2qJHHLGrj0mNo0J2J89OleMZI/UnbrYEvJV GPGyygswG/iv3xUl4P7LdBzdoUgwcv6U8AAH7xD66/XXH9yMkJdVF/0FlICBENylsEGn dcMi8dnqaaMmlJzKqo+/riZjt8xQF0dz9Urs/OD72F4v5wv5dWR8IsUpp3JuqADmx7ug rGjg== ARC-Authentication-Results: i=1; mx.google.com; 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 r25si1511581edc.257.2021.02.03.06.12.55; Wed, 03 Feb 2021 06:13:26 -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; 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 S232645AbhBCOJ4 (ORCPT + 99 others); Wed, 3 Feb 2021 09:09:56 -0500 Received: from mail-wr1-f53.google.com ([209.85.221.53]:43054 "EHLO mail-wr1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232499AbhBCOJu (ORCPT ); Wed, 3 Feb 2021 09:09:50 -0500 Received: by mail-wr1-f53.google.com with SMTP id z6so24400223wrq.10; Wed, 03 Feb 2021 06:09:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A7NdKPFVZmzRdCrC5SRoIaasaHnznmEayh0x0PGuBTA=; b=feQF8TgmgvMWXTAgeEA74jLQatxpzclMBJve54rTcQ8V8U4IXDniVeSQSPgC9lTnc1 vu/Fxacmfmm2P967wzwUWxyk7vHTquMwyearpHBALpXEmRDXng/yO9VkdWXVZXKq1Jk9 Rw47Y0j8lRkx3rTLZOVkkBunzHzEIlPVjqGrV/4Y+ZtgoqtGfCG1l2zsKeJLOJAeMOfj jLoiRTFxDJRcR+tsMkTER26lqj2rOvmGRvetQH0hfeJAg9nDcRsxvm8VqrLhH/cx0JrE uWhud++8GoeHRe7sJwCssUOfBCPnFZSVtVuOXxyD3lxrx0i7hHUyCTcwm384nNRKH48B 6HqA== X-Gm-Message-State: AOAM530G7pz1R/Ouv8ID3EeK/2fH1GA0b2w5XIlx0ydHs8gc9gyc0qQu sO1H1ke1IIMjYIB3prHWGsn26ZdS7wA= X-Received: by 2002:a5d:4242:: with SMTP id s2mr3809982wrr.108.1612361348006; Wed, 03 Feb 2021 06:09:08 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id u10sm2754907wmj.40.2021.02.03.06.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 06:09:07 -0800 (PST) Date: Wed, 3 Feb 2021 14:09:06 +0000 From: Wei Liu To: Arnd Bergmann Cc: Wei Liu , 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" Subject: Re: [PATCH v5 13/16] asm-generic/hyperv: introduce hv_device_id and auxiliary structures Message-ID: <20210203140906.g35zr7366hh7p5f3@liuwe-devbox-debian-v2> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 02:49:53PM +0100, Arnd Bergmann wrote: > 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. Thanks for the information. I think we will need to wait until Microsoft Hypervisor clearly defines the endianess in its header(s) before we can make changes to the copy in Linux. > > 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. Michael, let me know what you think. I'm not too fussed either way. Wei. > > Arnd