* how to set VM into debug mode ? what are xmx_entry_helper for?
@ 2013-05-10 6:09 yandong han
0 siblings, 0 replies; only message in thread
From: yandong han @ 2013-05-10 6:09 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 2106 bytes --]
hi,all
I have three problems,anyone can solve them or one of them or give me some
clue? thank you
(1) first, I want to know what job xmx_entry_helper does?
(2) second , whether every VMENTRY will call xmx_entry_helper ?if not,
which function will VMENTRY call everytime?
(3)my target is setting VM into debug mode by set Trag_flag, the code
below called vmx_properly_set_trap_flag,
and I add it at the end of vmx_vmexit_handler(). but it does not work.
inline void vmx_properly_set_trap_flag(struct vcpu *v)
1301 {
1302 /* we are currently stepping, so we need to set the trap flag
1303 * on the next instruction
1304 */
1305 unsigned long int_state = __vmread(GUEST_INTERRUPTIBILITY_INFO);
1306 unsigned long activity_state = __vmread(GUEST_ACTIVITY_STATE);
1307
1308 unsigned long intercepts = __vmread(EXCEPTION_BITMAP);
1309 unsigned long mask = (1UL << TRAP_debug );
1310
1311 unsigned long flags = __vmread(GUEST_RFLAGS);
1312 unsigned long flags_mask = (X86_EFLAGS_TF);
1313
1314 /* make sure the exception bitmap says to vmexit on
1315 * debug exceptions
1316 */
1317 intercepts |= mask;
1318 __vmwrite(EXCEPTION_BITMAP, intercepts);
1319
1320 /* Default to setting trap flag to on */
1321 flags |= flags_mask;
1322
1323 if((activity_state == 1))
1324 {
1325
1326 /* this means we're in HLT mode. Disabling is OK since
1327 ** we will get an NMI to get out of HLT.
1328 ** The NMI will cause a VMExit which will reset TF
1329 ** execution
1330 **/
1331 printk("Turning off SS due to HLT\n");
1332 //flags &= ~(flags_mask);
1333 }
1334
1335 if((int_state & 3) )
1336 {
1337 int_state &= ~(3);
1338 printk("init_state is 3\n");
1339 //__vmwrite(GUEST_INTERRUPTIBILITY_INFO, int_state);
1340 }
1342 /* setting TF due to stepping enabled;*/
1343 __vmwrite(GUEST_RFLAGS, flags);
1344
1345 }
thank you , hope for your help
--
----------------------------------------------------------
regards,
yandong
[-- Attachment #1.2: Type: text/html, Size: 3088 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] only message in thread
only message in thread, other threads:[~2013-05-10 6:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-10 6:09 how to set VM into debug mode ? what are xmx_entry_helper for? yandong han
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.