From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
"tamas@tklengyel.com" <tamas@tklengyel.com>,
"jbeulich@suse.com" <jbeulich@suse.com>,
"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
"rcojocaru@bitdefender.com" <rcojocaru@bitdefender.com>
Subject: Re: [PATCH v1 2/4] hvm/svm: Enable Breakpoint events
Date: Fri, 2 Feb 2018 16:27:53 +0000 [thread overview]
Message-ID: <1517588873.4937.5.camel@bitdefender.com> (raw)
In-Reply-To: <28707422-6aad-3907-21da-1b0ce83e1f30@citrix.com>
On Vi, 2018-02-02 at 15:58 +0000, Andrew Cooper wrote:
> On 02/02/18 09:37, Alexandru Isaila wrote:
> >
> > This commit enables the breakpoint events for svm.
> >
> > Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> > ---
> > xen/arch/x86/hvm/svm/svm.c | 52
> > ++++++++++++++++++++++++++++++++++++-------
> > xen/include/asm-x86/monitor.h | 3 ++-
> > 2 files changed, 46 insertions(+), 9 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/svm/svm.c
> > b/xen/arch/x86/hvm/svm/svm.c
> > index dcbd550..14a5f60 100644
> > --- a/xen/arch/x86/hvm/svm/svm.c
> > +++ b/xen/arch/x86/hvm/svm/svm.c
> > @@ -59,6 +59,7 @@
> > #include <asm/hap.h>
> > #include <asm/apic.h>
> > #include <asm/debugger.h>
> > +#include <asm/hvm/monitor.h>
> > #include <asm/xstate.h>
> >
> > void svm_asm_do_resume(void);
> > @@ -1079,7 +1080,8 @@ static void svm_ctxt_switch_to(struct vcpu
> > *v)
> > static void noreturn svm_do_resume(struct vcpu *v)
> > {
> > struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
> > - bool_t debug_state = v->domain->debugger_attached;
> > + bool_t debug_state = v->domain->debugger_attached
> > + || v->domain-
> > >arch.monitor.software_breakpoint_enabled;
> As a minor note, please clean up bool_t => bool as you end up making
> changes.
Will do, must of passed it.
>
> >
> > bool_t vcpu_guestmode = 0;
> > struct vlapic *vlapic = vcpu_vlapic(v);
> >
> > @@ -2407,6 +2409,23 @@ static bool svm_get_pending_event(struct
> > vcpu *v, struct x86_event *info)
> > return true;
> > }
> >
> > +static void svm_propagate_intr(struct vcpu *v, unsigned long
> > insn_len)
> > +{
> > + struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
> > + struct x86_event event = {
> > + .vector = vmcb->eventinj.fields.type,
> > + .type = vmcb->eventinj.fields.type,
> > + .error_code = vmcb->exitinfo1,
> > + };
> > +
> > + if ( event.type >= X86_EVENTTYPE_SW_INTERRUPT )
> > + event.insn_len = insn_len;
> > + else
> > + event.insn_len = 0;
> IIRC, you need to always set insn_len. The length handling is vastly
> complicated (depends on event type and hardware availability, and in
> some cases needs emulating anyway), but the lower injection levels
> should DTRT.
>
> If they don't, can you provide a concrete example which doesn't work
> and
> we can see about what to do.
I've copied the functionality form vmx but I can remove the if
statement and always add the inst_len to the event.
Alex
________________________
This email was scanned by Bitdefender
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-02 16:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 9:37 [PATCH v1 0/4] hvm/svm: Enable vm events for SVM Alexandru Isaila
2018-02-02 9:37 ` [PATCH v1 1/4] asm-x86/monitor: Enable svm monitor events Alexandru Isaila
2018-02-02 15:38 ` Tamas K Lengyel
2018-02-02 9:37 ` [PATCH v1 2/4] hvm/svm: Enable Breakpoint events Alexandru Isaila
2018-02-02 15:42 ` Tamas K Lengyel
2018-02-05 9:52 ` Alexandru Stefan ISAILA
2018-02-02 15:58 ` Andrew Cooper
2018-02-02 16:27 ` Alexandru Stefan ISAILA [this message]
2018-02-02 9:37 ` [PATCH v1 3/4] hvm/svm: Enable MSR events Alexandru Isaila
2018-02-02 9:37 ` [PATCH v1 4/4] hvm/svm: Enable CR events Alexandru Isaila
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1517588873.4937.5.camel@bitdefender.com \
--to=aisaila@bitdefender.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jbeulich@suse.com \
--cc=rcojocaru@bitdefender.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tamas@tklengyel.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).