From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v4 RFC 1/6] x86/PCI: add config space write abstract intercept logic Date: Tue, 23 Jun 2015 08:21:17 +0100 Message-ID: <5589250D0200007800087EDB@mail.emea.novell.com> References: <558839ED02000078000879FE@mail.emea.novell.com> <55883BD10200007800087A20@mail.emea.novell.com> <20150622193147.GC11441@l.oracle.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 1Z7IWG-0000Ld-ES for xen-devel@lists.xenproject.org; Tue, 23 Jun 2015 07:21:20 +0000 In-Reply-To: <20150622193147.GC11441@l.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 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. Jan