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

Re: [Xen-devel] [RFC PATCH V2 8/8] x86/hvm: factor out vm_event related functions into separate file



>>> On 18.01.15 at 16:18, <tamas.lengyel@xxxxxxxxxxxx> wrote:
> +static int hvm_event_traps(long parameters, vm_event_request_t *req)
> +{
> +    int rc;
> +    struct vcpu *v = current;
> +    struct domain *d = v->domain;

Unless the intention is to have an exact 1:1 copy of the original,
please use curr and currd here respectively.

> +void hvm_event_cr0(unsigned long value, unsigned long old)
> +{
> +    vm_event_request_t req = {
> +        .reason = VM_EVENT_REASON_CR0,
> +        .vcpu_id = current->vcpu_id,
> +        .cr_event.new_value = value,
> +        .cr_event.old_value = old
> +    };
> +
> +    long parameters = current->domain->arch.hvm_domain
> +                        .params[HVM_PARAM_MEMORY_EVENT_CR0];

And latch current into a local variable curr here and below.

> +void hvm_event_msr(unsigned long msr, unsigned long value)
> +{
> +    vm_event_request_t req = {
> +        .reason = VM_EVENT_REASON_MSR,
> +        .vcpu_id = current->vcpu_id,
> +        .msr_event.msr = msr,
> +        .msr_event.new_value = value,
> +    };

The .msr_event sub-structure also has an old_value member - how
come this doesn't get filled (I realize the old code was this way,
but I now doubt earlier patches are all correct in the regard).

Jan


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


 


Rackspace

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