All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mark Langsdorf" <mark.langsdorf@amd.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: dom0 and apicid not equal to cpuid
Date: Wed, 13 Feb 2008 16:52:01 -0600	[thread overview]
Message-ID: <200802131652.01613.mark.langsdorf@amd.com> (raw)
In-Reply-To: <C3D87132.1C623%Keir.Fraser@cl.cam.ac.uk>

On Wednesday 13 February 2008, Keir Fraser wrote:
> 
> On 12/2/08 19:09, "Langsdorf, Mark" <mark.langsdorf@amd.com> wrote:
> 
> >> It's fine not to change this case if you don't want to. It
> >> would probably logically belong in a separate patch anyway.
> > 
> > Is there an easy way to get Xen to pass the "cpufreq=dom0-kernel"
> > hypervisor argument onto to the Linux command line?  I can
> > add a separate parament to Linux easily enough, but I'd like it
> > if the end-user didn't need to add it twice.
> 
> I'm happy to fix this aspect myself when I check your patch in.

I'm not exactly sure if this is what you wanted or not, but it's
the minimum patch that resolves the issue on my system and it
should be the correct logic path.

Replace the hard coded values in the dom0_vcpus_pinned case with
with the correct logic to get Xen to do the right thing.

I'm happy to add a platform call if that's what you wanted instead.

-Mark Langsdorf
Operating System Research Center
AMD

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>


diff -r 08e85e79c65d arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c	Mon Feb 11 11:05:27 2008 +0000
+++ b/arch/x86_64/kernel/setup-xen.c	Wed Feb 13 16:39:58 2008 -0600
@@ -107,6 +107,9 @@ DEFINE_PER_CPU(int, nr_multicall_ents);
 /* Raw start-of-day parameters from the hypervisor. */
 start_info_t *xen_start_info;
 EXPORT_SYMBOL(xen_start_info);
+
+int dom0_vcpus_pinned;
+EXPORT_SYMBOL(dom0_vcpus_pinned);
 #endif
 
 /*
@@ -412,6 +415,9 @@ static __init void parse_cmdline_early (
 			skip_ioapic_setup = 0;
 			ioapic_force = 1;
 		}
+#else
+		if (fullarg(from, "cpufreq=dom0-kernel") || fullarg(from, "pin_dom0_vcpus"))
+			dom0_vcpus_pinned = 1;
 #endif
 			
 		if (!memcmp(from, "mem=", 4))
diff -r 08e85e79c65d drivers/xen/core/smpboot.c
--- a/drivers/xen/core/smpboot.c	Mon Feb 11 11:05:27 2008 +0000
+++ b/drivers/xen/core/smpboot.c	Wed Feb 13 16:39:58 2008 -0600
@@ -70,6 +70,8 @@ unsigned int maxcpus = NR_CPUS;
 unsigned int maxcpus = NR_CPUS;
 #endif
 
+extern int dom0_vcpus_pinned;
+
 void __init prefill_possible_map(void)
 {
 	int i, rc;
@@ -267,9 +269,13 @@ void __init smp_prepare_cpus(unsigned in
 	boot_cpu_data.apicid = 0;
 	cpu_data[0] = boot_cpu_data;
 
-	cpu_2_logical_apicid[0] = 0;
-	x86_cpu_to_apicid[0] = 0;
-
+	if (dom0_vcpus_pinned) {
+		cpu_2_logical_apicid[0] = 4;
+		x86_cpu_to_apicid[0] = 4;
+	} else {
+		cpu_2_logical_apicid[0] = 0;
+		x86_cpu_to_apicid[0] = 0;
+	}
 	current_thread_info()->cpu = 0;
 
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
@@ -315,8 +321,13 @@ void __init smp_prepare_cpus(unsigned in
 		cpu_data[cpu] = boot_cpu_data;
 		cpu_data[cpu].apicid = cpu;
 
-		cpu_2_logical_apicid[cpu] = cpu;
-		x86_cpu_to_apicid[cpu] = cpu;
+		if (dom0_vcpus_pinned) {
+			cpu_2_logical_apicid[cpu] = cpu + 4;
+			x86_cpu_to_apicid[cpu] = cpu + 4;
+		} else {
+			cpu_2_logical_apicid[cpu] = cpu;
+			x86_cpu_to_apicid[cpu] = cpu;
+		}
 
 		idle = fork_idle(cpu);
 		if (IS_ERR(idle))

  reply	other threads:[~2008-02-13 22:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 21:05 dom0 and apicid not equal to cpuid Langsdorf, Mark
2008-02-08 21:19 ` Keir Fraser
2008-02-08 21:22   ` Keir Fraser
2008-02-14 22:16     ` Mark Langsdorf
2008-02-14 22:22       ` Keir Fraser
2008-02-11 22:38   ` Langsdorf, Mark
2008-02-11 23:08     ` Keir Fraser
2008-02-12 10:29     ` Keir Fraser
2008-02-12 15:33       ` Langsdorf, Mark
2008-02-12 16:43         ` Keir Fraser
2008-02-12 19:09           ` Langsdorf, Mark
2008-02-13  9:23             ` Jan Beulich
2008-02-13 10:07               ` Keir Fraser
2008-02-13 10:04             ` Keir Fraser
2008-02-13 22:52               ` Mark Langsdorf [this message]
2008-02-14  8:26                 ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802131652.01613.mark.langsdorf@amd.com \
    --to=mark.langsdorf@amd.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.