From: "Jan Beulich" Subject: Re: [PATCH v3 3/3] xen: prevent access to HPET from Dom0 Date: Thu, 22 Jan 2015 15:47:46 +0000 Message-ID: <54C129B20200007800058557@mail.emea.novell.com> References: <1421939963-22182-1-git-send-email-roger.pau@citrix.com> <1421939963-22182-4-git-send-email-roger.pau@citrix.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 1YEJz2-0002O2-4r for xen-devel@lists.xenproject.org; Thu, 22 Jan 2015 15:47:48 +0000 In-Reply-To: <1421939963-22182-4-git-send-email-roger.pau@citrix.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: Roger Pau Monne Cc: Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 22.01.15 at 16:19, wrote: > --- a/xen/arch/x86/domain_build.c > +++ b/xen/arch/x86/domain_build.c > @@ -36,6 +36,7 @@ > #include /* for bzimage_parse */ > #include > #include > +#include /* for hpet_address */ Please drop the comment - with hpet_flags it's now stale > @@ -1495,6 +1499,16 @@ int __init construct_dom0( > rc |= iomem_deny_access(d, sfn, efn); > } > > + /* Prevent access to HPET */ > + if ( hpet_address != 0 ) > + { > + mfn = paddr_to_pfn(hpet_address); > + if ( hpet_flags & ACPI_HPET_PAGE_PROTECT4 ) The constant isn't a binary mask, you need to also use ACPI_HPET_PAGE_PROTECT_MASK. I further can't see why you wouldn't want to also handle ACPI_HPET_PAGE_PROTECT64. Jan