Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-10-07 17:46:06 +0200
committerJan Beulich <jbeulich@novell.com>2011-10-07 17:46:06 +0200
commita3e7c48606c61ab16e1d3ebafdaa091ae384144f (patch)
tree51d101b835856fb0db8bccca3284c2a230ec0352
parentd1f7572d9e3580383b216708356210de0290dfe5 (diff)
- Update Xen patches to 3.1-rc9 and c/s 1116.
-rw-r--r--arch/x86/kernel/e820-xen.c14
-rw-r--r--arch/x86/kernel/entry_64-xen.S14
-rw-r--r--drivers/hwmon/coretemp-xen.c236
-rw-r--r--drivers/pci/msi-xen.c14
-rw-r--r--drivers/xen/Kconfig63
-rw-r--r--drivers/xen/blkback/cdrom.c4
-rw-r--r--drivers/xen/core/domctl.c26
-rw-r--r--drivers/xen/netback/interface.c4
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c112
-rw-r--r--drivers/xen/xenbus/xenbus_xs.c17
-rw-r--r--include/linux/pci.h5
-rw-r--r--include/xen/interface/arch-x86/hvm/save.h31
-rw-r--r--include/xen/interface/domctl.h52
-rw-r--r--include/xen/interface/io/xs_wire.h3
-rw-r--r--include/xen/interface/sysctl.h1
15 files changed, 275 insertions, 321 deletions
diff --git a/arch/x86/kernel/e820-xen.c b/arch/x86/kernel/e820-xen.c
index 61b3b1215443..f36794487f9b 100644
--- a/arch/x86/kernel/e820-xen.c
+++ b/arch/x86/kernel/e820-xen.c
@@ -1177,7 +1177,8 @@ void __init e820_reserve_resources_late(void)
char *__init default_machine_specific_memory_setup(void)
{
int rc, nr_map;
- unsigned long long maxmem;
+ unsigned long maxmem;
+ domid_t domid = DOMID_SELF;
struct xen_memory_map memmap;
static struct e820entry __initdata map[E820MAX];
@@ -1206,13 +1207,16 @@ char *__init default_machine_specific_memory_setup(void)
/* See the comment in parse_memopt(). */
for (maxmem = rc = 0; rc < e820.nr_map; ++rc)
if (e820.map[rc].type == E820_RAM)
- maxmem += e820.map[rc].size;
- if ((maxmem >> (PAGE_SHIFT + 5)) > xen_start_info->nr_pages) {
+ maxmem += e820.map[rc].size >> PAGE_SHIFT;
+ rc = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
+ if (rc > 0 && maxmem > rc)
+ maxmem = rc;
+ if ((maxmem >> 5) > xen_start_info->nr_pages) {
unsigned long long size = (u64)xen_start_info->nr_pages << 5;
- pr_warn("maxmem of %LuM is invalid for an initial"
+ pr_warn("maxmem of %luM is invalid for an initial"
" allocation of %luM, using %LuM\n",
- maxmem >> 20,
+ maxmem >> (20 - PAGE_SHIFT),
xen_start_info->nr_pages >> (20 - PAGE_SHIFT),
size >> (20 - PAGE_SHIFT));
size <<= PAGE_SHIFT;
diff --git a/arch/x86/kernel/entry_64-xen.S b/arch/x86/kernel/entry_64-xen.S
index 78eccb659726..a70144817952 100644
--- a/arch/x86/kernel/entry_64-xen.S
+++ b/arch/x86/kernel/entry_64-xen.S
@@ -306,6 +306,7 @@ NMI_MASK = 0x80000000
* with rax, r11, and rcx being taken care of in the hypercall stub.
*/
.macro HYPERVISOR_IRET flag
+ .if \flag == 0 # return from syscall always uses the hypercall
testb $3,1*8(%rsp)
jnz 2f
testl $NMI_MASK,2*8(%rsp)
@@ -318,10 +319,11 @@ NMI_MASK = 0x80000000
orl $3,1*8(%rsp)
orl $3,4*8(%rsp)
1: iretq
+ .endif
2: /* Slow iret via hypervisor. */
andl $~NMI_MASK, 2*8(%rsp)
- pushq $\flag
+ pushq $\flag & VGCF_in_syscall
jmp hypercall_page + (__HYPERVISOR_iret * 32)
.endm
@@ -481,7 +483,7 @@ END(ret_from_fork)
ENTRY(system_call)
INTR_FRAME start=2 offset=2*8
- SAVE_ARGS -8,1
+ SAVE_ARGS -8,0
movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
GET_THREAD_INFO(%rcx)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%rcx)
@@ -512,8 +514,9 @@ sysret_check:
* sysretq will re-enable interrupts:
*/
TRACE_IRQS_ON
- ENABLE_INTERRUPTS(CLBR_NONE)
- RESTORE_ARGS 1,8,1
+ RESTORE_ARGS 1,8,0,0
+ xor %ecx,%ecx
+ xor %r11,%r11
HYPERVISOR_IRET VGCF_IN_SYSCALL
CFI_RESTORE_STATE
@@ -1347,7 +1350,8 @@ ENTRY(ignore_sysret)
popq_cfi %r11
CFI_RESTORE r11
mov $-ENOSYS,%eax
- HYPERVISOR_IRET 0
+ # any non-zero value not having VGCF_in_syscall set will do:
+ HYPERVISOR_IRET VGCF_i387_valid
CFI_ENDPROC
END(ignore_sysret)
#endif
diff --git a/drivers/hwmon/coretemp-xen.c b/drivers/hwmon/coretemp-xen.c
index e898157b7684..770827cc1a8d 100644
--- a/drivers/hwmon/coretemp-xen.c
+++ b/drivers/hwmon/coretemp-xen.c
@@ -36,18 +36,26 @@
#include <linux/cpu.h>
#include <linux/pci.h>
#include <linux/smp.h>
+#include <linux/moduleparam.h>
#include <asm/msr.h>
#include <xen/pcpu.h>
#include "../xen/core/domctl.h"
#define DRVNAME "coretemp"
+/*
+ * force_tjmax only matters when TjMax can't be read from the CPU itself.
+ * When set, it replaces the driver's suboptimal heuristic.
+ */
+static int force_tjmax;
+module_param_named(tjmax, force_tjmax, int, 0444);
+MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
+
#define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */
#define NUM_REAL_CORES 16 /* Number of Real cores per cpu */
#define CORETEMP_NAME_LENGTH 17 /* String Length of attrs */
#define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */
-#define MAX_THRESH_ATTRS 3 /* Maximum no of Threshold attrs */
-#define TOTAL_ATTRS (MAX_CORE_ATTRS + MAX_THRESH_ATTRS)
+#define TOTAL_ATTRS (MAX_CORE_ATTRS + 1)
#define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO)
#define TO_PHYS_ID(cpu) ({ \
@@ -64,8 +72,6 @@
* This value is passed as "id" field to rdmsr/wrmsr functions.
* @status_reg: One of IA32_THERM_STATUS or IA32_PACKAGE_THERM_STATUS,
* from where the temperature values should be read.
- * @intrpt_reg: One of IA32_THERM_INTERRUPT or IA32_PACKAGE_THERM_INTERRUPT,
- * from where the thresholds are read.
* @attr_size: Total number of pre-core attrs displayed in the sysfs.
* @is_pkg_data: If this is 1, the temp_data holds pkgtemp data.
* Otherwise, temp_data holds coretemp data.
@@ -74,13 +80,11 @@
struct temp_data {
int temp;
int ttarget;
- int tmin;
int tjmax;
unsigned long last_updated;
unsigned int cpu;
u32 cpu_core_id;
u32 status_reg;
- u32 intrpt_reg;
int attr_size;
bool is_pkg_data;
bool valid;
@@ -94,7 +98,6 @@ struct platform_data {
struct device *hwmon_dev;
u16 phys_proc_id;
u8 x86_model, x86_mask;
- u32 ucode_rev;
struct temp_data *core_data[MAX_CORE_DATA];
struct device_attribute name_attr;
};
@@ -148,19 +151,6 @@ static ssize_t show_crit_alarm(struct device *dev,
return sprintf(buf, "%d\n", (eax >> 5) & 1);
}
-static ssize_t show_max_alarm(struct device *dev,
- struct device_attribute *devattr, char *buf)
-{
- u32 eax, edx;
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct platform_data *pdata = dev_get_drvdata(dev);
- struct temp_data *tdata = pdata->core_data[attr->index];
-
- rdmsr_on_cpu(tdata->cpu, tdata->status_reg, &eax, &edx);
-
- return sprintf(buf, "%d\n", !!(eax & THERM_STATUS_THRESHOLD1));
-}
-
static ssize_t show_tjmax(struct device *dev,
struct device_attribute *devattr, char *buf)
{
@@ -179,83 +169,6 @@ static ssize_t show_ttarget(struct device *dev,
return sprintf(buf, "%d\n", pdata->core_data[attr->index]->ttarget);
}
-static ssize_t store_ttarget(struct device *dev,
- struct device_attribute *devattr,
- const char *buf, size_t count)
-{
- struct platform_data *pdata = dev_get_drvdata(dev);
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct temp_data *tdata = pdata->core_data[attr->index];
- u32 eax, edx;
- unsigned long val;
- int diff;
-
- if (strict_strtoul(buf, 10, &val))
- return -EINVAL;
-
- /*
- * THERM_MASK_THRESHOLD1 is 7 bits wide. Values are entered in terms
- * of milli degree celsius. Hence don't accept val > (127 * 1000)
- */
- if (val > tdata->tjmax || val > 127000)
- return -EINVAL;
-
- diff = (tdata->tjmax - val) / 1000;
-
- mutex_lock(&tdata->update_lock);
- rdmsr_on_cpu(tdata->cpu, tdata->intrpt_reg, &eax, &edx);
- eax = (eax & ~THERM_MASK_THRESHOLD1) |
- (diff << THERM_SHIFT_THRESHOLD1);
- wrmsr_on_cpu(tdata->cpu, tdata->intrpt_reg, eax, edx);
- tdata->ttarget = val;
- mutex_unlock(&tdata->update_lock);
-
- return count;
-}
-
-static ssize_t show_tmin(struct device *dev,
- struct device_attribute *devattr, char *buf)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct platform_data *pdata = dev_get_drvdata(dev);
-
- return sprintf(buf, "%d\n", pdata->core_data[attr->index]->tmin);
-}
-
-static ssize_t store_tmin(struct device *dev,
- struct device_attribute *devattr,
- const char *buf, size_t count)
-{
- struct platform_data *pdata = dev_get_drvdata(dev);
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct temp_data *tdata = pdata->core_data[attr->index];
- u32 eax, edx;
- unsigned long val;
- int diff;
-
- if (strict_strtoul(buf, 10, &val))
- return -EINVAL;
-
- /*
- * THERM_MASK_THRESHOLD0 is 7 bits wide. Values are entered in terms
- * of milli degree celsius. Hence don't accept val > (127 * 1000)
- */
- if (val > tdata->tjmax || val > 127000)
- return -EINVAL;
-
- diff = (tdata->tjmax - val) / 1000;
-
- mutex_lock(&tdata->update_lock);
- rdmsr_on_cpu(tdata->cpu, tdata->intrpt_reg, &eax, &edx);
- eax = (eax & ~THERM_MASK_THRESHOLD0) |
- (diff << THERM_SHIFT_THRESHOLD0);
- wrmsr_on_cpu(tdata->cpu, tdata->intrpt_reg, eax, edx);
- tdata->tmin = val;
- mutex_unlock(&tdata->update_lock);
-
- return count;
-}
-
static ssize_t show_temp(struct device *dev,
struct device_attribute *devattr, char *buf)
{
@@ -381,7 +294,6 @@ static int adjust_tjmax(struct platform_data *c, u32 id, struct device *dev)
static int get_tjmax(struct platform_data *c, u32 id, struct device *dev)
{
- /* The 100C is default for both mobile and non mobile CPUs */
int err;
u32 eax, edx;
u32 val;
@@ -392,7 +304,8 @@ static int get_tjmax(struct platform_data *c, u32 id, struct device *dev)
*/
err = rdmsr_safe_on_pcpu(id, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx);
if (err < 0) {
- dev_warn(dev, "Unable to read TjMax from CPU.\n");
+ if (c->x86_model > 0xe && c->x86_model != 0x1c)
+ dev_warn(dev, "Unable to read TjMax from CPU %u\n", id);
} else {
val = (eax >> 16) & 0xff;
/*
@@ -400,11 +313,17 @@ static int get_tjmax(struct platform_data *c, u32 id, struct device *dev)
* will be used
*/
if (val) {
- dev_info(dev, "TjMax is %d C.\n", val);
+ dev_dbg(dev, "TjMax is %d degrees C\n", val);
return val * 1000;
}
}
+ if (force_tjmax) {
+ dev_notice(dev, "TjMax forced to %d degrees C by user\n",
+ force_tjmax);
+ return force_tjmax * 1000;
+ }
+
/*
* An assumption is made for early CPUs and unreadable MSR.
* NOTE: the calculated value may not be correct.
@@ -412,21 +331,6 @@ static int get_tjmax(struct platform_data *c, u32 id, struct device *dev)
return adjust_tjmax(c, id, dev);
}
-static int get_pkg_tjmax(unsigned int cpu, struct device *dev)
-{
- int err;
- u32 eax, edx, val;
-
- err = rdmsr_safe_on_pcpu(cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx);
- if (err >= 0) {
- val = (eax >> 16) & 0xff;
- if (val)
- return val * 1000;
- }
- dev_warn(dev, "Unable to read Pkg-TjMax from CPU:%u\n", cpu);
- return 100000; /* Default TjMax: 100 degree celsius */
-}
-
static int create_name_attr(struct platform_data *pdata, struct device *dev)
{
sysfs_attr_init(&pdata->name_attr.attr);
@@ -443,16 +347,11 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
struct device_attribute *devattr, char *buf) = {
show_label, show_crit_alarm, show_temp, show_tjmax,
- show_max_alarm, show_ttarget, show_tmin };
- static ssize_t (*const rw_ptr[TOTAL_ATTRS]) (struct device *dev,
- struct device_attribute *devattr, const char *buf,
- size_t count) = { NULL, NULL, NULL, NULL, NULL,
- store_ttarget, store_tmin };
+ show_ttarget };
static const char *const names[TOTAL_ATTRS] = {
"temp%d_label", "temp%d_crit_alarm",
"temp%d_input", "temp%d_crit",
- "temp%d_max_alarm", "temp%d_max",
- "temp%d_max_hyst" };
+ "temp%d_max" };
for (i = 0; i < tdata->attr_size; i++) {
snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, names[i],
@@ -460,10 +359,6 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr);
tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i];
tdata->sd_attrs[i].dev_attr.attr.mode = S_IRUGO;
- if (rw_ptr[i]) {
- tdata->sd_attrs[i].dev_attr.attr.mode |= S_IWUSR;
- tdata->sd_attrs[i].dev_attr.store = rw_ptr[i];
- }
tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
tdata->sd_attrs[i].index = attr_no;
err = device_create_file(dev, &tdata->sd_attrs[i].dev_attr);
@@ -479,10 +374,8 @@ exit_free:
}
-static int chk_ucode_version(struct platform_device *pdev)
+static int chk_ucode_version(unsigned int cpu, const struct cpu_info *c)
{
- struct platform_data *c = platform_get_drvdata(pdev);
-
/*
* Check if we have problem with errata AE18 of Core processors:
* Readings might stop update when processor visited too deep sleep,
@@ -491,14 +384,12 @@ static int chk_ucode_version(struct platform_device *pdev)
if (c->x86_model == 0xe && c->x86_mask < 0xc) {
/* check for microcode update */
if (!(c->ucode_rev + 1)) {
- dev_err(&pdev->dev,
- "Cannot determine microcode revision of "
- "CPU#%u!\n", pdev->id);
+ pr_err("Cannot determine microcode revision of "
+ "CPU#%u!\n", cpu);
return -ENODEV;
} else if (c->ucode_rev < 0x39) {
- dev_err(&pdev->dev,
- "Errata AE18 not fixed, update BIOS or "
- "microcode of the CPU!\n");
+ pr_err("Errata AE18 not fixed, update BIOS or "
+ "microcode of the CPU!\n");
return -ENODEV;
}
}
@@ -523,7 +414,7 @@ static struct platform_device *coretemp_get_pdev(unsigned int cpu)
}
static struct temp_data *init_temp_data(unsigned int cpu,
- const struct cpu_info *info,
+ const struct cpu_info *c,
int pkg_flag)
{
struct temp_data *tdata;
@@ -534,11 +425,9 @@ static struct temp_data *init_temp_data(unsigned int cpu,
tdata->status_reg = pkg_flag ? MSR_IA32_PACKAGE_THERM_STATUS :
MSR_IA32_THERM_STATUS;
- tdata->intrpt_reg = pkg_flag ? MSR_IA32_PACKAGE_THERM_INTERRUPT :
- MSR_IA32_THERM_INTERRUPT;
tdata->is_pkg_data = pkg_flag;
tdata->cpu = cpu;
- tdata->cpu_core_id = info->cpu_core_id;
+ tdata->cpu_core_id = c->cpu_core_id;
tdata->attr_size = MAX_CORE_ATTRS;
mutex_init(&tdata->update_lock);
return tdata;
@@ -546,7 +435,7 @@ static struct temp_data *init_temp_data(unsigned int cpu,
static int create_core_data(struct platform_device *pdev,
unsigned int cpu,
- const struct cpu_info *info, int pkg_flag)
+ const struct cpu_info *c, int pkg_flag)
{
struct temp_data *tdata;
struct platform_data *pdata = platform_get_drvdata(pdev);
@@ -559,7 +448,7 @@ static int create_core_data(struct platform_device *pdev,
* The attr number is always core id + 2
* The Pkgtemp will always show up as temp1_*, if available
*/
- attr_no = pkg_flag ? 1 : CORE_ATTR_NO(info->cpu_core_id);
+ attr_no = pkg_flag ? 1 : CORE_ATTR_NO(c->cpu_core_id);
if (attr_no > MAX_CORE_DATA - 1)
return -ERANGE;
@@ -574,7 +463,7 @@ static int create_core_data(struct platform_device *pdev,
if (pdata->core_data[attr_no] != NULL)
return 0;
- tdata = init_temp_data(cpu, info, pkg_flag);
+ tdata = init_temp_data(cpu, c, pkg_flag);
if (!tdata)
return -ENOMEM;
@@ -584,47 +473,44 @@ static int create_core_data(struct platform_device *pdev,
goto exit_free;
/* We can access status register. Get Critical Temperature */
- if (pkg_flag)
- tdata->tjmax = get_pkg_tjmax(pdev->id, &pdev->dev);
- else
- tdata->tjmax = get_tjmax(pdata, cpu, &pdev->dev);
+ tdata->tjmax = get_tjmax(pdata, cpu, &pdev->dev);
/*
- * Test if we can access the intrpt register. If so, increase the
- * 'size' enough to have ttarget/tmin/max_alarm interfaces.
- * Initialize ttarget with bits 16:22 of MSR_IA32_THERM_INTERRUPT
+ * Read the still undocumented bits 8:15 of IA32_TEMPERATURE_TARGET.
+ * The target temperature is available on older CPUs but not in this
+ * register. Atoms don't have the register at all.
*/
- err = rdmsr_safe_on_pcpu(cpu, tdata->intrpt_reg, &eax, &edx);
- if (err >= 0) {
- tdata->attr_size += MAX_THRESH_ATTRS;
- tdata->tmin = tdata->tjmax -
- ((eax & THERM_MASK_THRESHOLD0) >>
- THERM_SHIFT_THRESHOLD0) * 1000;
- tdata->ttarget = tdata->tjmax -
- ((eax & THERM_MASK_THRESHOLD1) >>
- THERM_SHIFT_THRESHOLD1) * 1000;
+ if (c->x86_model > 0xe && c->x86_model != 0x1c) {
+ err = rdmsr_safe_on_pcpu(cpu, MSR_IA32_TEMPERATURE_TARGET,
+ &eax, &edx);
+ if (err >= 0) {
+ tdata->ttarget
+ = tdata->tjmax - ((eax >> 8) & 0xff) * 1000;
+ tdata->attr_size++;
+ }
}
+ pdata->core_data[attr_no] = tdata;
+
/* Create sysfs interfaces */
err = create_core_attrs(tdata, &pdev->dev, attr_no);
if (err)
goto exit_free;
- pdata->core_data[attr_no] = tdata;
-
return 0;
exit_free:
+ pdata->core_data[attr_no] = NULL;
kfree(tdata);
return err;
}
static void coretemp_add_core(unsigned int cpu,
- const struct cpu_info *info, int pkg_flag)
+ const struct cpu_info *c, int pkg_flag)
{
- struct platform_device *pdev = info->pdev;
+ struct platform_device *pdev = c->pdev;
int err;
- err = create_core_data(pdev, cpu, info, pkg_flag);
+ err = create_core_data(pdev, cpu, c, pkg_flag);
if (err)
dev_err(&pdev->dev, "Adding Core %u failed\n", cpu);
}
@@ -648,11 +534,6 @@ static int coretemp_probe(struct platform_device *pdev)
struct platform_data *pdata = platform_get_drvdata(pdev);
int err;
- /* Check the microcode version of the CPU */
- err = chk_ucode_version(pdev);
- if (err)
- return err;
-
/* Initialize the per-package data structures */
err = create_name_attr(pdata, &pdev->dev);
if (err)
@@ -696,7 +577,7 @@ static struct platform_driver coretemp_driver = {
.remove = coretemp_remove,
};
-static int coretemp_device_add(unsigned int cpu, struct cpu_info *info)
+static int coretemp_device_add(unsigned int cpu, struct cpu_info *c)
{
int err;
struct platform_device *pdev;
@@ -705,7 +586,7 @@ static int coretemp_device_add(unsigned int cpu, struct cpu_info *info)
mutex_lock(&pdev_list_mutex);
- pdev = platform_device_alloc(DRVNAME, info->phys_proc_id);
+ pdev = platform_device_alloc(DRVNAME, c->phys_proc_id);
if (!pdev) {
err = -ENOMEM;
pr_err("Device allocation failed\n");
@@ -718,10 +599,9 @@ static int coretemp_device_add(unsigned int cpu, struct cpu_info *info)
goto exit_device_put;
}
- pdata->phys_proc_id = info->phys_proc_id;
- pdata->x86_model = info->x86_model;
- pdata->x86_mask = info->x86_mask;
- pdata->ucode_rev = info->ucode_rev;
+ pdata->phys_proc_id = c->phys_proc_id;
+ pdata->x86_model = c->x86_model;
+ pdata->x86_mask = c->x86_mask;
platform_set_drvdata(pdev, pdata);
pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL);
@@ -737,8 +617,8 @@ static int coretemp_device_add(unsigned int cpu, struct cpu_info *info)
}
pdev_entry->pdev = pdev;
- pdev_entry->phys_proc_id = info->phys_proc_id;
- info->pdev = pdev;
+ pdev_entry->phys_proc_id = c->phys_proc_id;
+ c->pdev = pdev;
list_add_tail(&pdev_entry->list, &pdev_list);
mutex_unlock(&pdev_list_mutex);
@@ -842,6 +722,10 @@ static void get_core_online(unsigned int cpu)
return;
if (!pdev) {
+ /* Check the microcode version of the CPU */
+ if (chk_ucode_version(cpu, &info))
+ return;
+
/*
* Alright, we have DTS support.
* We are bringing the _first_ core in this pkg
diff --git a/drivers/pci/msi-xen.c b/drivers/pci/msi-xen.c
index f5b7289bc734..84d9b45c29d6 100644
--- a/drivers/pci/msi-xen.c
+++ b/drivers/pci/msi-xen.c
@@ -27,9 +27,9 @@
static int pci_msi_enable = 1;
#if CONFIG_XEN_COMPAT < 0x040200
-static bool pci_seg_supported = true;
+static int pci_seg_supported = 1;
#else
-#define pci_seg_supported true
+#define pci_seg_supported 1
#endif
static LIST_HEAD(msi_dev_head);
@@ -153,6 +153,7 @@ static void detach_pirq_entry(int entry_nr,
}
}
+#ifdef CONFIG_XEN_PRIVILEGED_GUEST
/*
* pciback will provide device's owner
*/
@@ -161,7 +162,7 @@ static int (*get_owner)(struct pci_dev *dev);
int register_msi_get_owner(int (*func)(struct pci_dev *dev))
{
if (get_owner) {
- printk(KERN_WARNING "register msi_get_owner again\n");
+ pr_warning("register msi_get_owner again\n");
return -EEXIST;
}
get_owner = func;
@@ -190,6 +191,9 @@ static int msi_get_dev_owner(struct pci_dev *dev)
return DOMID_SELF;
}
+#else
+#define msi_get_dev_owner(dev) ({ BUG(); DOMID_SELF; })
+#endif
static int msi_unmap_pirq(struct pci_dev *dev, int pirq)
{
@@ -261,7 +265,7 @@ static int msi_map_vector(struct pci_dev *dev, int entry_nr, u64 table_base)
map_irq.bus = dev->bus->number;
rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
if (rc != -EINVAL)
- pci_seg_supported = false;
+ pci_seg_supported = 0;
}
#endif
if (rc)
@@ -541,7 +545,7 @@ int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec)
status = pci_msi_check_device(dev, nvec, PCI_CAP_ID_MSI);
if (status)
- return status;
+ return status;
#ifdef CONFIG_XEN_PCIDEV_FRONTEND
if (!is_initial_xendomain())
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 0345e572c77c..d530f498853e 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -537,6 +537,37 @@ config XEN_PCIDEV_BACKEND
menu "PCI Backend Mode"
depends on XEN_PCIDEV_BACKEND
+choice
+ prompt "Default PCI backend mode"
+ default XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER if IA64
+ default XEN_PCIDEV_BACKEND_DEFAULT_VPCI
+
+config XEN_PCIDEV_BACKEND_DEFAULT_VPCI
+ bool "Virtual PCI"
+ select XEN_PCIDEV_BACKEND_VPCI
+
+config XEN_PCIDEV_BACKEND_DEFAULT_PASSTHROUGH
+ bool "Passthrough"
+ select XEN_PCIDEV_BACKEND_PASSTHROUGH
+
+config XEN_PCIDEV_BACKEND_DEFAULT_SLOT
+ bool "Slot"
+ select XEN_PCIDEV_BACKEND_SLOT
+
+config XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER
+ bool "Controller"
+ depends on IA64
+ select XEN_PCIDEV_BACKEND_CONTROLLER
+
+endchoice
+
+config XEN_PCIDEV_BACKEND_DEFAULT
+ string
+ default "vpci" if XEN_PCIDEV_BACKEND_DEFAULT_VPCI
+ default "passthrough" if XEN_PCIDEV_BACKEND_DEFAULT_PASSTHROUGH
+ default "slot" if XEN_PCIDEV_BACKEND_DEFAULT_SLOT
+ default "controller" if XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER
+
config XEN_PCIDEV_BACKEND_VPCI
bool "Virtual PCI"
default X86
@@ -577,7 +608,6 @@ config XEN_PCIDEV_BACKEND_SLOT
config XEN_PCIDEV_BACKEND_CONTROLLER
bool "Controller"
depends on IA64
- default y
---help---
This PCI backend virtualizes the PCI bus topology by providing a
virtual bus per PCI root device. Devices which are physically under
@@ -593,37 +623,6 @@ config XEN_PCIDEV_BACKEND_CONTROLLER
If not the default, the parameter "mode=controller" allows you to
use this mode.
-choice
- prompt "Default guest PCI bus topology representation"
- default XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER if IA64
- default XEN_PCIDEV_BACKEND_DEFAULT_VPCI
-
-config XEN_PCIDEV_BACKEND_DEFAULT_VPCI
- bool "Virtual PCI"
- select XEN_PCIDEV_BACKEND_VPCI
-
-config XEN_PCIDEV_BACKEND_DEFAULT_PASSTHROUGH
- bool "Passthrough"
- select XEN_PCIDEV_BACKEND_PASSTHROUGH
-
-config XEN_PCIDEV_BACKEND_DEFAULT_SLOT
- bool "Slot"
- select XEN_PCIDEV_BACKEND_SLOT
-
-config XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER
- bool "Controller"
- depends on IA64
- select XEN_PCIDEV_BACKEND_CONTROLLER
-
-endchoice
-
-config XEN_PCIDEV_BACKEND_DEFAULT
- string
- default "vpci" if XEN_PCIDEV_BACKEND_DEFAULT_VPCI
- default "passthrough" if XEN_PCIDEV_BACKEND_DEFAULT_PASSTHROUGH
- default "slot" if XEN_PCIDEV_BACKEND_DEFAULT_SLOT
- default "controller" if XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER
-
endmenu
endmenu
diff --git a/drivers/xen/blkback/cdrom.c b/drivers/xen/blkback/cdrom.c
index ebc9e7d70cf3..cb1de77cbc0c 100644
--- a/drivers/xen/blkback/cdrom.c
+++ b/drivers/xen/blkback/cdrom.c
@@ -102,8 +102,8 @@ void cdrom_add_media_watch(struct backend_info *be)
DPRINTK("nodename:%s", dev->nodename);
if (cdrom_is_type(be)) {
DPRINTK("is a cdrom");
- if ( cdrom_xenstore_write_media_present(be) == 0 ) {
- DPRINTK( "xenstore wrote OK");
+ if (cdrom_xenstore_write_media_present(be) == 0) {
+ DPRINTK("xenstore wrote OK");
err = xenbus_watch_path2(dev, dev->nodename, MEDIA_PRESENT,
&be->cdrom_watch,
cdrom_media_changed);
diff --git a/drivers/xen/core/domctl.c b/drivers/xen/core/domctl.c
index 32770e30cde0..abce18a44f6c 100644
--- a/drivers/xen/core/domctl.c
+++ b/drivers/xen/core/domctl.c
@@ -77,7 +77,8 @@ union xen_domctl {
/*
* v5: upstream: xen 3.1
* v6: upstream: xen 4.0
- * v7: sle11 sp1: xen 4.0 + cpupools patches
+ * v7: upstream: xen 4.1; sle11 sp1: xen 4.0 + cpupools patches
+ * v8: upstream: xen 4.2
*/
struct {
uint32_t cmd;
@@ -89,7 +90,7 @@ union xen_domctl {
uint64_aligned_t dummy_align;
uint8_t dummy_pad[128];
};
- } v5, v6, v7;
+ } v5, v6, v7, v8;
};
struct xen_sysctl_physinfo_v6 {
@@ -226,8 +227,11 @@ int xen_guest_address_size(int domid)
} \
} while (0)
- BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 7);
+ BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 8);
+ guest_address_size(8);
+#if CONFIG_XEN_COMPAT < 0x040200
guest_address_size(7);
+#endif
#if CONFIG_XEN_COMPAT < 0x040100
guest_address_size(6);
#endif
@@ -279,8 +283,12 @@ static inline int get_vcpuaffinity(unsigned int nr, void *mask)
union xen_domctl domctl;
int rc;
- BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 7);
- rc = vcpuaffinity(get, 7);
+ BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 8);
+ rc = vcpuaffinity(get, 8);
+#if CONFIG_XEN_COMPAT < 0x040200
+ if (rc)
+ rc = vcpuaffinity(get, 7);
+#endif
#if CONFIG_XEN_COMPAT < 0x040100
if (rc)
rc = vcpuaffinity(get, 6);
@@ -301,8 +309,12 @@ static inline int set_vcpuaffinity(unsigned int nr, void *mask)
union xen_domctl domctl;
int rc;
- BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 7);
- rc = vcpuaffinity(set, 7);
+ BUILD_BUG_ON(XEN_DOMCTL_INTERFACE_VERSION > 8);
+ rc = vcpuaffinity(set, 8);
+#if CONFIG_XEN_COMPAT < 0x040200
+ if (rc)
+ rc = vcpuaffinity(set, 7);
+#endif
#if CONFIG_XEN_COMPAT < 0x040100
if (rc)
rc = vcpuaffinity(set, 6);
diff --git a/drivers/xen/netback/interface.c b/drivers/xen/netback/interface.c
index 78d93bfa2add..592224f8d9a4 100644
--- a/drivers/xen/netback/interface.c
+++ b/drivers/xen/netback/interface.c
@@ -311,12 +311,12 @@ int netif_map(struct backend_info *be, grant_ref_t tx_ring_ref,
netif_get(netif);
rtnl_lock();
- if (netif_running(netif->dev))
- __netif_up(netif);
if (!netif->can_sg && netif->dev->mtu > ETH_DATA_LEN)
dev_set_mtu(netif->dev, ETH_DATA_LEN);
netdev_update_features(netif->dev);
netback_carrier_on(netif);
+ if (netif_running(netif->dev))
+ __netif_up(netif);
rtnl_unlock();
return 0;
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 958cedc35967..56cce3475603 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -959,72 +959,100 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
#endif
-#ifdef CONFIG_CRASH_DUMP
-static DECLARE_WAIT_QUEUE_HEAD(be_state_wq);
-static int be_state;
+#ifndef CONFIG_XEN
+static DECLARE_WAIT_QUEUE_HEAD(backend_state_wq);
+static int backend_state;
-static void xenbus_reset_state_changed(struct xenbus_watch *w, const char **v, unsigned int l)
+static void xenbus_reset_backend_state_changed(struct xenbus_watch *w,
+ const char **v, unsigned int l)
{
- if (xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i", &be_state) != 1)
- be_state = XenbusStateUnknown;
- pr_info("XENBUS: %s %s\n", v[XS_WATCH_PATH], xenbus_strstate(be_state));
- wake_up(&be_state_wq);
+ if (xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i", &backend_state) != 1)
+ backend_state = XenbusStateUnknown;
+ printk(KERN_DEBUG "XENBUS: backend %s %s\n",
+ v[XS_WATCH_PATH], xenbus_strstate(backend_state));
+ wake_up(&backend_state_wq);
}
-static int xenbus_reset_check_final(int *st)
+static void xenbus_reset_wait_for_backend(char *be, int expected)
{
- return *st == XenbusStateInitialising || *st == XenbusStateInitWait;
+ long timeout;
+ timeout = wait_event_interruptible_timeout(backend_state_wq,
+ backend_state == expected, 5 * HZ);
+ if (timeout <= 0)
+ pr_info("XENBUS: backend %s timed out.\n", be);
}
-static void xenbus_reset_frontend_state(char *backend, char *frontend)
+/*
+ * Reset frontend if it is in Connected or Closed state.
+ * Wait for backend to catch up.
+ * State Connected happens during kdump, Closed after kexec.
+ */
+static void xenbus_reset_frontend(char *fe, char *be, int be_state)
{
- struct xenbus_watch watch;
+ struct xenbus_watch be_watch;
- memset(&watch, 0, sizeof(watch));
- watch.node = kasprintf(GFP_NOIO | __GFP_HIGH, "%s/state", backend);
- if (!watch.node)
+ printk(KERN_DEBUG "XENBUS: backend %s %s\n",
+ be, xenbus_strstate(be_state));
+
+ memset(&be_watch, 0, sizeof(be_watch));
+ be_watch.node = kasprintf(GFP_NOIO | __GFP_HIGH, "%s/state", be);
+ if (!be_watch.node)
return;
- watch.callback = xenbus_reset_state_changed;
- be_state = XenbusStateUnknown;
+ be_watch.callback = xenbus_reset_backend_state_changed;
+ backend_state = XenbusStateUnknown;
- pr_info("XENBUS: triggering reconnect on %s\n", backend);
- register_xenbus_watch(&watch);
+ pr_info("XENBUS: triggering reconnect on %s\n", be);
+ register_xenbus_watch(&be_watch);
- xenbus_printf(XBT_NIL, frontend, "state", "%d", XenbusStateClosing);
- wait_event_interruptible(be_state_wq, be_state == XenbusStateClosing);
+ /* fall through to forward backend to state XenbusStateInitialising */
+ switch (be_state) {
+ case XenbusStateConnected:
+ xenbus_printf(XBT_NIL, fe, "state", "%d", XenbusStateClosing);
+ xenbus_reset_wait_for_backend(be, XenbusStateClosing);
- xenbus_printf(XBT_NIL, frontend, "state", "%d", XenbusStateClosed);
- wait_event_interruptible(be_state_wq, be_state == XenbusStateClosed);
+ case XenbusStateClosing:
+ xenbus_printf(XBT_NIL, fe, "state", "%d", XenbusStateClosed);
+ xenbus_reset_wait_for_backend(be, XenbusStateClosed);
- xenbus_printf(XBT_NIL, frontend, "state", "%d", XenbusStateInitialising);
- wait_event_interruptible(be_state_wq, xenbus_reset_check_final(&be_state));
+ case XenbusStateClosed:
+ xenbus_printf(XBT_NIL, fe, "state", "%d", XenbusStateInitialising);
+ xenbus_reset_wait_for_backend(be, XenbusStateInitWait);
+ }
- unregister_xenbus_watch(&watch);
- pr_info("XENBUS: reconnect done on %s\n", backend);
- kfree(watch.node);
+ unregister_xenbus_watch(&be_watch);
+ pr_info("XENBUS: reconnect done on %s\n", be);
+ kfree(be_watch.node);
}
-static void xenbus_reset_check_state(char *class, char *dev)
+static void xenbus_check_frontend(char *class, char *dev)
{
- int state, err;
+ int be_state, fe_state, err;
char *backend, *frontend;
frontend = kasprintf(GFP_NOIO | __GFP_HIGH, "device/%s/%s", class, dev);
if (!frontend)
return;
- err = xenbus_scanf(XBT_NIL, frontend, "state", "%i", &state);
- /* frontend connected? */
- if (err == 1 && state == XenbusStateConnected) {
+ err = xenbus_scanf(XBT_NIL, frontend, "state", "%i", &fe_state);
+ if (err != 1)
+ goto out;
+
+ switch (fe_state) {
+ case XenbusStateConnected:
+ case XenbusStateClosed:
+ printk(KERN_DEBUG "XENBUS: frontend %s %s\n",
+ frontend, xenbus_strstate(fe_state));
backend = xenbus_read(XBT_NIL, frontend, "backend", NULL);
if (!backend || IS_ERR(backend))
goto out;
- err = xenbus_scanf(XBT_NIL, backend, "state", "%i", &state);
- /* backend connected? */
- if (err == 1 && state == XenbusStateConnected)
- xenbus_reset_frontend_state(backend, frontend);
+ err = xenbus_scanf(XBT_NIL, backend, "state", "%i", &be_state);
+ if (err == 1)
+ xenbus_reset_frontend(frontend, backend, be_state);
kfree(backend);
+ break;
+ default:
+ break;
}
out:
kfree(frontend);
@@ -1045,7 +1073,7 @@ static void xenbus_reset_state(void)
if (IS_ERR(dev))
continue;
for (j = 0; j < dev_n; j++)
- xenbus_reset_check_state(devclass[i], dev[j]);
+ xenbus_check_frontend(devclass[i], dev[j]);
kfree(dev);
}
kfree(devclass);
@@ -1062,11 +1090,11 @@ xenbus_probe(struct work_struct *unused)
{
BUG_ON(!is_xenstored_ready());
-#ifdef CONFIG_CRASH_DUMP
- /* reset devices in XenbusStateConnected state */
- if (!is_initial_xendomain() && reset_devices)
- xenbus_reset_state();
+#ifndef CONFIG_XEN
+ /* reset devices in Connected or Closed state */
+ xenbus_reset_state();
#endif
+
#if defined(CONFIG_XEN) || defined(MODULE)
/* Enumerate devices in xenstore and watch for changes. */
xenbus_probe_devices(&xenbus_frontend);
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
index 894cc953ef4f..f1da50bd03ee 100644
--- a/drivers/xen/xenbus/xenbus_xs.c
+++ b/drivers/xen/xenbus/xenbus_xs.c
@@ -626,6 +626,17 @@ static struct xenbus_watch *find_watch(const char *token)
return NULL;
}
+static void xs_reset_watches(void)
+{
+#ifndef CONFIG_XEN
+ int err;
+
+ err = xs_error(xs_single(XBT_NIL, XS_RESET_WATCHES, "", NULL));
+ if (err && err != -EEXIST)
+ printk(KERN_WARNING "xs_reset_watches failed: %d\n", err);
+#endif
+}
+
/* Register callback to watch this node. */
int register_xenbus_watch(struct xenbus_watch *watch)
{
@@ -644,8 +655,7 @@ int register_xenbus_watch(struct xenbus_watch *watch)
err = xs_watch(watch->node, token);
- /* Ignore errors due to multiple registration. */
- if ((err != 0) && (err != -EEXIST)) {
+ if (err) {
spin_lock(&watches_lock);
list_del(&watch->list);
spin_unlock(&watches_lock);
@@ -946,5 +956,8 @@ int xs_init(void)
if (IS_ERR(task))
return PTR_ERR(task);
+ /* shutdown watches for kexec boot */
+ xs_reset_watches();
+
return 0;
}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 4d858a1e4f9c..49b118a9e851 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1026,11 +1026,6 @@ static inline int pci_msi_enabled(void)
{
return 0;
}
-
-#ifdef CONFIG_XEN
-#define register_msi_get_owner(func) 0
-#define unregister_msi_get_owner(func) 0
-#endif
#else
extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
extern void pci_msi_shutdown(struct pci_dev *dev);
diff --git a/include/xen/interface/arch-x86/hvm/save.h b/include/xen/interface/arch-x86/hvm/save.h
index 0600b1292b6d..036f635729fd 100644
--- a/include/xen/interface/arch-x86/hvm/save.h
+++ b/include/xen/interface/arch-x86/hvm/save.h
@@ -547,18 +547,6 @@ struct hvm_hw_mtrr {
DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct hvm_hw_mtrr);
/*
- * Viridian hypervisor context.
- */
-
-struct hvm_viridian_context {
- uint64_t hypercall_gpa;
- uint64_t guest_os_id;
-};
-
-DECLARE_HVM_SAVE_TYPE(VIRIDIAN, 15, struct hvm_viridian_context);
-
-
-/*
* The save area of XSAVE/XRSTOR.
*/
@@ -580,9 +568,26 @@ struct hvm_hw_cpu_xsave {
#define CPU_XSAVE_CODE 16
+/*
+ * Viridian hypervisor context.
+ */
+
+struct hvm_viridian_domain_context {
+ uint64_t hypercall_gpa;
+ uint64_t guest_os_id;
+};
+
+DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
+
+struct hvm_viridian_vcpu_context {
+ uint64_t apic_assist;
+};
+
+DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17, struct hvm_viridian_vcpu_context);
+
/*
* Largest type-code in use
*/
-#define HVM_SAVE_CODE_MAX 16
+#define HVM_SAVE_CODE_MAX 17
#endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
diff --git a/include/xen/interface/domctl.h b/include/xen/interface/domctl.h
index c0dbc0234eab..ea8fce63d9a9 100644
--- a/include/xen/interface/domctl.h
+++ b/include/xen/interface/domctl.h
@@ -35,7 +35,7 @@
#include "xen.h"
#include "grant_table.h"
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000007
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000008
/*
* NB. xen_domctl.domain is an IN/OUT parameter for this operation.
@@ -95,6 +95,7 @@ struct xen_domctl_getdomaininfo {
uint64_aligned_t tot_pages;
uint64_aligned_t max_pages;
uint64_aligned_t shr_pages;
+ uint64_aligned_t paged_pages;
uint64_aligned_t shared_info_frame; /* GMFN of shared_info struct */
uint64_aligned_t cpu_time;
uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
@@ -455,15 +456,15 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendtrigger_t);
/* XEN_DOMCTL_test_assign_device */
/* XEN_DOMCTL_deassign_device */
struct xen_domctl_assign_device {
- uint32_t machine_bdf; /* machine PCI ID of assigned device */
+ uint32_t machine_sbdf; /* machine PCI ID of assigned device */
};
typedef struct xen_domctl_assign_device xen_domctl_assign_device_t;
DEFINE_XEN_GUEST_HANDLE(xen_domctl_assign_device_t);
-/* Retrieve sibling devices infomation of machine_bdf */
+/* Retrieve sibling devices infomation of machine_sbdf */
/* XEN_DOMCTL_get_device_group */
struct xen_domctl_get_device_group {
- uint32_t machine_bdf; /* IN */
+ uint32_t machine_sbdf; /* IN */
uint32_t max_sdevs; /* IN */
uint32_t num_sdevs; /* OUT */
XEN_GUEST_HANDLE_64(uint32) sdev_array; /* OUT */
@@ -708,20 +709,18 @@ struct xen_domctl_gdbsx_domstatus {
/* XEN_DOMCTL_mem_event_op */
-/* Add and remove memory handlers */
-#define XEN_DOMCTL_MEM_EVENT_OP_ENABLE 0
-#define XEN_DOMCTL_MEM_EVENT_OP_DISABLE 1
-
/*
+* Domain memory paging
* Page memory in and out.
*/
#define XEN_DOMCTL_MEM_EVENT_OP_PAGING 1
-/* Domain memory paging */
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_NOMINATE 0
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_EVICT 1
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP 2
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_RESUME 3
+#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE 0
+#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE 1
+#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_NOMINATE 2
+#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_EVICT 3
+#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP 4
+#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_RESUME 5
/*
* Access permissions.
@@ -734,11 +733,14 @@ struct xen_domctl_gdbsx_domstatus {
* ACCESS_RESUME mode for the following domctl.
*/
#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS 2
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_RESUME 0
+
+#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE 0
+#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE 1
+#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_RESUME 2
struct xen_domctl_mem_event_op {
- uint32_t op; /* XEN_DOMCTL_MEM_EVENT_OP_* */
- uint32_t mode; /* XEN_DOMCTL_MEM_EVENT_ENABLE_* */
+ uint32_t op; /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
+ uint32_t mode; /* XEN_DOMCTL_MEM_EVENT_OP_* */
/* OP_ENABLE */
uint64_aligned_t shared_addr; /* IN: Virtual address of shared page */
@@ -755,14 +757,16 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
*/
/* XEN_DOMCTL_mem_sharing_op */
-#define XEN_DOMCTL_MEM_SHARING_OP_CONTROL 0
-#define XEN_DOMCTL_MEM_SHARING_OP_NOMINATE_GFN 1
-#define XEN_DOMCTL_MEM_SHARING_OP_NOMINATE_GREF 2
-#define XEN_DOMCTL_MEM_SHARING_OP_SHARE 3
-#define XEN_DOMCTL_MEM_SHARING_OP_RESUME 4
-#define XEN_DOMCTL_MEM_SHARING_OP_DEBUG_GFN 5
-#define XEN_DOMCTL_MEM_SHARING_OP_DEBUG_MFN 6
-#define XEN_DOMCTL_MEM_SHARING_OP_DEBUG_GREF 7
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING 3
+
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL 0
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GFN 1
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GREF 2
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE 3
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME 4
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN 5
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN 6
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF 7
#define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID (-10)
#define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID (-9)
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h
index 452143373870..debb02575879 100644
--- a/include/xen/interface/io/xs_wire.h
+++ b/include/xen/interface/io/xs_wire.h
@@ -48,7 +48,8 @@ enum xsd_sockmsg_type
XS_IS_DOMAIN_INTRODUCED,
XS_RESUME,
XS_SET_TARGET,
- XS_RESTRICT
+ XS_RESTRICT,
+ XS_RESET_WATCHES
};
#define XS_WRITE_NONE "NONE"
diff --git a/include/xen/interface/sysctl.h b/include/xen/interface/sysctl.h
index c10a85d1f8a5..88648c428632 100644
--- a/include/xen/interface/sysctl.h
+++ b/include/xen/interface/sysctl.h
@@ -399,6 +399,7 @@ struct xen_sysctl_page_offline_op {
#define PG_OFFLINE_OFFLINED (0x1UL << 1)
#define PG_OFFLINE_PENDING (0x1UL << 2)
#define PG_OFFLINE_FAILED (0x1UL << 3)
+#define PG_OFFLINE_AGAIN (0x1UL << 4)
#define PG_ONLINE_FAILED PG_OFFLINE_FAILED
#define PG_ONLINE_ONLINED PG_OFFLINE_OFFLINED