lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120703174410.GC24259@phenom.dumpdata.com>
Date:	Tue, 3 Jul 2012 13:44:10 -0400
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	Ian Campbell <Ian.Campbell@...rix.com>
Cc:	"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH 2/4] xen/perf: Define .glob for the different
 hypercalls.

On Tue, Jul 03, 2012 at 05:17:04PM +0100, Ian Campbell wrote:
> On Tue, 2012-07-03 at 16:40 +0100, Konrad Rzeszutek Wilk wrote:
> > This allows us in perf to have this:
> > 
> >  99.67%  [kernel]             [k] xen_hypercall_sched_op
> >   0.11%  [kernel]             [k] xen_hypercall_xen_version
> > 
> > instead of the borring ever-encompassing:
> > 
> >  99.13%  [kernel]              [k] hypercall_page
> > 
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
> 
> I don't suppose it would be possible to automate this somehow would it?
> Perhaps a small perl snippet consuming the output of 
>         grep ^\#define.__HYPERVISOR_ include/xen/interface/xen.h
> ?

Another way would be to do:

define NEXT_HYPERCALL(name) \
ENTRY(xen_hypercall_#name) \
.skip 32

And then
NEXT_HYPERCALL(set_trap_table);
NEXT_HYPERCALL(mmu_update);

.. and so on. And also use the .balign PAGE_SIZE at the end to pad it.


With the grep thingy I think we would also hit the large space between hypercall
#38 and #48 - which has no calls.

> 
> > ---
> >  arch/x86/xen/xen-head.S |  102 ++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 files changed, 100 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
> > index aaa7291..f6ba51d 100644
> > --- a/arch/x86/xen/xen-head.S
> > +++ b/arch/x86/xen/xen-head.S
> > @@ -28,9 +28,107 @@ ENTRY(startup_xen)
> >  	__FINIT
> >  
> >  .pushsection .text
> > -	.align PAGE_SIZE
> > +	.balign PAGE_SIZE
> >  ENTRY(hypercall_page)
> > -	.skip PAGE_SIZE
> > +ENTRY(xen_hypercall_set_trap_table)
> > +	.skip 32
> > +ENTRY(xen_hypercall_mmu_update)
> > +	.skip 32
> > +ENTRY(xen_hypercall_set_gdt)
> > +	.skip 32
> > +ENTRY(xen_hypercall_stack_switch)
> > +	.skip 32
> > +ENTRY(xen_hypercall_set_callbacks)
> > +	.skip 32
> > +ENTRY(xen_hypercall_fpu_taskswitch)
> > +	.skip 32
> > +ENTRY(xen_hypercall_sched_op_compat)
> > +	.skip 32
> > +ENTRY(xen_hypercall_platform_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_set_debugreg)
> > +	.skip 32
> > +ENTRY(xen_hypercall_get_debugreg)
> > +	.skip 32
> > +ENTRY(xen_hypercall_update_descriptor)
> > +	.skip 32
> > +ENTRY(xen_hypercall_ni)
> > +	.skip 32
> > +ENTRY(xen_hypercall_memory_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_multicall)
> > +	.skip 32
> > +ENTRY(xen_hypercall_update_va_mapping)
> > +	.skip 32
> > +ENTRY(xen_hypercall_set_timer_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_event_channel_op_compat)
> > +	.skip 32
> > +ENTRY(xen_hypercall_xen_version)
> > +	.skip 32
> > +ENTRY(xen_hypercall_console_io)
> > +	.skip 32
> > +ENTRY(xen_hypercall_physdev_op_compat)
> > +	.skip 32
> > +ENTRY(xen_hypercall_grant_table_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_vm_assist)
> > +	.skip 32
> > +ENTRY(xen_hypercall_update_va_mapping_otherdomain)
> > +	.skip 32
> > +ENTRY(xen_hypercall_iret)
> > +	.skip 32
> > +ENTRY(xen_hypercall_vcpu_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_set_segment_base)
> > +	.skip 32
> > +ENTRY(xen_hypercall_mmuext_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_xsm_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_nmi_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_sched_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_callback_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_xenoprof_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_event_channel_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_physdev_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_hvm_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_sysctl)
> > +	.skip 32
> > +ENTRY(xen_hypercall_domctl)
> > +	.skip 32
> > +ENTRY(xen_hypercall_kexec_op)
> > +	.skip 32
> > +ENTRY(xen_hypercall_tmem_op) /* 38 */
> > +	.skip 32
> > +ENTRY(xen_hypercall_rsvr)
> > +	.skip 320
> > +ENTRY(xen_hypercall_mca) /* 48 */
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_1)
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_2)
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_3)
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_4)
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_5)
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_6)
> > +	.skip 32
> > +ENTRY(xen_hypercall_arch_7)
> > +	.skip 32
> > +ENTRY(xen_hypercall_other)
> > +	.skip 2272
> > +
> >  .popsection
> >  
> >  	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ