From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?windows-1252?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH v3 3/3] xen: prevent access to HPET from Dom0 Date: Fri, 23 Jan 2015 12:46:43 +0100 Message-ID: <54C234A3.1020506@citrix.com> References: <1421939963-22182-1-git-send-email-roger.pau@citrix.com> <1421939963-22182-4-git-send-email-roger.pau@citrix.com> <54C129B20200007800058557@mail.emea.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 1YEchn-0004qY-Pb for xen-devel@lists.xenproject.org; Fri, 23 Jan 2015 11:47:15 +0000 In-Reply-To: <54C129B20200007800058557@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 , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org El 22/01/15 a les 16.47, Jan Beulich ha escrit: >>>> 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. Right, for PAGE_PROTECT64 we can also block access to the adjacent 15 pages. Roger.