Re: [PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers
Hello, On 3/10/22 02:34, Juergen Gross wrote: Now that the hypercall handlers are all being called directly instead through a function vector, the "cf_check" attribute can be removed. Signed-off-by: Juergen Gross Tested-by: Téo Couprie Diaz I tested the latest patch series on Armv8 on the FVP and N1SDP platforms. Dom0 and guests are booting, no issues with networking between guests and dom0: everything looks good. Regards, Téo
Re: [PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers
On 17.03.2022 17:47, Jan Beulich wrote: > On 10.03.2022 08:34, Juergen Gross wrote: >> Now that the hypercall handlers are all being called directly instead >> through a function vector, the "cf_check" attribute can be removed. >> >> Signed-off-by: Juergen Gross >> --- >> V4: >> - new patch >> --- >> xen/arch/x86/compat.c | 6 +++--- >> xen/arch/x86/cpu/mcheck/mce.c | 2 +- >> xen/arch/x86/cpu/vpmu.c | 2 +- >> xen/arch/x86/domain.c | 3 +-- >> xen/arch/x86/hvm/dm.c | 2 +- >> xen/arch/x86/hvm/hvm.c | 2 +- >> xen/arch/x86/hvm/hypercall.c| 6 +++--- >> xen/arch/x86/mm.c | 12 ++-- >> xen/arch/x86/mm/paging.c| 2 +- >> xen/arch/x86/physdev.c | 2 +- >> xen/arch/x86/platform_hypercall.c | 2 +- >> xen/arch/x86/pv/callback.c | 16 >> xen/arch/x86/pv/descriptor-tables.c | 8 >> xen/arch/x86/pv/iret.c | 4 ++-- >> xen/arch/x86/pv/misc-hypercalls.c | 10 +- >> xen/arch/x86/pv/shim.c | 4 ++-- >> xen/arch/x86/x86_64/compat/mm.c | 2 +- >> xen/common/argo.c | 4 ++-- >> xen/common/compat/grant_table.c | 2 +- >> xen/common/compat/kernel.c | 2 +- >> xen/common/compat/memory.c | 3 +-- >> xen/common/dm.c | 2 +- >> xen/common/domain.c | 2 +- >> xen/common/domctl.c | 2 +- >> xen/common/event_channel.c | 2 +- >> xen/common/grant_table.c| 3 +-- >> xen/common/hypfs.c | 2 +- >> xen/common/kernel.c | 2 +- >> xen/common/kexec.c | 4 ++-- >> xen/common/memory.c | 2 +- >> xen/common/multicall.c | 3 +-- >> xen/common/sched/compat.c | 2 +- >> xen/common/sched/core.c | 4 ++-- >> xen/common/sysctl.c | 2 +- >> xen/common/xenoprof.c | 2 +- >> xen/drivers/char/console.c | 2 +- >> xen/scripts/gen_hypercall.awk | 2 +- >> xen/xsm/xsm_core.c | 4 ++-- >> 38 files changed, 67 insertions(+), 71 deletions(-) > > But that's only the definitions; for a reason I forget the annotations > are present also on the declarations (really the "also" applies the > other way around; perhaps it was that a future gcc will want to warn > about declaration and definition having gone out of sync). Actually wait, this was nonsense - the declarations are gone by this point, and the awk script adjustment is all that's needed. Acked-by: Jan Beulich Jan
Re: [PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers
On 17.03.22 17:47, Jan Beulich wrote: On 10.03.2022 08:34, Juergen Gross wrote: Now that the hypercall handlers are all being called directly instead through a function vector, the "cf_check" attribute can be removed. Signed-off-by: Juergen Gross --- V4: - new patch --- xen/arch/x86/compat.c | 6 +++--- xen/arch/x86/cpu/mcheck/mce.c | 2 +- xen/arch/x86/cpu/vpmu.c | 2 +- xen/arch/x86/domain.c | 3 +-- xen/arch/x86/hvm/dm.c | 2 +- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/hvm/hypercall.c| 6 +++--- xen/arch/x86/mm.c | 12 ++-- xen/arch/x86/mm/paging.c| 2 +- xen/arch/x86/physdev.c | 2 +- xen/arch/x86/platform_hypercall.c | 2 +- xen/arch/x86/pv/callback.c | 16 xen/arch/x86/pv/descriptor-tables.c | 8 xen/arch/x86/pv/iret.c | 4 ++-- xen/arch/x86/pv/misc-hypercalls.c | 10 +- xen/arch/x86/pv/shim.c | 4 ++-- xen/arch/x86/x86_64/compat/mm.c | 2 +- xen/common/argo.c | 4 ++-- xen/common/compat/grant_table.c | 2 +- xen/common/compat/kernel.c | 2 +- xen/common/compat/memory.c | 3 +-- xen/common/dm.c | 2 +- xen/common/domain.c | 2 +- xen/common/domctl.c | 2 +- xen/common/event_channel.c | 2 +- xen/common/grant_table.c| 3 +-- xen/common/hypfs.c | 2 +- xen/common/kernel.c | 2 +- xen/common/kexec.c | 4 ++-- xen/common/memory.c | 2 +- xen/common/multicall.c | 3 +-- xen/common/sched/compat.c | 2 +- xen/common/sched/core.c | 4 ++-- xen/common/sysctl.c | 2 +- xen/common/xenoprof.c | 2 +- xen/drivers/char/console.c | 2 +- xen/scripts/gen_hypercall.awk | 2 +- xen/xsm/xsm_core.c | 4 ++-- 38 files changed, 67 insertions(+), 71 deletions(-) But that's only the definitions; for a reason I forget the annotations are present also on the declarations (really the "also" applies the other way around; perhaps it was that a future gcc will want to warn about declaration and definition having gone out of sync). See the change of xen/scripts/gen_hypercall.awk which is taking care of that. Juergen OpenPGP_0xB0DE9DD628BF132F.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature
Re: [PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers
On 10.03.2022 08:34, Juergen Gross wrote: > Now that the hypercall handlers are all being called directly instead > through a function vector, the "cf_check" attribute can be removed. > > Signed-off-by: Juergen Gross > --- > V4: > - new patch > --- > xen/arch/x86/compat.c | 6 +++--- > xen/arch/x86/cpu/mcheck/mce.c | 2 +- > xen/arch/x86/cpu/vpmu.c | 2 +- > xen/arch/x86/domain.c | 3 +-- > xen/arch/x86/hvm/dm.c | 2 +- > xen/arch/x86/hvm/hvm.c | 2 +- > xen/arch/x86/hvm/hypercall.c| 6 +++--- > xen/arch/x86/mm.c | 12 ++-- > xen/arch/x86/mm/paging.c| 2 +- > xen/arch/x86/physdev.c | 2 +- > xen/arch/x86/platform_hypercall.c | 2 +- > xen/arch/x86/pv/callback.c | 16 > xen/arch/x86/pv/descriptor-tables.c | 8 > xen/arch/x86/pv/iret.c | 4 ++-- > xen/arch/x86/pv/misc-hypercalls.c | 10 +- > xen/arch/x86/pv/shim.c | 4 ++-- > xen/arch/x86/x86_64/compat/mm.c | 2 +- > xen/common/argo.c | 4 ++-- > xen/common/compat/grant_table.c | 2 +- > xen/common/compat/kernel.c | 2 +- > xen/common/compat/memory.c | 3 +-- > xen/common/dm.c | 2 +- > xen/common/domain.c | 2 +- > xen/common/domctl.c | 2 +- > xen/common/event_channel.c | 2 +- > xen/common/grant_table.c| 3 +-- > xen/common/hypfs.c | 2 +- > xen/common/kernel.c | 2 +- > xen/common/kexec.c | 4 ++-- > xen/common/memory.c | 2 +- > xen/common/multicall.c | 3 +-- > xen/common/sched/compat.c | 2 +- > xen/common/sched/core.c | 4 ++-- > xen/common/sysctl.c | 2 +- > xen/common/xenoprof.c | 2 +- > xen/drivers/char/console.c | 2 +- > xen/scripts/gen_hypercall.awk | 2 +- > xen/xsm/xsm_core.c | 4 ++-- > 38 files changed, 67 insertions(+), 71 deletions(-) But that's only the definitions; for a reason I forget the annotations are present also on the declarations (really the "also" applies the other way around; perhaps it was that a future gcc will want to warn about declaration and definition having gone out of sync). Jan
Re: [PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers
On 3/10/22 02:34, Juergen Gross wrote: > Now that the hypercall handlers are all being called directly instead > through a function vector, the "cf_check" attribute can be removed. > > Signed-off-by: Juergen Gross > --- > V4: > - new patch > --- > xen/arch/x86/compat.c | 6 +++--- > xen/arch/x86/cpu/mcheck/mce.c | 2 +- > xen/arch/x86/cpu/vpmu.c | 2 +- > xen/arch/x86/domain.c | 3 +-- > xen/arch/x86/hvm/dm.c | 2 +- > xen/arch/x86/hvm/hvm.c | 2 +- > xen/arch/x86/hvm/hypercall.c| 6 +++--- > xen/arch/x86/mm.c | 12 ++-- > xen/arch/x86/mm/paging.c| 2 +- > xen/arch/x86/physdev.c | 2 +- > xen/arch/x86/platform_hypercall.c | 2 +- > xen/arch/x86/pv/callback.c | 16 > xen/arch/x86/pv/descriptor-tables.c | 8 > xen/arch/x86/pv/iret.c | 4 ++-- > xen/arch/x86/pv/misc-hypercalls.c | 10 +- > xen/arch/x86/pv/shim.c | 4 ++-- > xen/arch/x86/x86_64/compat/mm.c | 2 +- > xen/common/argo.c | 4 ++-- > xen/common/compat/grant_table.c | 2 +- > xen/common/compat/kernel.c | 2 +- > xen/common/compat/memory.c | 3 +-- > xen/common/dm.c | 2 +- > xen/common/domain.c | 2 +- > xen/common/domctl.c | 2 +- > xen/common/event_channel.c | 2 +- > xen/common/grant_table.c| 3 +-- > xen/common/hypfs.c | 2 +- > xen/common/kernel.c | 2 +- > xen/common/kexec.c | 4 ++-- > xen/common/memory.c | 2 +- > xen/common/multicall.c | 3 +-- > xen/common/sched/compat.c | 2 +- > xen/common/sched/core.c | 4 ++-- > xen/common/sysctl.c | 2 +- > xen/common/xenoprof.c | 2 +- > xen/drivers/char/console.c | 2 +- > xen/scripts/gen_hypercall.awk | 2 +- > xen/xsm/xsm_core.c | 4 ++-- > 38 files changed, 67 insertions(+), 71 deletions(-) > > diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c > index 2286a502e3..eaa028109b 100644 > --- a/xen/xsm/xsm_core.c > +++ b/xen/xsm/xsm_core.c > @@ -219,13 +219,13 @@ bool __init has_xsm_magic(paddr_t start) > > #endif > > -long cf_check do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op) > +long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op) > { > return xsm_do_xsm_op(op); > } > > #ifdef CONFIG_COMPAT > -int cf_check compat_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op) > +int compat_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op) > { > return xsm_do_compat_op(op); > } Reviewed-by: Daniel P. Smith
[PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers
Now that the hypercall handlers are all being called directly instead through a function vector, the "cf_check" attribute can be removed. Signed-off-by: Juergen Gross --- V4: - new patch --- xen/arch/x86/compat.c | 6 +++--- xen/arch/x86/cpu/mcheck/mce.c | 2 +- xen/arch/x86/cpu/vpmu.c | 2 +- xen/arch/x86/domain.c | 3 +-- xen/arch/x86/hvm/dm.c | 2 +- xen/arch/x86/hvm/hvm.c | 2 +- xen/arch/x86/hvm/hypercall.c| 6 +++--- xen/arch/x86/mm.c | 12 ++-- xen/arch/x86/mm/paging.c| 2 +- xen/arch/x86/physdev.c | 2 +- xen/arch/x86/platform_hypercall.c | 2 +- xen/arch/x86/pv/callback.c | 16 xen/arch/x86/pv/descriptor-tables.c | 8 xen/arch/x86/pv/iret.c | 4 ++-- xen/arch/x86/pv/misc-hypercalls.c | 10 +- xen/arch/x86/pv/shim.c | 4 ++-- xen/arch/x86/x86_64/compat/mm.c | 2 +- xen/common/argo.c | 4 ++-- xen/common/compat/grant_table.c | 2 +- xen/common/compat/kernel.c | 2 +- xen/common/compat/memory.c | 3 +-- xen/common/dm.c | 2 +- xen/common/domain.c | 2 +- xen/common/domctl.c | 2 +- xen/common/event_channel.c | 2 +- xen/common/grant_table.c| 3 +-- xen/common/hypfs.c | 2 +- xen/common/kernel.c | 2 +- xen/common/kexec.c | 4 ++-- xen/common/memory.c | 2 +- xen/common/multicall.c | 3 +-- xen/common/sched/compat.c | 2 +- xen/common/sched/core.c | 4 ++-- xen/common/sysctl.c | 2 +- xen/common/xenoprof.c | 2 +- xen/drivers/char/console.c | 2 +- xen/scripts/gen_hypercall.awk | 2 +- xen/xsm/xsm_core.c | 4 ++-- 38 files changed, 67 insertions(+), 71 deletions(-) diff --git a/xen/arch/x86/compat.c b/xen/arch/x86/compat.c index 28281a262a..a031062830 100644 --- a/xen/arch/x86/compat.c +++ b/xen/arch/x86/compat.c @@ -15,7 +15,7 @@ typedef long ret_t; #endif /* Legacy hypercall (as of 0x00030202). */ -ret_t cf_check do_physdev_op_compat(XEN_GUEST_HANDLE_PARAM(physdev_op_t) uop) +ret_t do_physdev_op_compat(XEN_GUEST_HANDLE_PARAM(physdev_op_t) uop) { struct physdev_op op; @@ -28,7 +28,7 @@ ret_t cf_check do_physdev_op_compat(XEN_GUEST_HANDLE_PARAM(physdev_op_t) uop) #ifndef COMPAT /* Legacy hypercall (as of 0x00030101). */ -long cf_check do_sched_op_compat(int cmd, unsigned long arg) +long do_sched_op_compat(int cmd, unsigned long arg) { switch ( cmd ) { @@ -50,7 +50,7 @@ long cf_check do_sched_op_compat(int cmd, unsigned long arg) } /* Legacy hypercall (as of 0x00030202). */ -long cf_check do_event_channel_op_compat( +long do_event_channel_op_compat( XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop) { struct evtchn_op op; diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 275c54be7c..f68e31b643 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -1351,7 +1351,7 @@ CHECK_mcinfo_recovery; # endif /* CONFIG_COMPAT */ /* Machine Check Architecture Hypercall */ -long cf_check do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc) +long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc) { long ret = 0; struct xen_mc curop, *op = &curop; diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c index 51d171615f..d2c03a1104 100644 --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/x86/cpu/vpmu.c @@ -672,7 +672,7 @@ void vpmu_dump(struct vcpu *v) alternative_vcall(vpmu_ops.arch_vpmu_dump, v); } -long cf_check do_xenpmu_op( +long do_xenpmu_op( unsigned int op, XEN_GUEST_HANDLE_PARAM(xen_pmu_params_t) arg) { int ret; diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index d566fc82b4..ddf969f76e 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1489,8 +1489,7 @@ int arch_vcpu_reset(struct vcpu *v) return 0; } -long cf_check do_vcpu_op(int cmd, unsigned int vcpuid, - XEN_GUEST_HANDLE_PARAM(void) arg) +long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg) { long rc = 0; struct domain *d = current->domain; diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c index d80975efcf..f8e6089870 100644 --- a/xen/arch/x86/hvm/dm.c +++ b/xen/arch/x86/hvm/dm.c @@ -654,7 +654,7 @@ CHECK_dm_op_relocate_memory; CHECK_dm_op_pin_memory_cacheattr; CHECK_dm_op_nr_vcpus; -int cf_check compat_dm_op( +int compat_dm_op( domid_t domid, unsigned int nr_bufs, XEN_GUEST_HANDLE_PARAM(void) bufs) { struct dmop_args args; diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 709a4191ef..9b3973dad8 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5022,7 +5022,7 @@ s