x86/mem_sharing: Fix build folloing VM Fork work
PATCH 1/1 x86/mem_sharing: Fix build folloing VM Fork work
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)
HVM_PARAM_STORE_PFN,
^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s 12f0c69f2709 "x86/HVM:
reduce hvm.h include dependencies".
---
CC: Tamas K Lengyel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
--- xen/arch/x86/mm/mem_sharing.c | 2 ++ 1 file changed, 2 insertions(+)
xen/arch/x86/mm/mem_sharing.c +2 -0
@@ -41,6 +41,8 @@#include <asm/hvm/hvm.h> #include <xsm/xsm.h> +#include <public/hvm/params.h> +#include "mm-locks.h" static shr_handle_t next_handle =1 ;
Signature · 1 line
2.11.0
Quoted 5 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)
Quoted 8 lines
HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>
So staging definitely compiles for me both with and without CONFIG_MEM_SHARING enabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.
Tamas
Quoted 11 lines · Tamas K Lengyel
Quoted 10 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".
Quoted 7 lines
Quoted 2 lines
Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>So staging definitely compiles for me both with and without
CONFIG_MEM_SHARINGenabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.
Exact config attached. I've just double checked that staging fails.
We should get to the bottom of exactly what is going on here, if it isn't the obvious thing.
~Andrew
#
# Automatically generated file; DO NOT EDIT.
# Xen/x86 4.14-unstable Configuration
#CONFIG_CC_IS_GCC=yCONFIG_GCC_VERSION=60300CONFIG_CLANG_VERSION=0 CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE=y CONFIG_X86_64=yCONFIG_X86=y CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" CONFIG_INDIRECT_THUNK=y
#
# Architecture Features
#CONFIG_NR_CPUS=256CONFIG_PV=yCONFIG_PV_LINEAR_PT=yCONFIG_HVM=yCONFIG_SHADOW_PAGING=y
# CONFIG_BIGMEM is not setCONFIG_HVM_FEP=yCONFIG_TBOOT=y
# CONFIG_XEN_ALIGN_DEFAULT is not setCONFIG_XEN_ALIGN_2M=yCONFIG_GUEST=yCONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=y
# CONFIG_PV_SHIM_EXCLUSIVE is not setCONFIG_HYPERV_GUEST=yCONFIG_MEM_SHARING=y
# end of Architecture Features
#
# Common Features
#CONFIG_COMPAT=yCONFIG_CORE_PARKING=yCONFIG_GRANT_TABLE=yCONFIG_HAS_ALTERNATIVE=yCONFIG_HAS_EX_TABLE=yCONFIG_HAS_FAST_MULTIPLY=yCONFIG_MEM_ACCESS_ALWAYS_ON=yCONFIG_MEM_ACCESS=yCONFIG_HAS_MEM_PAGING=yCONFIG_HAS_PDX=yCONFIG_HAS_UBSAN=yCONFIG_HAS_KEXEC=yCONFIG_HAS_IOPORTS=yCONFIG_HAS_SCHED_GRANULARITY=yCONFIG_NEEDS_LIBELF=y
#
# Speculative hardening
#CONFIG_SPECULATIVE_HARDEN_ARRAY=yCONFIG_SPECULATIVE_HARDEN_BRANCH=y
# end of Speculative hardening
CONFIG_KEXEC=y
# CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP is not setCONFIG_XENOPROF=yCONFIG_XSM=yCONFIG_XSM_FLASK=yCONFIG_XSM_FLASK_AVC_STATS=yCONFIG_XSM_FLASK_POLICY=yCONFIG_XSM_SILO=y
# CONFIG_XSM_DUMMY_DEFAULT is not set
# CONFIG_XSM_FLASK_DEFAULT is not setCONFIG_XSM_SILO_DEFAULT=y
# CONFIG_LATE_HWDOM is not setCONFIG_ARGO=y
#
# Schedulers
#CONFIG_SCHED_CREDIT=yCONFIG_SCHED_CREDIT2=yCONFIG_SCHED_RTDS=yCONFIG_SCHED_ARINC653=yCONFIG_SCHED_NULL=yCONFIG_SCHED_CREDIT_DEFAULT=y
# CONFIG_SCHED_CREDIT2_DEFAULT is not set
# CONFIG_SCHED_RTDS_DEFAULT is not set
# CONFIG_SCHED_ARINC653_DEFAULT is not set
# CONFIG_SCHED_NULL_DEFAULT is not setCONFIG_SCHED_DEFAULT="credit"
# end of Schedulers
CONFIG_CRYPTO=yCONFIG_LIVEPATCH=yCONFIG_FAST_SYMBOL_LOOKUP=yCONFIG_ENFORCE_UNIQUE_SYMBOLS=yCONFIG_CMDLINE=""CONFIG_DOM0_MEM=""CONFIG_TRACEBUFFER=y
# end of Common Features
#
# Device Drivers
#CONFIG_ACPI=yCONFIG_ACPI_LEGACY_TABLES_LOOKUP=yCONFIG_NUMA=yCONFIG_HAS_NS16550=yCONFIG_HAS_EHCI=yCONFIG_HAS_CPUFREQ=yCONFIG_HAS_PASSTHROUGH=yCONFIG_HAS_PCI=yCONFIG_VIDEO=yCONFIG_VGA=yCONFIG_HAS_VPCI=y
# end of Device Drivers
#
# Deprecated Functionality
#
# CONFIG_PV_LDT_PAGING is not set
# end of Deprecated Functionality
CONFIG_EXPERT="y"CONFIG_ARCH_SUPPORTS_INT128=y
#
# Debugging Options
#CONFIG_DEBUG=y
# CONFIG_CRASH_DEBUG is not setCONFIG_GDBSX=yCONFIG_DEBUG_INFO=yCONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_LOCK_PROFILE is not setCONFIG_DEBUG_LOCKS=y
# CONFIG_PERF_COUNTERS is not setCONFIG_VERBOSE_DEBUG=yCONFIG_SCRUB_DEBUG=y
# CONFIG_UBSAN is not set
# CONFIG_DEBUG_TRACE is not setCONFIG_XMEM_POOL_POISON=y
# end of Debugging Options
Quoted 21 lines · Andrew Cooper
Quoted 11 lines · Tamas K Lengyel
Quoted 10 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".Quoted 7 lines
Quoted 2 lines
Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>So staging definitely compiles for me both with and without
CONFIG_MEM_SHARINGenabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.
Quoted 4 lines
Exact config attached. I've just double checked that staging fails.
We should get to the bottom of exactly what is going on here, if it isn't the obvious thing.
Strange, with your config it does produce the error. With "echo CONFIG_MEM_SHARING=y > .config && XEN_CONFIG_EXPERT=y make olddefconfig && make" it does compile.
Tamas
Quoted 20 lines · Tamas K Lengyel
Quoted 19 lines · Andrew Cooper
Quoted 18 lines · Tamas K Lengyel
Quoted 4 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)Quoted 8 lines
HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>So staging definitely compiles for me both with and without
CONFIG_MEM_SHARINGenabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.
Quoted 7 lines
Quoted 4 lines
Exact config attached. I've just double checked that staging fails.
We should get to the bottom of exactly what is going on here, if it isn't the obvious thing.
Strange, with your config it does produce the error. With "echo
CONFIG_MEM_SHARING=y> .config && XEN_CONFIG_EXPERT=y make olddefconfig && make" it does compile.
You lose XEN_CONFIG_EXPERT=y in the second make, so it rewrites your .config behind your back. (This behaviour is totally obnoxious).
Diff the current config against original?
~Andrew
Quoted 24 lines · Andrew Cooper
Quoted 22 lines · Tamas K Lengyel
Quoted 21 lines · Andrew Cooper
Quoted 11 lines · Tamas K Lengyel
Quoted 10 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".Quoted 7 lines
Quoted 2 lines
Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>So staging definitely compiles for me both with and without
CONFIG_MEM_SHARINGenabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.Exact config attached. I've just double checked that staging fails.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
We should get to the bottom of exactly what is going on here, if it isn't the obvious thing.
Strange, with your config it does produce the error. With "echo
CONFIG_MEM_SHARING=y> .config && XEN_CONFIG_EXPERT=y make olddefconfig && make" it does compile.You lose XEN_CONFIG_EXPERT=y in the second make, so it rewrites your .config behind your back. (This behaviour is totally obnoxious).
I also compiled with export XEN_CONFIG_EXPERT=y and it compiles fine.
Quoted 1 line
Diff the current config against original?
drt@t0:~/workspace/xen/xen$ diff .config .config-debug 6c6 < CONFIG_GCC_VERSION=80300 ---
Quoted 1 line
CONFIG_GCC_VERSION=60300
25,28c25,32
< CONFIG_XEN_ALIGN_DEFAULT=y
< # CONFIG_XEN_ALIGN_2M is not set
< # CONFIG_XEN_GUEST is not set
< # CONFIG_HYPERV_GUEST is not set
---
Quoted 8 lines
#
CONFIG_XEN_ALIGN_DEFAULTis not setCONFIG_XEN_ALIGN_2M=yCONFIG_GUEST=yCONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=y
#CONFIG_PV_SHIM_EXCLUSIVEis not setCONFIG_HYPERV_GUEST=y
61,62c65,74
< # CONFIG_XSM is not set
< # CONFIG_ARGO is not set
---
Quoted 10 lines
CONFIG_XSM=yCONFIG_XSM_FLASK=yCONFIG_XSM_FLASK_AVC_STATS=yCONFIG_XSM_FLASK_POLICY=yCONFIG_XSM_SILO=y
#CONFIG_XSM_DUMMY_DEFAULTis not set
#CONFIG_XSM_FLASK_DEFAULTis not setCONFIG_XSM_SILO_DEFAULT=y
#CONFIG_LATE_HWDOMis not setCONFIG_ARGO=y
72,73c84,85
< # CONFIG_SCHED_CREDIT_DEFAULT is not set
< CONFIG_SCHED_CREDIT2_DEFAULT=y
---
Quoted 2 lines
CONFIG_SCHED_CREDIT_DEFAULT=y
#CONFIG_SCHED_CREDIT2_DEFAULTis not set
77c89
< CONFIG_SCHED_DEFAULT="credit2"
---
Quoted 1 line
CONFIG_SCHED_DEFAULT="credit"
Tamas
Quoted 31 lines · Tamas K Lengyel
Quoted 23 lines · Andrew Cooper
Quoted 22 lines · Tamas K Lengyel
Quoted 21 lines · Andrew Cooper
Quoted 11 lines · Tamas K Lengyel
Quoted 10 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".Quoted 7 lines
Quoted 2 lines
Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>So staging definitely compiles for me both with and without
CONFIG_MEM_SHARINGenabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.Exact config attached. I've just double checked that staging fails.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
We should get to the bottom of exactly what is going on here, if it isn't the obvious thing.
Strange, with your config it does produce the error. With "echo
CONFIG_MEM_SHARING=y> .config && XEN_CONFIG_EXPERT=y make olddefconfig && make" it does compile.You lose XEN_CONFIG_EXPERT=y in the second make, so it rewrites your .config behind your back. (This behaviour is totally obnoxious).
Quoted 8 lines
I also compiled with export XEN_CONFIG_EXPERT=y and it compiles fine.
Quoted 1 line
Diff the current config against original?
drt@t0:~/workspace/xen/xen$ diff .config .config-debug 6c6 < CONFIG_GCC_VERSION=80300 ---Quoted 1 line
CONFIG_GCC_VERSION=60300
;-(
I occasionally forget that diff defaults to unreadable.
Quoted 10 lines
Quoted 8 lines
#
CONFIG_XEN_ALIGN_DEFAULTis not setCONFIG_XEN_ALIGN_2M=yCONFIG_GUEST=yCONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=y
#CONFIG_PV_SHIM_EXCLUSIVEis not setCONFIG_HYPERV_GUEST=y61,62c65,74
< #CONFIG_XSMis not set
With XSM compiled out, xsm/dummy.h is used, and has to include public/hvm/params.h to get XEN_ALTP2M_* for xsm_hvm_altp2mhvm_op(), and this bleeds through into everything which includes xsm/xsm.h, which is basically everything.
Are you happy for me to fix up the commit message to this effect, replacing the previous guesswork?
~Andrew
Tamas K Lengyel
Acked-byQuoted 57 lines · Andrew Cooper
Quoted 31 lines · Tamas K Lengyel
Quoted 23 lines · Andrew Cooper
Quoted 22 lines · Tamas K Lengyel
Quoted 21 lines · Andrew Cooper
Quoted 11 lines · Tamas K Lengyel
Quoted 10 lines · Andrew Cooper
A default build fails with:
mem_sharing.c: In function ‘copy_special_pages’:
mem_sharing.c:1649:9: error: ‘HVM_PARAM_STORE_PFN’ undeclared (first use in this function)HVM_PARAM_STORE_PFN, ^~~~~~~~~~~~~~~~~~~I suspect this is a rebasing issue with respect to c/s
12f0c69f2709"x86/HVM:
reducehvm.hinclude dependencies".Quoted 7 lines
Quoted 2 lines
Fixes 41548c5472a "mem_sharing: VM forking"Signed-off-by Andrew Cooper <[email protected]>So staging definitely compiles for me both with and without
CONFIG_MEM_SHARINGenabled. By default its off, so this shouldn't even be compiled so I'm curious what's happening in your build. That said, I have no objection to the extra include if it turns out to be actually necessary.Exact config attached. I've just double checked that staging fails.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
We should get to the bottom of exactly what is going on here, if it isn't the obvious thing.
Strange, with your config it does produce the error. With "echo
CONFIG_MEM_SHARING=y> .config && XEN_CONFIG_EXPERT=y make olddefconfig && make" it does compile.You lose XEN_CONFIG_EXPERT=y in the second make, so it rewrites your .config behind your back. (This behaviour is totally obnoxious).
Quoted 8 lines
I also compiled with export XEN_CONFIG_EXPERT=y and it compiles fine.
Quoted 1 line
Diff the current config against original?
drt@t0:~/workspace/xen/xen$ diff .config .config-debug 6c6 < CONFIG_GCC_VERSION=80300 ---Quoted 1 line
CONFIG_GCC_VERSION=60300;-(
I occasionally forget that
diffdefaults to unreadable.Quoted 10 lines
Quoted 8 lines
#
CONFIG_XEN_ALIGN_DEFAULTis not setCONFIG_XEN_ALIGN_2M=yCONFIG_GUEST=yCONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=y
#CONFIG_PV_SHIM_EXCLUSIVEis not setCONFIG_HYPERV_GUEST=y61,62c65,74
< #CONFIG_XSMis not set
Quoted 7 lines
With XSM compiled out,
xsm/dummy.his used, and has to includepublic/hvm/params.hto get XEN_ALTP2M_* forxsm_hvm_altp2mhvm_op(), and this bleeds through into everything which includesxsm/xsm.h, which is basically everything.Are you happy for me to fix up the commit message to this effect, replacing the previous guesswork?
Of course. Thanks for deciphering this.