From: "Jan Beulich" Subject: Re: [PATCH v6 08/16] x86/hvm: unify stdvga mmio intercept with standard mmio intercept Date: Wed, 08 Jul 2015 17:17:16 +0100 Message-ID: <559D692C020000780008E62F@mail.emea.novell.com> References: <1435940733-20856-1-git-send-email-paul.durrant@citrix.com> <1435940733-20856-9-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZCs29-0005Qb-V5 for xen-devel@lists.xenproject.org; Wed, 08 Jul 2015 16:17:18 +0000 In-Reply-To: <1435940733-20856-9-git-send-email-paul.durrant@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: xen-devel@lists.xenproject.org, Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 03.07.15 at 18:25, 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 = ¤t->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