Displaying 20 results from an estimated 131 matches for "get_cpu".
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...-2.6.13.orig/include/asm-i386/desc.h 2005-08-08 17:15:56.000000000 -0700
+++ linux-2.6.13/include/asm-i386/desc.h 2005-08-08 17:16:07.000000000 -0700
@@ -21,6 +21,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
+#define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table, _cpu))
+
DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
struct Xgt_desc_struct {
@@ -68,7 +70,7 @@
static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
{
- _set_tssldt_desc(&per_cpu(cpu_gdt_...
2007 Apr 18
0
[PATCH 7/12] gdt-accessor
...-2.6.13.orig/include/asm-i386/desc.h 2005-08-08 17:15:56.000000000 -0700
+++ linux-2.6.13/include/asm-i386/desc.h 2005-08-08 17:16:07.000000000 -0700
@@ -21,6 +21,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
+#define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table, _cpu))
+
DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
struct Xgt_desc_struct {
@@ -68,7 +70,7 @@
static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
{
- _set_tssldt_desc(&per_cpu(cpu_gdt_...
2007 Apr 18
1
[PATCH 2/3] Gdt_accessor
...rc1.orig/include/asm-i386/desc.h 2005-09-20 14:49:10.000000000 -0700
+++ linux-2.6.14-rc1/include/asm-i386/desc.h 2005-09-20 18:49:07.000000000 -0700
@@ -17,6 +17,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
+#define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table,_cpu))
+
DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
struct Xgt_desc_struct {
@@ -60,7 +62,7 @@ __asm__ __volatile__ ("movw %w3,0(%2)\n\
static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)...
2007 Apr 18
1
[PATCH 2/3] Gdt_accessor
...rc1.orig/include/asm-i386/desc.h 2005-09-20 14:49:10.000000000 -0700
+++ linux-2.6.14-rc1/include/asm-i386/desc.h 2005-09-20 18:49:07.000000000 -0700
@@ -17,6 +17,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
+#define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table,_cpu))
+
DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
struct Xgt_desc_struct {
@@ -60,7 +62,7 @@ __asm__ __volatile__ ("movw %w3,0(%2)\n\
static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)...
2007 Apr 18
2
[PATCH 8/14] i386 / Add a per cpu gdt accessor
...-2.6.13.orig/include/asm-i386/desc.h 2005-08-09 20:17:21.000000000 -0700
+++ linux-2.6.13/include/asm-i386/desc.h 2005-08-10 20:41:03.000000000 -0700
@@ -39,6 +39,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
+#define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table, _cpu))
+
DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
struct Xgt_desc_struct {
Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h
===================================================================
--- linux-2.6.13.ori...
2007 Apr 18
2
[PATCH 8/14] i386 / Add a per cpu gdt accessor
...-2.6.13.orig/include/asm-i386/desc.h 2005-08-09 20:17:21.000000000 -0700
+++ linux-2.6.13/include/asm-i386/desc.h 2005-08-10 20:41:03.000000000 -0700
@@ -39,6 +39,8 @@
extern struct desc_struct cpu_gdt_table[GDT_ENTRIES];
DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]);
+#define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table, _cpu))
+
DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]);
struct Xgt_desc_struct {
Index: linux-2.6.13/include/asm-i386/mach-default/mach_desc.h
===================================================================
--- linux-2.6.13.ori...
2007 Apr 18
1
[PATCH 2/12] ldt-accessors
...T while reading it. */
down(¤t->mm->context.sem);
- desc = current->mm->context.ldt;
- desc = (void *)desc + (seg & ~7);
+ desc = &LDT_DESCRIPTOR(seg);
} else {
/* Must disable preemption while reading the GDT. */
- desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu());
- desc = (void *)desc + (seg & ~7);
+ desc = &per_cpu(cpu_gdt_table, get_cpu())[desc_number(seg)];
}
/* Decode the code segment base from the descriptor */
- base = get_desc_base((unsigned long *)desc);
+ base = get_desc_base(desc);
if (seg & (1<<2)) {
up(&...
2007 Apr 18
1
[PATCH 2/12] ldt-accessors
...T while reading it. */
down(¤t->mm->context.sem);
- desc = current->mm->context.ldt;
- desc = (void *)desc + (seg & ~7);
+ desc = &LDT_DESCRIPTOR(seg);
} else {
/* Must disable preemption while reading the GDT. */
- desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu());
- desc = (void *)desc + (seg & ~7);
+ desc = &per_cpu(cpu_gdt_table, get_cpu())[desc_number(seg)];
}
/* Decode the code segment base from the descriptor */
- base = get_desc_base((unsigned long *)desc);
+ base = get_desc_base(desc);
if (seg & (1<<2)) {
up(&...
2007 Apr 18
1
[PATCH 7/21] i386 Losing fs gs to bios
...c inline unsigned long get_desc_bas
return base;
}
+struct bios_segment_save {
+ struct desc_struct save_desc_40;
+ struct desc_struct *gdt;
+ unsigned short saved_fs;
+ unsigned short saved_gs;
+};
+
+static inline void prepare_bios_segments(struct bios_segment_save *save_area)
+{
+ int cpu = get_cpu();
+ struct desc_struct *gdt = get_cpu_gdt_table(cpu);
+ save_area->gdt = gdt;
+ savesegment(fs, save_area->saved_fs);
+ savesegment(gs, save_area->saved_gs);
+ save_area->save_desc_40 = gdt[GDT_ENTRY_BAD_BIOS];
+ gdt[GDT_ENTRY_BAD_BIOS] = gdt[GDT_ENTRY_BAD_BIOS_CACHE];
+}
+
+static inl...
2007 Apr 18
1
[PATCH 7/21] i386 Losing fs gs to bios
...c inline unsigned long get_desc_bas
return base;
}
+struct bios_segment_save {
+ struct desc_struct save_desc_40;
+ struct desc_struct *gdt;
+ unsigned short saved_fs;
+ unsigned short saved_gs;
+};
+
+static inline void prepare_bios_segments(struct bios_segment_save *save_area)
+{
+ int cpu = get_cpu();
+ struct desc_struct *gdt = get_cpu_gdt_table(cpu);
+ save_area->gdt = gdt;
+ savesegment(fs, save_area->saved_fs);
+ savesegment(gs, save_area->saved_gs);
+ save_area->save_desc_40 = gdt[GDT_ENTRY_BAD_BIOS];
+ gdt[GDT_ENTRY_BAD_BIOS] = gdt[GDT_ENTRY_BAD_BIOS_CACHE];
+}
+
+static inl...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...quot;
>
> @@ -758,9 +759,14 @@ struct smp_sync_call_struct {
> static void smp_call_sync_callback(struct work_struct *work)
> {
> struct smp_sync_call_struct *sscs;
> + unsigned int cpu;
>
> sscs = container_of(work, struct smp_sync_call_struct, work);
> + cpu = get_cpu();
> + hypervisor_pin_vcpu(cpu);
> sscs->ret = sscs->func(sscs->data);
> + hypervisor_pin_vcpu(-1);
> + put_cpu();
>
> complete(&sscs->done);
> }
So I don't really like this; it adds the requirement that the function
cannot schedule, which greatly li...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...quot;
>
> @@ -758,9 +759,14 @@ struct smp_sync_call_struct {
> static void smp_call_sync_callback(struct work_struct *work)
> {
> struct smp_sync_call_struct *sscs;
> + unsigned int cpu;
>
> sscs = container_of(work, struct smp_sync_call_struct, work);
> + cpu = get_cpu();
> + hypervisor_pin_vcpu(cpu);
> sscs->ret = sscs->func(sscs->data);
> + hypervisor_pin_vcpu(-1);
> + put_cpu();
>
> complete(&sscs->done);
> }
So I don't really like this; it adds the requirement that the function
cannot schedule, which greatly li...
2007 Apr 18
2
[PATCH 4/21] i386 Broken bios common
...pend_waitqueue);
static struct apm_user * user_list;
static DEFINE_SPINLOCK(user_list_lock);
-static struct desc_struct bad_bios_desc = { 0, 0x00409200 };
static char driver_version[] = "1.16ac"; /* no spaces */
@@ -593,7 +592,7 @@ static u8 apm_bios_call(u32 func, u32 eb
cpu = get_cpu();
gdt = get_cpu_gdt_table(cpu);
save_desc_40 = gdt[0x40 / 8];
- gdt[0x40 / 8] = bad_bios_desc;
+ gdt[0x40 / 8] = gdt[GDT_ENTRY_BAD_BIOS_CACHE];
local_save_flags(flags);
APM_DO_CLI;
@@ -637,7 +636,7 @@ static u8 apm_bios_call_simple(u32 func,
cpu = get_cpu();
gdt = get_cpu_gdt_table(c...
2007 Apr 18
2
[PATCH 4/21] i386 Broken bios common
...pend_waitqueue);
static struct apm_user * user_list;
static DEFINE_SPINLOCK(user_list_lock);
-static struct desc_struct bad_bios_desc = { 0, 0x00409200 };
static char driver_version[] = "1.16ac"; /* no spaces */
@@ -593,7 +592,7 @@ static u8 apm_bios_call(u32 func, u32 eb
cpu = get_cpu();
gdt = get_cpu_gdt_table(cpu);
save_desc_40 = gdt[0x40 / 8];
- gdt[0x40 / 8] = bad_bios_desc;
+ gdt[0x40 / 8] = gdt[GDT_ENTRY_BAD_BIOS_CACHE];
local_save_flags(flags);
APM_DO_CLI;
@@ -637,7 +636,7 @@ static u8 apm_bios_call_simple(u32 func,
cpu = get_cpu();
gdt = get_cpu_gdt_table(c...
2007 Apr 18
2
[PATCH] Simplify smp_call_function*() by using common implementation
...return until the remote CPU is nearly ready to execute <func>
+ * or is or has executed.
+ */
+int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
+ int nonatomic, int wait)
+{
+ /* prevent preemption and reschedule on another processor */
+ int ret;
+ int me = get_cpu();
+ if (cpu == me) {
+ WARN_ON(1);
+ put_cpu();
+ return -EBUSY;
+ }
+
+ ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait);
+
+ put_cpu();
+ return ret;
+}
+EXPORT_SYMBOL(smp_call_function_single);
static void stop_this_cpu (void * dummy)
{
@@ -598,7 +664,7 @@ void smp_sen...
2007 Apr 18
2
[PATCH] Simplify smp_call_function*() by using common implementation
...return until the remote CPU is nearly ready to execute <func>
+ * or is or has executed.
+ */
+int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
+ int nonatomic, int wait)
+{
+ /* prevent preemption and reschedule on another processor */
+ int ret;
+ int me = get_cpu();
+ if (cpu == me) {
+ WARN_ON(1);
+ put_cpu();
+ return -EBUSY;
+ }
+
+ ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait);
+
+ put_cpu();
+ return ret;
+}
+EXPORT_SYMBOL(smp_call_function_single);
static void stop_this_cpu (void * dummy)
{
@@ -598,7 +664,7 @@ void smp_sen...
2007 Apr 18
1
[PATCH 7/14] i386 / Add some descriptor convenience functions
...t *desc;
/* The standard kernel/user address space limit. */
*eip_limit = (seg & 3) ? USER_DS.seg : KERNEL_DS.seg;
@@ -108,12 +109,12 @@
desc = (void *)desc + (seg & ~7);
} else {
/* Must disable preemption while reading the GDT. */
- desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu());
+ desc = per_cpu(cpu_gdt_table, get_cpu());
desc = (void *)desc + (seg & ~7);
}
/* Decode the code segment base from the descriptor */
- base = get_desc_base((unsigned long *)desc);
+ base = get_desc_base(desc);
if (segment_from_ldt(seg)) {
up(¤t->mm->conte...
2007 Apr 18
1
[PATCH 7/14] i386 / Add some descriptor convenience functions
...t *desc;
/* The standard kernel/user address space limit. */
*eip_limit = (seg & 3) ? USER_DS.seg : KERNEL_DS.seg;
@@ -108,12 +109,12 @@
desc = (void *)desc + (seg & ~7);
} else {
/* Must disable preemption while reading the GDT. */
- desc = (u32 *)&per_cpu(cpu_gdt_table, get_cpu());
+ desc = per_cpu(cpu_gdt_table, get_cpu());
desc = (void *)desc + (seg & ~7);
}
/* Decode the code segment base from the descriptor */
- base = get_desc_base((unsigned long *)desc);
+ base = get_desc_base(desc);
if (segment_from_ldt(seg)) {
up(¤t->mm->conte...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...uct {
> >> static void smp_call_sync_callback(struct work_struct *work)
> >> {
> >> struct smp_sync_call_struct *sscs;
> >> + unsigned int cpu;
> >>
> >> sscs = container_of(work, struct smp_sync_call_struct, work);
> >> + cpu = get_cpu();
> >> + hypervisor_pin_vcpu(cpu);
> >> sscs->ret = sscs->func(sscs->data);
> >> + hypervisor_pin_vcpu(-1);
> >> + put_cpu();
> >>
> >> complete(&sscs->done);
> >> }
> >
> > So I don't really lik...
2016 Apr 01
2
[PATCH v3 5/6] virt, sched: add cpu pinning to smp_call_sync_on_phys_cpu()
...uct {
> >> static void smp_call_sync_callback(struct work_struct *work)
> >> {
> >> struct smp_sync_call_struct *sscs;
> >> + unsigned int cpu;
> >>
> >> sscs = container_of(work, struct smp_sync_call_struct, work);
> >> + cpu = get_cpu();
> >> + hypervisor_pin_vcpu(cpu);
> >> sscs->ret = sscs->func(sscs->data);
> >> + hypervisor_pin_vcpu(-1);
> >> + put_cpu();
> >>
> >> complete(&sscs->done);
> >> }
> >
> > So I don't really lik...