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

Re: [Xen-devel] [PATCH V4] xen/vm_event: Clean up control-register-write vm_events



> diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c
> index 9d5f9f3..310f0e8 100644
> --- a/xen/arch/x86/hvm/event.c
> +++ b/xen/arch/x86/hvm/event.c
> @@ -88,55 +88,29 @@ static int hvm_event_traps(uint8_t sync, 
> vm_event_request_t *req)
>      return 1;
>  }
>  
> -static inline
> -void hvm_event_cr(uint32_t reason, unsigned long value,
> -                         unsigned long old, bool_t onchangeonly, bool_t sync)
> +void hvm_event_cr(unsigned int index, unsigned long value, unsigned long old)
>  {
> -    if ( onchangeonly && value == old )
> +    struct arch_domain *currad = &current->domain->arch;
> +    unsigned int ctrlreg_bitmask = monitor_ctrlreg_bitmask(index);
> +
> +    if ( !(currad->monitor.write_ctrlreg_enabled & ctrlreg_bitmask) )
>          return;
> -    else
> +
> +    if ( !(currad->monitor.write_ctrlreg_onchangeonly & ctrlreg_bitmask) ||
> +         value != old )
>      {
>          vm_event_request_t req = {
> -            .reason = reason,
> +            .reason = VM_EVENT_REASON_WRITE_CTRLREG,
>              .vcpu_id = current->vcpu_id,
> -            .u.mov_to_cr.new_value = value,
> -            .u.mov_to_cr.old_value = old
> +            .u.write_ctrlreg.index = index,
> +            .u.write_ctrlreg.new_value = value,
> +            .u.write_ctrlreg.old_value = old
>          };
>  
> -        hvm_event_traps(sync, &req);
> +        hvm_event_traps(currad->monitor.write_ctrlreg_sync & index, &req);

Sorry, I've missed a required change here, the last line should now read
"currad->monitor.write_ctrlreg_sync & ctrlreg_bitmask", of course. I'll
fix this in V5, as well as address other remarks made on this patch.


Thanks,
Razvan

_______________________________________________
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®.