arch/x86_64: Flag xuk shared page volatile
The shared page is inherently used in multiprocessor contexts where the compiler optimizer can trip us up (specifically, a spin on num_active_pus was being hoisted out of the loop on some gcc's). Put the volatile declartion into the struct pointer itself instead of relying on the code to get it right. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
1781ec9d2f
commit
bbe6fa04b5
2 changed files with 3 additions and 3 deletions
|
@ -57,7 +57,7 @@ struct xuk_shared_mem {
|
|||
int vgacol;
|
||||
};
|
||||
|
||||
#define _shared (*((struct xuk_shared_mem *)(long)SHARED_ADDR))
|
||||
#define _shared (*((volatile struct xuk_shared_mem *)(long)SHARED_ADDR))
|
||||
|
||||
static inline void shared_init(void)
|
||||
{
|
||||
|
|
|
@ -314,8 +314,8 @@ void xuk_set_isr_mask(int interrupt, int masked)
|
|||
static void setup_fg_segs(int cpu)
|
||||
{
|
||||
int fi = 3 + 2 * cpu, gi = 3 + 2 * cpu + 1;
|
||||
struct gdt64 *fs = &_shared.gdt[fi];
|
||||
struct gdt64 *gs = &_shared.gdt[gi];
|
||||
struct gdt64 *fs = (struct gdt64 *) &_shared.gdt[fi];
|
||||
struct gdt64 *gs = (struct gdt64 *) &_shared.gdt[gi];
|
||||
|
||||
gdt64_set_base(fs, (long)&_shared.fs_ptrs[cpu]);
|
||||
gdt64_set_base(gs, (long)&_shared.gs_ptrs[cpu]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue