search for: __get_cpu_var

Displaying 20 results from an estimated 179 matches for "__get_cpu_var".

2012 Jun 29
0
[PATCH] linux-2.6.18/x86: improve CR0 read/write handling
...OL(cpu_16bit_stack); +#else +DEFINE_PER_CPU(unsigned int, xen_x86_cr0); +EXPORT_PER_CPU_SYMBOL(xen_x86_cr0); #endif static int cachesize_override __cpuinitdata = -1; @@ -681,6 +684,7 @@ old_gdt: cpu_gdt_descr->size = GDT_SIZE - 1; cpu_gdt_descr->address = (unsigned long)gdt; #else + __get_cpu_var(xen_x86_cr0) = raw_read_cr0(); if (cpu == 0 && cpu_gdt_descr->address == 0) { gdt = (struct desc_struct *)alloc_bootmem_pages(PAGE_SIZE); /* alloc_bootmem_pages panics on failure, so no check */ --- a/arch/i386/kernel/process-xen.c +++ b/arch/i386/kernel/process-xen.c @@ -641,6 +...
2007 Apr 18
5
[patch 0/4] Revised softlockup watchdog improvement patches
Hi Ingo, This series of patches implements a number of improvements to the softlockup watchdog and its users. They are: 1. Make the watchdog ignore stolen time When running under a hypervisor, the kernel may lose an arbitrary amount of time as "stolen time". This may cause the softlockup watchdog to trigger spruiously. Xen and VMI implement sched_clock() as measuring unstolen time,
2007 Apr 18
5
[patch 0/4] Revised softlockup watchdog improvement patches
Hi Ingo, This series of patches implements a number of improvements to the softlockup watchdog and its users. They are: 1. Make the watchdog ignore stolen time When running under a hypervisor, the kernel may lose an arbitrary amount of time as "stolen time". This may cause the softlockup watchdog to trigger spruiously. Xen and VMI implement sched_clock() as measuring unstolen time,
2016 Jan 22
2
Bug#812166: [PATCH] x86/mce: fix misleading indentation in init_nonfatal_mce_checker().
...ith gcc-6: non-fatal.c: In function 'init_nonfatal_mce_checker': non-fatal.c:103:2: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] switch (c->x86_vendor) { ^~~~~~ non-fatal.c:97:5: note: ...this 'if' clause, but it is not if ( __get_cpu_var(poll_bankmask) == NULL ) ^~ I was unable to reproduce (xen builds cleanly for me with "6.0.0 20160117 (experimental) [trunk revision 232481]") but looking at the code the issue above is clearly real. Correctly reindent the if statement. This file uses Linux coding style (infact th...
2013 Aug 27
1
[PATCH] xen/balloon: don't set P2M entry for auto translated guest
...alloon.c @@ -430,8 +430,13 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp) /* No more mappings: invalidate P2M and add to balloon. */ for (i = 0; i < nr_pages; i++) { pfn = mfn_to_pfn(frame_list[i]); - __set_phys_to_machine(pfn, - pfn_to_mfn(page_to_pfn(__get_cpu_var(balloon_scratch_page)))); + if (!xen_feature(XENFEAT_auto_translated_physmap)) { + unsigned long p; + struct page *pg; + pg = __get_cpu_var(balloon_scratch_page); + p = page_to_pfn(pg); + __set_phys_to_machine(pfn, pfn_to_mfn(p)); + } balloon_append(pfn_to_page(pfn)); } -- 1.7.1...
2007 Apr 18
1
[patch 8/9] Guest page hinting: discarded page list.
...es(void) } #endif /* CONFIG_PM */ +#if defined(CONFIG_PAGE_DISCARD_LIST) +DEFINE_PER_CPU(struct list_head, page_discard_list); + +static void __page_shrink_discards(void *info) +{ + static DEFINE_SPINLOCK(splice_lock); + struct list_head *discard_list = info; + struct list_head *cpu_list = &__get_cpu_var(page_discard_list); + + if (list_empty(cpu_list)) + return; + spin_lock(&splice_lock); + list_splice_init(cpu_list, discard_list); + spin_unlock(&splice_lock); +} + +unsigned long page_shrink_discards(void) +{ + struct list_head pages_to_free = LIST_HEAD_INIT(pages_to_free); + struct page...
2007 Apr 18
1
[patch 8/9] Guest page hinting: discarded page list.
...es(void) } #endif /* CONFIG_PM */ +#if defined(CONFIG_PAGE_DISCARD_LIST) +DEFINE_PER_CPU(struct list_head, page_discard_list); + +static void __page_shrink_discards(void *info) +{ + static DEFINE_SPINLOCK(splice_lock); + struct list_head *discard_list = info; + struct list_head *cpu_list = &__get_cpu_var(page_discard_list); + + if (list_empty(cpu_list)) + return; + spin_lock(&splice_lock); + list_splice_init(cpu_list, discard_list); + spin_unlock(&splice_lock); +} + +unsigned long page_shrink_discards(void) +{ + struct list_head pages_to_free = LIST_HEAD_INIT(pages_to_free); + struct page...
2007 Apr 18
0
[PATCH 7/10] Resurrect the VMI lazy mode fixes.
...de); } vmi_ops; /* @@ -545,6 +546,26 @@ vmi_startup_ipi_hook(int phys_apicid, un } #endif +static void vmi_set_lazy_mode(enum paravirt_lazy_mode mode) +{ + static DEFINE_PER_CPU(int, lazy_mode); + + if (!vmi_ops.set_lazy_mode) + return; + + /* Modes should never nest or overlap */ + BUG_ON(__get_cpu_var(lazy_mode) && !(mode == PARAVIRT_LAZY_NONE || + mode == PARAVIRT_LAZY_FLUSH)); + + if (mode == PARAVIRT_LAZY_FLUSH) { + vmi_ops.set_lazy_mode(0); + vmi_ops.set_lazy_mode(__get_cpu_var(lazy_mode)); + } else { + vmi_ops.set_lazy_mode(mode); + __get_cpu_var(lazy_mode) = mode; + }...
2007 Apr 18
0
[PATCH 7/10] Resurrect the VMI lazy mode fixes.
...de); } vmi_ops; /* @@ -545,6 +546,26 @@ vmi_startup_ipi_hook(int phys_apicid, un } #endif +static void vmi_set_lazy_mode(enum paravirt_lazy_mode mode) +{ + static DEFINE_PER_CPU(int, lazy_mode); + + if (!vmi_ops.set_lazy_mode) + return; + + /* Modes should never nest or overlap */ + BUG_ON(__get_cpu_var(lazy_mode) && !(mode == PARAVIRT_LAZY_NONE || + mode == PARAVIRT_LAZY_FLUSH)); + + if (mode == PARAVIRT_LAZY_FLUSH) { + vmi_ops.set_lazy_mode(0); + vmi_ops.set_lazy_mode(__get_cpu_var(lazy_mode)); + } else { + vmi_ops.set_lazy_mode(mode); + __get_cpu_var(lazy_mode) = mode; + }...
2010 Mar 11
1
[PATCH 1/2] xen: balloon: Fix checkpatch issues
drivers/xen/balloon.c:50: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> drivers/xen/balloon.c:158: ERROR: else should follow close brace '}' drivers/xen/balloon.c:277: ERROR: do not use assignment in if condition drivers/xen/balloon.c:293: ERROR: code indent should use tabs where possible drivers/xen/balloon.c:364: ERROR: that open brace { should be on the
2010 Mar 11
1
[PATCH 1/2] xen: balloon: Fix checkpatch issues
drivers/xen/balloon.c:50: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> drivers/xen/balloon.c:158: ERROR: else should follow close brace '}' drivers/xen/balloon.c:277: ERROR: do not use assignment in if condition drivers/xen/balloon.c:293: ERROR: code indent should use tabs where possible drivers/xen/balloon.c:364: ERROR: that open brace { should be on the
2010 Mar 11
1
[PATCH 1/2] xen: balloon: Fix checkpatch issues
drivers/xen/balloon.c:50: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> drivers/xen/balloon.c:158: ERROR: else should follow close brace '}' drivers/xen/balloon.c:277: ERROR: do not use assignment in if condition drivers/xen/balloon.c:293: ERROR: code indent should use tabs where possible drivers/xen/balloon.c:364: ERROR: that open brace { should be on the
2013 Feb 08
1
[PATCH linux-next] xen/multicall: xen_mc_callback(): avoid buffer overflow
...ed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c index 0d82003..5270407 100644 --- a/arch/x86/xen/multicalls.c +++ b/arch/x86/xen/multicalls.c @@ -195,9 +195,10 @@ void xen_mc_callback(void (*fn)(void *), void *data) struct mc_buffer *b = &__get_cpu_var(mc_buffer); struct callback *cb; - if (b->cbidx == MC_BATCH) { + if (b->cbidx >= MC_BATCH) { trace_xen_mc_flush_reason(XEN_MC_FL_CALLBACK); xen_mc_flush(); + return; } trace_xen_mc_callback(fn, data); -- 1.7.9.5
2013 Feb 08
1
[PATCH linux-next] xen/multicall: xen_mc_callback(): avoid buffer overflow
...ed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c index 0d82003..5270407 100644 --- a/arch/x86/xen/multicalls.c +++ b/arch/x86/xen/multicalls.c @@ -195,9 +195,10 @@ void xen_mc_callback(void (*fn)(void *), void *data) struct mc_buffer *b = &__get_cpu_var(mc_buffer); struct callback *cb; - if (b->cbidx == MC_BATCH) { + if (b->cbidx >= MC_BATCH) { trace_xen_mc_flush_reason(XEN_MC_FL_CALLBACK); xen_mc_flush(); + return; } trace_xen_mc_callback(fn, data); -- 1.7.9.5
2007 Apr 18
2
[patch 0/2] softlockup watchdog improvements
Here's couple of patches to improve the softlockup watchdog. The first changes the softlockup timer from using jiffies to sched_clock() as a timebase. Xen and VMI implement sched_clock() as counting unstolen time, so time stolen by the hypervisor won't cause the watchdog to bite. The second adds per-cpu enable flags for the watchdog timer. This allows the timer to be disabled when the
2007 Apr 18
2
[patch 0/2] softlockup watchdog improvements
Here's couple of patches to improve the softlockup watchdog. The first changes the softlockup timer from using jiffies to sched_clock() as a timebase. Xen and VMI implement sched_clock() as counting unstolen time, so time stolen by the hypervisor won't cause the watchdog to bite. The second adds per-cpu enable flags for the watchdog timer. This allows the timer to be disabled when the
2013 Jan 08
3
[PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
As Michael mentioned, set affinity and select queue will not work very well when CPU IDs are not consecutive, this can happen with hot unplug. Fix this bug by traversal the online CPUs, and create a per cpu variable to find the mapping from CPU to the preferable virtual-queue. Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason
2013 Jan 08
3
[PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
As Michael mentioned, set affinity and select queue will not work very well when CPU IDs are not consecutive, this can happen with hot unplug. Fix this bug by traversal the online CPUs, and create a per cpu variable to find the mapping from CPU to the preferable virtual-queue. Cc: Rusty Russell <rusty at rustcorp.com.au> Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason
2007 Oct 09
0
[PATCH RFC REPOST 2/2] paravirt: clean up lazy mode handling
...c @@ -552,24 +552,22 @@ vmi_startup_ipi_hook(int phys_apicid, un } #endif -static void vmi_set_lazy_mode(enum paravirt_lazy_mode mode) -{ - static DEFINE_PER_CPU(enum paravirt_lazy_mode, lazy_mode); - - if (!vmi_ops.set_lazy_mode) - return; - - /* Modes should never nest or overlap */ - BUG_ON(__get_cpu_var(lazy_mode) && !(mode == PARAVIRT_LAZY_NONE || - mode == PARAVIRT_LAZY_FLUSH)); - - if (mode == PARAVIRT_LAZY_FLUSH) { - vmi_ops.set_lazy_mode(0); - vmi_ops.set_lazy_mode(__get_cpu_var(lazy_mode)); - } else { - vmi_ops.set_lazy_mode(mode); - __get_cpu_var(lazy_mode) = mode; - }...
2007 Oct 09
0
[PATCH RFC REPOST 2/2] paravirt: clean up lazy mode handling
...c @@ -552,24 +552,22 @@ vmi_startup_ipi_hook(int phys_apicid, un } #endif -static void vmi_set_lazy_mode(enum paravirt_lazy_mode mode) -{ - static DEFINE_PER_CPU(enum paravirt_lazy_mode, lazy_mode); - - if (!vmi_ops.set_lazy_mode) - return; - - /* Modes should never nest or overlap */ - BUG_ON(__get_cpu_var(lazy_mode) && !(mode == PARAVIRT_LAZY_NONE || - mode == PARAVIRT_LAZY_FLUSH)); - - if (mode == PARAVIRT_LAZY_FLUSH) { - vmi_ops.set_lazy_mode(0); - vmi_ops.set_lazy_mode(__get_cpu_var(lazy_mode)); - } else { - vmi_ops.set_lazy_mode(mode); - __get_cpu_var(lazy_mode) = mode; - }...