Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1597128rdb; Mon, 2 Oct 2023 14:57:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG01yJ200I5zN6hOHSt8DcHEoX+lGt0GV1kovWxe+j3AVtBN4/nDfC4dJCN6sFsWKHQ8ts2 X-Received: by 2002:a05:6a20:431d:b0:15e:b253:269f with SMTP id h29-20020a056a20431d00b0015eb253269fmr1232211pzk.28.1696283852825; Mon, 02 Oct 2023 14:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696283852; cv=none; d=google.com; s=arc-20160816; b=UgdduUSLS7FMGyUeg11byQbPyeOnXjf2utgJgegPTjjfeyq8G+s9wOJnC2jyZd14us h+sgztr1p8Cks/hEUclZRL4elFrX9xsMKBJjztXYNzs1Xz3UmWtD+NgGaKEXXMTM6LLl DJEqq/uJlblM5Ix9iDcr9lXNxYUFT4BoFyUj4w9dqUoKBVbT/o7b2S06nNcfTv0vwqYH 4mfnJ1hsTinCunllxhWAwjgD779iec86YNovx8YBr56IO9k2s+bWoQsr2vfwqOd6H5ed K4u+byB6YxLniLu56ZZ/ItAVtwXre+PlJYd1JRN4bEny5+o/M99DGdHcSrlDtWVXUx2X ZT6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=d/FA2EfCmaMmbb04VxL3iHHe9pNT3SUAkPZRkFN887g=; fh=8LmBwgufWzfpgxaSVDyWbJyrpd8t2PCgbbDs0HIaBNY=; b=eiSm/IQTN1bvJRCXtX93p0gW+9pOBn3tqg1p51EjWaT3NwPKNBo2rvg6FDz4SNUD+Q jhM6WbR79oNpC/t21ZYfqDhKLFQ2I8IbGVjno9HPiTaOeaiXJfZHmmkmS9CTjkeuit3A BY9KVXh1yfujjwXbjy5R6jqZ0DhPDeIQgBAymKNtJjU6dA/td6VKnaJ2Z3xoyx76CRSW 1retRNhjJGAv9BblWyfKWWm1EgKMObZKaB3JGzRsleNmppLlkhG4h+lCZiVBkiDPDlKG qorviCekatqGnIBG+ObgdMtoVAXA+WEPcD4FCd8KsK2LyFUkTUjDnMWzROYqAumGb8qR 7lxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V0lkpOig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z16-20020a656650000000b0056c297d1640si25466048pgv.528.2023.10.02.14.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 14:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V0lkpOig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EDA69807C855; Mon, 2 Oct 2023 12:35:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238881AbjJBTfc (ORCPT + 99 others); Mon, 2 Oct 2023 15:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjJBTfb (ORCPT ); Mon, 2 Oct 2023 15:35:31 -0400 Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com [IPv6:2607:f8b0:4864:20::a34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B1BAA9; Mon, 2 Oct 2023 12:35:28 -0700 (PDT) Received: by mail-vk1-xa34.google.com with SMTP id 71dfb90a1353d-49d0ee68dcaso8684e0c.1; Mon, 02 Oct 2023 12:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696275327; x=1696880127; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=d/FA2EfCmaMmbb04VxL3iHHe9pNT3SUAkPZRkFN887g=; b=V0lkpOigC9Tka+6aTLS8pu29ESAFL7TIUPl5Tap3YS6nCtS4hA6iflJC39x99ASo1D I8lYn/dbeoUKOVfryKt7LPTqKD2Wjq/z+GyzYUhiDr2TLOiLuziEfPZej+lC/ozyPvBf NbNG4E8PadnlZ/fGhXDwiUsJFquQZaeho3Dd1fBw4jsJlqtTV9zfnnwXYN1nM+HR12Cq 7ZG6ZXYvjETnJgFDy4sMLvtSnvK1nk1XjDG8LBQvHswJ7EfT0IcxEaIlRZJ8aVy4A9tE x0TJhXcuO1n4WxXpUJIV6r2dhGvLbvgq4gV/BzS8/8eKUrpVjROub/EughNQHevYNVrU sVyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696275327; x=1696880127; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d/FA2EfCmaMmbb04VxL3iHHe9pNT3SUAkPZRkFN887g=; b=HtP8YZ2QmTCtEJ3VCXIvmIfIMPfvpepdBQTD9d87rV76BK26+tbeIgYXnyihqUA+r5 EuTutvylNG6rqkyRmtYkHSyiDItssV+ZpIwSRLPWxRl//uaHq/QjR5LzYmfbChjiKxTP BfYXCRphYJsVRno6pmBAgoaYpK38TBpIQZ02+FBJJWc6v29P5dyrw6WWMeMnF8PRAG2T KAdWXlZctN8Xaa3hBqGs8yxjTP42gQORS9mV+iHHWASYLEHRkvJ1gZD7QrGP7SC6/zwy CG8++37YjhoTOJ/rfkNZxPSaMslcyR66yD/Zf5vOijk8M97GewVfGjeINRQaXsDcOv1v C/ug== X-Gm-Message-State: AOJu0YxI3YaKzICtyyhvFWy/23lqAElO4lbA4nJrPbzuHOFKnhcxXOJR JcEOulhHKmvixdIeTv6SOtahm8FF97uk5FR0Q38= X-Received: by 2002:a05:6122:4993:b0:499:7af7:207d with SMTP id ex19-20020a056122499300b004997af7207dmr5484408vkb.1.1696275327064; Mon, 02 Oct 2023 12:35:27 -0700 (PDT) MIME-Version: 1.0 References: <1696010501-24584-1-git-send-email-nunodasneves@linux.microsoft.com> <1696010501-24584-15-git-send-email-nunodasneves@linux.microsoft.com> In-Reply-To: <1696010501-24584-15-git-send-email-nunodasneves@linux.microsoft.com> From: Alex Ionescu Date: Mon, 2 Oct 2023 15:35:16 -0400 Message-ID: Subject: Re: [PATCH v4 14/15] asm-generic: hyperv: Use new Hyper-V headers conditionally. To: Nuno Das Neves 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, wei.liu@kernel.org, gregkh@linuxfoundation.org, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 12:35:34 -0700 (PDT) Hi Nuno, I understand the requirement to have undocumented/non-standard/non-TLFS-published information in the HDK headers, however, the current state of this patch is that for any other code that's not in the kernel today, or in this upcoming driver, the hyperv-tlfs definitions are incomplete, because some *documented* TLFS fields are only in HDK headers. Similarly, it is also impossible to only use the HDK headers for other use cases, because some basic documented, standard defines only exist in hyperv-tlfs. So there is no "logical" relationship between the two -- HDK headers are not _just_ undocumented information, but also documented information, but also not complete documented information. Would you consider: 1) Updating hyperv-tlfs with all newly documented TLFS fields that are in the HDK headers? OR 2) Updating the new HDK headers you're adding here to also include previously-documented information from hyperv-tlfs? This way, someone can include the HDK headers and get everything they need OR 3) Truly making hypertv-tlfs the "documented" header, and then removing any duplication from HDK so that it remains the "undocumented" header file. In this manner, one would include hyperv-tlfs to use the stable ABI, and they would include HDK (which would include hyperv-tlfs) to use the unstable+stable ABI. Thank you for your consideration. Best regards, Alex Ionescu On Fri, Sep 29, 2023 at 2:02=E2=80=AFPM Nuno Das Neves wrote: > > Add asm-generic/hyperv-defs.h. It includes hyperv-tlfs.h or hvhdk.h > depending on compile-time constant HV_HYPERV_DEFS which will be defined i= n > the mshv driver. > > This is needed to keep unstable Hyper-V interfaces independent of > hyperv-tlfs.h. This ensures hvhdk.h replaces hyperv-tlfs.h in the mshv > driver, even via indirect includes. > > Signed-off-by: Nuno Das Neves > Acked-by: Wei Liu > --- > arch/arm64/include/asm/mshyperv.h | 2 +- > arch/x86/include/asm/mshyperv.h | 3 +-- > drivers/hv/hyperv_vmbus.h | 1 - > include/asm-generic/hyperv-defs.h | 26 ++++++++++++++++++++++++++ > include/asm-generic/mshyperv.h | 2 +- > include/linux/hyperv.h | 2 +- > 6 files changed, 30 insertions(+), 6 deletions(-) > create mode 100644 include/asm-generic/hyperv-defs.h > > diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/m= shyperv.h > index 20070a847304..8ec14caf3d4f 100644 > --- a/arch/arm64/include/asm/mshyperv.h > +++ b/arch/arm64/include/asm/mshyperv.h > @@ -20,7 +20,7 @@ > > #include > #include > -#include > +#include > > /* > * Declare calls to get and set Hyper-V VP register values on ARM64, whi= ch > diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyp= erv.h > index e3768d787065..bb1b97106cd3 100644 > --- a/arch/x86/include/asm/mshyperv.h > +++ b/arch/x86/include/asm/mshyperv.h > @@ -6,10 +6,9 @@ > #include > #include > #include > -#include > #include > #include > -#include > +#include > > /* > * Hyper-V always provides a single IO-APIC at this MMIO address. > diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h > index 09792eb4ffed..0e4bc18a13fa 100644 > --- a/drivers/hv/hyperv_vmbus.h > +++ b/drivers/hv/hyperv_vmbus.h > @@ -15,7 +15,6 @@ > #include > #include > #include > -#include > #include > #include > #include > diff --git a/include/asm-generic/hyperv-defs.h b/include/asm-generic/hype= rv-defs.h > new file mode 100644 > index 000000000000..ac6fcba35c8c > --- /dev/null > +++ b/include/asm-generic/hyperv-defs.h > @@ -0,0 +1,26 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _ASM_GENERIC_HYPERV_DEFS_H > +#define _ASM_GENERIC_HYPERV_DEFS_H > + > +/* > + * There are cases where Microsoft Hypervisor ABIs are needed which may = not be > + * stable or present in the Hyper-V TLFS document. E.g. the mshv_root dr= iver. > + * > + * As these interfaces are unstable and may differ from hyperv-tlfs.h, t= hey > + * must be kept separate and independent. > + * > + * However, code from files that depend on hyperv-tlfs.h (such as mshype= rv.h) > + * is still needed, so work around the issue by conditionally including = the > + * correct definitions. > + * > + * Note: Since they are independent of each other, there are many defini= tions > + * duplicated in both hyperv-tlfs.h and uapi/hyperv/hv*.h files. > + */ > +#ifdef HV_HYPERV_DEFS > +#include > +#else > +#include > +#endif > + > +#endif /* _ASM_GENERIC_HYPERV_DEFS_H */ > + > diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyper= v.h > index d832852d0ee7..6bef0d59d1b7 100644 > --- a/include/asm-generic/mshyperv.h > +++ b/include/asm-generic/mshyperv.h > @@ -25,7 +25,7 @@ > #include > #include > #include > -#include > +#include > > #define VTPM_BASE_ADDRESS 0xfed40000 > > diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h > index 4d5a5e39d76c..722a8cf23d87 100644 > --- a/include/linux/hyperv.h > +++ b/include/linux/hyperv.h > @@ -24,7 +24,7 @@ > #include > #include > #include > -#include > +#include > > #define MAX_PAGE_BUFFER_COUNT 32 > #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ > -- > 2.25.1 > >