From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v4 RFC 1/6] x86/PCI: add config space write abstract intercept logic Date: Mon, 22 Jun 2015 15:31:47 -0400 Message-ID: <20150622193147.GC11441@l.oracle.com> References: <558839ED02000078000879FE@mail.emea.novell.com> <55883BD10200007800087A20@mail.emea.novell.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 1Z77Ri-0000m4-Qr for xen-devel@lists.xenproject.org; Mon, 22 Jun 2015 19:31:54 +0000 Content-Disposition: inline In-Reply-To: <55883BD10200007800087A20@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , Keir Fraser , Andrew Cooper List-Id: xen-devel@lists.xenproject.org > -static bool_t pci_cfg_ok(struct domain *currd, bool_t write, > - unsigned int start, unsigned int size) > +static bool_t pci_cfg_ok(struct domain *currd, unsigned int start, > + unsigned int size, uint32_t *write) > { > uint32_t machine_bdf; > > @@ -1804,8 +1804,12 @@ static bool_t pci_cfg_ok(struct domain * > start |= CF8_ADDR_HI(currd->arch.pci_cf8); > } > > - return !xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf, > - start, start + size - 1, write); > + if ( xsm_pci_config_permission(XSM_HOOK, currd, machine_bdf, > + start, start + size - 1, !!write) != 0 ) > + return 0; > + > + return !write || > + pci_conf_write_intercept(0, machine_bdf, start, size, write) >= 0; Won't the 'write' parameter cause an compiler error as it expects an pointer?