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: Tue, 23 Jun 2015 07:06:49 -0400 Message-ID: <0574A5C5-DC67-4C8B-982E-5D8CD75A5633@oracle.com> References: <558839ED02000078000879FE@mail.emea.novell.com> <55883BD10200007800087A20@mail.emea.novell.com> <20150622193147.GC11441@l.oracle.com> <5589250D0200007800087EDB@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 1Z7M2g-0005Wu-3G for xen-devel@lists.xenproject.org; Tue, 23 Jun 2015 11:07:02 +0000 In-Reply-To: <5589250D0200007800087EDB@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: Andrew Cooper , Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org 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? > >Jan