All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Paul Durrant <paul.durrant@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 03/15] x86/emul: Rename hvm_trap to x86_event and move it into the emulation infrastructure
Date: Thu, 24 Nov 2016 06:56:23 -0700	[thread overview]
Message-ID: <5836FF970200007800121B7E@prv-mh.provo.novell.com> (raw)
In-Reply-To: <1479915538-15282-4-git-send-email-andrew.cooper3@citrix.com>

>>> On 23.11.16 at 16:38, <andrew.cooper3@citrix.com> wrote:
> --- a/xen/arch/x86/x86_emulate/x86_emulate.h
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.h
> @@ -67,6 +67,28 @@ enum x86_swint_emulation {
>      x86_swint_emulate_all,  /* Help needed with all software events */
>  };
>  
> +/*
> + * x86 event types. This enumeration is valid for:
> + *  Intel VMX: {VM_ENTRY,VM_EXIT,IDT_VECTORING}_INTR_INFO[10:8]
> + *  AMD SVM: eventinj[10:8] and exitintinfo[10:8] (types 0-4 only)
> + */
> +enum x86_event_type {
> +    X86_EVENTTYPE_EXT_INTR,         /* External interrupt */
> +    X86_EVENTTYPE_NMI = 2,          /* NMI */
> +    X86_EVENTTYPE_HW_EXCEPTION,     /* Hardware exception */
> +    X86_EVENTTYPE_SW_INTERRUPT,     /* Software interrupt (CD nn) */
> +    X86_EVENTTYPE_PRI_SW_EXCEPTION, /* ICEBP (F1) */
> +    X86_EVENTTYPE_SW_EXCEPTION,     /* INT3 (CC), INTO (CE) */
> +};
> +
> +struct x86_event {
> +    int16_t       vector;
> +    uint8_t       type;         /* X86_EVENTTYPE_* */

Do we perhaps want to make the compiler warn about possibly
incomplete switch statements, but making this an 8-bit field of
type enum x86_event_type? (That would perhaps imply making
vector and insn_len bitfields too; see also below.)

> +    uint8_t       insn_len;     /* Instruction length */
> +    uint32_t      error_code;   /* HVM_DELIVER_NO_ERROR_CODE if n/a */
> +    unsigned long cr2;          /* Only for TRAP_page_fault h/w exception */
> +};

Also I have to admit I'm not really happy about the mixing of fixed
width and fundamental types. Can I talk you into using only the
latter?

> --- a/xen/include/asm-x86/hvm/vmx/vvmx.h
> +++ b/xen/include/asm-x86/hvm/vmx/vvmx.h
> @@ -112,8 +112,8 @@ void nvmx_vcpu_destroy(struct vcpu *v);
>  int nvmx_vcpu_reset(struct vcpu *v);
>  uint64_t nvmx_vcpu_eptp_base(struct vcpu *v);
>  enum hvm_intblk nvmx_intr_blocked(struct vcpu *v);
> -bool_t nvmx_intercepts_exception(struct vcpu *v, unsigned int trap,
> -                                 int error_code);
> +bool_t nvmx_intercepts_exception(
> +    struct vcpu *v, unsigned int vector, int error_code);

This reformatting doesn't appear to be in line with other nearby
code. But iirc you've got an ack from the VMX side already...

Anyway, with or without the comments addressed,
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


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

  parent reply	other threads:[~2016-11-24 13:56 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 15:38 [PATCH for-4.9 00/15] XSA-191 followup Andrew Cooper
2016-11-23 15:38 ` [PATCH 01/15] x86/hvm: Rename hvm_emulate_init() and hvm_emulate_prepare() for clarity Andrew Cooper
2016-11-23 15:49   ` Paul Durrant
2016-11-23 15:53   ` Wei Liu
2016-11-23 16:40   ` Jan Beulich
2016-11-23 16:41   ` Boris Ostrovsky
2016-11-23 16:41     ` Andrew Cooper
2016-11-24  6:16   ` Tian, Kevin
2016-11-23 15:38 ` [PATCH 02/15] x86/emul: Simplfy emulation state setup Andrew Cooper
2016-11-23 15:58   ` Paul Durrant
2016-11-23 16:01     ` Andrew Cooper
2016-11-23 16:03       ` Paul Durrant
2016-11-23 16:07   ` Tim Deegan
2016-11-24 13:44   ` Jan Beulich
2016-11-24 13:59     ` Andrew Cooper
2016-11-24 14:18       ` Jan Beulich
2016-11-23 15:38 ` [PATCH 03/15] x86/emul: Rename hvm_trap to x86_event and move it into the emulation infrastructure Andrew Cooper
2016-11-23 16:12   ` Paul Durrant
2016-11-23 16:22     ` Andrew Cooper
2016-11-23 16:59   ` Boris Ostrovsky
2016-11-24  6:17   ` Tian, Kevin
2016-11-24 13:56   ` Jan Beulich [this message]
2016-11-24 14:42     ` Andrew Cooper
2016-11-24 14:57       ` Jan Beulich
2016-11-23 15:38 ` [PATCH 04/15] x86/emul: Rename HVM_DELIVER_NO_ERROR_CODE to X86_EVENT_NO_EC Andrew Cooper
2016-11-23 16:20   ` Paul Durrant
2016-11-23 17:05   ` Boris Ostrovsky
2016-11-24  6:18   ` Tian, Kevin
2016-11-24 14:18   ` Jan Beulich
2016-11-23 15:38 ` [PATCH 05/15] x86/emul: Remove opencoded exception generation Andrew Cooper
2016-11-24 14:31   ` Jan Beulich
2016-11-24 16:24     ` Andrew Cooper
2016-11-24 16:31       ` Jan Beulich
2016-11-24 17:04         ` Andrew Cooper
2016-11-23 15:38 ` [PATCH 06/15] x86/emul: Rework emulator event injection Andrew Cooper
2016-11-23 16:19   ` Tim Deegan
2016-11-23 16:33     ` Jan Beulich
2016-11-23 16:43       ` Tim Deegan
2016-11-23 16:38     ` Andrew Cooper
2016-11-23 17:56   ` Boris Ostrovsky
2016-11-24  6:20   ` Tian, Kevin
2016-11-24 14:53   ` Jan Beulich
2016-11-24 17:00     ` Andrew Cooper
2016-11-24 17:08       ` Jan Beulich
2016-11-24 17:19         ` Andrew Cooper
2016-11-24 17:30           ` Tim Deegan
2016-11-24 17:37             ` Andrew Cooper
2016-11-25  7:25               ` Jan Beulich
2016-11-25  9:41                 ` Tim Deegan
2016-11-25  7:42           ` Jan Beulich
2016-11-23 15:38 ` [PATCH 07/15] x86/vmx: Use hvm_{get, set}_segment_register() rather than vmx_{get, set}_segment_register() Andrew Cooper
2016-11-24  6:20   ` Tian, Kevin
2016-11-23 15:38 ` [PATCH 08/15] x86/hvm: Reposition the modification of raw segment data from the VMCB/VMCS Andrew Cooper
2016-11-23 19:01   ` Boris Ostrovsky
2016-11-23 19:28     ` Andrew Cooper
2016-11-23 19:41       ` Boris Ostrovsky
2016-11-23 19:58         ` Andrew Cooper
2016-11-24  6:24   ` Tian, Kevin
2016-11-24 15:25   ` Jan Beulich
2016-11-24 17:22     ` Andrew Cooper
2016-11-25  7:45       ` Jan Beulich
2016-11-23 15:38 ` [PATCH 09/15] x86/emul: Avoid raising faults behind the emulators back Andrew Cooper
2016-11-23 16:31   ` Tim Deegan
2016-11-23 16:40     ` Andrew Cooper
2016-11-23 16:50       ` Tim Deegan
2016-11-23 16:58         ` Andrew Cooper
2016-11-24 10:43           ` Jan Beulich
2016-11-24 10:46             ` Andrew Cooper
2016-11-24 11:24               ` Jan Beulich
2016-11-23 15:38 ` [PATCH 10/15] x86/hvm: Extend the hvm_copy_*() API with a pagefault_info pointer Andrew Cooper
2016-11-23 16:32   ` Tim Deegan
2016-11-23 16:36   ` Paul Durrant
2016-11-24  6:25   ` Tian, Kevin
2016-11-23 15:38 ` [PATCH 11/15] x86/hvm: Reimplement hvm_copy_*_nofault() in terms of no pagefault_info Andrew Cooper
2016-11-23 16:35   ` Tim Deegan
2016-11-23 16:38     ` Andrew Cooper
2016-11-23 16:40     ` Tim Deegan
2016-11-23 15:38 ` [PATCH 12/15] x86/hvm: Rename hvm_copy_*_guest_virt() to hvm_copy_*_guest_linear() Andrew Cooper
2016-11-23 16:35   ` Tim Deegan
2016-11-24  6:26   ` Tian, Kevin
2016-11-24 15:41   ` Jan Beulich
2016-11-23 15:38 ` [PATCH 13/15] x86/hvm: Avoid __hvm_copy() raising #PF behind the emulators back Andrew Cooper
2016-11-23 16:18   ` Andrew Cooper
2016-11-23 16:39   ` Tim Deegan
2016-11-23 17:06     ` Andrew Cooper
2016-11-23 15:38 ` [PATCH 14/15] x86/hvm: Prepare to allow use of system segments for memory references Andrew Cooper
2016-11-23 16:42   ` Paul Durrant
2016-11-24 15:48   ` Jan Beulich
2016-11-23 15:38 ` [PATCH 15/15] x86/hvm: Use system-segment relative memory accesses Andrew Cooper
2016-11-24 16:01   ` Jan Beulich
2016-11-24 16:03     ` Andrew Cooper

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=5836FF970200007800121B7E@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=paul.durrant@citrix.com \
    --cc=suravee.suthikulpanit@amd.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.