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

Re: [Xen-devel] [PATCH v6 08/16] x86/hvm: unify stdvga mmio intercept with standard mmio intercept



>>> On 03.07.15 at 18:25, <paul.durrant@xxxxxxxxxx> wrote:
> -int stdvga_intercept_mmio(ioreq_t *p)
> +static bool_t stdvga_mem_accept(const struct hvm_io_handler *handler,
> +                                const ioreq_t *p)
>  {
> -    struct domain *d = current->domain;
> -    struct hvm_hw_stdvga *s = &d->arch.hvm_domain.stdvga;
> -    uint64_t start, end, count = p->count, size = p->size;
> -    int buf = 0, rc;
> -
> -    if ( p->df )
> -    {
> -        start = (p->addr - (count - 1) * size);
> -        end = p->addr + size;
> -    }
> -    else
> -    {
> -        start = p->addr;
> -        end = p->addr + count * size;
> -    }
> -
> -    if ( (start < VGA_MEM_BASE) || (end > (VGA_MEM_BASE + VGA_MEM_SIZE)) )
> -        return X86EMUL_UNHANDLEABLE;
> -
> -    if ( p->size > 8 )
> -    {
> -        gdprintk(XENLOG_WARNING, "invalid mmio size %d\n", (int)p->size);
> -        return X86EMUL_UNHANDLEABLE;
> -    }
> +    struct hvm_hw_stdvga *s = &current->domain->arch.hvm_domain.stdvga;
>  
>      spin_lock(&s->lock);
>  
> -    if ( s->stdvga && s->cache )
> +    if ( !s->stdvga ||
> +         (p->addr < VGA_MEM_BASE) ||
> +         ((p->addr + p->size) > (VGA_MEM_BASE + VGA_MEM_SIZE)) )
> +        goto reject;

I came here just to check whether you make use of the earlier
added hvm_mmio_{first,last}_byte(), but found that you're ignoring
p->df now altogether. That can't be right?

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