From: "Jan Beulich" Subject: Re: [PATCH v4 RFC 1/6] x86/PCI: add config space write abstract intercept logic Date: Tue, 23 Jun 2015 13:55:09 +0100 Message-ID: <5589734D02000078000884DD@mail.emea.novell.com> References: <558839ED02000078000879FE@mail.emea.novell.com> <55883BD10200007800087A20@mail.emea.novell.com> <20150622193147.GC11441@l.oracle.com> <5589250D0200007800087EDB@mail.emea.novell.com> <0574A5C5-DC67-4C8B-982E-5D8CD75A5633@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z7NjL-0005hC-LR for xen-devel@lists.xenproject.org; Tue, 23 Jun 2015 12:55:11 +0000 In-Reply-To: <0574A5C5-DC67-4C8B-982E-5D8CD75A5633@oracle.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: Konrad Rzeszutek Wilk Cc: Andrew Cooper , Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 23.06.15 at 13:06, wrote: > On June 23, 2015 3:21:17 AM EDT, Jan Beulich wrote: >>>>> On 22.06.15 at 21:31, wrote: >>>> @@ -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? >> >>No, certainly not - !write means the same as write != NULL, but is >>(imo) easier to read. > > I meant the > > pci_conf_write_intercept(...,write). > > The prototype for the last parameter is for *uint32? But the write parameter is being changed to this very type in this patch. Jan