From: Simon Horman <horms@kernel.org>
To: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
iommu@lists.linux.dev, netdev@vger.kernel.org,
linux-pci@vger.kernel.org, linux-arch@vger.kernel.org,
virtualization@lists.linux.dev, kys@microsoft.com,
haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
catalin.marinas@arm.com, will@kernel.org, luto@kernel.org,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
seanjc@google.com, pbonzini@redhat.com, peterz@infradead.org,
daniel.lezcano@linaro.org, joro@8bytes.org, robin.murphy@arm.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, lpieralisi@kernel.org, kw@linux.com,
robh@kernel.org, bhelgaas@google.com, arnd@arndb.de,
sgarzare@redhat.com, jinankjain@linux.microsoft.com,
muminulrussell@gmail.com, skinsburskii@linux.microsoft.com,
mukeshrathor@microsoft.com
Subject: Re: [PATCH 5/5] hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code
Date: Fri, 4 Oct 2024 20:11:04 +0100 [thread overview]
Message-ID: <20241004191104.GI1310185@kernel.org> (raw)
In-Reply-To: <1727985064-18362-6-git-send-email-nunodasneves@linux.microsoft.com>
On Thu, Oct 03, 2024 at 12:51:04PM -0700, Nuno Das Neves wrote:
> To move toward importing headers from Hyper-V directly, switch to
> using hvhdk.h in all Hyper-V code. KVM code that uses Hyper-V
> definitions from hyperv-tlfs.h remains untouched.
>
> Add HYPERV_NONTLFS_HEADERS everywhere mshyperv.h, asm/svm.h,
> clocksource/hyperv_timer.h is included in Hyper-V code.
>
> Replace hyperv-tlfs.h with hvhdk.h directly in linux/hyperv.h, and
> define HYPERV_NONTLFS_HEADERS there, since it is only used in
> Hyper-V device code.
>
> Update a couple of definitions to updated names found in the new
> headers: HV_EXT_MEM_HEAT_HINT, HV_SUBNODE_TYPE_ANY.
>
> Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
...
> diff --git a/arch/arm64/hyperv/mshyperv.c b/arch/arm64/hyperv/mshyperv.c
> index b1a4de4eee29..62b2a270ae65 100644
> --- a/arch/arm64/hyperv/mshyperv.c
> +++ b/arch/arm64/hyperv/mshyperv.c
> @@ -15,6 +15,7 @@
> #include <linux/errno.h>
> #include <linux/version.h>
> #include <linux/cpuhotplug.h>
> +#define HYPERV_NONTLFS_HEADERS
> #include <asm/mshyperv.h>
>
> static bool hyperv_initialized;
Hi,
With this change in place I see allmodconfig x86_64 builds reporting that
HV_REGISTER_FEATURES is undeclared.
arch/arm64/hyperv/mshyperv.c: In function 'hyperv_init':
arch/arm64/hyperv/mshyperv.c:53:26: error: 'HV_REGISTER_FEATURES' undeclared (first use in this function); did you mean 'HV_REGISTER_FEATURES_INFO'?
53 | hv_get_vpreg_128(HV_REGISTER_FEATURES, &result);
| ^~~~~~~~~~~~~~~~~~~~
| HV_REGISTER_FEATURES_INFO
arch/arm64/hyperv/mshyperv.c:53:26: note: each undeclared identifier is reported only once for each function it appears in
arch/arm64/hyperv/mshyperv.c:58:26: error: 'HV_REGISTER_ENLIGHTENMENTS' undeclared (first use in this function); did you mean 'HV_ACCESS_REENLIGHTENMENT'?
58 | hv_get_vpreg_128(HV_REGISTER_ENLIGHTENMENTS, &result);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| HV_ACCESS_REENLIGHTENMENT
> diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
> index 6d83ceb7f1ba..5f4053c49658 100644
> --- a/arch/x86/entry/vdso/vma.c
> +++ b/arch/x86/entry/vdso/vma.c
> @@ -25,6 +25,7 @@
> #include <asm/page.h>
> #include <asm/desc.h>
> #include <asm/cpufeature.h>
> +#define HYPERV_NONTLFS_HEADERS
> #include <clocksource/hyperv_timer.h>
>
> #undef _ASM_X86_VVAR_H
> diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
> index f022d5f64fb6..4fe3b3b13256 100644
> --- a/arch/x86/hyperv/hv_apic.c
> +++ b/arch/x86/hyperv/hv_apic.c
> @@ -26,6 +26,7 @@
> #include <linux/slab.h>
> #include <linux/cpuhotplug.h>
> #include <asm/hypervisor.h>
> +#define HYPERV_NONTLFS_HEADERS
> #include <asm/mshyperv.h>
> #include <asm/apic.h>
>
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index fc3c3d76c181..680c4abc456e 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -19,6 +19,7 @@
> #include <asm/sev.h>
> #include <asm/ibt.h>
> #include <asm/hypervisor.h>
> +#define HYPERV_NONTLFS_HEADERS
> #include <asm/mshyperv.h>
> #include <asm/idtentry.h>
> #include <asm/set_memory.h>
And here too, with x86_64 allmodconfig.
In file included from ./include/linux/string.h:390,
from ./include/linux/efi.h:16,
from arch/x86/hyperv/hv_init.c:12:
arch/x86/hyperv/hv_init.c: In function 'get_vtl':
./include/linux/overflow.h:372:23: error: invalid application of 'sizeof' to incomplete type 'struct hv_get_vp_registers_input'
372 | sizeof(*(p)) + flex_array_size(p, member, count), \
| ^
./include/linux/fortify-string.h:502:42: note: in definition of macro '__fortify_memset_chk'
502 | size_t __fortify_size = (size_t)(size); \
| ^~~~
arch/x86/hyperv/hv_init.c:427:9: note: in expansion of macro 'memset'
427 | memset(input, 0, struct_size(input, element, 1));
| ^~~~~~
arch/x86/hyperv/hv_init.c:427:26: note: in expansion of macro 'struct_size'
427 | memset(input, 0, struct_size(input, element, 1));
| ^~~~~~~~~~~
[errors trimmed for the sake of brevity]
...
> diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
> index 04775346369c..a8bb6ad7efb6 100644
> --- a/arch/x86/hyperv/hv_vtl.c
> +++ b/arch/x86/hyperv/hv_vtl.c
> @@ -10,6 +10,7 @@
> #include <asm/boot.h>
> #include <asm/desc.h>
> #include <asm/i8259.h>
> +#define HYPERV_NONTLFS_HEADERS
> #include <asm/mshyperv.h>
> #include <asm/realmode.h>
> #include <../kernel/smpboot.h>
And, likewise, with this patch applied I see a number of errors when
compiling this file. This is with allmodconfig on x86_64 with:
Modified: CONFIG_HYPERV=y (instead of m)
Added: CONFIG_HYPERV_VTL_MODE=y
arch/x86/hyperv/hv_vtl.c: In function 'hv_vtl_bringup_vcpu':
arch/x86/hyperv/hv_vtl.c:154:34: error: 'HVCALL_ENABLE_VP_VTL' undeclared (first use in this function)
154 | status = hv_do_hypercall(HVCALL_ENABLE_VP_VTL, input, NULL);
| ^~~~~~~~~~~~~~~~~~~~
arch/x86/hyperv/hv_vtl.c:154:34: note: each undeclared identifier is reported only once for each function it appears in
In file included from ./include/linux/string.h:390,
from ./include/linux/bitmap.h:13,
from ./include/linux/cpumask.h:12,
from ./arch/x86/include/asm/apic.h:5,
from arch/x86/hyperv/hv_vtl.c:9:
arch/x86/hyperv/hv_vtl.c: In function 'hv_vtl_apicid_to_vp_id':
arch/x86/hyperv/hv_vtl.c:189:32: error: invalid application of 'sizeof' to incomplete type 'struct hv_get_vp_from_apic_id_in'
189 | memset(input, 0, sizeof(*input));
| ^
./include/linux/fortify-string.h:502:42: note: in definition of macro '__fortify_memset_chk'
502 | size_t __fortify_size = (size_t)(size); \
| ^~~~
arch/x86/hyperv/hv_vtl.c:189:9: note: in expansion of macro 'memset'
189 | memset(input, 0, sizeof(*input));
| ^~~~~~
arch/x86/hyperv/hv_vtl.c:190:14: error: invalid use of undefined type 'struct hv_get_vp_from_apic_id_in'
190 | input->partition_id = HV_PARTITION_ID_SELF;
| ^~
arch/x86/hyperv/hv_vtl.c:191:14: error: invalid use of undefined type 'struct hv_get_vp_from_apic_id_in'
191 | input->apic_ids[0] = apic_id;
| ^~
arch/x86/hyperv/hv_vtl.c:195:45: error: 'HVCALL_GET_VP_ID_FROM_APIC_ID' undeclared (first use in this function)
195 | control = HV_HYPERCALL_REP_COMP_1 | HVCALL_GET_VP_ID_FROM_APIC_ID;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
next prev parent reply other threads:[~2024-10-04 19:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 19:50 [PATCH 0/5] Add new headers for Hyper-V Dom0 Nuno Das Neves
2024-10-03 19:51 ` [PATCH 1/5] hyperv: Move hv_connection_id to hyperv-tlfs.h Nuno Das Neves
2024-10-07 16:24 ` Wei Liu
2024-10-03 19:51 ` [PATCH 2/5] hyperv: Remove unnecessary #includes Nuno Das Neves
2024-10-07 16:24 ` Wei Liu
2024-10-10 18:21 ` Michael Kelley
2024-10-31 18:47 ` Nuno Das Neves
2024-10-03 19:51 ` [PATCH 3/5] hyperv: Add new Hyper-V headers Nuno Das Neves
2024-10-10 18:21 ` Michael Kelley
2024-10-11 1:34 ` [EXTERNAL] " MUKESH RATHOR
2024-10-03 19:51 ` [PATCH 4/5] hyperv: Add hv_defs.h to conditionally include hyperv-tlfs.h or hvhdk.h Nuno Das Neves
2024-10-03 19:51 ` [PATCH 5/5] hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code Nuno Das Neves
2024-10-04 15:58 ` Stanislav Kinsburskii
2024-10-05 0:07 ` Nuno Das Neves
2024-10-04 19:11 ` Simon Horman [this message]
2024-10-04 23:36 ` Nuno Das Neves
2024-10-04 21:55 ` kernel test robot
2024-10-05 1:54 ` kernel test robot
2024-10-07 16:26 ` [PATCH 0/5] Add new headers for Hyper-V Dom0 Wei Liu
2024-10-10 18:21 ` Michael Kelley
2024-10-11 1:34 ` [EXTERNAL] " MUKESH RATHOR
2024-10-23 0:04 ` Nuno Das Neves
2024-10-23 18:39 ` Michael Kelley
2024-10-23 0:51 ` Nuno Das Neves
2024-10-23 18:32 ` Michael Kelley
2024-10-31 19:05 ` Easwar Hariharan
2024-10-31 22:59 ` Nuno Das Neves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241004191104.GI1310185@kernel.org \
--to=horms@kernel.org \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux.dev \
--cc=jinankjain@linux.microsoft.com \
--cc=joro@8bytes.org \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kw@linux.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=mukeshrathor@microsoft.com \
--cc=muminulrussell@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nunodasneves@linux.microsoft.com \
--cc=pabeni@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=seanjc@google.com \
--cc=sgarzare@redhat.com \
--cc=skinsburskii@linux.microsoft.com \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux.dev \
--cc=wei.liu@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.