All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Stefan ISAILA <aisaila@bitdefender.com>
To: "boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
	"JBeulich@suse.com" <JBeulich@suse.com>
Cc: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"tamas@tklengyel.com" <tamas@tklengyel.com>,
	"rcojocaru@bitdefender.com" <rcojocaru@bitdefender.com>,
	"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v5] hvm/svm: Implement Debug events
Date: Fri, 23 Mar 2018 13:35:59 +0000	[thread overview]
Message-ID: <1521812166.9360.1.camel@bitdefender.com> (raw)
In-Reply-To: <5ab912d4-46ce-d6ab-08b3-25dfbc5908fd@oracle.com>

On Vi, 2018-03-23 at 09:35 -0400, Boris Ostrovsky wrote:
> On 03/23/2018 05:10 AM, Jan Beulich wrote:
> >
> > >
> > > >
> > > > >
> > > > > On 23.03.18 at 09:31, <aisaila@bitdefender.com> wrote:
> > > @@ -2656,9 +2663,28 @@ void svm_vmexit_handler(struct
> > > cpu_user_regs *regs)
> > >          HVMTRACE_0D(SMI);
> > >          break;
> > >
> > > +    case VMEXIT_ICEBP:
> > >      case VMEXIT_EXCEPTION_DB:
> > >          if ( !v->domain->debugger_attached )
> > > -            hvm_inject_hw_exception(TRAP_debug,
> > > X86_EVENT_NO_EC);
> > > +        {
> > > +            int rc;
> > > +            unsigned int trap_type = exit_reason == VMEXIT_ICEBP
> > > ?
> > > +                X86_EVENTTYPE_PRI_SW_EXCEPTION :
> > > X86_EVENTTYPE_HW_EXCEPTION;
> > > +
> > > +            inst_len = 0;
> > > +
> > > +            if ( trap_type == X86_EVENTTYPE_PRI_SW_EXCEPTION )
> > > +                inst_len = __get_instruction_length(v,
> > > INSTR_ICEBP);
> > It'll be the SVM maintainers to judge, but I think the code
> > structure
> > I've previously suggested would make things more clear:
> >
> >             if ( exit_reason != VMEXIT_ICEBP )
> >             {
> >                 trap_type == X86_EVENTTYPE_HW_EXCEPTION;
> >                 inst_len = 0;
> >             }
> >             else
> >             {
> >                 trap_type == X86_EVENTTYPE_PRI_SW_EXCEPTION;
> >                 inst_len = __get_instruction_length(v,
> > INSTR_ICEBP);
> >             }
> >
> > Perhaps even with likely() added.
> Yes, I also think this is easier to read.
>
> -boris
>
>
Ok, I will change it in the next version

~Alex

________________________
This email was scanned by Bitdefender
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

      reply	other threads:[~2018-03-23 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23  8:31 [PATCH v5] hvm/svm: Implement Debug events Alexandru Isaila
2018-03-23  9:10 ` Jan Beulich
2018-03-23 13:35   ` Boris Ostrovsky
2018-03-23 13:35     ` Alexandru Stefan ISAILA [this message]

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=1521812166.9360.1.camel@bitdefender.com \
    --to=aisaila@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.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 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.