Merge branch 'x86/urgent' into x86/iommu
This commit is contained in:
@@ -41,7 +41,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
|
||||
obj-y += process.o
|
||||
obj-y += i387.o xsave.o
|
||||
obj-y += ptrace.o
|
||||
obj-y += ds.o
|
||||
obj-$(CONFIG_X86_DS) += ds.o
|
||||
obj-$(CONFIG_X86_32) += tls.o
|
||||
obj-$(CONFIG_IA32_EMULATION) += tls.o
|
||||
obj-y += step.o
|
||||
|
@@ -538,7 +538,7 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom,
|
||||
address >>= PAGE_SHIFT;
|
||||
iommu_area_free(dom->bitmap, address, pages);
|
||||
|
||||
if (address + pages >= dom->next_bit)
|
||||
if (address >= dom->next_bit)
|
||||
dom->need_flush = true;
|
||||
}
|
||||
|
||||
|
@@ -122,7 +122,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
|
||||
LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
|
||||
we find in ACPI */
|
||||
unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */
|
||||
int amd_iommu_isolate; /* if 1, device isolation is enabled */
|
||||
int amd_iommu_isolate = 1; /* if 1, device isolation is enabled */
|
||||
bool amd_iommu_unmap_flush; /* if true, flush on every unmap */
|
||||
|
||||
LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the
|
||||
@@ -1214,7 +1214,9 @@ static int __init parse_amd_iommu_options(char *str)
|
||||
for (; *str; ++str) {
|
||||
if (strncmp(str, "isolate", 7) == 0)
|
||||
amd_iommu_isolate = 1;
|
||||
if (strncmp(str, "fullflush", 11) == 0)
|
||||
if (strncmp(str, "share", 5) == 0)
|
||||
amd_iommu_isolate = 0;
|
||||
if (strncmp(str, "fullflush", 9) == 0)
|
||||
amd_iommu_unmap_flush = true;
|
||||
}
|
||||
|
||||
|
@@ -21,8 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifdef CONFIG_X86_DS
|
||||
|
||||
#include <asm/ds.h>
|
||||
|
||||
#include <linux/errno.h>
|
||||
@@ -211,14 +209,15 @@ static DEFINE_PER_CPU(struct ds_context *, system_context);
|
||||
static inline struct ds_context *ds_get_context(struct task_struct *task)
|
||||
{
|
||||
struct ds_context *context;
|
||||
unsigned long irq;
|
||||
|
||||
spin_lock(&ds_lock);
|
||||
spin_lock_irqsave(&ds_lock, irq);
|
||||
|
||||
context = (task ? task->thread.ds_ctx : this_system_context);
|
||||
if (context)
|
||||
context->count++;
|
||||
|
||||
spin_unlock(&ds_lock);
|
||||
spin_unlock_irqrestore(&ds_lock, irq);
|
||||
|
||||
return context;
|
||||
}
|
||||
@@ -226,18 +225,16 @@ static inline struct ds_context *ds_get_context(struct task_struct *task)
|
||||
/*
|
||||
* Same as ds_get_context, but allocates the context and it's DS
|
||||
* structure, if necessary; returns NULL; if out of memory.
|
||||
*
|
||||
* pre: requires ds_lock to be held
|
||||
*/
|
||||
static inline struct ds_context *ds_alloc_context(struct task_struct *task)
|
||||
{
|
||||
struct ds_context **p_context =
|
||||
(task ? &task->thread.ds_ctx : &this_system_context);
|
||||
struct ds_context *context = *p_context;
|
||||
unsigned long irq;
|
||||
|
||||
if (!context) {
|
||||
context = kzalloc(sizeof(*context), GFP_KERNEL);
|
||||
|
||||
if (!context)
|
||||
return NULL;
|
||||
|
||||
@@ -247,18 +244,27 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*p_context = context;
|
||||
spin_lock_irqsave(&ds_lock, irq);
|
||||
|
||||
context->this = p_context;
|
||||
context->task = task;
|
||||
if (*p_context) {
|
||||
kfree(context->ds);
|
||||
kfree(context);
|
||||
|
||||
if (task)
|
||||
set_tsk_thread_flag(task, TIF_DS_AREA_MSR);
|
||||
context = *p_context;
|
||||
} else {
|
||||
*p_context = context;
|
||||
|
||||
if (!task || (task == current))
|
||||
wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0);
|
||||
context->this = p_context;
|
||||
context->task = task;
|
||||
|
||||
get_tracer(task);
|
||||
if (task)
|
||||
set_tsk_thread_flag(task, TIF_DS_AREA_MSR);
|
||||
|
||||
if (!task || (task == current))
|
||||
wrmsrl(MSR_IA32_DS_AREA,
|
||||
(unsigned long)context->ds);
|
||||
}
|
||||
spin_unlock_irqrestore(&ds_lock, irq);
|
||||
}
|
||||
|
||||
context->count++;
|
||||
@@ -272,10 +278,12 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task)
|
||||
*/
|
||||
static inline void ds_put_context(struct ds_context *context)
|
||||
{
|
||||
unsigned long irq;
|
||||
|
||||
if (!context)
|
||||
return;
|
||||
|
||||
spin_lock(&ds_lock);
|
||||
spin_lock_irqsave(&ds_lock, irq);
|
||||
|
||||
if (--context->count)
|
||||
goto out;
|
||||
@@ -297,7 +305,7 @@ static inline void ds_put_context(struct ds_context *context)
|
||||
kfree(context->ds);
|
||||
kfree(context);
|
||||
out:
|
||||
spin_unlock(&ds_lock);
|
||||
spin_unlock_irqrestore(&ds_lock, irq);
|
||||
}
|
||||
|
||||
|
||||
@@ -368,6 +376,7 @@ static int ds_request(struct task_struct *task, void *base, size_t size,
|
||||
struct ds_context *context;
|
||||
unsigned long buffer, adj;
|
||||
const unsigned long alignment = (1 << 3);
|
||||
unsigned long irq;
|
||||
int error = 0;
|
||||
|
||||
if (!ds_cfg.sizeof_ds)
|
||||
@@ -382,25 +391,27 @@ static int ds_request(struct task_struct *task, void *base, size_t size,
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
|
||||
spin_lock(&ds_lock);
|
||||
|
||||
if (!check_tracer(task))
|
||||
return -EPERM;
|
||||
|
||||
error = -ENOMEM;
|
||||
context = ds_alloc_context(task);
|
||||
if (!context)
|
||||
return -ENOMEM;
|
||||
|
||||
spin_lock_irqsave(&ds_lock, irq);
|
||||
|
||||
error = -EPERM;
|
||||
if (!check_tracer(task))
|
||||
goto out_unlock;
|
||||
|
||||
get_tracer(task);
|
||||
|
||||
error = -EALREADY;
|
||||
if (context->owner[qual] == current)
|
||||
goto out_unlock;
|
||||
goto out_put_tracer;
|
||||
error = -EPERM;
|
||||
if (context->owner[qual] != NULL)
|
||||
goto out_unlock;
|
||||
goto out_put_tracer;
|
||||
context->owner[qual] = current;
|
||||
|
||||
spin_unlock(&ds_lock);
|
||||
spin_unlock_irqrestore(&ds_lock, irq);
|
||||
|
||||
|
||||
error = -ENOMEM;
|
||||
@@ -448,10 +459,17 @@ static int ds_request(struct task_struct *task, void *base, size_t size,
|
||||
out_release:
|
||||
context->owner[qual] = NULL;
|
||||
ds_put_context(context);
|
||||
put_tracer(task);
|
||||
return error;
|
||||
|
||||
out_put_tracer:
|
||||
spin_unlock_irqrestore(&ds_lock, irq);
|
||||
ds_put_context(context);
|
||||
put_tracer(task);
|
||||
return error;
|
||||
|
||||
out_unlock:
|
||||
spin_unlock(&ds_lock);
|
||||
spin_unlock_irqrestore(&ds_lock, irq);
|
||||
ds_put_context(context);
|
||||
return error;
|
||||
}
|
||||
@@ -801,13 +819,21 @@ static const struct ds_configuration ds_cfg_var = {
|
||||
.sizeof_ds = sizeof(long) * 12,
|
||||
.sizeof_field = sizeof(long),
|
||||
.sizeof_rec[ds_bts] = sizeof(long) * 3,
|
||||
#ifdef __i386__
|
||||
.sizeof_rec[ds_pebs] = sizeof(long) * 10
|
||||
#else
|
||||
.sizeof_rec[ds_pebs] = sizeof(long) * 18
|
||||
#endif
|
||||
};
|
||||
static const struct ds_configuration ds_cfg_64 = {
|
||||
.sizeof_ds = 8 * 12,
|
||||
.sizeof_field = 8,
|
||||
.sizeof_rec[ds_bts] = 8 * 3,
|
||||
#ifdef __i386__
|
||||
.sizeof_rec[ds_pebs] = 8 * 10
|
||||
#else
|
||||
.sizeof_rec[ds_pebs] = 8 * 18
|
||||
#endif
|
||||
};
|
||||
|
||||
static inline void
|
||||
@@ -861,4 +887,3 @@ void ds_free(struct ds_context *context)
|
||||
while (leftovers--)
|
||||
ds_put_context(context);
|
||||
}
|
||||
#endif /* CONFIG_X86_DS */
|
||||
|
@@ -250,31 +250,24 @@ int __init find_unisys_acpi_oem_table(unsigned long *oem_addr)
|
||||
{
|
||||
struct acpi_table_header *header = NULL;
|
||||
int i = 0;
|
||||
acpi_size tbl_size;
|
||||
|
||||
while (ACPI_SUCCESS(acpi_get_table_with_size("OEM1", i++, &header, &tbl_size))) {
|
||||
while (ACPI_SUCCESS(acpi_get_table("OEM1", i++, &header))) {
|
||||
if (!memcmp((char *) &header->oem_id, "UNISYS", 6)) {
|
||||
struct oem_table *t = (struct oem_table *)header;
|
||||
|
||||
oem_addrX = t->OEMTableAddr;
|
||||
oem_size = t->OEMTableSize;
|
||||
early_acpi_os_unmap_memory(header, tbl_size);
|
||||
|
||||
*oem_addr = (unsigned long)__acpi_map_table(oem_addrX,
|
||||
oem_size);
|
||||
return 0;
|
||||
}
|
||||
early_acpi_os_unmap_memory(header, tbl_size);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr)
|
||||
{
|
||||
if (!oem_addr)
|
||||
return;
|
||||
|
||||
__acpi_unmap_table((char *)oem_addr, oem_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -58,7 +58,7 @@ void __cpuinit mxcsr_feature_mask_init(void)
|
||||
stts();
|
||||
}
|
||||
|
||||
void __init init_thread_xstate(void)
|
||||
void __cpuinit init_thread_xstate(void)
|
||||
{
|
||||
if (!HAVE_HWFP) {
|
||||
xstate_size = sizeof(struct i387_soft_struct);
|
||||
|
@@ -1140,6 +1140,20 @@ static void __clear_irq_vector(int irq)
|
||||
|
||||
cfg->vector = 0;
|
||||
cpus_clear(cfg->domain);
|
||||
|
||||
if (likely(!cfg->move_in_progress))
|
||||
return;
|
||||
cpus_and(mask, cfg->old_domain, cpu_online_map);
|
||||
for_each_cpu_mask_nr(cpu, mask) {
|
||||
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS;
|
||||
vector++) {
|
||||
if (per_cpu(vector_irq, cpu)[vector] != irq)
|
||||
continue;
|
||||
per_cpu(vector_irq, cpu)[vector] = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
cfg->move_in_progress = 0;
|
||||
}
|
||||
|
||||
void __setup_vector_irq(int cpu)
|
||||
@@ -3594,27 +3608,7 @@ int __init io_apic_get_redir_entries (int ioapic)
|
||||
|
||||
int __init probe_nr_irqs(void)
|
||||
{
|
||||
int idx;
|
||||
int nr = 0;
|
||||
#ifndef CONFIG_XEN
|
||||
int nr_min = 32;
|
||||
#else
|
||||
int nr_min = NR_IRQS;
|
||||
#endif
|
||||
|
||||
for (idx = 0; idx < nr_ioapics; idx++)
|
||||
nr += io_apic_get_redir_entries(idx) + 1;
|
||||
|
||||
/* double it for hotplug and msi and nmi */
|
||||
nr <<= 1;
|
||||
|
||||
/* something wrong ? */
|
||||
if (nr < nr_min)
|
||||
nr = nr_min;
|
||||
if (WARN_ON(nr > NR_IRQS))
|
||||
nr = NR_IRQS;
|
||||
|
||||
return nr;
|
||||
return NR_IRQS;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
|
@@ -1567,7 +1567,7 @@ static int __init calgary_parse_options(char *p)
|
||||
++p;
|
||||
if (*p == '\0')
|
||||
break;
|
||||
bridge = simple_strtol(p, &endp, 0);
|
||||
bridge = simple_strtoul(p, &endp, 0);
|
||||
if (p == endp)
|
||||
break;
|
||||
|
||||
|
@@ -169,6 +169,15 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
|
||||
},
|
||||
},
|
||||
{ /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
|
||||
.callback = set_bios_reboot,
|
||||
.ident = "Dell OptiPlex 330",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
|
||||
},
|
||||
},
|
||||
{ /* Handle problems with rebooting on Dell 2400's */
|
||||
.callback = set_bios_reboot,
|
||||
.ident = "Dell PowerEdge 2400",
|
||||
|
@@ -765,7 +765,7 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
|
||||
.callback = dmi_low_memory_corruption,
|
||||
.ident = "Phoenix BIOS",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
|
||||
DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"),
|
||||
},
|
||||
},
|
||||
#endif
|
||||
|
@@ -46,7 +46,9 @@ static __cpuinit void check_tsc_warp(void)
|
||||
cycles_t start, now, prev, end;
|
||||
int i;
|
||||
|
||||
rdtsc_barrier();
|
||||
start = get_cycles();
|
||||
rdtsc_barrier();
|
||||
/*
|
||||
* The measurement runs for 20 msecs:
|
||||
*/
|
||||
@@ -61,7 +63,9 @@ static __cpuinit void check_tsc_warp(void)
|
||||
*/
|
||||
__raw_spin_lock(&sync_lock);
|
||||
prev = last_tsc;
|
||||
rdtsc_barrier();
|
||||
now = get_cycles();
|
||||
rdtsc_barrier();
|
||||
last_tsc = now;
|
||||
__raw_spin_unlock(&sync_lock);
|
||||
|
||||
|
@@ -310,7 +310,7 @@ static void __init setup_xstate_init(void)
|
||||
/*
|
||||
* Enable and initialize the xsave feature.
|
||||
*/
|
||||
void __init xsave_cntxt_init(void)
|
||||
void __ref xsave_cntxt_init(void)
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
|
||||
|
Reference in New Issue
Block a user