Skip to contentSkip to conversation

Xen support for i386/core and i386/core2?

PATCH New Markus Armbruster 2 participants 5 messages Nov 15, 2006 – Nov 16, 2006

lore
Share & tools
lore
#0 lore raw

Xen's oprofile code is derived from Linux. Linux's version knows core, Xen's doesn't.

Linux code (arch/i386/oprofile/nmi_int.c):

static int __init ppro_init(char ** cpu_type)

{
	__u8 cpu_model = boot_cpu_data.x86_model;

	if (cpu_model == 14)
		*cpu_type = "i386/core";
	else if (cpu_model == 15)
		*cpu_type = "i386/core_2";
	else if (cpu_model > 0xd)
		return 0;
	else if (cpu_model == 9) {
		*cpu_type = "i386/p6_mobile";
	} else if (cpu_model > 5) {
		*cpu_type = "i386/piii";
	} else if (cpu_model > 2) {
		*cpu_type = "i386/pii";
	} else {
		*cpu_type = "i386/ppro";
	}

	model = &op_ppro_spec;
	return 1;
}

Current Xen code:

static int __init ppro_init(char *cpu_type)

{
	__u8 cpu_model = current_cpu_data.x86_model;

	if (cpu_model > 0xd) {
		printk("xenoprof: Initialization failed. "
		       "Intel processor model %d for P6 class family is not "
		       "supported\n", cpu_model);
		return 0;
	}

	if (cpu_model == 9) {
		strncpy (cpu_type, "i386/p6_mobile", XENOPROF_CPU_TYPE_SIZE - 1);
	} else if (cpu_model > 5) {
		strncpy (cpu_type, "i386/piii", XENOPROF_CPU_TYPE_SIZE - 1);
	} else if (cpu_model > 2) {
		strncpy (cpu_type, "i386/pii", XENOPROF_CPU_TYPE_SIZE - 1);
	} else {
		strncpy (cpu_type, "i386/ppro", XENOPROF_CPU_TYPE_SIZE - 1);
	}

	model = &op_ppro_spec;
	return 1;
}

Andrew Theurer posted a patch back in October[*], which makes the Xen code match the Linux code. What happened to it?

[*] http://lists.xensource.com/archives/html/xen-devel/2006-10/msg00032.html

#1 lore raw
Quoted 2 lines · Markus Armbruster

Andrew Theurer posted a patch back in October[*], which makes the Xen code match the Linux code. What happened to it?

I guess it got dropped on the floor.

-- Keir

#2 lore raw
Quoted 6 lines · Keir Fraser
Quoted 2 lines · Markus Armbruster

Andrew Theurer posted a patch back in October[*], which makes the Xen code match the Linux code. What happened to it?

I guess it got dropped on the floor.

Mind to pick it up?

#3 lore raw
Quoted 8 lines · Markus Armbruster
Quoted 6 lines · Markus Armbruster
Quoted 3 lines

Andrew Theurer posted a patch back in October[*], which makes the Xen code match the Linux code. What happened to it?

I guess it got dropped on the floor.

Mind to pick it up?

Repost it and I'll put it on my to-apply list.

-- Keir

#4 lore raw

PATCH 1/1 Xenoprof: Support Intel CORE microarchitecture (was Re: Xen support for i386/core and i386/core2?)

Repost of Andrew Theurer's patch
http://lists.xensource.com/archives/html/xen-devel/2006-10/msg00032.html

Message-ID: <[email protected]>
Date: Mon, 02 Oct 2006 11:12:50 -0500
From: Andrew Theurer <[email protected]>
To: [email protected]

This adds support for core and core2 chips. Tested on Woodcrest processors. Requires Oprofile 0.9.2.

-Andrew

diff -Naurp xen-unstable.hg-11684/xen/arch/x86/oprofile/nmi_int.c xen-unstable.hg-11684-oprofile/xen/arch/x86/oprofile/nmi_int.c
--- xen-unstable.hg-11684/xen/arch/x86/oprofile/nmi_int.c 2006-10-02
10:55:35.000000000 -0500
+++ xen-unstable.hg-11684-oprofile/xen/arch/x86/oprofile/nmi_int.c

2006-10-02 10:58:35.000000000 -0500
@@ -305,22 +305,24 @@ static int __init ppro_init(char *cpu_ty
 {
        __u8 cpu_model = current_cpu_data.x86_model;

- if (cpu_model > 0xd) {

+       if (cpu_model > 15) {
                printk("xenoprof: Initialization failed. "
                       "Intel processor model %d for P6 class family is not "
                       "supported\n", cpu_model);
                return 0;
        }

-
- if (cpu_model == 9) {
+ else if (cpu_model == 15)
+ strncpy (cpu_type, "i386/core_2", XENOPROF_CPU_TYPE_SIZE - 1);
+ else if (cpu_model == 14)
+ strncpy (cpu_type, "i386/core", XENOPROF_CPU_TYPE_SIZE - 1);
+ else if (cpu_model == 9)

                strncpy (cpu_type, "i386/p6_mobile", XENOPROF_CPU_TYPE_SIZE - 
1);
-       } else if (cpu_model > 5) {
+       else if (cpu_model > 5)
                strncpy (cpu_type, "i386/piii", XENOPROF_CPU_TYPE_SIZE - 1);
-       } else if (cpu_model > 2) {
+       else if (cpu_model > 2)
                strncpy (cpu_type, "i386/pii", XENOPROF_CPU_TYPE_SIZE - 1);
-       } else {
+       else
                strncpy (cpu_type, "i386/ppro", XENOPROF_CPU_TYPE_SIZE - 1);

- }

        model = &op_ppro_spec;
        return 1;