Re: [thisops uV3 14/18] lguest: Use this_cpu_ops

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rusty Russell
Date: Monday, December 6, 2010 - 12:46 am

On Wed, 1 Dec 2010 05:37:21 am Christoph Lameter wrote:

This doesn't even compile :(

I've applied it, and applied the following fixes, too:

lguest: compile fixes

arch/x86/lguest/boot.c: In function ‘lguest_init_IRQ’:
arch/x86/lguest/boot.c:824: error: macro "__this_cpu_write" requires 2 arguments, but only 1 given
arch/x86/lguest/boot.c:824: error: ‘__this_cpu_write’ undeclared (first use in this function)
arch/x86/lguest/boot.c:824: error: (Each undeclared identifier is reported only once
arch/x86/lguest/boot.c:824: error: for each function it appears in.)

drivers/lguest/x86/core.c: In function ‘copy_in_guest_info’:
drivers/lguest/x86/core.c:94: error: lvalue required as left operand of assignment

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -821,7 +821,7 @@ static void __init lguest_init_IRQ(void)
 
 	for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
 		/* Some systems map "vectors" to interrupts weirdly.  Not us! */
-		__this_cpu_write(vector_irq[i]) = i - FIRST_EXTERNAL_VECTOR;
+		__this_cpu_write(vector_irq[i], i - FIRST_EXTERNAL_VECTOR);
 		if (i != SYSCALL_VECTOR)
 			set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]);
 	}
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -91,7 +91,7 @@ static void copy_in_guest_info(struct lg
 	 * Guest has changed.
 	 */
 	if (__this_cpu_read(lg_last_cpu) != cpu || cpu->last_pages != pages) {
-		__this_cpu_read(lg_last_cpu) = cpu;
+		__this_cpu_write(lg_last_cpu, cpu);
 		cpu->last_pages = pages;
 		cpu->changed = CHANGED_ALL;
 	}
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[thisops uV3 00/18] Upgrade of this_cpu_ops V3, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 01/18] percpucounter: Optimize __percpu_count ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 02/18] vmstat: Optimize zone counter modifica ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 03/18] percpu: Generic support for this_cpu_a ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 04/18] x86: Support for this_cpu_add,sub,dec, ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 05/18] x86: Use this_cpu_inc_return for nmi c ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 06/18] vmstat: Use this_cpu_inc_return for vm ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 07/18] highmem: Use this_cpu_xx_return() oper ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 08/18] Taskstats: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 09/18] fs: Use this_cpu_xx operations in buffer.c, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 10/18] x86: Use this_cpu_ops to optimize code, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 11/18] x86: Use this_cpu_ops for current_cpu_ ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 12/18] Core: Replace __get_cpu_var with __thi ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 13/18] drivers: Replace __get_cpu_var with __ ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 14/18] lguest: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 15/18] Xen: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 16/18] kprobes: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 17/18] Connector: Use this_cpu operations, Christoph Lameter, (Tue Nov 30, 12:07 pm)
[thisops uV3 18/18] Fakekey: Simplify speakup_fake_key_pre ..., Christoph Lameter, (Tue Nov 30, 12:07 pm)
Re: [thisops uV3 07/18] highmem: Use this_cpu_xx_return() ..., Christoph Lameter, (Tue Nov 30, 12:26 pm)
Re: [thisops uV3 07/18] highmem: Use this_cpu_xx_return() ..., Christoph Lameter, (Tue Nov 30, 12:53 pm)
[extra] timers: Use this_cpu_read, Christoph Lameter, (Tue Nov 30, 1:05 pm)
Re: [thisops uV3 15/18] Xen: Use this_cpu_ops, Jeremy Fitzhardinge, (Tue Nov 30, 1:53 pm)
Re: [thisops uV3 15/18] Xen: Use this_cpu_ops, Christoph Lameter, (Tue Nov 30, 2:03 pm)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Michael Holzheu, (Wed Dec 1, 11:06 am)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Christoph Lameter, (Wed Dec 1, 11:13 am)
Re: [thisops uV3 14/18] lguest: Use this_cpu_ops, Rusty Russell, (Mon Dec 6, 12:46 am)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Balbir Singh, (Mon Dec 6, 7:32 am)
Re: [thisops uV3 14/18] lguest: Use this_cpu_ops, Christoph Lameter, (Mon Dec 6, 8:54 am)
Re: [thisops uV3 08/18] Taskstats: Use this_cpu_ops, Christoph Lameter, (Tue Dec 7, 7:39 am)
[tip:timers/core] timers: Use this_cpu_read, tip-bot for Christop ..., (Sun Dec 12, 10:41 am)