[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for 4.9 4/6] x86/svm: Introduce svm_emul_swint_injection()



>>> On 31.03.17 at 21:50, <andrew.cooper3@xxxxxxxxxx> wrote:
> +static void svm_emul_swint_injection(struct x86_event *event)
> +{
> +    struct vcpu *curr = current;
> +    struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
> +    struct cpu_user_regs *regs = guest_cpu_user_regs();

All three look like they can be const.

> +
> +    unsigned int trap = event->vector, type = event->type;

Stray blank line in the middle of declarations.

> +    unsigned int fault = TRAP_gp_fault, ec = 0;
> +
> +    if ( vmcb->_cr0 & X86_CR0_PE ) /* TODO: support real-mode injection? */

vmcb_get_cr0() (also for EFER and CPL below).

> +    {
> +        pagefault_info_t pf;
> +        struct segment_register idtr;
> +        unsigned int idte_size, idte_offset;
> +        unsigned long idte_linear_addr;
> +        struct { uint32_t a, b, c, d; } idte = {};
> +        bool lm = vmcb->_efer & EFER_LMA;
> +        enum hvm_segmentation_mode seg_mode =
> +            lm ? hvm_seg_mode_long : hvm_seg_mode_prot;

This open coding is, I think, another hint that the helper function in
the other patch would perhaps better be dropped.

Jan


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.