[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v1 for-4.6 2/2] xen: prevent access to HPET from Dom0



On 18/12/14 18:27, Roger Pau Monne wrote:
> Prevent Dom0 from accessing HPET MMIO region by adding it to the list of
> denied memory regions.
>
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Apologies that this reply is split between patch 0 and 2 - I replied to
your cover letter before reading this patch.

Denying access is only valid if acpi_table_hpet.flags & 
ACPI_HPET_PAGE_PROTECT4 is true.

~Andrew

> ---
>  xen/arch/x86/domain_build.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index aa3bf0f..788f7db 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -36,6 +36,9 @@
>  #include <asm/bzimage.h> /* for bzimage_parse */
>  #include <asm/io_apic.h>
>  #include <asm/hap.h>
> +#ifdef CONFIG_HPET_TIMER
> +#include <asm/hpet.h> /* for hpet_address */
> +#endif
>  
>  #include <public/version.h>
>  
> @@ -1516,6 +1519,15 @@ int __init construct_dom0(
>              rc |= iomem_deny_access(d, sfn, efn);
>      }
>  
> +#ifdef CONFIG_HPET_TIMER
> +    /* Prevent access to HPET */
> +    if ( hpet_address != 0 )
> +    {
> +        mfn = paddr_to_pfn(hpet_address);
> +        rc |= iomem_deny_access(d, mfn, mfn);
> +    }
> +#endif
> +
>      BUG_ON(rc != 0);
>  
>      if ( elf_check_broken(&elf) )


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.