Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2277641rdb; Tue, 3 Oct 2023 16:37:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEP8bv5yMaymiwqSUJnlekK/kVVvx3v490mPglZfzYzLYC4SsXhVGRKfCMV7Dix4vYoS37+ X-Received: by 2002:a05:6a00:190d:b0:68f:dfda:1814 with SMTP id y13-20020a056a00190d00b0068fdfda1814mr1032471pfi.18.1696376248281; Tue, 03 Oct 2023 16:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696376248; cv=none; d=google.com; s=arc-20160816; b=GvIJQu6e+wo6eXb0kc4BaRQFCnARthYAug3CEA0wxmgpHwM53V8V269BQQeJEhyxd7 q1qOUcO3lezd6/KwYuJqdvk0CFBaS0A9bIO4fQT3H1EWmT8iNeHObmLJMj5K7StsDirD UljHAzyZArdJtOek3kQwu0vcS3wxN5zxa9H0gXEXJpwDoGCz4yqQmTpCV3cSMBHucn16 DkCbNeuScH8NrfDR9FXa6/b3B1zrtqWWII8eAq3wiBk+2VERkhbCvIHG0H7vfsQijqKn edppYklL5ByDM2v0NbFa4tKkEPabhgt+L3s6ACHjtBsu80JSbLhQCafbeYxu34yYIWGj SZ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=tsip8nWvlbps3k11kkyVGy2+8yeAGiiGZPurvzAPE14=; fh=4IeBZmlOVToLc/pN4Fsijk40AHTc2siBePJ4bkaQO4M=; b=DZ7aHRGny4KiyjATIoiGjQsB6G68S+G0eYs3IGbNJBWTwkNdbxKaiwYOyWsK8kkHmr x7CVM7wr+yHXIk6/cASpfV56uepKSGdMmtoblfS8/5N9HYbJjwwLoXHJlmVF8NH3u1BA +IRytEY5CbKMOGopLnaoxZnsCDRFtrpQcrNzE8jrz9bqRr79fsej7evnbIdst0kiE9Gi mICxKj+/2TwqLxRkQRZrd0j41U4ROp5sJtWdLvTeaUC14+hMi4v60S0U+svd+QpNwgdc zUHWeCNcAs68+LhKNvZ3or/xLl0s/ubucW0BLuncMthL7vNdwsDC4sbCGq7KWSGvYBOt I9gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=C+EH+ZFf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u18-20020a056a00099200b0068faabd47fcsi2671280pfg.210.2023.10.03.16.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 16:37:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=C+EH+ZFf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A4FD4812A63A; Tue, 3 Oct 2023 16:37:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237343AbjJCXhK (ORCPT + 99 others); Tue, 3 Oct 2023 19:37:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237285AbjJCXhF (ORCPT ); Tue, 3 Oct 2023 19:37:05 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D6C6DA; Tue, 3 Oct 2023 16:37:01 -0700 (PDT) Received: from [10.0.0.178] (c-76-135-56-23.hsd1.wa.comcast.net [76.135.56.23]) by linux.microsoft.com (Postfix) with ESMTPSA id 2294820B74C0; Tue, 3 Oct 2023 16:37:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2294820B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1696376220; bh=tsip8nWvlbps3k11kkyVGy2+8yeAGiiGZPurvzAPE14=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=C+EH+ZFfOJLP32l5gUhfgckBSI+ZFNZKDVMrKVnd98UhkWNMSwPGbCF5RRrGmG7Ty s+2bZf/590Ek6L1hvVy/dIss4fpBiPry8a/1xTDjehOQrpGCdw59aBRvB+l2G5BZVK 17n4LJMibOWB4335M2rEm7WLeM52xH8yTw73kExw= Message-ID: Date: Tue, 3 Oct 2023 16:37:01 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 13/15] uapi: hyperv: Add mshv driver headers defining hypervisor ABIs Content-Language: en-US To: Greg KH , Wei Liu Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, patches@lists.linux.dev, mikelley@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, apais@linux.microsoft.com, Tianyu.Lan@microsoft.com, ssengar@linux.microsoft.com, mukeshrathor@microsoft.com, stanislav.kinsburskiy@gmail.com, jinankjain@linux.microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, will@kernel.org, catalin.marinas@arm.com References: <1696010501-24584-1-git-send-email-nunodasneves@linux.microsoft.com> <1696010501-24584-14-git-send-email-nunodasneves@linux.microsoft.com> <2023093057-eggplant-reshoot-8513@gregkh> <2023100154-ferret-rift-acef@gregkh> From: Nuno Das Neves In-Reply-To: <2023100154-ferret-rift-acef@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 03 Oct 2023 16:37:26 -0700 (PDT) On 9/30/2023 11:19 PM, Greg KH wrote: > On Sat, Sep 30, 2023 at 10:01:58PM +0000, Wei Liu wrote: >> On Sat, Sep 30, 2023 at 08:09:19AM +0200, Greg KH wrote: >>> On Fri, Sep 29, 2023 at 11:01:39AM -0700, Nuno Das Neves wrote: >>>> +/* Define connection identifier type. */ >>>> +union hv_connection_id { >>>> + __u32 asu32; >>>> + struct { >>>> + __u32 id:24; >>>> + __u32 reserved:8; >>>> + } __packed u; >>> >>> bitfields will not work properly in uapi .h files, please never do that. >> >> Can you clarify a bit more why it wouldn't work? Endianess? Alignment? > > Yes to both. > > Did you all read the documentation for how to write a kernel api? If > not, please do so. I think it mentions bitfields, but it not, it really > should as of course, this will not work properly with different endian > systems or many compilers. Yes, in https://docs.kernel.org/driver-api/ioctl.html it says that it is "better to avoid" bitfields. Unfortunately bitfields are used in the definition of the hypervisor ABI. We import these definitions directly from the hypervisor code. In practice the hypervisor, linux, and VMM compilers all produce the same layout for bitfields on the architectures we support. Thanks, Nuno > > thanks, > > greg k-h