* How do I print all hypercalls as they come in?
@ 2015-02-05 21:16 D'Mita Levy
2015-02-05 21:20 ` Andrew Cooper
0 siblings, 1 reply; 6+ messages in thread
From: D'Mita Levy @ 2015-02-05 21:16 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 578 bytes --]
Hello,
I am trying to compile a xen build that will simply print all the
hypercalls as they come into the hypervisor. Specifically, I'm looking for
the hypercall handler function so that I can insert a simple printk
statement. I'm having trouble because I can't find a doc that describes
what most of the modules found in xen/arch/x86 and x86_64 do...am I right
in thinking that the do_platform_op function in platform_hypercall.c serves
as the entry point for all hypercalls?
Thank You,
--
D'Mita Levy
Cyber Fellow, Applied Research Center
Florida International University
[-- Attachment #1.2: Type: text/html, Size: 798 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How do I print all hypercalls as they come in?
2015-02-05 21:16 How do I print all hypercalls as they come in? D'Mita Levy
@ 2015-02-05 21:20 ` Andrew Cooper
2015-02-06 15:17 ` D'Mita Levy
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2015-02-05 21:20 UTC (permalink / raw)
To: D'Mita Levy, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 845 bytes --]
On 05/02/15 21:16, D'Mita Levy wrote:
> Hello,
>
> I am trying to compile a xen build that will simply print all the
> hypercalls as they come into the hypervisor. Specifically, I'm looking
> for the hypercall handler function so that I can insert a simple
> printk statement.
The logging rate will easily overwhelm your serial connection. What is
the actual piece of information you are after?
> I'm having trouble because I can't find a doc that describes what most
> of the modules found in xen/arch/x86 and x86_64 do...am I right in
> thinking that the do_platform_op function in platform_hypercall.c
> serves as the entry point for all hypercalls?
do_platform_op() is the handler for __HYPERCALL_platform_op which is one
single hypercall.
The actual hypercall root handler is the 'hypercall' symbol in
arch/x86/x86_64/entry.S
~Andrew
[-- Attachment #1.2: Type: text/html, Size: 1737 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How do I print all hypercalls as they come in?
2015-02-05 21:20 ` Andrew Cooper
@ 2015-02-06 15:17 ` D'Mita Levy
2015-02-06 15:23 ` Andrew Cooper
0 siblings, 1 reply; 6+ messages in thread
From: D'Mita Levy @ 2015-02-06 15:17 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1295 bytes --]
Andrew,
Thanks for your help. I am trying to log the following hypercalls to dmesg
as they come in:
-HYPERVISOR_grant_table_op()
- HYPERVISOR_mmu_update()
- HYPERVISOR_set_trap_table()
Are there single handlers for these as well?
Thanks,
On Thu, Feb 5, 2015 at 4:20 PM, Andrew Cooper <andrew.cooper3@citrix.com>
wrote:
> On 05/02/15 21:16, D'Mita Levy wrote:
>
> Hello,
>
> I am trying to compile a xen build that will simply print all the
> hypercalls as they come into the hypervisor. Specifically, I'm looking for
> the hypercall handler function so that I can insert a simple printk
> statement.
>
>
> The logging rate will easily overwhelm your serial connection. What is
> the actual piece of information you are after?
>
> I'm having trouble because I can't find a doc that describes what most
> of the modules found in xen/arch/x86 and x86_64 do...am I right in thinking
> that the do_platform_op function in platform_hypercall.c serves as the
> entry point for all hypercalls?
>
>
> do_platform_op() is the handler for __HYPERCALL_platform_op which is one
> single hypercall.
>
> The actual hypercall root handler is the 'hypercall' symbol in
> arch/x86/x86_64/entry.S
>
> ~Andrew
>
--
D'Mita Levy
Cyber Fellow, Applied Research Center
Florida International University
[-- Attachment #1.2: Type: text/html, Size: 2842 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How do I print all hypercalls as they come in?
2015-02-06 15:17 ` D'Mita Levy
@ 2015-02-06 15:23 ` Andrew Cooper
2015-02-12 18:19 ` D'Mita Levy
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2015-02-06 15:23 UTC (permalink / raw)
To: D'Mita Levy; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 428 bytes --]
On 06/02/15 15:17, D'Mita Levy wrote:
> Andrew,
>
> Thanks for your help. I am trying to log the following hypercalls to
> dmesg as they come in:
>
> -HYPERVISOR_grant_table_op()
>
> - HYPERVISOR_mmu_update()
>
> - HYPERVISOR_set_trap_table()
>
> Are there single handlers for these as well?
>
The hypercall_table in arch/x86/x86_64/entry.S is the function pointer
dispatch table, and is indexed by hypercall number.
~Andrew
[-- Attachment #1.2: Type: text/html, Size: 1517 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How do I print all hypercalls as they come in?
2015-02-06 15:23 ` Andrew Cooper
@ 2015-02-12 18:19 ` D'Mita Levy
2015-02-12 18:35 ` Andrew Cooper
0 siblings, 1 reply; 6+ messages in thread
From: D'Mita Levy @ 2015-02-12 18:19 UTC (permalink / raw)
To: Andrew Cooper; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1687 bytes --]
Andrew,
My apologies if my logic is flawed or what I am describing is convoluted -
I am a student doing research into Xen and trying my best to grasp what is
going on, also my ASM is subpar. I have read a paper on system call
interception (
https://hal.inria.fr/inria-00431031/PDF/Technical_Report_Syscall_Interception.pdf
) - page 10 describes disabling fast system calls by commenting out some
code in the do_set_trap_table() function and logging the calls along with
other guest info. My concern is that this may be a dated methodology as the
paper was written in 2009 but also that this will only work for x86 and not
x86_64 systems; including possible loss of performance since fast calls
tend to run better on x86 series processor systems. My goal is to identify
when a guest makes a hypercall requesting HYPERVISOR_......grant_table_op(),
mmu_update(), set_trap_table(), essentially I would love to be able to
say...if trapcode = xxx printk("Hypercall xxx\n") has occurred but I am
unsure what would be a good route to do something like that.
Thanks,
D'Mita
On Fri, Feb 6, 2015 at 10:23 AM, Andrew Cooper <andrew.cooper3@citrix.com>
wrote:
> On 06/02/15 15:17, D'Mita Levy wrote:
>
> Andrew,
>
> Thanks for your help. I am trying to log the following hypercalls to
> dmesg as they come in:
>
> -HYPERVISOR_grant_table_op()
>
> - HYPERVISOR_mmu_update()
>
> - HYPERVISOR_set_trap_table()
>
> Are there single handlers for these as well?
>
>
> The hypercall_table in arch/x86/x86_64/entry.S is the function pointer
> dispatch table, and is indexed by hypercall number.
>
> ~Andrew
>
--
D'Mita Levy
Cyber Fellow, Applied Research Center
Florida International University
[-- Attachment #1.2: Type: text/html, Size: 3504 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How do I print all hypercalls as they come in?
2015-02-12 18:19 ` D'Mita Levy
@ 2015-02-12 18:35 ` Andrew Cooper
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2015-02-12 18:35 UTC (permalink / raw)
To: D'Mita Levy; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1771 bytes --]
Please do not top post.
On 12/02/15 18:19, D'Mita Levy wrote:
> Andrew,
>
> My apologies if my logic is flawed or what I am describing is
> convoluted - I am a student doing research into Xen and trying my best
> to grasp what is going on, also my ASM is subpar. I have read a paper
> on system call interception (
> https://hal.inria.fr/inria-00431031/PDF/Technical_Report_Syscall_Interception.pdf
> ) - page 10 describes disabling fast system calls by commenting out
> some code in the do_set_trap_table() function and logging the calls
> along with other guest info. My concern is that this may be a dated
> methodology as the paper was written in 2009 but also that this will
> only work for x86 and not x86_64 systems; including possible loss of
> performance since fast calls tend to run better on x86 series
> processor systems. My goal is to identify when a guest makes a
> hypercall requesting HYPERVISOR_......grant_table_op(), mmu_update(),
> set_trap_table(), essentially I would love to be able to say...if
> trapcode = xxx printk("Hypercall xxx\n") has occurred but I am unsure
> what would be a good route to do something like that.
For something written in 2009, that has aged surprisingly well, given
that it refers to exact snippets of code. It will however fail to catch
any system call made using sysenter or syscall.
However, intercepting system calls in a PV guest is completely different
to intercepting hypercalls, and the described method will not help you
in this case.
My original point still stands. You cannot put a printk in hypercall
handlers such as mmu_update and grant_table_op. Xen will be completely
crippled under the spew of all the logging.
Have you considered using xentrace?
~Andrew
[-- Attachment #1.2: Type: text/html, Size: 2774 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-02-12 18:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 21:16 How do I print all hypercalls as they come in? D'Mita Levy
2015-02-05 21:20 ` Andrew Cooper
2015-02-06 15:17 ` D'Mita Levy
2015-02-06 15:23 ` Andrew Cooper
2015-02-12 18:19 ` D'Mita Levy
2015-02-12 18:35 ` Andrew Cooper
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.