WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 05/16] xen mtrr: Add mtrr_ops support for Xen mtr

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 05/16] xen mtrr: Add mtrr_ops support for Xen mtrr
From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Date: Tue, 2 Jun 2009 17:36:21 +0200 (CEST)
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stephen Tweedie <sct@xxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>
Delivery-date: Thu, 04 Jun 2009 02:32:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1242163718-2934-6-git-send-email-jeremy@xxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1242163718-2934-1-git-send-email-jeremy@xxxxxxxx> <1242163718-2934-6-git-send-email-jeremy@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Tue, 12 May 2009, Jeremy Fitzhardinge wrote:
>       if (cpu_has_mtrr) {
>               mtrr_if = &generic_mtrr_ops;
> +#ifdef CONFIG_XEN_DOM0
> +             xen_init_mtrr();
> +#endif
> +

  No #ifdefs please. Also isn't there some common place where Xen can
  do all of it's magic extra init ?

  Aside of that this patch needs to be split into two. One adding the
  num_var_ranges op and one adding the Xen bits.

> +#include <xen/interface/platform.h>
> +#include <asm/xen/hypervisor.h>
> +#include <asm/xen/hypercall.h>
> +
> +static int __init xen_num_var_ranges(void);

  Can we move the function here please ?

> +/* DOM0 TODO: Need to fill in the remaining mtrr methods to have full
> + * working userland mtrr support. */
> +static struct mtrr_ops xen_mtrr_ops = {
> +     .vendor            = X86_VENDOR_UNKNOWN,
> +     .get_free_region   = generic_get_free_region,
> +     .have_wrcomb       = positive_have_wrcomb,
> +     .use_intel_if      = 0,
> +     .num_var_ranges    = xen_num_var_ranges,
> +};
> +
> +static int __init xen_num_var_ranges(void)
> +{
> +     int ranges;
> +     struct xen_platform_op op;
> +
> +     for (ranges = 0; ; ranges++) {
> +             op.cmd = XENPF_read_memtype;

  Is op.cmd changed in the hypervisor call ?

> +             op.u.read_memtype.reg = ranges;
> +             if (HYPERVISOR_dom0_op(&op) != 0)
> +                     break;
> +     }
> +     return ranges;
> +}
> +
> +void __init xen_init_mtrr(void)
> +{
> +     struct cpuinfo_x86 *c = &boot_cpu_data;
> +
> +     if (!xen_initial_domain())
> +             return;
> +
> +     if ((!cpu_has(c, X86_FEATURE_MTRR)) &&

  cpu_has_mtrr ..... please 

> +         (!cpu_has(c, X86_FEATURE_K6_MTRR)) &&
> +         (!cpu_has(c, X86_FEATURE_CYRIX_ARR)) &&
> +         (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))
> +             return;

Thanks,

        tglx

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>