xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Pop <apop@bitdefender.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Tamas K Lengyel <tamas@tklengyel.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v2] x86/monitor: add support for descriptor access events
Date: Thu, 6 Apr 2017 12:37:42 +0300	[thread overview]
Message-ID: <20170406093742.GA27143@hel> (raw)
In-Reply-To: <58E62475020000780014DD41@prv-mh.provo.novell.com>

On Thu, Apr 06, 2017 at 03:20:21AM -0600, Jan Beulich wrote:
> >>> On 06.04.17 at 10:59, <apop@bitdefender.com> wrote:
> > On Wed, Apr 05, 2017 at 08:26:27AM -0600, Jan Beulich wrote:
> >> >>> On 04.04.17 at 11:57, <apop@bitdefender.com> wrote:
> >> > --- a/xen/arch/x86/hvm/hvm.c
> >> > +++ b/xen/arch/x86/hvm/hvm.c
> >> > @@ -3572,6 +3572,43 @@ gp_fault:
> >> >      return X86EMUL_EXCEPTION;
> >> >  }
> >> >  
> >> > +int hvm_descriptor_access_intercept(uint64_t exit_info,
> >> > +                                    uint64_t vmx_exit_qualification,
> >> > +                                    uint8_t descriptor, bool is_write)
> >> 
> >> Why uint8_t?
> > 
> > The descriptor type from struct vm_event_desc_access is uint8_t since
> > there are only 4 possible descriptors:
> > 
> >> > +#define VM_EVENT_DESC_IDTR           1
> >> > +#define VM_EVENT_DESC_GDTR           2
> >> > +#define VM_EVENT_DESC_LDTR           3
> >> > +#define VM_EVENT_DESC_TR             4
> > 
> > Should it be something else?
> 
> Well, you should avoid fixed width types where they're not really
> needed (their use should signal a true dependency on the specified
> width). "unsigned int" would be quite fine here afaict.

So should it be changed in the struct definition as well?

> >> > +struct vm_event_desc_access {
> >> > +    union {
> >> > +        struct {
> >> > +            uint32_t instr_info;         /* VMX: VMCS Instruction-Information */
> >> > +            uint32_t _pad1;
> >> > +            uint64_t exit_qualification; /* VMX: VMCS Exit Qualification */
> >> > +        } vmx;
> >> > +        struct {
> >> > +            uint64_t exitinfo;           /* SVM: VMCB EXITINFO */
> >> > +            uint64_t _pad2;
> >> > +        } svm;
> >> > +    } arch;
> >> > +    uint8_t descriptor;                  /* VM_EVENT_DESC_* */
> >> > +    uint8_t is_write;
> >> > +    uint8_t _pad[6];
> >> > +};

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-04-06  9:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04  9:57 [PATCH v2] x86/monitor: add support for descriptor access events Adrian Pop
2017-04-04 10:52 ` Razvan Cojocaru
2017-04-04 11:46   ` Adrian Pop
2017-04-04 13:23 ` Boris Ostrovsky
2017-04-04 13:45   ` Adrian Pop
2017-04-04 15:26 ` Andrew Cooper
2017-04-04 17:11   ` Adrian Pop
2017-04-05  7:13 ` Tian, Kevin
2017-04-05 14:26 ` Jan Beulich
2017-04-06  8:59   ` Adrian Pop
2017-04-06  9:20     ` Jan Beulich
2017-04-06  9:37       ` Adrian Pop [this message]
2017-04-06 14:09         ` Jan Beulich
2017-04-07 10:01           ` Adrian Pop

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=20170406093742.GA27143@hel \
    --to=apop@bitdefender.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).