From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 12/21] xen/passthrough: iommu: Split generic IOMMU code Date: Wed, 23 Apr 2014 13:42:33 +0100 Message-ID: <5357B539.7040607@linaro.org> References: <1398172475-27873-1-git-send-email-julien.grall@linaro.org> <1398172475-27873-13-git-send-email-julien.grall@linaro.org> <53568F58020000780000ADBF@nat28.tlf.novell.com> <53568380.7060400@linaro.org> <5356B60F020000780000AFA9@nat28.tlf.novell.com> <53569CB4.4010601@linaro.org> <5356BBF7020000780000AFEF@nat28.tlf.novell.com> <5356AEA0.1030104@linaro.org> <53579947020000780000B30F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WcwVZ-0008RH-9f for xen-devel@lists.xenproject.org; Wed, 23 Apr 2014 12:42:37 +0000 Received: by mail-ee0-f53.google.com with SMTP id b57so740514eek.12 for ; Wed, 23 Apr 2014 05:42:35 -0700 (PDT) In-Reply-To: <53579947020000780000B30F@nat28.tlf.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@lists.xenproject.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, Xiantao Zhang , tim@xen.org List-Id: xen-devel@lists.xenproject.org On 04/23/2014 09:43 AM, Jan Beulich wrote: >>>> On 22.04.14 at 20:02, wrote: >> On 04/22/2014 05:59 PM, Jan Beulich wrote: >>>>>> On 22.04.14 at 18:45, wrote: >>>> On 04/22/2014 05:33 PM, Jan Beulich wrote: >>>>>>>> On 22.04.14 at 16:58, wrote: >>>>>>>> +void __hwdom_init arch_iommu_check_hwdom_reqs(struct domain *d) >>>>>>>> +{ >>>>>>>> + if ( !iommu_enabled ) >>>>>>>> + panic("Presently, iommu must be enabled for pvh dom0\n"); >>>>>>>> +} >>>>>>> >>>>>>> Message text (containing PVH) and function name (not containing >>>>>>> PVH) don't fit together, nor does the conditional really establish a >>>>>>> connection. >>>>>> >>>>>> Do you prefer a comment, or an explicit check to is_pvh_domain(d)? >>>>> >>>>> That depends on where it would go: If the caller checks for PVH, then >>>>> the function name should change. If the caller doesn't, then I don't >>>>> see how you'd avoid getting here for non-PVH. >>>> >>>> The caller will go there when the DOM0 is auto-translated (i.e PVH as >>>> dom0 can't be an HVM). >>>> >>>> I can remove PVH from the log, but for the user it's not accurate. >>> >>> In which case the function name should reflect this. >> >> What about arch_iommu_check_autotranslate_hwdom_reqs? > > Getting quite long, but seems okay. Perhaps drop the _reqs? Sounds good to me. I will drop it for the next version. Regards, -- Julien Grall