From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Ja-0007Fh-7f; Tue, 02 Apr 2013 21:00:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8JZ-0007Fa-Ng
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:21 +0000
Received: from [85.158.138.51:18643] by server-4.bemta-3.messagelabs.com id
	08/E8-21470-0E64B515; Tue, 02 Apr 2013 21:00:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1364936413!27721575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5090 invoked from network); 2 Apr 2013 21:00:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8JJ-0001UH-62
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8JI-0002Uj-QR
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:04 +0000
Date: Tue, 02 Apr 2013 21:00:04 +0000
Message-Id: <E1UN8JI-0002Uj-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] powernow: add fixups for AMD
	P-state figures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53e44e226b667ac792c5b71ade92920b4fe0f11c
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Apr 2 12:25:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:25:07 2013 +0200

    powernow: add fixups for AMD P-state figures
    
    In the Linux kernel, these two git commits:
    
    - f594065faf4f9067c2283a34619fc0714e79a98d
      ACPI: Add fixups for AMD P-state figures
    - 9855d8ce41a7801548a05d844db2f46c3e810166
      ACPI: Check MSR valid bit before using P-state frequencies
    
    Try to fix the the issue that "some AMD systems may round the
    frequencies in ACPI tables to 100MHz boundaries. We can obtain the real
    frequencies from MSRs, so add a quirk to fix these frequencies up
    on AMD systems." (from f594065..)
    
    In discussion (around 9855d8..) "it turned out that indeed real
    HW/BIOSes may choose to not set the valid bit and thus mark the
    P-state as invalid. So this could be considered a fix for broken
    BIOSes." (from 9855d8..)
    
    which is great for Linux. Unfortunatly the Linux kernel, when
    it tries to do the RDMSR under Xen it fails to get the right
    value (it gets zero) as Xen traps it and returns zero. Hence
    when dom0 uploads the P-states they will be unmodified and
    we should take care of updating the frequencies with the right
    values.
    
    I've tested it under Dell Inc. PowerEdge T105 /0RR825, BIOS 1.3.2
    08/20/2008 where this quirk can be observed (x86 == 0x10, model == 2).
    Also on other AMD (x86 == 0x12, A8-3850; x86 = 0x14, AMD E-350) to
    make sure the quirk is not applied there.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: stefan.bader@canonical.com
    
    Do the MSR access here (and while at it, also the one reading
    MSR_PSTATE_CUR_LIMIT) on the target CPU, and bound the loop over
    amd_fixup_frequency() by max_hw_pstate (matching the one in
    powernow_cpufreq_cpu_init()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 1d80765b504b34b63a42a63aff4291e07e29f0c5
    master date: 2013-03-12 15:34:22 +0100
---
 xen/arch/x86/acpi/cpufreq/powernow.c |   56 ++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index db1806f..398c1c6 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -146,6 +146,51 @@ static int powernow_cpufreq_target(struct cpufreq_policy *policy,
     return result;
 }
 
+static void amd_fixup_frequency(struct xen_processor_px *px)
+{
+    u32 hi, lo, fid, did;
+    int index = px->control & 0x00000007;
+    const struct cpuinfo_x86 *c = &current_cpu_data;
+
+    if ((c->x86 != 0x10 || c->x86_model >= 10) && c->x86 != 0x11)
+        return;
+
+    rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
+    /*
+     * MSR C001_0064+:
+     * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
+     */
+    if (!(hi & (1U << 31)))
+        return;
+
+    fid = lo & 0x3f;
+    did = (lo >> 6) & 7;
+    if (c->x86 == 0x10)
+        px->core_frequency = (100 * (fid + 16)) >> did;
+    else
+        px->core_frequency = (100 * (fid + 8)) >> did;
+}
+
+struct amd_cpu_data {
+    struct processor_performance *perf;
+    u32 max_hw_pstate;
+};
+
+static void get_cpu_data(void *arg)
+{
+    struct amd_cpu_data *data = arg;
+    struct processor_performance *perf = data->perf;
+    uint64_t msr_content;
+    unsigned int i;
+
+    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
+    data->max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >>
+                          HW_PSTATE_MAX_SHIFT;
+
+    for (i = 0; i < perf->state_count && i <= data->max_hw_pstate; i++)
+        amd_fixup_frequency(&perf->states[i]);
+}
+
 static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
 {
     struct powernow_cpufreq_data *data;
@@ -192,8 +237,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     struct powernow_cpufreq_data *data;
     unsigned int result = 0;
     struct processor_performance *perf;
-    u32 max_hw_pstate;
-    uint64_t msr_content;
+    struct amd_cpu_data info;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
 
     data = xmalloc(struct powernow_cpufreq_data);
@@ -205,7 +249,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
-    perf = data->acpi_data;
+    info.perf = perf = data->acpi_data;
     policy->shared_type = perf->shared_type;
 
     /*
@@ -225,8 +269,6 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
         result = -ENODEV;
         goto err_unreg;
     }
-    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
-    max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT;
 
     if (perf->control_register.space_id != perf->status_register.space_id) {
         result = -ENODEV;
@@ -251,9 +293,11 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR;
 
+    on_selected_cpus(cpumask_of(cpu), get_cpu_data, &info, 1);
+
     data->max_freq = perf->states[0].core_frequency * 1000;
     /* table init */
-    for (i = 0; i < perf->state_count && i <= max_hw_pstate; i++) {
+    for (i = 0; i < perf->state_count && i <= info.max_hw_pstate; i++) {
         if (i > 0 && perf->states[i].core_frequency >=
             data->freq_table[valid_states-1].frequency / 1000)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Ja-0007Fh-7f; Tue, 02 Apr 2013 21:00:22 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8JZ-0007Fa-Ng
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:21 +0000
Received: from [85.158.138.51:18643] by server-4.bemta-3.messagelabs.com id
	08/E8-21470-0E64B515; Tue, 02 Apr 2013 21:00:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1364936413!27721575!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5090 invoked from network); 2 Apr 2013 21:00:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8JJ-0001UH-62
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8JI-0002Uj-QR
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:04 +0000
Date: Tue, 02 Apr 2013 21:00:04 +0000
Message-Id: <E1UN8JI-0002Uj-QR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] powernow: add fixups for AMD
	P-state figures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53e44e226b667ac792c5b71ade92920b4fe0f11c
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Apr 2 12:25:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:25:07 2013 +0200

    powernow: add fixups for AMD P-state figures
    
    In the Linux kernel, these two git commits:
    
    - f594065faf4f9067c2283a34619fc0714e79a98d
      ACPI: Add fixups for AMD P-state figures
    - 9855d8ce41a7801548a05d844db2f46c3e810166
      ACPI: Check MSR valid bit before using P-state frequencies
    
    Try to fix the the issue that "some AMD systems may round the
    frequencies in ACPI tables to 100MHz boundaries. We can obtain the real
    frequencies from MSRs, so add a quirk to fix these frequencies up
    on AMD systems." (from f594065..)
    
    In discussion (around 9855d8..) "it turned out that indeed real
    HW/BIOSes may choose to not set the valid bit and thus mark the
    P-state as invalid. So this could be considered a fix for broken
    BIOSes." (from 9855d8..)
    
    which is great for Linux. Unfortunatly the Linux kernel, when
    it tries to do the RDMSR under Xen it fails to get the right
    value (it gets zero) as Xen traps it and returns zero. Hence
    when dom0 uploads the P-states they will be unmodified and
    we should take care of updating the frequencies with the right
    values.
    
    I've tested it under Dell Inc. PowerEdge T105 /0RR825, BIOS 1.3.2
    08/20/2008 where this quirk can be observed (x86 == 0x10, model == 2).
    Also on other AMD (x86 == 0x12, A8-3850; x86 = 0x14, AMD E-350) to
    make sure the quirk is not applied there.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: stefan.bader@canonical.com
    
    Do the MSR access here (and while at it, also the one reading
    MSR_PSTATE_CUR_LIMIT) on the target CPU, and bound the loop over
    amd_fixup_frequency() by max_hw_pstate (matching the one in
    powernow_cpufreq_cpu_init()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 1d80765b504b34b63a42a63aff4291e07e29f0c5
    master date: 2013-03-12 15:34:22 +0100
---
 xen/arch/x86/acpi/cpufreq/powernow.c |   56 ++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index db1806f..398c1c6 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -146,6 +146,51 @@ static int powernow_cpufreq_target(struct cpufreq_policy *policy,
     return result;
 }
 
+static void amd_fixup_frequency(struct xen_processor_px *px)
+{
+    u32 hi, lo, fid, did;
+    int index = px->control & 0x00000007;
+    const struct cpuinfo_x86 *c = &current_cpu_data;
+
+    if ((c->x86 != 0x10 || c->x86_model >= 10) && c->x86 != 0x11)
+        return;
+
+    rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
+    /*
+     * MSR C001_0064+:
+     * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
+     */
+    if (!(hi & (1U << 31)))
+        return;
+
+    fid = lo & 0x3f;
+    did = (lo >> 6) & 7;
+    if (c->x86 == 0x10)
+        px->core_frequency = (100 * (fid + 16)) >> did;
+    else
+        px->core_frequency = (100 * (fid + 8)) >> did;
+}
+
+struct amd_cpu_data {
+    struct processor_performance *perf;
+    u32 max_hw_pstate;
+};
+
+static void get_cpu_data(void *arg)
+{
+    struct amd_cpu_data *data = arg;
+    struct processor_performance *perf = data->perf;
+    uint64_t msr_content;
+    unsigned int i;
+
+    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
+    data->max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >>
+                          HW_PSTATE_MAX_SHIFT;
+
+    for (i = 0; i < perf->state_count && i <= data->max_hw_pstate; i++)
+        amd_fixup_frequency(&perf->states[i]);
+}
+
 static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
 {
     struct powernow_cpufreq_data *data;
@@ -192,8 +237,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     struct powernow_cpufreq_data *data;
     unsigned int result = 0;
     struct processor_performance *perf;
-    u32 max_hw_pstate;
-    uint64_t msr_content;
+    struct amd_cpu_data info;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
 
     data = xmalloc(struct powernow_cpufreq_data);
@@ -205,7 +249,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
-    perf = data->acpi_data;
+    info.perf = perf = data->acpi_data;
     policy->shared_type = perf->shared_type;
 
     /*
@@ -225,8 +269,6 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
         result = -ENODEV;
         goto err_unreg;
     }
-    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
-    max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT;
 
     if (perf->control_register.space_id != perf->status_register.space_id) {
         result = -ENODEV;
@@ -251,9 +293,11 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR;
 
+    on_selected_cpus(cpumask_of(cpu), get_cpu_data, &info, 1);
+
     data->max_freq = perf->states[0].core_frequency * 1000;
     /* table init */
-    for (i = 0; i < perf->state_count && i <= max_hw_pstate; i++) {
+    for (i = 0; i < perf->state_count && i <= info.max_hw_pstate; i++) {
         if (i > 0 && perf->states[i].core_frequency >=
             data->freq_table[valid_states-1].frequency / 1000)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Jg-0007G2-Ap; Tue, 02 Apr 2013 21:00:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jf-0007Fw-O8
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:27 +0000
Received: from [85.158.139.83:34877] by server-10.bemta-5.messagelabs.com id
	2A/E3-23714-AE64B515; Tue, 02 Apr 2013 21:00:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1364936424!27770688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16007 invoked from network); 2 Apr 2013 21:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jb-0001UK-Qy
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jb-0002WV-Dl
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:23 +0000
Date: Tue, 02 Apr 2013 21:00:23 +0000
Message-Id: <E1UN8Jb-0002WV-Dl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/MCA: suppress bank clearing
	for certain injected events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf7ec303a920cfead31ebd4373ecd365b527e680
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 12:26:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:26:22 2013 +0200

    x86/MCA: suppress bank clearing for certain injected events
    
    As the bits indicating validity of the ADDR and MISC bank MSRs may be
    injected in a way that isn't consistent with what the underlying
    hardware implements (while the bank must be valid for injection to
    work, the auxiliary MSRs may not be implemented - and hence cause #GP
    upon access - if the hardware never sets the corresponding valid bits.
    
    Consequently we need to do the clearing writes only if no value was
    interposed for the respective MSR (which also makes sense the other way
    around: there's no point in clearing a hardware register when all data
    read came from software). Of course this all requires the injection
    tool to do things in a consistent way (but that had been a requirement
    before already).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Ren Yongjie <yongjie.ren@intel.com>
    Acked-by: Liu Jinsong <jinsong.liu@intel.com>
    master changeset: b0583c0e64cc8bb6229c95c3304fdac2051f79b3
    master date: 2013-03-12 15:53:30 +0100
---
 xen/arch/x86/cpu/mcheck/mce.c |   12 +++++++-----
 xen/arch/x86/cpu/mcheck/mce.h |    8 ++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 8a1c19c..1842e52 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1117,13 +1117,15 @@ static void intpose_add(unsigned int cpu_nr, uint64_t msr, uint64_t val)
     printk("intpose_add: interpose array full - request dropped\n");
 }
 
-void intpose_inval(unsigned int cpu_nr, uint64_t msr)
+bool_t intpose_inval(unsigned int cpu_nr, uint64_t msr)
 {
-    struct intpose_ent *ent;
+    struct intpose_ent *ent = intpose_lookup(cpu_nr, msr, NULL);
 
-    if ((ent = intpose_lookup(cpu_nr, msr, NULL)) != NULL) {
-        ent->cpu_nr = -1;
-    }
+    if ( !ent )
+        return 0;
+
+    ent->cpu_nr = -1;
+    return 1;
 }
 
 #define IS_MCA_BANKREG(r) \
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index f87fd08..2428f3a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -83,7 +83,7 @@ extern void mce_recoverable_register(mce_recoverable_t);
 /* Read an MSR, checking for an interposed value first */
 extern struct intpose_ent *intpose_lookup(unsigned int, uint64_t,
     uint64_t *);
-extern void intpose_inval(unsigned int, uint64_t);
+extern bool_t intpose_inval(unsigned int, uint64_t);
 
 static inline uint64_t mca_rdmsr(unsigned int msr)
 {
@@ -95,9 +95,9 @@ static inline uint64_t mca_rdmsr(unsigned int msr)
 
 /* Write an MSR, invalidating any interposed value */
 #define mca_wrmsr(msr, val) do { \
-       intpose_inval(smp_processor_id(), msr); \
-       wrmsrl(msr, val); \
-} while (0)
+    if ( !intpose_inval(smp_processor_id(), msr) ) \
+        wrmsrl(msr, val); \
+} while ( 0 )
 
 
 /* Utility function to "logout" all architectural MCA telemetry from the MCA
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Jg-0007G2-Ap; Tue, 02 Apr 2013 21:00:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jf-0007Fw-O8
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:27 +0000
Received: from [85.158.139.83:34877] by server-10.bemta-5.messagelabs.com id
	2A/E3-23714-AE64B515; Tue, 02 Apr 2013 21:00:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1364936424!27770688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16007 invoked from network); 2 Apr 2013 21:00:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jb-0001UK-Qy
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jb-0002WV-Dl
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:23 +0000
Date: Tue, 02 Apr 2013 21:00:23 +0000
Message-Id: <E1UN8Jb-0002WV-Dl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/MCA: suppress bank clearing
	for certain injected events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf7ec303a920cfead31ebd4373ecd365b527e680
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 12:26:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:26:22 2013 +0200

    x86/MCA: suppress bank clearing for certain injected events
    
    As the bits indicating validity of the ADDR and MISC bank MSRs may be
    injected in a way that isn't consistent with what the underlying
    hardware implements (while the bank must be valid for injection to
    work, the auxiliary MSRs may not be implemented - and hence cause #GP
    upon access - if the hardware never sets the corresponding valid bits.
    
    Consequently we need to do the clearing writes only if no value was
    interposed for the respective MSR (which also makes sense the other way
    around: there's no point in clearing a hardware register when all data
    read came from software). Of course this all requires the injection
    tool to do things in a consistent way (but that had been a requirement
    before already).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Ren Yongjie <yongjie.ren@intel.com>
    Acked-by: Liu Jinsong <jinsong.liu@intel.com>
    master changeset: b0583c0e64cc8bb6229c95c3304fdac2051f79b3
    master date: 2013-03-12 15:53:30 +0100
---
 xen/arch/x86/cpu/mcheck/mce.c |   12 +++++++-----
 xen/arch/x86/cpu/mcheck/mce.h |    8 ++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 8a1c19c..1842e52 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1117,13 +1117,15 @@ static void intpose_add(unsigned int cpu_nr, uint64_t msr, uint64_t val)
     printk("intpose_add: interpose array full - request dropped\n");
 }
 
-void intpose_inval(unsigned int cpu_nr, uint64_t msr)
+bool_t intpose_inval(unsigned int cpu_nr, uint64_t msr)
 {
-    struct intpose_ent *ent;
+    struct intpose_ent *ent = intpose_lookup(cpu_nr, msr, NULL);
 
-    if ((ent = intpose_lookup(cpu_nr, msr, NULL)) != NULL) {
-        ent->cpu_nr = -1;
-    }
+    if ( !ent )
+        return 0;
+
+    ent->cpu_nr = -1;
+    return 1;
 }
 
 #define IS_MCA_BANKREG(r) \
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index f87fd08..2428f3a 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -83,7 +83,7 @@ extern void mce_recoverable_register(mce_recoverable_t);
 /* Read an MSR, checking for an interposed value first */
 extern struct intpose_ent *intpose_lookup(unsigned int, uint64_t,
     uint64_t *);
-extern void intpose_inval(unsigned int, uint64_t);
+extern bool_t intpose_inval(unsigned int, uint64_t);
 
 static inline uint64_t mca_rdmsr(unsigned int msr)
 {
@@ -95,9 +95,9 @@ static inline uint64_t mca_rdmsr(unsigned int msr)
 
 /* Write an MSR, invalidating any interposed value */
 #define mca_wrmsr(msr, val) do { \
-       intpose_inval(smp_processor_id(), msr); \
-       wrmsrl(msr, val); \
-} while (0)
+    if ( !intpose_inval(smp_processor_id(), msr) ) \
+        wrmsrl(msr, val); \
+} while ( 0 )
 
 
 /* Utility function to "logout" all architectural MCA telemetry from the MCA
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Jr-0007Hp-Dw; Tue, 02 Apr 2013 21:00:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jq-0007HV-4X
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:38 +0000
Received: from [85.158.138.51:19575] by server-5.bemta-3.messagelabs.com id
	4D/FF-30636-4F64B515; Tue, 02 Apr 2013 21:00:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1364936434!8758513!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4819 invoked from network); 2 Apr 2013 21:00:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jm-0001UP-Cb
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jm-0002Wv-1s
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:34 +0000
Date: Tue, 02 Apr 2013 21:00:34 +0000
Message-Id: <E1UN8Jm-0002Wv-1s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] AMD/IOMMU: Process softirqs while
	building dom0 iommu mappings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dafb4bd5885ca66040094b5d79e053e245d587df
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:27:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:27:20 2013 +0200

    AMD/IOMMU: Process softirqs while building dom0 iommu mappings
    
    Recent changes which have made their way into xen-4.2 stable have pushed the
    runtime of construct_dom0() over 5 seconds, which has caused regressions in
    XenServer testing because of our 5 second watchdog.
    
    The root cause is that amd_iommu_dom0_init() does not process softirqs and in
    particular the nmi_timer which causes the watchdog to decide that no useful
    progress is being made.
    
    This patch adds periodic calls to process_pending_softirqs() at the same
    interval as the Intel variant of this function.  The server which was failing
    with the watchdog test now boots reliably with a timeout of 1 second.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 0f7b6f91ac1bbfd33b23c291b14874b9561909d2
    master date: 2013-03-20 10:00:01 +0100
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 21b7460..43175cd 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -21,6 +21,7 @@
 #include <xen/sched.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
+#include <xen/softirq.h>
 #include <asm/hvm/iommu.h>
 #include <asm/amd-iommu.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
@@ -271,6 +272,9 @@ static void __init amd_iommu_dom0_init(struct domain *d)
              * a pfn_valid() check would seem desirable here.
              */
             amd_iommu_map_page(d, pfn, pfn, IOMMUF_readable|IOMMUF_writable);
+
+            if ( !(i & 0xfffff) )
+                process_pending_softirqs();
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Jr-0007Hp-Dw; Tue, 02 Apr 2013 21:00:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jq-0007HV-4X
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:38 +0000
Received: from [85.158.138.51:19575] by server-5.bemta-3.messagelabs.com id
	4D/FF-30636-4F64B515; Tue, 02 Apr 2013 21:00:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1364936434!8758513!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4819 invoked from network); 2 Apr 2013 21:00:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jm-0001UP-Cb
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jm-0002Wv-1s
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:34 +0000
Date: Tue, 02 Apr 2013 21:00:34 +0000
Message-Id: <E1UN8Jm-0002Wv-1s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] AMD/IOMMU: Process softirqs while
	building dom0 iommu mappings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dafb4bd5885ca66040094b5d79e053e245d587df
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:27:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:27:20 2013 +0200

    AMD/IOMMU: Process softirqs while building dom0 iommu mappings
    
    Recent changes which have made their way into xen-4.2 stable have pushed the
    runtime of construct_dom0() over 5 seconds, which has caused regressions in
    XenServer testing because of our 5 second watchdog.
    
    The root cause is that amd_iommu_dom0_init() does not process softirqs and in
    particular the nmi_timer which causes the watchdog to decide that no useful
    progress is being made.
    
    This patch adds periodic calls to process_pending_softirqs() at the same
    interval as the Intel variant of this function.  The server which was failing
    with the watchdog test now boots reliably with a timeout of 1 second.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 0f7b6f91ac1bbfd33b23c291b14874b9561909d2
    master date: 2013-03-20 10:00:01 +0100
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 21b7460..43175cd 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -21,6 +21,7 @@
 #include <xen/sched.h>
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
+#include <xen/softirq.h>
 #include <asm/hvm/iommu.h>
 #include <asm/amd-iommu.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
@@ -271,6 +272,9 @@ static void __init amd_iommu_dom0_init(struct domain *d)
              * a pfn_valid() check would seem desirable here.
              */
             amd_iommu_map_page(d, pfn, pfn, IOMMUF_readable|IOMMUF_writable);
+
+            if ( !(i & 0xfffff) )
+                process_pending_softirqs();
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8K0-0007Jd-Gr; Tue, 02 Apr 2013 21:00:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jz-0007JK-Cx
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:47 +0000
Received: from [85.158.139.211:61279] by server-10.bemta-5.messagelabs.com id
	0D/24-23714-EF64B515; Tue, 02 Apr 2013 21:00:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1364936444!18519603!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31450 invoked from network); 2 Apr 2013 21:00:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jw-0001UY-Mo
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jw-0002XI-Hl
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:44 +0000
Date: Tue, 02 Apr 2013 21:00:44 +0000
Message-Id: <E1UN8Jw-0002XI-Hl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VT-d: Enumerate IOMMUs when
	listing capabilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71957125b573864f8a7e72d1e2ade89446da88a7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:28:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:28:22 2013 +0200

    VT-d: Enumerate IOMMUs when listing capabilities
    
    This saves N identical console log lines on a multi-iommu server.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 32861c537781ac94bf403fb778505c3679b85f67
    master date: 2013-03-20 10:02:26 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e1faacb..c218ec3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2164,7 +2164,8 @@ int __init intel_vtd_setup(void)
     {
         iommu = drhd->iommu;
 
-        printk("Intel VT-d supported page sizes: 4kB");
+        printk("Intel VT-d iommu %"PRIu32" supported page sizes: 4kB",
+               iommu->index);
         if (cap_sps_2mb(iommu->cap))
             printk(", 2MB");
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:00:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8K0-0007Jd-Gr; Tue, 02 Apr 2013 21:00:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jz-0007JK-Cx
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:47 +0000
Received: from [85.158.139.211:61279] by server-10.bemta-5.messagelabs.com id
	0D/24-23714-EF64B515; Tue, 02 Apr 2013 21:00:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1364936444!18519603!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31450 invoked from network); 2 Apr 2013 21:00:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jw-0001UY-Mo
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Jw-0002XI-Hl
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:44 +0000
Date: Tue, 02 Apr 2013 21:00:44 +0000
Message-Id: <E1UN8Jw-0002XI-Hl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VT-d: Enumerate IOMMUs when
	listing capabilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 71957125b573864f8a7e72d1e2ade89446da88a7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:28:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:28:22 2013 +0200

    VT-d: Enumerate IOMMUs when listing capabilities
    
    This saves N identical console log lines on a multi-iommu server.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 32861c537781ac94bf403fb778505c3679b85f67
    master date: 2013-03-20 10:02:26 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index e1faacb..c218ec3 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2164,7 +2164,8 @@ int __init intel_vtd_setup(void)
     {
         iommu = drhd->iommu;
 
-        printk("Intel VT-d supported page sizes: 4kB");
+        printk("Intel VT-d iommu %"PRIu32" supported page sizes: 4kB",
+               iommu->index);
         if (cap_sps_2mb(iommu->cap))
             printk(", 2MB");
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8KA-0007LG-KT; Tue, 02 Apr 2013 21:00:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8K9-0007Ky-Kh
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:57 +0000
Received: from [85.158.138.51:51393] by server-6.bemta-3.messagelabs.com id
	38/51-11048-8074B515; Tue, 02 Apr 2013 21:00:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1364936455!27454742!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25334 invoked from network); 2 Apr 2013 21:00:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8K6-0001Uh-Tx
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8K6-0002Xk-Rg
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:54 +0000
Date: Tue, 02 Apr 2013 21:00:54 +0000
Message-Id: <E1UN8K6-0002Xk-Rg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] IOMMU: properly check whether
	interrupt remapping is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bbfb6a516f1af90981bcfbbcff0795474d0759ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 12:29:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:29:34 2013 +0200

    IOMMU: properly check whether interrupt remapping is enabled
    
    ... rather than the IOMMU as a whole.
    
    That in turn required to make sure iommu_intremap gets properly
    cleared when the respective initialization fails (or isn't being
    done at all).
    
    Along with making sure interrupt remapping doesn't get inconsistently
    enabled on some IOMMUs and not on others in the VT-d code, this in turn
    allowed quite a bit of cleanup on the VT-d side (removed from the
    backport).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: fae0372140befb88d890a30704a8ec058c902af8
    master date: 2013-03-25 14:28:31 +0100
---
 xen/arch/x86/msi.c                  |    6 +++---
 xen/drivers/passthrough/iommu.c     |    5 +++++
 xen/drivers/passthrough/vtd/iommu.c |    3 +++
 xen/include/asm-x86/io_apic.h       |    2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index ef332fb..ef3e4bd 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -201,7 +201,7 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         BUG();
     }
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
 }
 
@@ -222,7 +222,7 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
     {
         ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
@@ -438,7 +438,7 @@ int msi_free_irq(struct msi_desc *entry)
     }
 
     /* Free the unused IRTE if intr remap enabled */
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_update_ire_from_msi(entry, NULL);
 
     list_del(&entry->list);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 456014a..cf506e2 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -323,6 +323,8 @@ int __init iommu_setup(void)
         rc = iommu_hardware_setup();
         iommu_enabled = (rc == 0);
     }
+    if ( !iommu_enabled )
+        iommu_intremap = 0;
 
     if ( (force_iommu && !iommu_enabled) ||
          (force_intremap && !iommu_intremap) )
@@ -339,9 +341,12 @@ int __init iommu_setup(void)
     }
     printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis");
     if ( iommu_enabled )
+    {
         printk(" - Dom0 mode: %s\n",
                iommu_passthrough ? "Passthrough" :
                iommu_dom0_strict ? "Strict" : "Relaxed");
+        printk("Interrupt remapping %sabled\n", iommu_intremap ? "en" : "dis");
+    }
 
     return rc;
 }
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c218ec3..22e757c 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2101,6 +2101,9 @@ static int init_vtd_hw(void)
                 break;
             }
         }
+        if ( !iommu_intremap )
+            for_each_drhd_unit ( drhd )
+                disable_intremap(drhd->iommu);
     }
 
     /*
diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h
index 1b42f85..bbb6f38 100644
--- a/xen/include/asm-x86/io_apic.h
+++ b/xen/include/asm-x86/io_apic.h
@@ -129,7 +129,7 @@ struct IO_APIC_route_entry {
 extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
 
 /* Only need to remap ioapic RTE (reg: 10~3Fh) */
-#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10))
+#define ioapic_reg_remapped(reg) (iommu_intremap && ((reg) >= 0x10))
 
 static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8KA-0007LG-KT; Tue, 02 Apr 2013 21:00:58 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8K9-0007Ky-Kh
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:57 +0000
Received: from [85.158.138.51:51393] by server-6.bemta-3.messagelabs.com id
	38/51-11048-8074B515; Tue, 02 Apr 2013 21:00:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1364936455!27454742!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25334 invoked from network); 2 Apr 2013 21:00:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:00:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8K6-0001Uh-Tx
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8K6-0002Xk-Rg
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:00:54 +0000
Date: Tue, 02 Apr 2013 21:00:54 +0000
Message-Id: <E1UN8K6-0002Xk-Rg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] IOMMU: properly check whether
	interrupt remapping is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bbfb6a516f1af90981bcfbbcff0795474d0759ef
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 12:29:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:29:34 2013 +0200

    IOMMU: properly check whether interrupt remapping is enabled
    
    ... rather than the IOMMU as a whole.
    
    That in turn required to make sure iommu_intremap gets properly
    cleared when the respective initialization fails (or isn't being
    done at all).
    
    Along with making sure interrupt remapping doesn't get inconsistently
    enabled on some IOMMUs and not on others in the VT-d code, this in turn
    allowed quite a bit of cleanup on the VT-d side (removed from the
    backport).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: fae0372140befb88d890a30704a8ec058c902af8
    master date: 2013-03-25 14:28:31 +0100
---
 xen/arch/x86/msi.c                  |    6 +++---
 xen/drivers/passthrough/iommu.c     |    5 +++++
 xen/drivers/passthrough/vtd/iommu.c |    3 +++
 xen/include/asm-x86/io_apic.h       |    2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index ef332fb..ef3e4bd 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -201,7 +201,7 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         BUG();
     }
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
 }
 
@@ -222,7 +222,7 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
     {
         ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
@@ -438,7 +438,7 @@ int msi_free_irq(struct msi_desc *entry)
     }
 
     /* Free the unused IRTE if intr remap enabled */
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_update_ire_from_msi(entry, NULL);
 
     list_del(&entry->list);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 456014a..cf506e2 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -323,6 +323,8 @@ int __init iommu_setup(void)
         rc = iommu_hardware_setup();
         iommu_enabled = (rc == 0);
     }
+    if ( !iommu_enabled )
+        iommu_intremap = 0;
 
     if ( (force_iommu && !iommu_enabled) ||
          (force_intremap && !iommu_intremap) )
@@ -339,9 +341,12 @@ int __init iommu_setup(void)
     }
     printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis");
     if ( iommu_enabled )
+    {
         printk(" - Dom0 mode: %s\n",
                iommu_passthrough ? "Passthrough" :
                iommu_dom0_strict ? "Strict" : "Relaxed");
+        printk("Interrupt remapping %sabled\n", iommu_intremap ? "en" : "dis");
+    }
 
     return rc;
 }
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c218ec3..22e757c 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2101,6 +2101,9 @@ static int init_vtd_hw(void)
                 break;
             }
         }
+        if ( !iommu_intremap )
+            for_each_drhd_unit ( drhd )
+                disable_intremap(drhd->iommu);
     }
 
     /*
diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h
index 1b42f85..bbb6f38 100644
--- a/xen/include/asm-x86/io_apic.h
+++ b/xen/include/asm-x86/io_apic.h
@@ -129,7 +129,7 @@ struct IO_APIC_route_entry {
 extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
 
 /* Only need to remap ioapic RTE (reg: 10~3Fh) */
-#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10))
+#define ioapic_reg_remapped(reg) (iommu_intremap && ((reg) >= 0x10))
 
 static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8KN-0007QW-Nw; Tue, 02 Apr 2013 21:01:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KM-0007Q7-B9
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:10 +0000
Received: from [85.158.137.99:11825] by server-3.bemta-3.messagelabs.com id
	6E/06-26934-4174B515; Tue, 02 Apr 2013 21:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1364936465!16393811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22848 invoked from network); 2 Apr 2013 21:01:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KH-0001VJ-7L
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KH-0002YG-4E
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:05 +0000
Date: Tue, 02 Apr 2013 21:01:05 +0000
Message-Id: <E1UN8KH-0002YG-4E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VT-d: deal with 5500/5520/X58
	errata
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0734ad109457365d8801601860fd98077944dd15
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Apr 2 12:30:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:30:55 2013 +0200

    VT-d: deal with 5500/5520/X58 errata
    
    http://www.intel.com/content/www/us/en/chipsets/5520-and-5500-chipset-ioh-specification-update.html
    
    Stepping B-3 has two errata (#47 and #53) related to Interrupt
    remapping, to which the workaround is for the BIOS to completely disable
    interrupt remapping.  These errata are fixed in stepping C-2.
    
    Unfortunately this chipset stepping is very common and many BIOSes are
    not disabling interrupt remapping on this stepping .  We can detect this in
    Xen and prevent Xen from using the problematic interrupt remapping feature.
    
    The Intel 5500/5520/X58 chipset does not support VT-d
    Extended Interrupt Mode(EIM). This means the iommu_supports_eim() check
    always fails and so x2apic mode cannot be enabled in Xen before this quirk
    disables the interrupt remapping feature.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Gate the function call to check the quirk on interrupt remapping being
    requested to get enabled, and upon failure disable the IOMMU to be in
    line with what the changes for XSA-36 (plus follow-ups) did.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: 6890cebc6a987d0e896f5d23a8de11a3934101cf
    master date: 2013-03-25 14:31:27 +0100
---
 xen/drivers/passthrough/vtd/iommu.c  |    2 ++
 xen/drivers/passthrough/vtd/quirks.c |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 22e757c..bbfcf2a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2151,6 +2151,8 @@ int __init intel_vtd_setup(void)
         return -ENODEV;
 
     platform_quirks_init();
+    if ( !iommu_enabled )
+        return -ENODEV;
 
     irq_to_iommu = xmalloc_array(struct iommu*, nr_irqs);
     BUG_ON(!irq_to_iommu);
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 0f7db71..b540b9c 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -249,6 +249,29 @@ void vtd_ops_postamble_quirk(struct iommu* iommu)
     }
 }
 
+/* 5500/5520/X58 Chipset Interrupt remapping errata, for stepping B-3.
+ * Fixed in stepping C-2. */
+static void __init tylersburg_intremap_quirk(void)
+{
+    uint32_t bus, device;
+    uint8_t rev;
+
+    for ( bus = 0; bus < 0x100; bus++ )
+    {
+        /* Match on System Management Registers on Device 20 Function 0 */
+        device = pci_conf_read32(bus, 20, 0, PCI_VENDOR_ID);
+        rev = pci_conf_read8(bus, 20, 0, PCI_REVISION_ID);
+
+        if ( rev == 0x13 && device == 0x342e8086 )
+        {
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Disabling IOMMU due to Intel 5500/5520/X58 Chipset errata #47, #53\n");
+            iommu_enabled = 0;
+            break;
+        }
+    }
+}
+
 /* initialize platform identification flags */
 void __init platform_quirks_init(void)
 {
@@ -269,6 +292,10 @@ void __init platform_quirks_init(void)
 
     /* ioremap IGD MMIO+0x2000 page */
     map_igd_reg();
+
+    /* Tylersburg interrupt remap quirk */
+    if ( iommu_intremap )
+        tylersburg_intremap_quirk();
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8KN-0007QW-Nw; Tue, 02 Apr 2013 21:01:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KM-0007Q7-B9
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:10 +0000
Received: from [85.158.137.99:11825] by server-3.bemta-3.messagelabs.com id
	6E/06-26934-4174B515; Tue, 02 Apr 2013 21:01:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1364936465!16393811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22848 invoked from network); 2 Apr 2013 21:01:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KH-0001VJ-7L
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KH-0002YG-4E
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:05 +0000
Date: Tue, 02 Apr 2013 21:01:05 +0000
Message-Id: <E1UN8KH-0002YG-4E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VT-d: deal with 5500/5520/X58
	errata
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0734ad109457365d8801601860fd98077944dd15
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Apr 2 12:30:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:30:55 2013 +0200

    VT-d: deal with 5500/5520/X58 errata
    
    http://www.intel.com/content/www/us/en/chipsets/5520-and-5500-chipset-ioh-specification-update.html
    
    Stepping B-3 has two errata (#47 and #53) related to Interrupt
    remapping, to which the workaround is for the BIOS to completely disable
    interrupt remapping.  These errata are fixed in stepping C-2.
    
    Unfortunately this chipset stepping is very common and many BIOSes are
    not disabling interrupt remapping on this stepping .  We can detect this in
    Xen and prevent Xen from using the problematic interrupt remapping feature.
    
    The Intel 5500/5520/X58 chipset does not support VT-d
    Extended Interrupt Mode(EIM). This means the iommu_supports_eim() check
    always fails and so x2apic mode cannot be enabled in Xen before this quirk
    disables the interrupt remapping feature.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Gate the function call to check the quirk on interrupt remapping being
    requested to get enabled, and upon failure disable the IOMMU to be in
    line with what the changes for XSA-36 (plus follow-ups) did.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: 6890cebc6a987d0e896f5d23a8de11a3934101cf
    master date: 2013-03-25 14:31:27 +0100
---
 xen/drivers/passthrough/vtd/iommu.c  |    2 ++
 xen/drivers/passthrough/vtd/quirks.c |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 22e757c..bbfcf2a 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2151,6 +2151,8 @@ int __init intel_vtd_setup(void)
         return -ENODEV;
 
     platform_quirks_init();
+    if ( !iommu_enabled )
+        return -ENODEV;
 
     irq_to_iommu = xmalloc_array(struct iommu*, nr_irqs);
     BUG_ON(!irq_to_iommu);
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 0f7db71..b540b9c 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -249,6 +249,29 @@ void vtd_ops_postamble_quirk(struct iommu* iommu)
     }
 }
 
+/* 5500/5520/X58 Chipset Interrupt remapping errata, for stepping B-3.
+ * Fixed in stepping C-2. */
+static void __init tylersburg_intremap_quirk(void)
+{
+    uint32_t bus, device;
+    uint8_t rev;
+
+    for ( bus = 0; bus < 0x100; bus++ )
+    {
+        /* Match on System Management Registers on Device 20 Function 0 */
+        device = pci_conf_read32(bus, 20, 0, PCI_VENDOR_ID);
+        rev = pci_conf_read8(bus, 20, 0, PCI_REVISION_ID);
+
+        if ( rev == 0x13 && device == 0x342e8086 )
+        {
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Disabling IOMMU due to Intel 5500/5520/X58 Chipset errata #47, #53\n");
+            iommu_enabled = 0;
+            break;
+        }
+    }
+}
+
 /* initialize platform identification flags */
 void __init platform_quirks_init(void)
 {
@@ -269,6 +292,10 @@ void __init platform_quirks_init(void)
 
     /* ioremap IGD MMIO+0x2000 page */
     map_igd_reg();
+
+    /* Tylersburg interrupt remap quirk */
+    if ( iommu_intremap )
+        tylersburg_intremap_quirk();
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8KV-0007SC-TL; Tue, 02 Apr 2013 21:01:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KU-0007Rk-Ed
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:18 +0000
Received: from [85.158.139.83:36855] by server-14.bemta-5.messagelabs.com id
	29/39-13158-D174B515; Tue, 02 Apr 2013 21:01:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1364936475!20282134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32376 invoked from network); 2 Apr 2013 21:01:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KR-0001VP-Ew
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KR-0002ZC-CE
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:15 +0000
Date: Tue, 02 Apr 2013 21:01:15 +0000
Message-Id: <E1UN8KR-0002ZC-CE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] AMD IOMMU: allow disabling only
	interrupt remapping when certain IVRS consistency checks fail
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 842a6cedc61eabe5731ef192bf39dad66403d0c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 12:31:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:31:36 2013 +0200

    AMD IOMMU: allow disabling only interrupt remapping when certain IVRS consistency checks fail
    
    After some more thought on the XSA-36 and specifically the comments we
    got regarding disabling the IOMMU in this situation altogether making
    things worse instead of better, I came to the conclusion that we can
    actually restrict the action in affected cases to just disabling
    interrupt remapping. That doesn't make the situation worse than prior
    to the XSA-36 fixes (where interrupt remapping didn't really protect
    domains from one another), but allows at least DMA isolation to still
    be utilized.
    
    To do so, disabling of interrupt remapping must be explicitly requested
    on the command line - respective checks will then be skipped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
    master changeset: 92b8bc03bd4b582cb524db51494d0dba7607e7ac
    master date: 2013-03-25 16:55:22 +0100
---
 xen/drivers/passthrough/amd/iommu_acpi.c |    5 ++++-
 xen/drivers/passthrough/amd/iommu_init.c |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index eb9c13c..7352438 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -664,6 +664,9 @@ static u16 __init parse_ivhd_device_special(
         return dev_length;
     }
 
+    if ( !iommu_intremap )
+        return dev_length;
+
     /*
      * Some BIOSes have IOAPIC broken entries so we check for IVRS
      * consistency here --- whether entry's IOAPIC ID is valid and
@@ -902,7 +905,7 @@ static int __init parse_ivrs_table(struct acpi_table_header *_table)
     }
 
     /* Each IO-APIC must have been mentioned in the table. */
-    for ( apic = 0; !error && apic < nr_ioapics; ++apic )
+    for ( apic = 0; !error && iommu_intremap && apic < nr_ioapics; ++apic )
     {
         if ( !nr_ioapic_registers[apic] ||
              ioapic_bdf[IO_APIC_ID(apic)].pin_setup )
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 31acec9..fcb7e87 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -971,7 +971,8 @@ int __init amd_iommu_init(void)
 
     BUG_ON( !iommu_found() );
 
-    if ( amd_iommu_perdev_intremap && amd_sp5100_erratum28() )
+    if ( iommu_intremap && amd_iommu_perdev_intremap &&
+         amd_sp5100_erratum28() )
         goto error_out;
 
     irq_to_iommu = xmalloc_array(struct amd_iommu *, nr_irqs);
@@ -991,7 +992,7 @@ int __init amd_iommu_init(void)
         goto error_out;
 
     /* initialize io-apic interrupt remapping entries */
-    if ( amd_iommu_setup_ioapic_remapping() != 0 )
+    if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 )
         goto error_out;
 
     /* allocate and initialize a global device table shared by all iommus */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8KV-0007SC-TL; Tue, 02 Apr 2013 21:01:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KU-0007Rk-Ed
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:18 +0000
Received: from [85.158.139.83:36855] by server-14.bemta-5.messagelabs.com id
	29/39-13158-D174B515; Tue, 02 Apr 2013 21:01:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-182.messagelabs.com!1364936475!20282134!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32376 invoked from network); 2 Apr 2013 21:01:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KR-0001VP-Ew
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8KR-0002ZC-CE
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:15 +0000
Date: Tue, 02 Apr 2013 21:01:15 +0000
Message-Id: <E1UN8KR-0002ZC-CE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] AMD IOMMU: allow disabling only
	interrupt remapping when certain IVRS consistency checks fail
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 842a6cedc61eabe5731ef192bf39dad66403d0c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 12:31:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:31:36 2013 +0200

    AMD IOMMU: allow disabling only interrupt remapping when certain IVRS consistency checks fail
    
    After some more thought on the XSA-36 and specifically the comments we
    got regarding disabling the IOMMU in this situation altogether making
    things worse instead of better, I came to the conclusion that we can
    actually restrict the action in affected cases to just disabling
    interrupt remapping. That doesn't make the situation worse than prior
    to the XSA-36 fixes (where interrupt remapping didn't really protect
    domains from one another), but allows at least DMA isolation to still
    be utilized.
    
    To do so, disabling of interrupt remapping must be explicitly requested
    on the command line - respective checks will then be skipped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
    master changeset: 92b8bc03bd4b582cb524db51494d0dba7607e7ac
    master date: 2013-03-25 16:55:22 +0100
---
 xen/drivers/passthrough/amd/iommu_acpi.c |    5 ++++-
 xen/drivers/passthrough/amd/iommu_init.c |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index eb9c13c..7352438 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -664,6 +664,9 @@ static u16 __init parse_ivhd_device_special(
         return dev_length;
     }
 
+    if ( !iommu_intremap )
+        return dev_length;
+
     /*
      * Some BIOSes have IOAPIC broken entries so we check for IVRS
      * consistency here --- whether entry's IOAPIC ID is valid and
@@ -902,7 +905,7 @@ static int __init parse_ivrs_table(struct acpi_table_header *_table)
     }
 
     /* Each IO-APIC must have been mentioned in the table. */
-    for ( apic = 0; !error && apic < nr_ioapics; ++apic )
+    for ( apic = 0; !error && iommu_intremap && apic < nr_ioapics; ++apic )
     {
         if ( !nr_ioapic_registers[apic] ||
              ioapic_bdf[IO_APIC_ID(apic)].pin_setup )
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index 31acec9..fcb7e87 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -971,7 +971,8 @@ int __init amd_iommu_init(void)
 
     BUG_ON( !iommu_found() );
 
-    if ( amd_iommu_perdev_intremap && amd_sp5100_erratum28() )
+    if ( iommu_intremap && amd_iommu_perdev_intremap &&
+         amd_sp5100_erratum28() )
         goto error_out;
 
     irq_to_iommu = xmalloc_array(struct amd_iommu *, nr_irqs);
@@ -991,7 +992,7 @@ int __init amd_iommu_init(void)
         goto error_out;
 
     /* initialize io-apic interrupt remapping entries */
-    if ( amd_iommu_setup_ioapic_remapping() != 0 )
+    if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 )
         goto error_out;
 
     /* allocate and initialize a global device table shared by all iommus */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Kg-0007V5-0H; Tue, 02 Apr 2013 21:01:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Ke-0007Uc-KJ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:28 +0000
Received: from [85.158.139.83:37300] by server-12.bemta-5.messagelabs.com id
	FA/D0-11486-7274B515; Tue, 02 Apr 2013 21:01:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1364936486!28052511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2584 invoked from network); 2 Apr 2013 21:01:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kb-0001VY-Pf
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kb-0002Zh-Kj
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:25 +0000
Date: Tue, 02 Apr 2013 21:01:25 +0000
Message-Id: <E1UN8Kb-0002Zh-Kj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: reserve pages when
	SandyBridge integrated graphics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7c0d6df2557a86510ace568ecaf5a02dd4440c99
Author:     Xudong Hao <xudong.hao@intel.com>
AuthorDate: Tue Apr 2 12:33:47 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:33:47 2013 +0200

    x86: reserve pages when SandyBridge integrated graphics
    
    SNB graphics devices have a bug that prevent them from accessing certain
    memory ranges, namely anything below 1M and in the pages listed in the
    table.
    
    Xen does not initialize below 1MB to heap, i.e. below 1MB pages don't be
    allocated, so it's unnecessary to reserve memory below the 1 MB mark
    that has not already been reserved.
    
    So reserve those pages listed in the table at xen boot if set detect a
    SNB gfx device on the CPU to avoid GPU hangs.
    
    Signed-off-by: Xudong Hao <xudong.hao@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: db537fe3023bf157b85c8246782cb72a6f989b31
    master date: 2013-03-26 14:22:07 +0100
---
 xen/arch/x86/mm.c                    |   20 ++++++++++++++++++++
 xen/common/page_alloc.c              |   23 +++++++++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |    1 -
 xen/include/asm-x86/mm.h             |    1 +
 xen/include/xen/pci.h                |    5 +++++
 5 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ca2c8f8..0ee088a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -113,6 +113,7 @@
 #include <public/memory.h>
 #include <public/sched.h>
 #include <xsm/xsm.h>
+#include <xen/pci.h>
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
@@ -5693,6 +5694,25 @@ void memguard_unguard_stack(void *p)
     memguard_unguard_range(p, PAGE_SIZE);
 }
 
+const unsigned long *__init get_platform_badpages(unsigned int *array_size)
+{
+    u32 igd_id;
+    static unsigned long __initdata bad_pages[] = {
+        0x20050000,
+        0x20110000,
+        0x20130000,
+        0x20138000,
+        0x40004000,
+    };
+
+    *array_size = ARRAY_SIZE(bad_pages);
+    igd_id = pci_conf_read32(0, 2, 0, 0);
+    if ( !IS_SNB_GFX(igd_id) )
+        return NULL;
+
+    return bad_pages;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 311b5ee..f0de320 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -144,6 +144,10 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 {
     unsigned long bad_spfn, bad_epfn;
     const char *p;
+#ifdef CONFIG_X86
+    const unsigned long *badpage = NULL;
+    unsigned int i, array_size;
+#endif
 
     ps = round_pgup(ps);
     pe = round_pgdown(pe);
@@ -154,6 +158,25 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 
     bootmem_region_add(ps >> PAGE_SHIFT, pe >> PAGE_SHIFT);
 
+#ifdef CONFIG_X86
+    /*
+     * Here we put platform-specific memory range workarounds, i.e.
+     * memory known to be corrupt or otherwise in need to be reserved on
+     * specific platforms.
+     * We get these certain pages and remove them from memory region list.
+     */
+    badpage = get_platform_badpages(&array_size);
+    if ( badpage )
+    {
+        for ( i = 0; i < array_size; i++ )
+        {
+            bootmem_region_zap(*badpage >> PAGE_SHIFT,
+                               (*badpage >> PAGE_SHIFT) + 1);
+            badpage++;
+        }
+    }
+#endif
+
     /* Check new pages against the bad-page list. */
     p = opt_badpage;
     while ( *p != '\0' )
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index b540b9c..19c1a96 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -47,7 +47,6 @@
 #define IS_CTG(id)    (id == 0x2a408086)
 #define IS_ILK(id)    (id == 0x00408086 || id == 0x00448086 || id== 0x00628086 || id == 0x006A8086)
 #define IS_CPT(id)    (id == 0x01008086 || id == 0x01048086)
-#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 || id == 0x01268086 || id == 0x01028086 || id == 0x01128086 || id == 0x01228086 || id == 0x010A8086)
 
 u32 ioh_id;
 u32 igd_id;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index c93a022..2013ba9 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -329,6 +329,7 @@ int is_iomem_page(unsigned long mfn);
 
 void clear_superpage_mark(struct page_info *page);
 
+const unsigned long *get_platform_badpages(unsigned int *array_size);
 struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3b8067e..ea514da 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -127,4 +127,9 @@ int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *d, int pirq);
 void pci_enable_acs(struct pci_dev *pdev);
 
+#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
+                        || id == 0x01268086 || id == 0x01028086 \
+                        || id == 0x01128086 || id == 0x01228086 \
+                        || id == 0x010A8086 )
+
 #endif /* __XEN_PCI_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Kg-0007V5-0H; Tue, 02 Apr 2013 21:01:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Ke-0007Uc-KJ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:28 +0000
Received: from [85.158.139.83:37300] by server-12.bemta-5.messagelabs.com id
	FA/D0-11486-7274B515; Tue, 02 Apr 2013 21:01:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1364936486!28052511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2584 invoked from network); 2 Apr 2013 21:01:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kb-0001VY-Pf
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kb-0002Zh-Kj
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:25 +0000
Date: Tue, 02 Apr 2013 21:01:25 +0000
Message-Id: <E1UN8Kb-0002Zh-Kj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: reserve pages when
	SandyBridge integrated graphics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7c0d6df2557a86510ace568ecaf5a02dd4440c99
Author:     Xudong Hao <xudong.hao@intel.com>
AuthorDate: Tue Apr 2 12:33:47 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:33:47 2013 +0200

    x86: reserve pages when SandyBridge integrated graphics
    
    SNB graphics devices have a bug that prevent them from accessing certain
    memory ranges, namely anything below 1M and in the pages listed in the
    table.
    
    Xen does not initialize below 1MB to heap, i.e. below 1MB pages don't be
    allocated, so it's unnecessary to reserve memory below the 1 MB mark
    that has not already been reserved.
    
    So reserve those pages listed in the table at xen boot if set detect a
    SNB gfx device on the CPU to avoid GPU hangs.
    
    Signed-off-by: Xudong Hao <xudong.hao@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: db537fe3023bf157b85c8246782cb72a6f989b31
    master date: 2013-03-26 14:22:07 +0100
---
 xen/arch/x86/mm.c                    |   20 ++++++++++++++++++++
 xen/common/page_alloc.c              |   23 +++++++++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |    1 -
 xen/include/asm-x86/mm.h             |    1 +
 xen/include/xen/pci.h                |    5 +++++
 5 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index ca2c8f8..0ee088a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -113,6 +113,7 @@
 #include <public/memory.h>
 #include <public/sched.h>
 #include <xsm/xsm.h>
+#include <xen/pci.h>
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
@@ -5693,6 +5694,25 @@ void memguard_unguard_stack(void *p)
     memguard_unguard_range(p, PAGE_SIZE);
 }
 
+const unsigned long *__init get_platform_badpages(unsigned int *array_size)
+{
+    u32 igd_id;
+    static unsigned long __initdata bad_pages[] = {
+        0x20050000,
+        0x20110000,
+        0x20130000,
+        0x20138000,
+        0x40004000,
+    };
+
+    *array_size = ARRAY_SIZE(bad_pages);
+    igd_id = pci_conf_read32(0, 2, 0, 0);
+    if ( !IS_SNB_GFX(igd_id) )
+        return NULL;
+
+    return bad_pages;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 311b5ee..f0de320 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -144,6 +144,10 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 {
     unsigned long bad_spfn, bad_epfn;
     const char *p;
+#ifdef CONFIG_X86
+    const unsigned long *badpage = NULL;
+    unsigned int i, array_size;
+#endif
 
     ps = round_pgup(ps);
     pe = round_pgdown(pe);
@@ -154,6 +158,25 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 
     bootmem_region_add(ps >> PAGE_SHIFT, pe >> PAGE_SHIFT);
 
+#ifdef CONFIG_X86
+    /*
+     * Here we put platform-specific memory range workarounds, i.e.
+     * memory known to be corrupt or otherwise in need to be reserved on
+     * specific platforms.
+     * We get these certain pages and remove them from memory region list.
+     */
+    badpage = get_platform_badpages(&array_size);
+    if ( badpage )
+    {
+        for ( i = 0; i < array_size; i++ )
+        {
+            bootmem_region_zap(*badpage >> PAGE_SHIFT,
+                               (*badpage >> PAGE_SHIFT) + 1);
+            badpage++;
+        }
+    }
+#endif
+
     /* Check new pages against the bad-page list. */
     p = opt_badpage;
     while ( *p != '\0' )
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index b540b9c..19c1a96 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -47,7 +47,6 @@
 #define IS_CTG(id)    (id == 0x2a408086)
 #define IS_ILK(id)    (id == 0x00408086 || id == 0x00448086 || id== 0x00628086 || id == 0x006A8086)
 #define IS_CPT(id)    (id == 0x01008086 || id == 0x01048086)
-#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 || id == 0x01268086 || id == 0x01028086 || id == 0x01128086 || id == 0x01228086 || id == 0x010A8086)
 
 u32 ioh_id;
 u32 igd_id;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index c93a022..2013ba9 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -329,6 +329,7 @@ int is_iomem_page(unsigned long mfn);
 
 void clear_superpage_mark(struct page_info *page);
 
+const unsigned long *get_platform_badpages(unsigned int *array_size);
 struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3b8067e..ea514da 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -127,4 +127,9 @@ int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *d, int pirq);
 void pci_enable_acs(struct pci_dev *pdev);
 
+#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
+                        || id == 0x01268086 || id == 0x01028086 \
+                        || id == 0x01128086 || id == 0x01228086 \
+                        || id == 0x010A8086 )
+
 #endif /* __XEN_PCI_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Kq-0007XT-3o; Tue, 02 Apr 2013 21:01:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Ko-0007X9-P0
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:38 +0000
Received: from [85.158.138.51:23876] by server-2.bemta-3.messagelabs.com id
	C6/54-05208-2374B515; Tue, 02 Apr 2013 21:01:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1364936496!19695690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30123 invoked from network); 2 Apr 2013 21:01:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Km-0001Ve-0O
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kl-0002aF-UV
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:35 +0000
Date: Tue, 02 Apr 2013 21:01:35 +0000
Message-Id: <E1UN8Kl-0002aF-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] hvm: Clean up vlapic_reg_write()
	error propagation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9dc35328f103d4dad8067914d5b6519a3b4b7c8
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Tue Apr 2 12:34:35 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:34:35 2013 +0200

    hvm: Clean up vlapic_reg_write() error propagation.
    
    In particular, correctly propagate errors through vlapic_apicv_write()
    and hvm_x2apic_msr_write().
    
    Signed-off-by: Keir Fraser <keir@xen.org>
    master commit: 5082cc19524b6687ef1bc0a717538d75aae7cd00
    master date: 2013-03-28 20:16:37 +0000
---
 xen/arch/x86/hvm/vlapic.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 3af41cc..09baf8d 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -660,10 +660,9 @@ static int vlapic_reg_write(struct vcpu *v,
         break;
 
     case APIC_SELF_IPI:
-        if ( vlapic_x2apic_mode(vlapic) )
-            vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff));
-        else
-            rc = X86EMUL_UNHANDLEABLE;
+        rc = vlapic_x2apic_mode(vlapic)
+            ? vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff))
+            : X86EMUL_UNHANDLEABLE;
         break;
 
     case APIC_ICR:
@@ -818,19 +817,18 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
     uint32_t offset = (msr - MSR_IA32_APICBASE_MSR) << 4;
-    int rc;
 
     if ( !vlapic_x2apic_mode(vlapic) )
-        return 1;
+        return X86EMUL_UNHANDLEABLE;
 
     if ( offset == APIC_ICR )
-        if ( vlapic_reg_write(v, APIC_ICR2 , (uint32_t)(msr_content >> 32)) )
-            return 1;
-
-    rc = vlapic_reg_write(v, offset, (uint32_t)msr_content);
+    {
+        int rc = vlapic_reg_write(v, APIC_ICR2, (uint32_t)(msr_content >> 32));
+        if ( rc )
+            return rc;
+    }
 
-    /* X86EMUL_RETRY for SIPI */
-    return ((rc != X86EMUL_OKAY) && (rc != X86EMUL_RETRY));
+    return vlapic_reg_write(v, offset, (uint32_t)msr_content);
 }
 
 static int vlapic_range(struct vcpu *v, unsigned long addr)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Kq-0007XT-3o; Tue, 02 Apr 2013 21:01:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Ko-0007X9-P0
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:38 +0000
Received: from [85.158.138.51:23876] by server-2.bemta-3.messagelabs.com id
	C6/54-05208-2374B515; Tue, 02 Apr 2013 21:01:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1364936496!19695690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30123 invoked from network); 2 Apr 2013 21:01:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Km-0001Ve-0O
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kl-0002aF-UV
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:35 +0000
Date: Tue, 02 Apr 2013 21:01:35 +0000
Message-Id: <E1UN8Kl-0002aF-UV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] hvm: Clean up vlapic_reg_write()
	error propagation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9dc35328f103d4dad8067914d5b6519a3b4b7c8
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Tue Apr 2 12:34:35 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:34:35 2013 +0200

    hvm: Clean up vlapic_reg_write() error propagation.
    
    In particular, correctly propagate errors through vlapic_apicv_write()
    and hvm_x2apic_msr_write().
    
    Signed-off-by: Keir Fraser <keir@xen.org>
    master commit: 5082cc19524b6687ef1bc0a717538d75aae7cd00
    master date: 2013-03-28 20:16:37 +0000
---
 xen/arch/x86/hvm/vlapic.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 3af41cc..09baf8d 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -660,10 +660,9 @@ static int vlapic_reg_write(struct vcpu *v,
         break;
 
     case APIC_SELF_IPI:
-        if ( vlapic_x2apic_mode(vlapic) )
-            vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff));
-        else
-            rc = X86EMUL_UNHANDLEABLE;
+        rc = vlapic_x2apic_mode(vlapic)
+            ? vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff))
+            : X86EMUL_UNHANDLEABLE;
         break;
 
     case APIC_ICR:
@@ -818,19 +817,18 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
     uint32_t offset = (msr - MSR_IA32_APICBASE_MSR) << 4;
-    int rc;
 
     if ( !vlapic_x2apic_mode(vlapic) )
-        return 1;
+        return X86EMUL_UNHANDLEABLE;
 
     if ( offset == APIC_ICR )
-        if ( vlapic_reg_write(v, APIC_ICR2 , (uint32_t)(msr_content >> 32)) )
-            return 1;
-
-    rc = vlapic_reg_write(v, offset, (uint32_t)msr_content);
+    {
+        int rc = vlapic_reg_write(v, APIC_ICR2, (uint32_t)(msr_content >> 32));
+        if ( rc )
+            return rc;
+    }
 
-    /* X86EMUL_RETRY for SIPI */
-    return ((rc != X86EMUL_OKAY) && (rc != X86EMUL_RETRY));
+    return vlapic_reg_write(v, offset, (uint32_t)msr_content);
 }
 
 static int vlapic_range(struct vcpu *v, unsigned long addr)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8L1-0007Zj-72; Tue, 02 Apr 2013 21:01:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kz-0007ZR-Nr
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:49 +0000
Received: from [193.109.254.147:62250] by server-7.bemta-14.messagelabs.com id
	65/4A-19255-D374B515; Tue, 02 Apr 2013 21:01:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1364936506!8516763!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2846 invoked from network); 2 Apr 2013 21:01:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kw-0001Vm-61
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kw-0002ab-4q
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:46 +0000
Date: Tue, 02 Apr 2013 21:01:46 +0000
Message-Id: <E1UN8Kw-0002ab-4q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI/APEI: fix ERST MOVE_DATA
	instruction implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1ac613c29576ba6554bdfc9caec4634761fbc634
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 12:35:42 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:35:42 2013 +0200

    ACPI/APEI: fix ERST MOVE_DATA instruction implementation
    
    The src_base and dst_base fields in apei_exec_context are physical
    address, so they should be ioremaped before being used in ERST
    MOVE_DATA instruction.
    
    Reported-by: Javier Martinez Canillas <martinez.javier@gmail.com>
    Reported-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    Replace use of ioremap() by __acpi_map_table()/set_fixmap(). Fix error
    handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: df2cf6a726b815fafa12e503c9a36707c3962f22
    master date: 2012-10-17 14:12:06 +0200
---
 xen/drivers/acpi/apei/erst.c |   57 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index eb666a6..46fcff5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -247,15 +247,64 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
 {
 	int rc;
 	u64 offset;
+#ifdef CONFIG_X86
+	enum fixed_addresses idx;
+#endif
+	void *src, *dst;
+
+	/* ioremap does not work in interrupt context */
+	if (in_irq()) {
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used in interrupt context\n");
+		return -EBUSY;
+	}
 
 	rc = __apei_exec_read_register(entry, &offset);
 	if (rc)
 		return rc;
-	memmove((void *)(unsigned long)(ctx->dst_base + offset),
-		(void *)(unsigned long)(ctx->src_base + offset),
-		ctx->var2);
 
-	return 0;
+#ifdef CONFIG_X86
+	switch (ctx->var2) {
+	case 0:
+		return 0;
+	case 1 ... PAGE_SIZE:
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
+		       ctx->var2);
+		return -EOPNOTSUPP;
+	}
+
+	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
+#else
+	src = ioremap(ctx->src_base + offset, ctx->var2);
+#endif
+	if (!src)
+		return -ENOMEM;
+
+#ifdef CONFIG_X86
+	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
+	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
+	offset += ctx->dst_base;
+	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
+	set_fixmap(idx, offset);
+	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
+		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
+		set_fixmap(idx, offset + PAGE_SIZE);
+	}
+#else
+	dst = ioremap(ctx->dst_base + offset, ctx->var2);
+#endif
+	if (dst) {
+		memmove(dst, src, ctx->var2);
+		iounmap(dst);
+	} else
+		rc = -ENOMEM;
+
+	iounmap(src);
+
+	return rc;
 }
 
 static struct apei_exec_ins_type erst_ins_type[] = {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:01:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:01:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8L1-0007Zj-72; Tue, 02 Apr 2013 21:01:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kz-0007ZR-Nr
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:49 +0000
Received: from [193.109.254.147:62250] by server-7.bemta-14.messagelabs.com id
	65/4A-19255-D374B515; Tue, 02 Apr 2013 21:01:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1364936506!8516763!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2846 invoked from network); 2 Apr 2013 21:01:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kw-0001Vm-61
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Kw-0002ab-4q
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:46 +0000
Date: Tue, 02 Apr 2013 21:01:46 +0000
Message-Id: <E1UN8Kw-0002ab-4q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI/APEI: fix ERST MOVE_DATA
	instruction implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1ac613c29576ba6554bdfc9caec4634761fbc634
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 12:35:42 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:35:42 2013 +0200

    ACPI/APEI: fix ERST MOVE_DATA instruction implementation
    
    The src_base and dst_base fields in apei_exec_context are physical
    address, so they should be ioremaped before being used in ERST
    MOVE_DATA instruction.
    
    Reported-by: Javier Martinez Canillas <martinez.javier@gmail.com>
    Reported-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    Replace use of ioremap() by __acpi_map_table()/set_fixmap(). Fix error
    handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: df2cf6a726b815fafa12e503c9a36707c3962f22
    master date: 2012-10-17 14:12:06 +0200
---
 xen/drivers/acpi/apei/erst.c |   57 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index eb666a6..46fcff5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -247,15 +247,64 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
 {
 	int rc;
 	u64 offset;
+#ifdef CONFIG_X86
+	enum fixed_addresses idx;
+#endif
+	void *src, *dst;
+
+	/* ioremap does not work in interrupt context */
+	if (in_irq()) {
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used in interrupt context\n");
+		return -EBUSY;
+	}
 
 	rc = __apei_exec_read_register(entry, &offset);
 	if (rc)
 		return rc;
-	memmove((void *)(unsigned long)(ctx->dst_base + offset),
-		(void *)(unsigned long)(ctx->src_base + offset),
-		ctx->var2);
 
-	return 0;
+#ifdef CONFIG_X86
+	switch (ctx->var2) {
+	case 0:
+		return 0;
+	case 1 ... PAGE_SIZE:
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
+		       ctx->var2);
+		return -EOPNOTSUPP;
+	}
+
+	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
+#else
+	src = ioremap(ctx->src_base + offset, ctx->var2);
+#endif
+	if (!src)
+		return -ENOMEM;
+
+#ifdef CONFIG_X86
+	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
+	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
+	offset += ctx->dst_base;
+	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
+	set_fixmap(idx, offset);
+	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
+		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
+		set_fixmap(idx, offset + PAGE_SIZE);
+	}
+#else
+	dst = ioremap(ctx->dst_base + offset, ctx->var2);
+#endif
+	if (dst) {
+		memmove(dst, src, ctx->var2);
+		iounmap(dst);
+	} else
+		rc = -ENOMEM;
+
+	iounmap(src);
+
+	return rc;
 }
 
 static struct apei_exec_ins_type erst_ins_type[] = {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8LA-0007bY-A4; Tue, 02 Apr 2013 21:02:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8L8-0007b5-Pt
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:58 +0000
Received: from [85.158.139.83:14891] by server-9.bemta-5.messagelabs.com id
	B8/57-08547-6474B515; Tue, 02 Apr 2013 21:01:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1364936516!27770754!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17902 invoked from network); 2 Apr 2013 21:01:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8L6-0001Vv-Cj
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8L6-0002b0-9u
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:56 +0000
Date: Tue, 02 Apr 2013 21:01:56 +0000
Message-Id: <E1UN8L6-0002b0-9u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI/ERST: Name table in otherwise
	opaque error messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc925edf483f12fbde3ec61842812ea22e4d7a0e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:36:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:36:34 2013 +0200

    ACPI/ERST: Name table in otherwise opaque error messages
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Fix spelling and lower severities.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 759847e44401176401e86e7c55b644cb9f93c781
    master date: 2013-03-20 10:02:52 +0100
---
 xen/drivers/acpi/apei/erst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 46fcff5..1e420c5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -788,11 +788,11 @@ int __init erst_init(void)
 	status = acpi_get_table(ACPI_SIG_ERST, 0,
 				(struct acpi_table_header **)&erst_tab);
 	if (status == AE_NOT_FOUND) {
-		printk(KERN_ERR "Table is not found!\n");
+		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
 	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
-		printk(KERN_ERR "Failed to get table, %s\n", msg);
+		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8LA-0007bY-A4; Tue, 02 Apr 2013 21:02:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8L8-0007b5-Pt
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:58 +0000
Received: from [85.158.139.83:14891] by server-9.bemta-5.messagelabs.com id
	B8/57-08547-6474B515; Tue, 02 Apr 2013 21:01:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1364936516!27770754!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17902 invoked from network); 2 Apr 2013 21:01:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:01:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8L6-0001Vv-Cj
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8L6-0002b0-9u
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:01:56 +0000
Date: Tue, 02 Apr 2013 21:01:56 +0000
Message-Id: <E1UN8L6-0002b0-9u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI/ERST: Name table in otherwise
	opaque error messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dc925edf483f12fbde3ec61842812ea22e4d7a0e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:36:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:36:34 2013 +0200

    ACPI/ERST: Name table in otherwise opaque error messages
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Fix spelling and lower severities.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 759847e44401176401e86e7c55b644cb9f93c781
    master date: 2013-03-20 10:02:52 +0100
---
 xen/drivers/acpi/apei/erst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 46fcff5..1e420c5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -788,11 +788,11 @@ int __init erst_init(void)
 	status = acpi_get_table(ACPI_SIG_ERST, 0,
 				(struct acpi_table_header **)&erst_tab);
 	if (status == AE_NOT_FOUND) {
-		printk(KERN_ERR "Table is not found!\n");
+		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
 	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
-		printk(KERN_ERR "Failed to get table, %s\n", msg);
+		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8LL-0007dq-DR; Tue, 02 Apr 2013 21:02:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LJ-0007dM-Hp
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:09 +0000
Received: from [85.158.139.211:64082] by server-15.bemta-5.messagelabs.com id
	C3/55-22815-0574B515; Tue, 02 Apr 2013 21:02:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1364936526!18504829!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14237 invoked from network); 2 Apr 2013 21:02:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:02:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LG-0001WU-IL
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LG-0002bN-Ge
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:06 +0000
Date: Tue, 02 Apr 2013 21:02:06 +0000
Message-Id: <E1UN8LG-0002bN-Ge@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI/APEI: Unlock apei_iomaps_lock
	on error path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1745fb53ae0bb483767473e3c95d3420a5fb10e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:37:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:37:28 2013 +0200

    ACPI/APEI: Unlock apei_iomaps_lock on error path
    
    This causes deadlocks during early boot on hardware with broken/buggy
    APEI implementations, such as a Dell Poweredge 2950 with the latest
    currently available BIOS.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Don't use goto or another special error path, as handling the error
    case in normal flow is quite simple.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0611689d9153227831979c7bafe594214b8505a3
    master date: 2013-03-22 09:43:38 +0100
---
 xen/drivers/acpi/apei/apei-io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-io.c b/xen/drivers/acpi/apei/apei-io.c
index d57035b..f0f4636 100644
--- a/xen/drivers/acpi/apei/apei-io.c
+++ b/xen/drivers/acpi/apei/apei-io.c
@@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr_t paddr, unsigned long size)
 
 	spin_lock_irqsave(&apei_iomaps_lock, flags);
 	map = __apei_find_iomap(paddr, size);
-	if (!map)
-		return;
-
-	list_del(&map->list);
+	if (map)
+		list_del(&map->list);
 	spin_unlock_irqrestore(&apei_iomaps_lock, flags);
 
 	xfree(map);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8LL-0007dq-DR; Tue, 02 Apr 2013 21:02:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LJ-0007dM-Hp
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:09 +0000
Received: from [85.158.139.211:64082] by server-15.bemta-5.messagelabs.com id
	C3/55-22815-0574B515; Tue, 02 Apr 2013 21:02:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1364936526!18504829!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14237 invoked from network); 2 Apr 2013 21:02:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:02:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LG-0001WU-IL
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LG-0002bN-Ge
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:06 +0000
Date: Tue, 02 Apr 2013 21:02:06 +0000
Message-Id: <E1UN8LG-0002bN-Ge@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI/APEI: Unlock apei_iomaps_lock
	on error path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1745fb53ae0bb483767473e3c95d3420a5fb10e3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 12:37:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:37:28 2013 +0200

    ACPI/APEI: Unlock apei_iomaps_lock on error path
    
    This causes deadlocks during early boot on hardware with broken/buggy
    APEI implementations, such as a Dell Poweredge 2950 with the latest
    currently available BIOS.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Don't use goto or another special error path, as handling the error
    case in normal flow is quite simple.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 0611689d9153227831979c7bafe594214b8505a3
    master date: 2013-03-22 09:43:38 +0100
---
 xen/drivers/acpi/apei/apei-io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-io.c b/xen/drivers/acpi/apei/apei-io.c
index d57035b..f0f4636 100644
--- a/xen/drivers/acpi/apei/apei-io.c
+++ b/xen/drivers/acpi/apei/apei-io.c
@@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr_t paddr, unsigned long size)
 
 	spin_lock_irqsave(&apei_iomaps_lock, flags);
 	map = __apei_find_iomap(paddr, size);
-	if (!map)
-		return;
-
-	list_del(&map->list);
+	if (map)
+		list_del(&map->list);
 	spin_unlock_irqrestore(&apei_iomaps_lock, flags);
 
 	xfree(map);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8LV-0007fa-Ga; Tue, 02 Apr 2013 21:02:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LT-0007f9-CO
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:19 +0000
Received: from [85.158.138.51:62264] by server-14.bemta-3.messagelabs.com id
	DA/E8-27076-A574B515; Tue, 02 Apr 2013 21:02:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1364936536!28114012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14533 invoked from network); 2 Apr 2013 21:02:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:02:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LQ-0001Wa-NF
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LQ-0002cU-M1
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:16 +0000
Date: Tue, 02 Apr 2013 21:02:16 +0000
Message-Id: <E1UN8LQ-0002cU-M1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI,
	APEI: Add apei_exec_run_optional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39fbe392cfd5c7df08cc2299a9baebf02edbad74
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 12:38:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:38:15 2013 +0200

    ACPI, APEI: Add apei_exec_run_optional
    
    Some actions in APEI ERST and EINJ tables are optional, for example,
    ACPI_EINJ_BEGIN_OPERATION action is used to do some preparation for
    error injection, and firmware may choose to do nothing here.  While
    some other actions are mandatory, for example, firmware must provide
    ACPI_EINJ_GET_ERROR_TYPE implementation.
    
    Original implementation treats all actions as optional (that is, can
    have no instructions), that may cause issue if firmware does not
    provide some mandatory actions.  To fix this, this patch adds
    apei_exec_run_optional, which should be used for optional actions.
    The original apei_exec_run should be used for mandatory actions.
    
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 72af01bf6f7489e54ad59270222a29d3e8c501d1
    master date: 2013-03-22 12:46:25 +0100
---
 xen/drivers/acpi/apei/apei-base.c     |    7 ++++---
 xen/drivers/acpi/apei/apei-internal.h |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-base.c b/xen/drivers/acpi/apei/apei-base.c
index 0a365b7..43f8f98 100644
--- a/xen/drivers/acpi/apei/apei-base.c
+++ b/xen/drivers/acpi/apei/apei-base.c
@@ -154,9 +154,10 @@ int apei_exec_noop(struct apei_exec_context *ctx,
  * Interpret the specified action. Go through whole action table,
  * execute all instructions belong to the action.
  */
-int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action,
+		    bool_t optional)
 {
-	int rc;
+	int rc = -ENOENT;
 	u32 i, ip;
 	struct acpi_whea_header *entry;
 	apei_exec_ins_func_t run;
@@ -195,7 +196,7 @@ rewind:
 			goto rewind;
 	}
 
-	return 0;
+	return !optional && rc < 0 ? rc : 0;
 }
 
 typedef int (*apei_exec_entry_func_t)(struct apei_exec_context *ctx,
diff --git a/xen/drivers/acpi/apei/apei-internal.h b/xen/drivers/acpi/apei/apei-internal.h
index 77f31fb..b813d55 100644
--- a/xen/drivers/acpi/apei/apei-internal.h
+++ b/xen/drivers/acpi/apei/apei-internal.h
@@ -48,7 +48,18 @@ static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
 	return ctx->value;
 }
 
-int apei_exec_run(struct apei_exec_context *ctx, u8 action);
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional);
+
+static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 0);
+}
+
+/* It is optional whether the firmware provides the action */
+static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 1);
+}
 
 /* Common instruction implementation */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8LV-0007fa-Ga; Tue, 02 Apr 2013 21:02:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LT-0007f9-CO
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:19 +0000
Received: from [85.158.138.51:62264] by server-14.bemta-3.messagelabs.com id
	DA/E8-27076-A574B515; Tue, 02 Apr 2013 21:02:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1364936536!28114012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14533 invoked from network); 2 Apr 2013 21:02:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:02:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LQ-0001Wa-NF
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8LQ-0002cU-M1
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:16 +0000
Date: Tue, 02 Apr 2013 21:02:16 +0000
Message-Id: <E1UN8LQ-0002cU-M1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI,
	APEI: Add apei_exec_run_optional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 39fbe392cfd5c7df08cc2299a9baebf02edbad74
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 12:38:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:38:15 2013 +0200

    ACPI, APEI: Add apei_exec_run_optional
    
    Some actions in APEI ERST and EINJ tables are optional, for example,
    ACPI_EINJ_BEGIN_OPERATION action is used to do some preparation for
    error injection, and firmware may choose to do nothing here.  While
    some other actions are mandatory, for example, firmware must provide
    ACPI_EINJ_GET_ERROR_TYPE implementation.
    
    Original implementation treats all actions as optional (that is, can
    have no instructions), that may cause issue if firmware does not
    provide some mandatory actions.  To fix this, this patch adds
    apei_exec_run_optional, which should be used for optional actions.
    The original apei_exec_run should be used for mandatory actions.
    
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 72af01bf6f7489e54ad59270222a29d3e8c501d1
    master date: 2013-03-22 12:46:25 +0100
---
 xen/drivers/acpi/apei/apei-base.c     |    7 ++++---
 xen/drivers/acpi/apei/apei-internal.h |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-base.c b/xen/drivers/acpi/apei/apei-base.c
index 0a365b7..43f8f98 100644
--- a/xen/drivers/acpi/apei/apei-base.c
+++ b/xen/drivers/acpi/apei/apei-base.c
@@ -154,9 +154,10 @@ int apei_exec_noop(struct apei_exec_context *ctx,
  * Interpret the specified action. Go through whole action table,
  * execute all instructions belong to the action.
  */
-int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action,
+		    bool_t optional)
 {
-	int rc;
+	int rc = -ENOENT;
 	u32 i, ip;
 	struct acpi_whea_header *entry;
 	apei_exec_ins_func_t run;
@@ -195,7 +196,7 @@ rewind:
 			goto rewind;
 	}
 
-	return 0;
+	return !optional && rc < 0 ? rc : 0;
 }
 
 typedef int (*apei_exec_entry_func_t)(struct apei_exec_context *ctx,
diff --git a/xen/drivers/acpi/apei/apei-internal.h b/xen/drivers/acpi/apei/apei-internal.h
index 77f31fb..b813d55 100644
--- a/xen/drivers/acpi/apei/apei-internal.h
+++ b/xen/drivers/acpi/apei/apei-internal.h
@@ -48,7 +48,18 @@ static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
 	return ctx->value;
 }
 
-int apei_exec_run(struct apei_exec_context *ctx, u8 action);
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional);
+
+static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 0);
+}
+
+/* It is optional whether the firmware provides the action */
+static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 1);
+}
 
 /* Common instruction implementation */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Lf-0007hc-Lm; Tue, 02 Apr 2013 21:02:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Ld-0007h8-Fc
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:29 +0000
Received: from [85.158.139.83:20048] by server-12.bemta-5.messagelabs.com id
	76/C1-11486-4674B515; Tue, 02 Apr 2013 21:02:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1364936547!27773811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18887 invoked from network); 2 Apr 2013 21:02:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:02:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Lb-0001Wg-1T
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8La-0002cy-S1
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:27 +0000
Date: Tue, 02 Apr 2013 21:02:26 +0000
Message-Id: <E1UN8La-0002cy-S1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI: fix APEI related table size
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f2e4f020204f36485ba8d34da80064f3971e09af
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 12:39:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:39:15 2013 +0200

    ACPI: fix APEI related table size checking
    
    On Huang Ying's machine:
    
    erst_tab->header_length == sizeof(struct acpi_table_einj)
    
    but Yinghai reported that on his machine,
    
    erst_tab->header_length == sizeof(struct acpi_table_einj) -
    sizeof(struct acpi_table_header)
    
    To make erst table size checking code works on all systems, both
    testing are treated as PASS.
    
    Same situation applies to einj_tab->header_length, so corresponding
    table size checking is changed in similar way too.
    
    Originally-by: Yinghai Lu <yinghai@kernel.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    - use switch() for better readability
    - add comment explaining why a formally invalid size it also being
      accepted
    - check erst_tab->header.length before even looking at
      erst_tab->header_length
    - prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 915ef37d7cc8fcac5b37eb0b40c693754fcd12ab
    master date: 2012-10-16 17:26:36 +0200
---
 xen/drivers/acpi/apei/erst.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 1e420c5..71db9fa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -764,12 +764,23 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-	if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+	if (erst_tab->header.length < sizeof(*erst_tab))
 		return -EINVAL;
-	if (erst_tab->header.length < sizeof(struct acpi_table_erst))
+
+	switch (erst_tab->header_length) {
+	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+	/*
+	 * While invalid per specification, there are (early?) systems
+	 * indicating the full header size here, so accept that value too.
+	 */
+	case sizeof(*erst_tab):
+		break;
+	default:
 		return -EINVAL;
+	}
+
 	if (erst_tab->entries !=
-	    (erst_tab->header.length - sizeof(struct acpi_table_erst)) /
+	    (erst_tab->header.length - sizeof(*erst_tab)) /
 	    sizeof(struct acpi_erst_entry))
 		return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 21:02:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 21:02:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN8Lf-0007hc-Lm; Tue, 02 Apr 2013 21:02:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Ld-0007h8-Fc
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:29 +0000
Received: from [85.158.139.83:20048] by server-12.bemta-5.messagelabs.com id
	76/C1-11486-4674B515; Tue, 02 Apr 2013 21:02:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1364936547!27773811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18887 invoked from network); 2 Apr 2013 21:02:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 21:02:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8Lb-0001Wg-1T
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN8La-0002cy-S1
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 21:02:27 +0000
Date: Tue, 02 Apr 2013 21:02:26 +0000
Message-Id: <E1UN8La-0002cy-S1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] ACPI: fix APEI related table size
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f2e4f020204f36485ba8d34da80064f3971e09af
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 12:39:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 12:39:15 2013 +0200

    ACPI: fix APEI related table size checking
    
    On Huang Ying's machine:
    
    erst_tab->header_length == sizeof(struct acpi_table_einj)
    
    but Yinghai reported that on his machine,
    
    erst_tab->header_length == sizeof(struct acpi_table_einj) -
    sizeof(struct acpi_table_header)
    
    To make erst table size checking code works on all systems, both
    testing are treated as PASS.
    
    Same situation applies to einj_tab->header_length, so corresponding
    table size checking is changed in similar way too.
    
    Originally-by: Yinghai Lu <yinghai@kernel.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    - use switch() for better readability
    - add comment explaining why a formally invalid size it also being
      accepted
    - check erst_tab->header.length before even looking at
      erst_tab->header_length
    - prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 915ef37d7cc8fcac5b37eb0b40c693754fcd12ab
    master date: 2012-10-16 17:26:36 +0200
---
 xen/drivers/acpi/apei/erst.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 1e420c5..71db9fa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -764,12 +764,23 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-	if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+	if (erst_tab->header.length < sizeof(*erst_tab))
 		return -EINVAL;
-	if (erst_tab->header.length < sizeof(struct acpi_table_erst))
+
+	switch (erst_tab->header_length) {
+	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+	/*
+	 * While invalid per specification, there are (early?) systems
+	 * indicating the full header size here, so accept that value too.
+	 */
+	case sizeof(*erst_tab):
+		break;
+	default:
 		return -EINVAL;
+	}
+
 	if (erst_tab->entries !=
-	    (erst_tab->header.length - sizeof(struct acpi_table_erst)) /
+	    (erst_tab->header.length - sizeof(*erst_tab)) /
 	    sizeof(struct acpi_erst_entry))
 		return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Q4-0008UM-VX; Tue, 02 Apr 2013 22:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Q2-0008Tb-TN
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:07 +0000
Received: from [85.158.137.99:5288] by server-11.bemta-3.messagelabs.com id
	3C/CF-01263-A775B515; Tue, 02 Apr 2013 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1364940664!17753857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25831 invoked from network); 2 Apr 2013 22:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Pz-0002Ei-UJ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Pz-0004Bi-P2
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:03 +0000
Date: Tue, 02 Apr 2013 22:11:03 +0000
Message-Id: <E1UN9Pz-0004Bi-P2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] powernow: add fixups for AMD
	P-state figures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c2eb456b376a4a3a6bf9477a5d6577628b68300
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Apr 2 10:45:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:45:30 2013 +0200

    powernow: add fixups for AMD P-state figures
    
    In the Linux kernel, these two git commits:
    
    - f594065faf4f9067c2283a34619fc0714e79a98d
      ACPI: Add fixups for AMD P-state figures
    - 9855d8ce41a7801548a05d844db2f46c3e810166
      ACPI: Check MSR valid bit before using P-state frequencies
    
    Try to fix the the issue that "some AMD systems may round the
    frequencies in ACPI tables to 100MHz boundaries. We can obtain the real
    frequencies from MSRs, so add a quirk to fix these frequencies up
    on AMD systems." (from f594065..)
    
    In discussion (around 9855d8..) "it turned out that indeed real
    HW/BIOSes may choose to not set the valid bit and thus mark the
    P-state as invalid. So this could be considered a fix for broken
    BIOSes." (from 9855d8..)
    
    which is great for Linux. Unfortunatly the Linux kernel, when
    it tries to do the RDMSR under Xen it fails to get the right
    value (it gets zero) as Xen traps it and returns zero. Hence
    when dom0 uploads the P-states they will be unmodified and
    we should take care of updating the frequencies with the right
    values.
    
    I've tested it under Dell Inc. PowerEdge T105 /0RR825, BIOS 1.3.2
    08/20/2008 where this quirk can be observed (x86 == 0x10, model == 2).
    Also on other AMD (x86 == 0x12, A8-3850; x86 = 0x14, AMD E-350) to
    make sure the quirk is not applied there.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: stefan.bader@canonical.com
    
    Do the MSR access here (and while at it, also the one reading
    MSR_PSTATE_CUR_LIMIT) on the target CPU, and bound the loop over
    amd_fixup_frequency() by max_hw_pstate (matching the one in
    powernow_cpufreq_cpu_init()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 1d80765b504b34b63a42a63aff4291e07e29f0c5
    master date: 2013-03-12 15:34:22 +0100
---
 xen/arch/x86/acpi/cpufreq/powernow.c |   56 ++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index 48b7188..e11414e 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -159,6 +159,51 @@ static int powernow_cpufreq_target(struct cpufreq_policy *policy,
     return result;
 }
 
+static void amd_fixup_frequency(struct xen_processor_px *px)
+{
+    u32 hi, lo, fid, did;
+    int index = px->control & 0x00000007;
+    const struct cpuinfo_x86 *c = &current_cpu_data;
+
+    if ((c->x86 != 0x10 || c->x86_model >= 10) && c->x86 != 0x11)
+        return;
+
+    rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
+    /*
+     * MSR C001_0064+:
+     * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
+     */
+    if (!(hi & (1U << 31)))
+        return;
+
+    fid = lo & 0x3f;
+    did = (lo >> 6) & 7;
+    if (c->x86 == 0x10)
+        px->core_frequency = (100 * (fid + 16)) >> did;
+    else
+        px->core_frequency = (100 * (fid + 8)) >> did;
+}
+
+struct amd_cpu_data {
+    struct processor_performance *perf;
+    u32 max_hw_pstate;
+};
+
+static void get_cpu_data(void *arg)
+{
+    struct amd_cpu_data *data = arg;
+    struct processor_performance *perf = data->perf;
+    uint64_t msr_content;
+    unsigned int i;
+
+    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
+    data->max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >>
+                          HW_PSTATE_MAX_SHIFT;
+
+    for (i = 0; i < perf->state_count && i <= data->max_hw_pstate; i++)
+        amd_fixup_frequency(&perf->states[i]);
+}
+
 static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
 {
     struct acpi_cpufreq_data *data;
@@ -205,8 +250,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     struct acpi_cpufreq_data *data;
     unsigned int result = 0;
     struct processor_performance *perf;
-    u32 max_hw_pstate;
-    uint64_t msr_content;
+    struct amd_cpu_data info;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
 
     data = xzalloc(struct acpi_cpufreq_data);
@@ -217,7 +261,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
-    perf = data->acpi_data;
+    info.perf = perf = data->acpi_data;
     policy->shared_type = perf->shared_type;
 
     if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
@@ -239,8 +283,6 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
         result = -ENODEV;
         goto err_unreg;
     }
-    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
-    max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT;
 
     if (perf->control_register.space_id != perf->status_register.space_id) {
         result = -ENODEV;
@@ -265,8 +307,10 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR;
 
+    on_selected_cpus(cpumask_of(cpu), get_cpu_data, &info, 1);
+
     /* table init */
-    for (i = 0; i < perf->state_count && i <= max_hw_pstate; i++) {
+    for (i = 0; i < perf->state_count && i <= info.max_hw_pstate; i++) {
         if (i > 0 && perf->states[i].core_frequency >=
             data->freq_table[valid_states-1].frequency / 1000)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Q4-0008UM-VX; Tue, 02 Apr 2013 22:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Q2-0008Tb-TN
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:07 +0000
Received: from [85.158.137.99:5288] by server-11.bemta-3.messagelabs.com id
	3C/CF-01263-A775B515; Tue, 02 Apr 2013 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1364940664!17753857!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25831 invoked from network); 2 Apr 2013 22:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Pz-0002Ei-UJ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Pz-0004Bi-P2
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:03 +0000
Date: Tue, 02 Apr 2013 22:11:03 +0000
Message-Id: <E1UN9Pz-0004Bi-P2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] powernow: add fixups for AMD
	P-state figures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c2eb456b376a4a3a6bf9477a5d6577628b68300
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Apr 2 10:45:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:45:30 2013 +0200

    powernow: add fixups for AMD P-state figures
    
    In the Linux kernel, these two git commits:
    
    - f594065faf4f9067c2283a34619fc0714e79a98d
      ACPI: Add fixups for AMD P-state figures
    - 9855d8ce41a7801548a05d844db2f46c3e810166
      ACPI: Check MSR valid bit before using P-state frequencies
    
    Try to fix the the issue that "some AMD systems may round the
    frequencies in ACPI tables to 100MHz boundaries. We can obtain the real
    frequencies from MSRs, so add a quirk to fix these frequencies up
    on AMD systems." (from f594065..)
    
    In discussion (around 9855d8..) "it turned out that indeed real
    HW/BIOSes may choose to not set the valid bit and thus mark the
    P-state as invalid. So this could be considered a fix for broken
    BIOSes." (from 9855d8..)
    
    which is great for Linux. Unfortunatly the Linux kernel, when
    it tries to do the RDMSR under Xen it fails to get the right
    value (it gets zero) as Xen traps it and returns zero. Hence
    when dom0 uploads the P-states they will be unmodified and
    we should take care of updating the frequencies with the right
    values.
    
    I've tested it under Dell Inc. PowerEdge T105 /0RR825, BIOS 1.3.2
    08/20/2008 where this quirk can be observed (x86 == 0x10, model == 2).
    Also on other AMD (x86 == 0x12, A8-3850; x86 = 0x14, AMD E-350) to
    make sure the quirk is not applied there.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: stefan.bader@canonical.com
    
    Do the MSR access here (and while at it, also the one reading
    MSR_PSTATE_CUR_LIMIT) on the target CPU, and bound the loop over
    amd_fixup_frequency() by max_hw_pstate (matching the one in
    powernow_cpufreq_cpu_init()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 1d80765b504b34b63a42a63aff4291e07e29f0c5
    master date: 2013-03-12 15:34:22 +0100
---
 xen/arch/x86/acpi/cpufreq/powernow.c |   56 ++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufreq/powernow.c
index 48b7188..e11414e 100644
--- a/xen/arch/x86/acpi/cpufreq/powernow.c
+++ b/xen/arch/x86/acpi/cpufreq/powernow.c
@@ -159,6 +159,51 @@ static int powernow_cpufreq_target(struct cpufreq_policy *policy,
     return result;
 }
 
+static void amd_fixup_frequency(struct xen_processor_px *px)
+{
+    u32 hi, lo, fid, did;
+    int index = px->control & 0x00000007;
+    const struct cpuinfo_x86 *c = &current_cpu_data;
+
+    if ((c->x86 != 0x10 || c->x86_model >= 10) && c->x86 != 0x11)
+        return;
+
+    rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
+    /*
+     * MSR C001_0064+:
+     * Bit 63: PstateEn. Read-write. If set, the P-state is valid.
+     */
+    if (!(hi & (1U << 31)))
+        return;
+
+    fid = lo & 0x3f;
+    did = (lo >> 6) & 7;
+    if (c->x86 == 0x10)
+        px->core_frequency = (100 * (fid + 16)) >> did;
+    else
+        px->core_frequency = (100 * (fid + 8)) >> did;
+}
+
+struct amd_cpu_data {
+    struct processor_performance *perf;
+    u32 max_hw_pstate;
+};
+
+static void get_cpu_data(void *arg)
+{
+    struct amd_cpu_data *data = arg;
+    struct processor_performance *perf = data->perf;
+    uint64_t msr_content;
+    unsigned int i;
+
+    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
+    data->max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >>
+                          HW_PSTATE_MAX_SHIFT;
+
+    for (i = 0; i < perf->state_count && i <= data->max_hw_pstate; i++)
+        amd_fixup_frequency(&perf->states[i]);
+}
+
 static int powernow_cpufreq_verify(struct cpufreq_policy *policy)
 {
     struct acpi_cpufreq_data *data;
@@ -205,8 +250,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
     struct acpi_cpufreq_data *data;
     unsigned int result = 0;
     struct processor_performance *perf;
-    u32 max_hw_pstate;
-    uint64_t msr_content;
+    struct amd_cpu_data info;
     struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
 
     data = xzalloc(struct acpi_cpufreq_data);
@@ -217,7 +261,7 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     data->acpi_data = &processor_pminfo[cpu]->perf;
 
-    perf = data->acpi_data;
+    info.perf = perf = data->acpi_data;
     policy->shared_type = perf->shared_type;
 
     if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
@@ -239,8 +283,6 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
         result = -ENODEV;
         goto err_unreg;
     }
-    rdmsrl(MSR_PSTATE_CUR_LIMIT, msr_content);
-    max_hw_pstate = (msr_content & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT;
 
     if (perf->control_register.space_id != perf->status_register.space_id) {
         result = -ENODEV;
@@ -265,8 +307,10 @@ static int powernow_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
     policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR;
 
+    on_selected_cpus(cpumask_of(cpu), get_cpu_data, &info, 1);
+
     /* table init */
-    for (i = 0; i < perf->state_count && i <= max_hw_pstate; i++) {
+    for (i = 0; i < perf->state_count && i <= info.max_hw_pstate; i++) {
         if (i > 0 && perf->states[i].core_frequency >=
             data->freq_table[valid_states-1].frequency / 1000)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9QE-0008VL-2W; Tue, 02 Apr 2013 22:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QC-0008VC-Ne
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:16 +0000
Received: from [85.158.139.211:49071] by server-8.bemta-5.messagelabs.com id
	6F/33-05790-4875B515; Tue, 02 Apr 2013 22:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1364940674!18509809!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24166 invoked from network); 2 Apr 2013 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QA-0002El-79
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QA-0004C6-4r
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:14 +0000
Date: Tue, 02 Apr 2013 22:11:14 +0000
Message-Id: <E1UN9QA-0004C6-4r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/MCA: suppress bank clearing
	for certain injected events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2daa977e4e08b94459b6bfe62cf2c8a381df0903
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 10:47:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:47:26 2013 +0200

    x86/MCA: suppress bank clearing for certain injected events
    
    As the bits indicating validity of the ADDR and MISC bank MSRs may be
    injected in a way that isn't consistent with what the underlying
    hardware implements (while the bank must be valid for injection to
    work, the auxiliary MSRs may not be implemented - and hence cause #GP
    upon access - if the hardware never sets the corresponding valid bits.
    
    Consequently we need to do the clearing writes only if no value was
    interposed for the respective MSR (which also makes sense the other way
    around: there's no point in clearing a hardware register when all data
    read came from software). Of course this all requires the injection
    tool to do things in a consistent way (but that had been a requirement
    before already).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Ren Yongjie <yongjie.ren@intel.com>
    Acked-by: Liu Jinsong <jinsong.liu@intel.com>
    master changeset: b0583c0e64cc8bb6229c95c3304fdac2051f79b3
    master date: 2013-03-12 15:53:30 +0100
---
 xen/arch/x86/cpu/mcheck/mce.c |   12 +++++++-----
 xen/arch/x86/cpu/mcheck/mce.h |    8 ++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c836320..50596e3 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1145,13 +1145,15 @@ static void intpose_add(unsigned int cpu_nr, uint64_t msr, uint64_t val)
     printk("intpose_add: interpose array full - request dropped\n");
 }
 
-void intpose_inval(unsigned int cpu_nr, uint64_t msr)
+bool_t intpose_inval(unsigned int cpu_nr, uint64_t msr)
 {
-    struct intpose_ent *ent;
+    struct intpose_ent *ent = intpose_lookup(cpu_nr, msr, NULL);
 
-    if ((ent = intpose_lookup(cpu_nr, msr, NULL)) != NULL) {
-        ent->cpu_nr = -1;
-    }
+    if ( !ent )
+        return 0;
+
+    ent->cpu_nr = -1;
+    return 1;
 }
 
 #define IS_MCA_BANKREG(r) \
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index 3c773c7..72b6368 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -89,7 +89,7 @@ extern void mce_recoverable_register(mce_recoverable_t);
 /* Read an MSR, checking for an interposed value first */
 extern struct intpose_ent *intpose_lookup(unsigned int, uint64_t,
     uint64_t *);
-extern void intpose_inval(unsigned int, uint64_t);
+extern bool_t intpose_inval(unsigned int, uint64_t);
 
 static inline uint64_t mca_rdmsr(unsigned int msr)
 {
@@ -101,9 +101,9 @@ static inline uint64_t mca_rdmsr(unsigned int msr)
 
 /* Write an MSR, invalidating any interposed value */
 #define mca_wrmsr(msr, val) do { \
-       intpose_inval(smp_processor_id(), msr); \
-       wrmsrl(msr, val); \
-} while (0)
+    if ( !intpose_inval(smp_processor_id(), msr) ) \
+        wrmsrl(msr, val); \
+} while ( 0 )
 
 
 /* Utility function to "logout" all architectural MCA telemetry from the MCA
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9QE-0008VL-2W; Tue, 02 Apr 2013 22:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QC-0008VC-Ne
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:16 +0000
Received: from [85.158.139.211:49071] by server-8.bemta-5.messagelabs.com id
	6F/33-05790-4875B515; Tue, 02 Apr 2013 22:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1364940674!18509809!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24166 invoked from network); 2 Apr 2013 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QA-0002El-79
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QA-0004C6-4r
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:14 +0000
Date: Tue, 02 Apr 2013 22:11:14 +0000
Message-Id: <E1UN9QA-0004C6-4r@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/MCA: suppress bank clearing
	for certain injected events
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2daa977e4e08b94459b6bfe62cf2c8a381df0903
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 10:47:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:47:26 2013 +0200

    x86/MCA: suppress bank clearing for certain injected events
    
    As the bits indicating validity of the ADDR and MISC bank MSRs may be
    injected in a way that isn't consistent with what the underlying
    hardware implements (while the bank must be valid for injection to
    work, the auxiliary MSRs may not be implemented - and hence cause #GP
    upon access - if the hardware never sets the corresponding valid bits.
    
    Consequently we need to do the clearing writes only if no value was
    interposed for the respective MSR (which also makes sense the other way
    around: there's no point in clearing a hardware register when all data
    read came from software). Of course this all requires the injection
    tool to do things in a consistent way (but that had been a requirement
    before already).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Ren Yongjie <yongjie.ren@intel.com>
    Acked-by: Liu Jinsong <jinsong.liu@intel.com>
    master changeset: b0583c0e64cc8bb6229c95c3304fdac2051f79b3
    master date: 2013-03-12 15:53:30 +0100
---
 xen/arch/x86/cpu/mcheck/mce.c |   12 +++++++-----
 xen/arch/x86/cpu/mcheck/mce.h |    8 ++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c836320..50596e3 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1145,13 +1145,15 @@ static void intpose_add(unsigned int cpu_nr, uint64_t msr, uint64_t val)
     printk("intpose_add: interpose array full - request dropped\n");
 }
 
-void intpose_inval(unsigned int cpu_nr, uint64_t msr)
+bool_t intpose_inval(unsigned int cpu_nr, uint64_t msr)
 {
-    struct intpose_ent *ent;
+    struct intpose_ent *ent = intpose_lookup(cpu_nr, msr, NULL);
 
-    if ((ent = intpose_lookup(cpu_nr, msr, NULL)) != NULL) {
-        ent->cpu_nr = -1;
-    }
+    if ( !ent )
+        return 0;
+
+    ent->cpu_nr = -1;
+    return 1;
 }
 
 #define IS_MCA_BANKREG(r) \
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index 3c773c7..72b6368 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -89,7 +89,7 @@ extern void mce_recoverable_register(mce_recoverable_t);
 /* Read an MSR, checking for an interposed value first */
 extern struct intpose_ent *intpose_lookup(unsigned int, uint64_t,
     uint64_t *);
-extern void intpose_inval(unsigned int, uint64_t);
+extern bool_t intpose_inval(unsigned int, uint64_t);
 
 static inline uint64_t mca_rdmsr(unsigned int msr)
 {
@@ -101,9 +101,9 @@ static inline uint64_t mca_rdmsr(unsigned int msr)
 
 /* Write an MSR, invalidating any interposed value */
 #define mca_wrmsr(msr, val) do { \
-       intpose_inval(smp_processor_id(), msr); \
-       wrmsrl(msr, val); \
-} while (0)
+    if ( !intpose_inval(smp_processor_id(), msr) ) \
+        wrmsrl(msr, val); \
+} while ( 0 )
 
 
 /* Utility function to "logout" all architectural MCA telemetry from the MCA
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9QO-0008WT-5u; Tue, 02 Apr 2013 22:11:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QM-0008WD-Qx
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:27 +0000
Received: from [85.158.143.99:61491] by server-3.bemta-4.messagelabs.com id
	A7/87-02186-E875B515; Tue, 02 Apr 2013 22:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1364940684!27824327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15379 invoked from network); 2 Apr 2013 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QK-0002F2-By
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QK-0004Cz-AQ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:24 +0000
Date: Tue, 02 Apr 2013 22:11:24 +0000
Message-Id: <E1UN9QK-0004Cz-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD/IOMMU: Process softirqs while
	building dom0 iommu mappings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dcae564ba85c516d8a4c4be7981bdae07dd03972
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 10:48:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:48:36 2013 +0200

    AMD/IOMMU: Process softirqs while building dom0 iommu mappings
    
    Recent changes which have made their way into xen-4.2 stable have pushed the
    runtime of construct_dom0() over 5 seconds, which has caused regressions in
    XenServer testing because of our 5 second watchdog.
    
    The root cause is that amd_iommu_dom0_init() does not process softirqs and in
    particular the nmi_timer which causes the watchdog to decide that no useful
    progress is being made.
    
    This patch adds periodic calls to process_pending_softirqs() at the same
    interval as the Intel variant of this function.  The server which was failing
    with the watchdog test now boots reliably with a timeout of 1 second.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 0f7b6f91ac1bbfd33b23c291b14874b9561909d2
    master date: 2013-03-20 10:00:01 +0100
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 2955cf0..281a52b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -286,6 +286,9 @@ static void __init amd_iommu_dom0_init(struct domain *d)
             if ( mfn_valid(pfn) )
                 amd_iommu_map_page(d, pfn, pfn, 
                                    IOMMUF_readable|IOMMUF_writable);
+
+            if ( !(i & 0xfffff) )
+                process_pending_softirqs();
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9QO-0008WT-5u; Tue, 02 Apr 2013 22:11:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QM-0008WD-Qx
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:27 +0000
Received: from [85.158.143.99:61491] by server-3.bemta-4.messagelabs.com id
	A7/87-02186-E875B515; Tue, 02 Apr 2013 22:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-216.messagelabs.com!1364940684!27824327!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15379 invoked from network); 2 Apr 2013 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QK-0002F2-By
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QK-0004Cz-AQ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:24 +0000
Date: Tue, 02 Apr 2013 22:11:24 +0000
Message-Id: <E1UN9QK-0004Cz-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD/IOMMU: Process softirqs while
	building dom0 iommu mappings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dcae564ba85c516d8a4c4be7981bdae07dd03972
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 10:48:36 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:48:36 2013 +0200

    AMD/IOMMU: Process softirqs while building dom0 iommu mappings
    
    Recent changes which have made their way into xen-4.2 stable have pushed the
    runtime of construct_dom0() over 5 seconds, which has caused regressions in
    XenServer testing because of our 5 second watchdog.
    
    The root cause is that amd_iommu_dom0_init() does not process softirqs and in
    particular the nmi_timer which causes the watchdog to decide that no useful
    progress is being made.
    
    This patch adds periodic calls to process_pending_softirqs() at the same
    interval as the Intel variant of this function.  The server which was failing
    with the watchdog test now boots reliably with a timeout of 1 second.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 0f7b6f91ac1bbfd33b23c291b14874b9561909d2
    master date: 2013-03-20 10:00:01 +0100
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 2955cf0..281a52b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -286,6 +286,9 @@ static void __init amd_iommu_dom0_init(struct domain *d)
             if ( mfn_valid(pfn) )
                 amd_iommu_map_page(d, pfn, pfn, 
                                    IOMMUF_readable|IOMMUF_writable);
+
+            if ( !(i & 0xfffff) )
+                process_pending_softirqs();
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9QZ-00006m-8w; Tue, 02 Apr 2013 22:11:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QX-00006N-8B
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:37 +0000
Received: from [85.158.137.99:48934] by server-16.bemta-3.messagelabs.com id
	52/E7-20692-8975B515; Tue, 02 Apr 2013 22:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1364940694!12087280!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23137 invoked from network); 2 Apr 2013 22:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QU-0002FD-H4
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QU-0004DP-FQ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:34 +0000
Date: Tue, 02 Apr 2013 22:11:34 +0000
Message-Id: <E1UN9QU-0004DP-FQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: Enumerate IOMMUs when
	listing capabilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22ad6638d4fb351d641a7352f6d388b8c7e6ed7f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 10:49:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:49:26 2013 +0200

    VT-d: Enumerate IOMMUs when listing capabilities
    
    This saves N identical console log lines on a multi-iommu server.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 32861c537781ac94bf403fb778505c3679b85f67
    master date: 2013-03-20 10:02:26 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b34081a..6291574 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2149,7 +2149,8 @@ int __init intel_vtd_setup(void)
     {
         iommu = drhd->iommu;
 
-        printk("Intel VT-d supported page sizes: 4kB");
+        printk("Intel VT-d iommu %"PRIu32" supported page sizes: 4kB",
+               iommu->index);
         if (cap_sps_2mb(iommu->cap))
             printk(", 2MB");
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9QZ-00006m-8w; Tue, 02 Apr 2013 22:11:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QX-00006N-8B
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:37 +0000
Received: from [85.158.137.99:48934] by server-16.bemta-3.messagelabs.com id
	52/E7-20692-8975B515; Tue, 02 Apr 2013 22:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1364940694!12087280!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23137 invoked from network); 2 Apr 2013 22:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QU-0002FD-H4
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9QU-0004DP-FQ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:34 +0000
Date: Tue, 02 Apr 2013 22:11:34 +0000
Message-Id: <E1UN9QU-0004DP-FQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: Enumerate IOMMUs when
	listing capabilities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22ad6638d4fb351d641a7352f6d388b8c7e6ed7f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 10:49:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:49:26 2013 +0200

    VT-d: Enumerate IOMMUs when listing capabilities
    
    This saves N identical console log lines on a multi-iommu server.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 32861c537781ac94bf403fb778505c3679b85f67
    master date: 2013-03-20 10:02:26 +0100
---
 xen/drivers/passthrough/vtd/iommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index b34081a..6291574 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2149,7 +2149,8 @@ int __init intel_vtd_setup(void)
     {
         iommu = drhd->iommu;
 
-        printk("Intel VT-d supported page sizes: 4kB");
+        printk("Intel VT-d iommu %"PRIu32" supported page sizes: 4kB",
+               iommu->index);
         if (cap_sps_2mb(iommu->cap))
             printk(", 2MB");
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Qj-00008d-CM; Tue, 02 Apr 2013 22:11:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qh-000089-Bw
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:47 +0000
Received: from [85.158.139.211:53742] by server-15.bemta-5.messagelabs.com id
	54/40-22815-2A75B515; Tue, 02 Apr 2013 22:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1364940704!20136520!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8034 invoked from network); 2 Apr 2013 22:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qe-0002FG-Nu
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qe-0004Dl-MM
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:44 +0000
Date: Tue, 02 Apr 2013 22:11:44 +0000
Message-Id: <E1UN9Qe-0004Dl-MM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] IOMMU: properly check whether
	interrupt remapping is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd1993bc6b1d5999534344fab2c73124079671d4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 10:50:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:50:52 2013 +0200

    IOMMU: properly check whether interrupt remapping is enabled
    
    ... rather than the IOMMU as a whole.
    
    That in turn required to make sure iommu_intremap gets properly
    cleared when the respective initialization fails (or isn't being
    done at all).
    
    Along with making sure interrupt remapping doesn't get inconsistently
    enabled on some IOMMUs and not on others in the VT-d code, this in turn
    allowed quite a bit of cleanup on the VT-d side (removed from the
    backport).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: fae0372140befb88d890a30704a8ec058c902af8
    master date: 2013-03-25 14:28:31 +0100
---
 xen/arch/x86/msi.c                  |    6 +++---
 xen/drivers/passthrough/iommu.c     |    5 +++++
 xen/drivers/passthrough/vtd/iommu.c |    3 +++
 xen/include/asm-x86/io_apic.h       |    2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 54ec8e7..bf6b542 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -204,7 +204,7 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         BUG();
     }
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
 }
 
@@ -212,7 +212,7 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
     {
         ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
@@ -482,7 +482,7 @@ int msi_free_irq(struct msi_desc *entry)
     }
 
     /* Free the unused IRTE if intr remap enabled */
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_update_ire_from_msi(entry, NULL);
 
     list_del(&entry->list);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 92e54e2..4e275a6 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -404,6 +404,8 @@ int __init iommu_setup(void)
         rc = iommu_hardware_setup();
         iommu_enabled = (rc == 0);
     }
+    if ( !iommu_enabled )
+        iommu_intremap = 0;
 
     if ( (force_iommu && !iommu_enabled) ||
          (force_intremap && !iommu_intremap) )
@@ -420,9 +422,12 @@ int __init iommu_setup(void)
     }
     printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis");
     if ( iommu_enabled )
+    {
         printk(" - Dom0 mode: %s\n",
                iommu_passthrough ? "Passthrough" :
                iommu_dom0_strict ? "Strict" : "Relaxed");
+        printk("Interrupt remapping %sabled\n", iommu_intremap ? "en" : "dis");
+    }
 
     return rc;
 }
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 6291574..f38a62c 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2086,6 +2086,9 @@ static int init_vtd_hw(void)
                 break;
             }
         }
+        if ( !iommu_intremap )
+            for_each_drhd_unit ( drhd )
+                disable_intremap(drhd->iommu);
     }
 
     /*
diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h
index cee283e..2360222 100644
--- a/xen/include/asm-x86/io_apic.h
+++ b/xen/include/asm-x86/io_apic.h
@@ -129,7 +129,7 @@ struct IO_APIC_route_entry {
 extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
 
 /* Only need to remap ioapic RTE (reg: 10~3Fh) */
-#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10))
+#define ioapic_reg_remapped(reg) (iommu_intremap && ((reg) >= 0x10))
 
 static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:11:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:11:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Qj-00008d-CM; Tue, 02 Apr 2013 22:11:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qh-000089-Bw
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:47 +0000
Received: from [85.158.139.211:53742] by server-15.bemta-5.messagelabs.com id
	54/40-22815-2A75B515; Tue, 02 Apr 2013 22:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1364940704!20136520!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8034 invoked from network); 2 Apr 2013 22:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qe-0002FG-Nu
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qe-0004Dl-MM
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:44 +0000
Date: Tue, 02 Apr 2013 22:11:44 +0000
Message-Id: <E1UN9Qe-0004Dl-MM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] IOMMU: properly check whether
	interrupt remapping is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fd1993bc6b1d5999534344fab2c73124079671d4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 10:50:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:50:52 2013 +0200

    IOMMU: properly check whether interrupt remapping is enabled
    
    ... rather than the IOMMU as a whole.
    
    That in turn required to make sure iommu_intremap gets properly
    cleared when the respective initialization fails (or isn't being
    done at all).
    
    Along with making sure interrupt remapping doesn't get inconsistently
    enabled on some IOMMUs and not on others in the VT-d code, this in turn
    allowed quite a bit of cleanup on the VT-d side (removed from the
    backport).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: fae0372140befb88d890a30704a8ec058c902af8
    master date: 2013-03-25 14:28:31 +0100
---
 xen/arch/x86/msi.c                  |    6 +++---
 xen/drivers/passthrough/iommu.c     |    5 +++++
 xen/drivers/passthrough/vtd/iommu.c |    3 +++
 xen/include/asm-x86/io_apic.h       |    2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 54ec8e7..bf6b542 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -204,7 +204,7 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         BUG();
     }
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_read_msi_from_ire(entry, msg);
 }
 
@@ -212,7 +212,7 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
 
-    if ( iommu_enabled )
+    if ( iommu_intremap )
     {
         ASSERT(msg != &entry->msg);
         iommu_update_ire_from_msi(entry, msg);
@@ -482,7 +482,7 @@ int msi_free_irq(struct msi_desc *entry)
     }
 
     /* Free the unused IRTE if intr remap enabled */
-    if ( iommu_enabled )
+    if ( iommu_intremap )
         iommu_update_ire_from_msi(entry, NULL);
 
     list_del(&entry->list);
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 92e54e2..4e275a6 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -404,6 +404,8 @@ int __init iommu_setup(void)
         rc = iommu_hardware_setup();
         iommu_enabled = (rc == 0);
     }
+    if ( !iommu_enabled )
+        iommu_intremap = 0;
 
     if ( (force_iommu && !iommu_enabled) ||
          (force_intremap && !iommu_intremap) )
@@ -420,9 +422,12 @@ int __init iommu_setup(void)
     }
     printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis");
     if ( iommu_enabled )
+    {
         printk(" - Dom0 mode: %s\n",
                iommu_passthrough ? "Passthrough" :
                iommu_dom0_strict ? "Strict" : "Relaxed");
+        printk("Interrupt remapping %sabled\n", iommu_intremap ? "en" : "dis");
+    }
 
     return rc;
 }
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 6291574..f38a62c 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2086,6 +2086,9 @@ static int init_vtd_hw(void)
                 break;
             }
         }
+        if ( !iommu_intremap )
+            for_each_drhd_unit ( drhd )
+                disable_intremap(drhd->iommu);
     }
 
     /*
diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h
index cee283e..2360222 100644
--- a/xen/include/asm-x86/io_apic.h
+++ b/xen/include/asm-x86/io_apic.h
@@ -129,7 +129,7 @@ struct IO_APIC_route_entry {
 extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS];
 
 /* Only need to remap ioapic RTE (reg: 10~3Fh) */
-#define ioapic_reg_remapped(reg) (iommu_enabled && ((reg) >= 0x10))
+#define ioapic_reg_remapped(reg) (iommu_intremap && ((reg) >= 0x10))
 
 static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9R2-0000Cb-I8; Tue, 02 Apr 2013 22:12:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9R1-0000CI-SS
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:08 +0000
Received: from [85.158.137.99:2841] by server-11.bemta-3.messagelabs.com id
	B5/40-01263-7B75B515; Tue, 02 Apr 2013 22:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1364940725!17753933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27130 invoked from network); 2 Apr 2013 22:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qz-0002Fy-6S
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qz-0004EZ-4m
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:05 +0000
Date: Tue, 02 Apr 2013 22:12:05 +0000
Message-Id: <E1UN9Qz-0004EZ-4m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD IOMMU: allow disabling only
	interrupt remapping when certain IVRS consistency checks fail
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77c1e88c14bb6705f6fca091e12d2aa4d8882207
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 10:52:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:52:26 2013 +0200

    AMD IOMMU: allow disabling only interrupt remapping when certain IVRS consistency checks fail
    
    After some more thought on the XSA-36 and specifically the comments we
    got regarding disabling the IOMMU in this situation altogether making
    things worse instead of better, I came to the conclusion that we can
    actually restrict the action in affected cases to just disabling
    interrupt remapping. That doesn't make the situation worse than prior
    to the XSA-36 fixes (where interrupt remapping didn't really protect
    domains from one another), but allows at least DMA isolation to still
    be utilized.
    
    To do so, disabling of interrupt remapping must be explicitly requested
    on the command line - respective checks will then be skipped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
    master changeset: 92b8bc03bd4b582cb524db51494d0dba7607e7ac
    master date: 2013-03-25 16:55:22 +0100
---
 xen/drivers/passthrough/amd/iommu_acpi.c |    5 ++++-
 xen/drivers/passthrough/amd/iommu_init.c |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index 7205a5f..2b52ea9 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -664,6 +664,9 @@ static u16 __init parse_ivhd_device_special(
         return dev_length;
     }
 
+    if ( !iommu_intremap )
+        return dev_length;
+
     /*
      * Some BIOSes have IOAPIC broken entries so we check for IVRS
      * consistency here --- whether entry's IOAPIC ID is valid and
@@ -902,7 +905,7 @@ static int __init parse_ivrs_table(struct acpi_table_header *table)
     }
 
     /* Each IO-APIC must have been mentioned in the table. */
-    for ( apic = 0; !error && apic < nr_ioapics; ++apic )
+    for ( apic = 0; !error && iommu_intremap && apic < nr_ioapics; ++apic )
     {
         if ( !nr_ioapic_entries[apic] ||
              ioapic_sbdf[IO_APIC_ID(apic)].pin_setup )
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index a97b68b..ebf964c 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -1200,7 +1200,8 @@ int __init amd_iommu_init(void)
 
     BUG_ON( !iommu_found() );
 
-    if ( amd_iommu_perdev_intremap && amd_sp5100_erratum28() )
+    if ( iommu_intremap && amd_iommu_perdev_intremap &&
+         amd_sp5100_erratum28() )
         goto error_out;
 
     ivrs_bdf_entries = amd_iommu_get_ivrs_dev_entries();
@@ -1217,7 +1218,7 @@ int __init amd_iommu_init(void)
         goto error_out;
 
     /* initialize io-apic interrupt remapping entries */
-    if ( amd_iommu_setup_ioapic_remapping() != 0 )
+    if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 )
         goto error_out;
 
     /* allocate and initialize a global device table shared by all iommus */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9R2-0000Cb-I8; Tue, 02 Apr 2013 22:12:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9R1-0000CI-SS
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:08 +0000
Received: from [85.158.137.99:2841] by server-11.bemta-3.messagelabs.com id
	B5/40-01263-7B75B515; Tue, 02 Apr 2013 22:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1364940725!17753933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27130 invoked from network); 2 Apr 2013 22:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qz-0002Fy-6S
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qz-0004EZ-4m
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:05 +0000
Date: Tue, 02 Apr 2013 22:12:05 +0000
Message-Id: <E1UN9Qz-0004EZ-4m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD IOMMU: allow disabling only
	interrupt remapping when certain IVRS consistency checks fail
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77c1e88c14bb6705f6fca091e12d2aa4d8882207
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 10:52:26 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:52:26 2013 +0200

    AMD IOMMU: allow disabling only interrupt remapping when certain IVRS consistency checks fail
    
    After some more thought on the XSA-36 and specifically the comments we
    got regarding disabling the IOMMU in this situation altogether making
    things worse instead of better, I came to the conclusion that we can
    actually restrict the action in affected cases to just disabling
    interrupt remapping. That doesn't make the situation worse than prior
    to the XSA-36 fixes (where interrupt remapping didn't really protect
    domains from one another), but allows at least DMA isolation to still
    be utilized.
    
    To do so, disabling of interrupt remapping must be explicitly requested
    on the command line - respective checks will then be skipped.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
    master changeset: 92b8bc03bd4b582cb524db51494d0dba7607e7ac
    master date: 2013-03-25 16:55:22 +0100
---
 xen/drivers/passthrough/amd/iommu_acpi.c |    5 ++++-
 xen/drivers/passthrough/amd/iommu_init.c |    5 +++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_acpi.c b/xen/drivers/passthrough/amd/iommu_acpi.c
index 7205a5f..2b52ea9 100644
--- a/xen/drivers/passthrough/amd/iommu_acpi.c
+++ b/xen/drivers/passthrough/amd/iommu_acpi.c
@@ -664,6 +664,9 @@ static u16 __init parse_ivhd_device_special(
         return dev_length;
     }
 
+    if ( !iommu_intremap )
+        return dev_length;
+
     /*
      * Some BIOSes have IOAPIC broken entries so we check for IVRS
      * consistency here --- whether entry's IOAPIC ID is valid and
@@ -902,7 +905,7 @@ static int __init parse_ivrs_table(struct acpi_table_header *table)
     }
 
     /* Each IO-APIC must have been mentioned in the table. */
-    for ( apic = 0; !error && apic < nr_ioapics; ++apic )
+    for ( apic = 0; !error && iommu_intremap && apic < nr_ioapics; ++apic )
     {
         if ( !nr_ioapic_entries[apic] ||
              ioapic_sbdf[IO_APIC_ID(apic)].pin_setup )
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index a97b68b..ebf964c 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -1200,7 +1200,8 @@ int __init amd_iommu_init(void)
 
     BUG_ON( !iommu_found() );
 
-    if ( amd_iommu_perdev_intremap && amd_sp5100_erratum28() )
+    if ( iommu_intremap && amd_iommu_perdev_intremap &&
+         amd_sp5100_erratum28() )
         goto error_out;
 
     ivrs_bdf_entries = amd_iommu_get_ivrs_dev_entries();
@@ -1217,7 +1218,7 @@ int __init amd_iommu_init(void)
         goto error_out;
 
     /* initialize io-apic interrupt remapping entries */
-    if ( amd_iommu_setup_ioapic_remapping() != 0 )
+    if ( iommu_intremap && amd_iommu_setup_ioapic_remapping() != 0 )
         goto error_out;
 
     /* allocate and initialize a global device table shared by all iommus */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RD-0000EY-LR; Tue, 02 Apr 2013 22:12:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RC-0000EH-S7
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:19 +0000
Received: from [85.158.137.99:54110] by server-8.bemta-3.messagelabs.com id
	68/2B-20604-1C75B515; Tue, 02 Apr 2013 22:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1364940736!17753948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27534 invoked from network); 2 Apr 2013 22:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qo-0002FP-Vw
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qo-0004E7-SL
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:54 +0000
Date: Tue, 02 Apr 2013 22:11:54 +0000
Message-Id: <E1UN9Qo-0004E7-SL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: deal with 5500/5520/X58
	errata
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 144d1b5c4647d829080e32d7887c33795bf4c326
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Apr 2 10:51:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:51:40 2013 +0200

    VT-d: deal with 5500/5520/X58 errata
    
    http://www.intel.com/content/www/us/en/chipsets/5520-and-5500-chipset-ioh-specification-update.html
    
    Stepping B-3 has two errata (#47 and #53) related to Interrupt
    remapping, to which the workaround is for the BIOS to completely disable
    interrupt remapping.  These errata are fixed in stepping C-2.
    
    Unfortunately this chipset stepping is very common and many BIOSes are
    not disabling interrupt remapping on this stepping .  We can detect this in
    Xen and prevent Xen from using the problematic interrupt remapping feature.
    
    The Intel 5500/5520/X58 chipset does not support VT-d
    Extended Interrupt Mode(EIM). This means the iommu_supports_eim() check
    always fails and so x2apic mode cannot be enabled in Xen before this quirk
    disables the interrupt remapping feature.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Gate the function call to check the quirk on interrupt remapping being
    requested to get enabled, and upon failure disable the IOMMU to be in
    line with what the changes for XSA-36 (plus follow-ups) did.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: 6890cebc6a987d0e896f5d23a8de11a3934101cf
    master date: 2013-03-25 14:31:27 +0100
---
 xen/drivers/passthrough/vtd/iommu.c  |    5 +++++
 xen/drivers/passthrough/vtd/quirks.c |   27 +++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index f38a62c..071a91b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2143,6 +2143,11 @@ int __init intel_vtd_setup(void)
     }
 
     platform_quirks_init();
+    if ( !iommu_enabled )
+    {
+        ret = -ENODEV;
+        goto error;
+    }
 
     /* We enable the following features only if they are supported by all VT-d
      * engines: Snoop Control, DMA passthrough, Queued Invalidation and
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 6b92164..ee87d10 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -248,6 +248,29 @@ void vtd_ops_postamble_quirk(struct iommu* iommu)
     }
 }
 
+/* 5500/5520/X58 Chipset Interrupt remapping errata, for stepping B-3.
+ * Fixed in stepping C-2. */
+static void __init tylersburg_intremap_quirk(void)
+{
+    uint32_t bus, device;
+    uint8_t rev;
+
+    for ( bus = 0; bus < 0x100; bus++ )
+    {
+        /* Match on System Management Registers on Device 20 Function 0 */
+        device = pci_conf_read32(0, bus, 20, 0, PCI_VENDOR_ID);
+        rev = pci_conf_read8(0, bus, 20, 0, PCI_REVISION_ID);
+
+        if ( rev == 0x13 && device == 0x342e8086 )
+        {
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Disabling IOMMU due to Intel 5500/5520/X58 Chipset errata #47, #53\n");
+            iommu_enabled = 0;
+            break;
+        }
+    }
+}
+
 /* initialize platform identification flags */
 void __init platform_quirks_init(void)
 {
@@ -268,6 +291,10 @@ void __init platform_quirks_init(void)
 
     /* ioremap IGD MMIO+0x2000 page */
     map_igd_reg();
+
+    /* Tylersburg interrupt remap quirk */
+    if ( iommu_intremap )
+        tylersburg_intremap_quirk();
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RD-0000EY-LR; Tue, 02 Apr 2013 22:12:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RC-0000EH-S7
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:19 +0000
Received: from [85.158.137.99:54110] by server-8.bemta-3.messagelabs.com id
	68/2B-20604-1C75B515; Tue, 02 Apr 2013 22:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1364940736!17753948!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27534 invoked from network); 2 Apr 2013 22:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qo-0002FP-Vw
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Qo-0004E7-SL
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:11:54 +0000
Date: Tue, 02 Apr 2013 22:11:54 +0000
Message-Id: <E1UN9Qo-0004E7-SL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: deal with 5500/5520/X58
	errata
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 144d1b5c4647d829080e32d7887c33795bf4c326
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Apr 2 10:51:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:51:40 2013 +0200

    VT-d: deal with 5500/5520/X58 errata
    
    http://www.intel.com/content/www/us/en/chipsets/5520-and-5500-chipset-ioh-specification-update.html
    
    Stepping B-3 has two errata (#47 and #53) related to Interrupt
    remapping, to which the workaround is for the BIOS to completely disable
    interrupt remapping.  These errata are fixed in stepping C-2.
    
    Unfortunately this chipset stepping is very common and many BIOSes are
    not disabling interrupt remapping on this stepping .  We can detect this in
    Xen and prevent Xen from using the problematic interrupt remapping feature.
    
    The Intel 5500/5520/X58 chipset does not support VT-d
    Extended Interrupt Mode(EIM). This means the iommu_supports_eim() check
    always fails and so x2apic mode cannot be enabled in Xen before this quirk
    disables the interrupt remapping feature.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Gate the function call to check the quirk on interrupt remapping being
    requested to get enabled, and upon failure disable the IOMMU to be in
    line with what the changes for XSA-36 (plus follow-ups) did.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
    master changeset: 6890cebc6a987d0e896f5d23a8de11a3934101cf
    master date: 2013-03-25 14:31:27 +0100
---
 xen/drivers/passthrough/vtd/iommu.c  |    5 +++++
 xen/drivers/passthrough/vtd/quirks.c |   27 +++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index f38a62c..071a91b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2143,6 +2143,11 @@ int __init intel_vtd_setup(void)
     }
 
     platform_quirks_init();
+    if ( !iommu_enabled )
+    {
+        ret = -ENODEV;
+        goto error;
+    }
 
     /* We enable the following features only if they are supported by all VT-d
      * engines: Snoop Control, DMA passthrough, Queued Invalidation and
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 6b92164..ee87d10 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -248,6 +248,29 @@ void vtd_ops_postamble_quirk(struct iommu* iommu)
     }
 }
 
+/* 5500/5520/X58 Chipset Interrupt remapping errata, for stepping B-3.
+ * Fixed in stepping C-2. */
+static void __init tylersburg_intremap_quirk(void)
+{
+    uint32_t bus, device;
+    uint8_t rev;
+
+    for ( bus = 0; bus < 0x100; bus++ )
+    {
+        /* Match on System Management Registers on Device 20 Function 0 */
+        device = pci_conf_read32(0, bus, 20, 0, PCI_VENDOR_ID);
+        rev = pci_conf_read8(0, bus, 20, 0, PCI_REVISION_ID);
+
+        if ( rev == 0x13 && device == 0x342e8086 )
+        {
+            printk(XENLOG_WARNING VTDPREFIX
+                   "Disabling IOMMU due to Intel 5500/5520/X58 Chipset errata #47, #53\n");
+            iommu_enabled = 0;
+            break;
+        }
+    }
+}
+
 /* initialize platform identification flags */
 void __init platform_quirks_init(void)
 {
@@ -268,6 +291,10 @@ void __init platform_quirks_init(void)
 
     /* ioremap IGD MMIO+0x2000 page */
     map_igd_reg();
+
+    /* Tylersburg interrupt remap quirk */
+    if ( iommu_intremap )
+        tylersburg_intremap_quirk();
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RH-0000Fe-OP; Tue, 02 Apr 2013 22:12:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RH-0000FM-2L
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:23 +0000
Received: from [85.158.137.99:7031] by server-3.bemta-3.messagelabs.com id
	5D/0A-26934-1C75B515; Tue, 02 Apr 2013 22:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1364940735!12087329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24529 invoked from network); 2 Apr 2013 22:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9R9-0002G2-DJ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9R9-0004Ex-Bf
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:15 +0000
Date: Tue, 02 Apr 2013 22:12:15 +0000
Message-Id: <E1UN9R9-0004Ex-Bf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/APEI: fix ERST MOVE_DATA
	instruction implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a44b0a5538c26f993b72fbd083c3d3c216fa8ca8
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 10:58:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:58:31 2013 +0200

    ACPI/APEI: fix ERST MOVE_DATA instruction implementation
    
    The src_base and dst_base fields in apei_exec_context are physical
    address, so they should be ioremaped before being used in ERST
    MOVE_DATA instruction.
    
    Reported-by: Javier Martinez Canillas <martinez.javier@gmail.com>
    Reported-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    Replace use of ioremap() by __acpi_map_table()/set_fixmap(). Fix error
    handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: df2cf6a726b815fafa12e503c9a36707c3962f22
    master date: 2012-10-17 14:12:06 +0200
---
 xen/drivers/acpi/apei/erst.c |   57 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index eb666a6..46fcff5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -247,15 +247,64 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
 {
 	int rc;
 	u64 offset;
+#ifdef CONFIG_X86
+	enum fixed_addresses idx;
+#endif
+	void *src, *dst;
+
+	/* ioremap does not work in interrupt context */
+	if (in_irq()) {
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used in interrupt context\n");
+		return -EBUSY;
+	}
 
 	rc = __apei_exec_read_register(entry, &offset);
 	if (rc)
 		return rc;
-	memmove((void *)(unsigned long)(ctx->dst_base + offset),
-		(void *)(unsigned long)(ctx->src_base + offset),
-		ctx->var2);
 
-	return 0;
+#ifdef CONFIG_X86
+	switch (ctx->var2) {
+	case 0:
+		return 0;
+	case 1 ... PAGE_SIZE:
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
+		       ctx->var2);
+		return -EOPNOTSUPP;
+	}
+
+	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
+#else
+	src = ioremap(ctx->src_base + offset, ctx->var2);
+#endif
+	if (!src)
+		return -ENOMEM;
+
+#ifdef CONFIG_X86
+	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
+	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
+	offset += ctx->dst_base;
+	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
+	set_fixmap(idx, offset);
+	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
+		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
+		set_fixmap(idx, offset + PAGE_SIZE);
+	}
+#else
+	dst = ioremap(ctx->dst_base + offset, ctx->var2);
+#endif
+	if (dst) {
+		memmove(dst, src, ctx->var2);
+		iounmap(dst);
+	} else
+		rc = -ENOMEM;
+
+	iounmap(src);
+
+	return rc;
 }
 
 static struct apei_exec_ins_type erst_ins_type[] = {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RH-0000Fe-OP; Tue, 02 Apr 2013 22:12:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RH-0000FM-2L
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:23 +0000
Received: from [85.158.137.99:7031] by server-3.bemta-3.messagelabs.com id
	5D/0A-26934-1C75B515; Tue, 02 Apr 2013 22:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1364940735!12087329!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24529 invoked from network); 2 Apr 2013 22:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9R9-0002G2-DJ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9R9-0004Ex-Bf
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:15 +0000
Date: Tue, 02 Apr 2013 22:12:15 +0000
Message-Id: <E1UN9R9-0004Ex-Bf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/APEI: fix ERST MOVE_DATA
	instruction implementation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a44b0a5538c26f993b72fbd083c3d3c216fa8ca8
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 10:58:31 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:58:31 2013 +0200

    ACPI/APEI: fix ERST MOVE_DATA instruction implementation
    
    The src_base and dst_base fields in apei_exec_context are physical
    address, so they should be ioremaped before being used in ERST
    MOVE_DATA instruction.
    
    Reported-by: Javier Martinez Canillas <martinez.javier@gmail.com>
    Reported-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    Replace use of ioremap() by __acpi_map_table()/set_fixmap(). Fix error
    handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: df2cf6a726b815fafa12e503c9a36707c3962f22
    master date: 2012-10-17 14:12:06 +0200
---
 xen/drivers/acpi/apei/erst.c |   57 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index eb666a6..46fcff5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -247,15 +247,64 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
 {
 	int rc;
 	u64 offset;
+#ifdef CONFIG_X86
+	enum fixed_addresses idx;
+#endif
+	void *src, *dst;
+
+	/* ioremap does not work in interrupt context */
+	if (in_irq()) {
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used in interrupt context\n");
+		return -EBUSY;
+	}
 
 	rc = __apei_exec_read_register(entry, &offset);
 	if (rc)
 		return rc;
-	memmove((void *)(unsigned long)(ctx->dst_base + offset),
-		(void *)(unsigned long)(ctx->src_base + offset),
-		ctx->var2);
 
-	return 0;
+#ifdef CONFIG_X86
+	switch (ctx->var2) {
+	case 0:
+		return 0;
+	case 1 ... PAGE_SIZE:
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MOVE_DATA cannot be used for %#"PRIx64" bytes of data\n",
+		       ctx->var2);
+		return -EOPNOTSUPP;
+	}
+
+	src = __acpi_map_table(ctx->src_base + offset, ctx->var2);
+#else
+	src = ioremap(ctx->src_base + offset, ctx->var2);
+#endif
+	if (!src)
+		return -ENOMEM;
+
+#ifdef CONFIG_X86
+	BUILD_BUG_ON(FIX_ACPI_PAGES < 4);
+	idx = virt_to_fix((unsigned long)src + 2 * PAGE_SIZE);
+	offset += ctx->dst_base;
+	dst = (void *)fix_to_virt(idx) + (offset & ~PAGE_MASK);
+	set_fixmap(idx, offset);
+	if (PFN_DOWN(offset) != PFN_DOWN(offset + ctx->var2 - 1)) {
+		idx = virt_to_fix((unsigned long)dst + PAGE_SIZE);
+		set_fixmap(idx, offset + PAGE_SIZE);
+	}
+#else
+	dst = ioremap(ctx->dst_base + offset, ctx->var2);
+#endif
+	if (dst) {
+		memmove(dst, src, ctx->var2);
+		iounmap(dst);
+	} else
+		rc = -ENOMEM;
+
+	iounmap(src);
+
+	return rc;
 }
 
 static struct apei_exec_ins_type erst_ins_type[] = {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RM-0000H0-RD; Tue, 02 Apr 2013 22:12:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RM-0000Gd-7H
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:28 +0000
Received: from [85.158.139.83:61887] by server-5.bemta-5.messagelabs.com id
	62/72-02762-BC75B515; Tue, 02 Apr 2013 22:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1364940745!26814263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26144 invoked from network); 2 Apr 2013 22:12:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RJ-0002GA-No
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RJ-0004G4-Hl
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:25 +0000
Date: Tue, 02 Apr 2013 22:12:25 +0000
Message-Id: <E1UN9RJ-0004G4-Hl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/ERST: Name table in otherwise
	opaque error messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 67e5f2ad3885d1ce27b02732f11e3010ee58d540
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 10:59:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:59:34 2013 +0200

    ACPI/ERST: Name table in otherwise opaque error messages
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Fix spelling and lower severities.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 759847e44401176401e86e7c55b644cb9f93c781
    master date: 2013-03-20 10:02:52 +0100
---
 xen/drivers/acpi/apei/erst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 46fcff5..1e420c5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -788,11 +788,11 @@ int __init erst_init(void)
 	status = acpi_get_table(ACPI_SIG_ERST, 0,
 				(struct acpi_table_header **)&erst_tab);
 	if (status == AE_NOT_FOUND) {
-		printk(KERN_ERR "Table is not found!\n");
+		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
 	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
-		printk(KERN_ERR "Failed to get table, %s\n", msg);
+		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RM-0000H0-RD; Tue, 02 Apr 2013 22:12:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RM-0000Gd-7H
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:28 +0000
Received: from [85.158.139.83:61887] by server-5.bemta-5.messagelabs.com id
	62/72-02762-BC75B515; Tue, 02 Apr 2013 22:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-182.messagelabs.com!1364940745!26814263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26144 invoked from network); 2 Apr 2013 22:12:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RJ-0002GA-No
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RJ-0004G4-Hl
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:25 +0000
Date: Tue, 02 Apr 2013 22:12:25 +0000
Message-Id: <E1UN9RJ-0004G4-Hl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/ERST: Name table in otherwise
	opaque error messages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 67e5f2ad3885d1ce27b02732f11e3010ee58d540
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 10:59:34 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 10:59:34 2013 +0200

    ACPI/ERST: Name table in otherwise opaque error messages
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Fix spelling and lower severities.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 759847e44401176401e86e7c55b644cb9f93c781
    master date: 2013-03-20 10:02:52 +0100
---
 xen/drivers/acpi/apei/erst.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 46fcff5..1e420c5 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -788,11 +788,11 @@ int __init erst_init(void)
 	status = acpi_get_table(ACPI_SIG_ERST, 0,
 				(struct acpi_table_header **)&erst_tab);
 	if (status == AE_NOT_FOUND) {
-		printk(KERN_ERR "Table is not found!\n");
+		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
 	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
-		printk(KERN_ERR "Failed to get table, %s\n", msg);
+		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RZ-0000Ja-UY; Tue, 02 Apr 2013 22:12:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RY-0000J8-GA
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:40 +0000
Received: from [85.158.138.51:6917] by server-6.bemta-3.messagelabs.com id
	6C/94-11048-7D75B515; Tue, 02 Apr 2013 22:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1364940756!18485330!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26113 invoked from network); 2 Apr 2013 22:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RU-0002GL-3H
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RT-0004Ga-Ut
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:36 +0000
Date: Tue, 02 Apr 2013 22:12:35 +0000
Message-Id: <E1UN9RT-0004Ga-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/APEI: Unlock apei_iomaps_lock
	on error path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d82be94efbf8e2721f5957fe459fc296198ffc80
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 11:00:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:00:22 2013 +0200

    ACPI/APEI: Unlock apei_iomaps_lock on error path
    
    This causes deadlocks during early boot on hardware with broken/buggy
    APEI implementations, such as a Dell Poweredge 2950 with the latest
    currently available BIOS.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Don't use goto or another special error path, as handling the error
    case in normal flow is quite simple.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 0611689d9153227831979c7bafe594214b8505a3
    master date: 2013-03-22 09:43:38 +0100
---
 xen/drivers/acpi/apei/apei-io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-io.c b/xen/drivers/acpi/apei/apei-io.c
index d57035b..f0f4636 100644
--- a/xen/drivers/acpi/apei/apei-io.c
+++ b/xen/drivers/acpi/apei/apei-io.c
@@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr_t paddr, unsigned long size)
 
 	spin_lock_irqsave(&apei_iomaps_lock, flags);
 	map = __apei_find_iomap(paddr, size);
-	if (!map)
-		return;
-
-	list_del(&map->list);
+	if (map)
+		list_del(&map->list);
 	spin_unlock_irqrestore(&apei_iomaps_lock, flags);
 
 	xfree(map);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9RZ-0000Ja-UY; Tue, 02 Apr 2013 22:12:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RY-0000J8-GA
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:40 +0000
Received: from [85.158.138.51:6917] by server-6.bemta-3.messagelabs.com id
	6C/94-11048-7D75B515; Tue, 02 Apr 2013 22:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1364940756!18485330!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26113 invoked from network); 2 Apr 2013 22:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RU-0002GL-3H
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9RT-0004Ga-Ut
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:36 +0000
Date: Tue, 02 Apr 2013 22:12:35 +0000
Message-Id: <E1UN9RT-0004Ga-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/APEI: Unlock apei_iomaps_lock
	on error path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d82be94efbf8e2721f5957fe459fc296198ffc80
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 2 11:00:22 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:00:22 2013 +0200

    ACPI/APEI: Unlock apei_iomaps_lock on error path
    
    This causes deadlocks during early boot on hardware with broken/buggy
    APEI implementations, such as a Dell Poweredge 2950 with the latest
    currently available BIOS.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    
    Don't use goto or another special error path, as handling the error
    case in normal flow is quite simple.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master changeset: 0611689d9153227831979c7bafe594214b8505a3
    master date: 2013-03-22 09:43:38 +0100
---
 xen/drivers/acpi/apei/apei-io.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-io.c b/xen/drivers/acpi/apei/apei-io.c
index d57035b..f0f4636 100644
--- a/xen/drivers/acpi/apei/apei-io.c
+++ b/xen/drivers/acpi/apei/apei-io.c
@@ -146,10 +146,8 @@ static void __init apei_post_unmap(paddr_t paddr, unsigned long size)
 
 	spin_lock_irqsave(&apei_iomaps_lock, flags);
 	map = __apei_find_iomap(paddr, size);
-	if (!map)
-		return;
-
-	list_del(&map->list);
+	if (map)
+		list_del(&map->list);
 	spin_unlock_irqrestore(&apei_iomaps_lock, flags);
 
 	xfree(map);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Ri-0000LU-1A; Tue, 02 Apr 2013 22:12:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Rh-0000LF-5h
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:49 +0000
Received: from [85.158.143.99:55947] by server-2.bemta-4.messagelabs.com id
	69/2A-12656-0E75B515; Tue, 02 Apr 2013 22:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1364940766!22135778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17736 invoked from network); 2 Apr 2013 22:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Re-0002GO-At
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Re-0004Gw-8m
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:46 +0000
Date: Tue, 02 Apr 2013 22:12:46 +0000
Message-Id: <E1UN9Re-0004Gw-8m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI,
	APEI: Add apei_exec_run_optional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f51b14d1f25c96fba290882f0a80fc7baf0fe28e
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 11:01:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:01:40 2013 +0200

    ACPI, APEI: Add apei_exec_run_optional
    
    Some actions in APEI ERST and EINJ tables are optional, for example,
    ACPI_EINJ_BEGIN_OPERATION action is used to do some preparation for
    error injection, and firmware may choose to do nothing here.  While
    some other actions are mandatory, for example, firmware must provide
    ACPI_EINJ_GET_ERROR_TYPE implementation.
    
    Original implementation treats all actions as optional (that is, can
    have no instructions), that may cause issue if firmware does not
    provide some mandatory actions.  To fix this, this patch adds
    apei_exec_run_optional, which should be used for optional actions.
    The original apei_exec_run should be used for mandatory actions.
    
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 72af01bf6f7489e54ad59270222a29d3e8c501d1
    master date: 2013-03-22 12:46:25 +0100
---
 xen/drivers/acpi/apei/apei-base.c     |    7 ++++---
 xen/drivers/acpi/apei/apei-internal.h |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-base.c b/xen/drivers/acpi/apei/apei-base.c
index 0a365b7..43f8f98 100644
--- a/xen/drivers/acpi/apei/apei-base.c
+++ b/xen/drivers/acpi/apei/apei-base.c
@@ -154,9 +154,10 @@ int apei_exec_noop(struct apei_exec_context *ctx,
  * Interpret the specified action. Go through whole action table,
  * execute all instructions belong to the action.
  */
-int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action,
+		    bool_t optional)
 {
-	int rc;
+	int rc = -ENOENT;
 	u32 i, ip;
 	struct acpi_whea_header *entry;
 	apei_exec_ins_func_t run;
@@ -195,7 +196,7 @@ rewind:
 			goto rewind;
 	}
 
-	return 0;
+	return !optional && rc < 0 ? rc : 0;
 }
 
 typedef int (*apei_exec_entry_func_t)(struct apei_exec_context *ctx,
diff --git a/xen/drivers/acpi/apei/apei-internal.h b/xen/drivers/acpi/apei/apei-internal.h
index 77f31fb..b813d55 100644
--- a/xen/drivers/acpi/apei/apei-internal.h
+++ b/xen/drivers/acpi/apei/apei-internal.h
@@ -48,7 +48,18 @@ static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
 	return ctx->value;
 }
 
-int apei_exec_run(struct apei_exec_context *ctx, u8 action);
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional);
+
+static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 0);
+}
+
+/* It is optional whether the firmware provides the action */
+static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 1);
+}
 
 /* Common instruction implementation */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:12:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Ri-0000LU-1A; Tue, 02 Apr 2013 22:12:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Rh-0000LF-5h
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:49 +0000
Received: from [85.158.143.99:55947] by server-2.bemta-4.messagelabs.com id
	69/2A-12656-0E75B515; Tue, 02 Apr 2013 22:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1364940766!22135778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17736 invoked from network); 2 Apr 2013 22:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Re-0002GO-At
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Re-0004Gw-8m
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:46 +0000
Date: Tue, 02 Apr 2013 22:12:46 +0000
Message-Id: <E1UN9Re-0004Gw-8m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI,
	APEI: Add apei_exec_run_optional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f51b14d1f25c96fba290882f0a80fc7baf0fe28e
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 11:01:40 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:01:40 2013 +0200

    ACPI, APEI: Add apei_exec_run_optional
    
    Some actions in APEI ERST and EINJ tables are optional, for example,
    ACPI_EINJ_BEGIN_OPERATION action is used to do some preparation for
    error injection, and firmware may choose to do nothing here.  While
    some other actions are mandatory, for example, firmware must provide
    ACPI_EINJ_GET_ERROR_TYPE implementation.
    
    Original implementation treats all actions as optional (that is, can
    have no instructions), that may cause issue if firmware does not
    provide some mandatory actions.  To fix this, this patch adds
    apei_exec_run_optional, which should be used for optional actions.
    The original apei_exec_run should be used for mandatory actions.
    
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master changeset: 72af01bf6f7489e54ad59270222a29d3e8c501d1
    master date: 2013-03-22 12:46:25 +0100
---
 xen/drivers/acpi/apei/apei-base.c     |    7 ++++---
 xen/drivers/acpi/apei/apei-internal.h |   13 ++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/acpi/apei/apei-base.c b/xen/drivers/acpi/apei/apei-base.c
index 0a365b7..43f8f98 100644
--- a/xen/drivers/acpi/apei/apei-base.c
+++ b/xen/drivers/acpi/apei/apei-base.c
@@ -154,9 +154,10 @@ int apei_exec_noop(struct apei_exec_context *ctx,
  * Interpret the specified action. Go through whole action table,
  * execute all instructions belong to the action.
  */
-int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action,
+		    bool_t optional)
 {
-	int rc;
+	int rc = -ENOENT;
 	u32 i, ip;
 	struct acpi_whea_header *entry;
 	apei_exec_ins_func_t run;
@@ -195,7 +196,7 @@ rewind:
 			goto rewind;
 	}
 
-	return 0;
+	return !optional && rc < 0 ? rc : 0;
 }
 
 typedef int (*apei_exec_entry_func_t)(struct apei_exec_context *ctx,
diff --git a/xen/drivers/acpi/apei/apei-internal.h b/xen/drivers/acpi/apei/apei-internal.h
index 77f31fb..b813d55 100644
--- a/xen/drivers/acpi/apei/apei-internal.h
+++ b/xen/drivers/acpi/apei/apei-internal.h
@@ -48,7 +48,18 @@ static inline u64 apei_exec_ctx_get_output(struct apei_exec_context *ctx)
 	return ctx->value;
 }
 
-int apei_exec_run(struct apei_exec_context *ctx, u8 action);
+int __apei_exec_run(struct apei_exec_context *ctx, u8 action, bool_t optional);
+
+static inline int apei_exec_run(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 0);
+}
+
+/* It is optional whether the firmware provides the action */
+static inline int apei_exec_run_optional(struct apei_exec_context *ctx, u8 action)
+{
+	return __apei_exec_run(ctx, action, 1);
+}
 
 /* Common instruction implementation */
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:13:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:13:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Rs-0000Np-4E; Tue, 02 Apr 2013 22:13:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Rq-0000NT-Q9
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:58 +0000
Received: from [85.158.143.99:6846] by server-3.bemta-4.messagelabs.com id
	B6/E7-02186-AE75B515; Tue, 02 Apr 2013 22:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1364940776!21430452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28223 invoked from network); 2 Apr 2013 22:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ro-0002GX-GB
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ro-0004HI-Ef
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:56 +0000
Date: Tue, 02 Apr 2013 22:12:56 +0000
Message-Id: <E1UN9Ro-0004HI-Ef@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI: fix APEI related table size
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2328ed01762e4f2023bddda3de323de5311c813c
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 11:02:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:02:30 2013 +0200

    ACPI: fix APEI related table size checking
    
    On Huang Ying's machine:
    
    erst_tab->header_length == sizeof(struct acpi_table_einj)
    
    but Yinghai reported that on his machine,
    
    erst_tab->header_length == sizeof(struct acpi_table_einj) -
    sizeof(struct acpi_table_header)
    
    To make erst table size checking code works on all systems, both
    testing are treated as PASS.
    
    Same situation applies to einj_tab->header_length, so corresponding
    table size checking is changed in similar way too.
    
    Originally-by: Yinghai Lu <yinghai@kernel.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    - use switch() for better readability
    - add comment explaining why a formally invalid size it also being
      accepted
    - check erst_tab->header.length before even looking at
      erst_tab->header_length
    - prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: 915ef37d7cc8fcac5b37eb0b40c693754fcd12ab
    master date: 2012-10-16 17:26:36 +0200
---
 xen/drivers/acpi/apei/erst.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 1e420c5..71db9fa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -764,12 +764,23 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-	if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+	if (erst_tab->header.length < sizeof(*erst_tab))
 		return -EINVAL;
-	if (erst_tab->header.length < sizeof(struct acpi_table_erst))
+
+	switch (erst_tab->header_length) {
+	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+	/*
+	 * While invalid per specification, there are (early?) systems
+	 * indicating the full header size here, so accept that value too.
+	 */
+	case sizeof(*erst_tab):
+		break;
+	default:
 		return -EINVAL;
+	}
+
 	if (erst_tab->entries !=
-	    (erst_tab->header.length - sizeof(struct acpi_table_erst)) /
+	    (erst_tab->header.length - sizeof(*erst_tab)) /
 	    sizeof(struct acpi_erst_entry))
 		return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:13:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:13:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9Rs-0000Np-4E; Tue, 02 Apr 2013 22:13:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Rq-0000NT-Q9
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:58 +0000
Received: from [85.158.143.99:6846] by server-3.bemta-4.messagelabs.com id
	B6/E7-02186-AE75B515; Tue, 02 Apr 2013 22:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1364940776!21430452!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28223 invoked from network); 2 Apr 2013 22:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:12:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ro-0002GX-GB
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ro-0004HI-Ef
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:12:56 +0000
Date: Tue, 02 Apr 2013 22:12:56 +0000
Message-Id: <E1UN9Ro-0004HI-Ef@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI: fix APEI related table size
	checking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2328ed01762e4f2023bddda3de323de5311c813c
Author:     Huang Ying <ying.huang@intel.com>
AuthorDate: Tue Apr 2 11:02:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:02:30 2013 +0200

    ACPI: fix APEI related table size checking
    
    On Huang Ying's machine:
    
    erst_tab->header_length == sizeof(struct acpi_table_einj)
    
    but Yinghai reported that on his machine,
    
    erst_tab->header_length == sizeof(struct acpi_table_einj) -
    sizeof(struct acpi_table_header)
    
    To make erst table size checking code works on all systems, both
    testing are treated as PASS.
    
    Same situation applies to einj_tab->header_length, so corresponding
    table size checking is changed in similar way too.
    
    Originally-by: Yinghai Lu <yinghai@kernel.org>
    Signed-off-by: Huang Ying <ying.huang@intel.com>
    
    - use switch() for better readability
    - add comment explaining why a formally invalid size it also being
      accepted
    - check erst_tab->header.length before even looking at
      erst_tab->header_length
    - prefer sizeof(*erst_tab) over sizeof(struct acpi_table_erst)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: 915ef37d7cc8fcac5b37eb0b40c693754fcd12ab
    master date: 2012-10-16 17:26:36 +0200
---
 xen/drivers/acpi/apei/erst.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 1e420c5..71db9fa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -764,12 +764,23 @@ int erst_clear(u64 record_id)
 
 static int __init erst_check_table(struct acpi_table_erst *erst_tab)
 {
-	if (erst_tab->header_length != sizeof(struct acpi_table_erst))
+	if (erst_tab->header.length < sizeof(*erst_tab))
 		return -EINVAL;
-	if (erst_tab->header.length < sizeof(struct acpi_table_erst))
+
+	switch (erst_tab->header_length) {
+	case sizeof(*erst_tab) - sizeof(erst_tab->header):
+	/*
+	 * While invalid per specification, there are (early?) systems
+	 * indicating the full header size here, so accept that value too.
+	 */
+	case sizeof(*erst_tab):
+		break;
+	default:
 		return -EINVAL;
+	}
+
 	if (erst_tab->entries !=
-	    (erst_tab->header.length - sizeof(struct acpi_table_erst)) /
+	    (erst_tab->header.length - sizeof(*erst_tab)) /
 	    sizeof(struct acpi_erst_entry))
 		return -EINVAL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:13:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:13:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9S4-0000QD-A6; Tue, 02 Apr 2013 22:13:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9S3-0000Px-5J
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:11 +0000
Received: from [85.158.143.99:56661] by server-3.bemta-4.messagelabs.com id
	02/F7-02186-6F75B515; Tue, 02 Apr 2013 22:13:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1364940786!27541218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32245 invoked from network); 2 Apr 2013 22:13:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:13:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ry-0002H6-P5
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ry-0004Hf-Mi
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:06 +0000
Date: Tue, 02 Apr 2013 22:13:06 +0000
Message-Id: <E1UN9Ry-0004Hf-Mi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: reserve pages when
	SandyBridge integrated graphics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7947b74a37020b15a69e2aa1e1e5ede9516c77cd
Author:     Xudong Hao <xudong.hao@intel.com>
AuthorDate: Tue Apr 2 11:21:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:21:55 2013 +0200

    x86: reserve pages when SandyBridge integrated graphics
    
    SNB graphics devices have a bug that prevent them from accessing certain
    memory ranges, namely anything below 1M and in the pages listed in the
    table.
    
    Xen does not initialize below 1MB to heap, i.e. below 1MB pages don't be
    allocated, so it's unnecessary to reserve memory below the 1 MB mark
    that has not already been reserved.
    
    So reserve those pages listed in the table at xen boot if set detect a
    SNB gfx device on the CPU to avoid GPU hangs.
    
    Signed-off-by: Xudong Hao <xudong.hao@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: db537fe3023bf157b85c8246782cb72a6f989b31
    master date: 2013-03-26 14:22:07 +0100
---
 xen/arch/x86/mm.c                    |   20 ++++++++++++++++++++
 xen/common/page_alloc.c              |   23 +++++++++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 xen/include/asm-x86/mm.h             |    1 +
 xen/include/asm-x86/pci.h            |    5 +++++
 5 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1aeacbd..8444610 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -120,6 +120,7 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
+#include <asm/pci.h>
 
 /*
  * Mapping of first 2 or 4 megabytes of memory. This is mapped with 4kB
@@ -5849,6 +5850,25 @@ void arch_dump_shared_mem_info(void)
 }
 #endif
 
+const unsigned long *__init get_platform_badpages(unsigned int *array_size)
+{
+    u32 igd_id;
+    static unsigned long __initdata bad_pages[] = {
+        0x20050000,
+        0x20110000,
+        0x20130000,
+        0x20138000,
+        0x40004000,
+    };
+
+    *array_size = ARRAY_SIZE(bad_pages);
+    igd_id = pci_conf_read32(0, 0, 2, 0, 0);
+    if ( !IS_SNB_GFX(igd_id) )
+        return NULL;
+
+    return bad_pages;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 95bd794..fbdff5c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -151,6 +151,10 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 {
     unsigned long bad_spfn, bad_epfn;
     const char *p;
+#ifdef CONFIG_X86
+    const unsigned long *badpage = NULL;
+    unsigned int i, array_size;
+#endif
 
     ps = round_pgup(ps);
     pe = round_pgdown(pe);
@@ -161,6 +165,25 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 
     bootmem_region_add(ps >> PAGE_SHIFT, pe >> PAGE_SHIFT);
 
+#ifdef CONFIG_X86
+    /*
+     * Here we put platform-specific memory range workarounds, i.e.
+     * memory known to be corrupt or otherwise in need to be reserved on
+     * specific platforms.
+     * We get these certain pages and remove them from memory region list.
+     */
+    badpage = get_platform_badpages(&array_size);
+    if ( badpage )
+    {
+        for ( i = 0; i < array_size; i++ )
+        {
+            bootmem_region_zap(*badpage >> PAGE_SHIFT,
+                               (*badpage >> PAGE_SHIFT) + 1);
+            badpage++;
+        }
+    }
+#endif
+
     /* Check new pages against the bad-page list. */
     p = opt_badpage;
     while ( *p != '\0' )
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index ee87d10..8010f38 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -31,6 +31,7 @@
 #include <xen/keyhandler.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
+#include <asm/pci.h>
 #include <mach_apic.h>
 #include "iommu.h"
 #include "dmar.h"
@@ -47,7 +48,6 @@
 #define IS_CTG(id)    (id == 0x2a408086)
 #define IS_ILK(id)    (id == 0x00408086 || id == 0x00448086 || id== 0x00628086 || id == 0x006A8086)
 #define IS_CPT(id)    (id == 0x01008086 || id == 0x01048086)
-#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 || id == 0x01268086 || id == 0x01028086 || id == 0x01128086 || id == 0x01228086 || id == 0x010A8086)
 
 static u32 __read_mostly ioh_id;
 static u32 __initdata igd_id;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 2ed53d9..a7bb3bb 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -342,6 +342,7 @@ int is_iomem_page(unsigned long mfn);
 
 void clear_superpage_mark(struct page_info *page);
 
+const unsigned long *get_platform_badpages(unsigned int *array_size);
 /* Per page locks:
  * page_lock() is used for two purposes: pte serialization, and memory sharing.
  *
diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
index 7bcb702..e0598fd 100644
--- a/xen/include/asm-x86/pci.h
+++ b/xen/include/asm-x86/pci.h
@@ -1,6 +1,11 @@
 #ifndef __X86_PCI_H__
 #define __X86_PCI_H__
 
+#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
+                        || id == 0x01268086 || id == 0x01028086 \
+                        || id == 0x01128086 || id == 0x01228086 \
+                        || id == 0x010A8086 )
+
 struct arch_pci_dev {
     vmask_t used_vectors;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:13:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:13:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9S4-0000QD-A6; Tue, 02 Apr 2013 22:13:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9S3-0000Px-5J
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:11 +0000
Received: from [85.158.143.99:56661] by server-3.bemta-4.messagelabs.com id
	02/F7-02186-6F75B515; Tue, 02 Apr 2013 22:13:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1364940786!27541218!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32245 invoked from network); 2 Apr 2013 22:13:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:13:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ry-0002H6-P5
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9Ry-0004Hf-Mi
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:06 +0000
Date: Tue, 02 Apr 2013 22:13:06 +0000
Message-Id: <E1UN9Ry-0004Hf-Mi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: reserve pages when
	SandyBridge integrated graphics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7947b74a37020b15a69e2aa1e1e5ede9516c77cd
Author:     Xudong Hao <xudong.hao@intel.com>
AuthorDate: Tue Apr 2 11:21:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:21:55 2013 +0200

    x86: reserve pages when SandyBridge integrated graphics
    
    SNB graphics devices have a bug that prevent them from accessing certain
    memory ranges, namely anything below 1M and in the pages listed in the
    table.
    
    Xen does not initialize below 1MB to heap, i.e. below 1MB pages don't be
    allocated, so it's unnecessary to reserve memory below the 1 MB mark
    that has not already been reserved.
    
    So reserve those pages listed in the table at xen boot if set detect a
    SNB gfx device on the CPU to avoid GPU hangs.
    
    Signed-off-by: Xudong Hao <xudong.hao@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: db537fe3023bf157b85c8246782cb72a6f989b31
    master date: 2013-03-26 14:22:07 +0100
---
 xen/arch/x86/mm.c                    |   20 ++++++++++++++++++++
 xen/common/page_alloc.c              |   23 +++++++++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 xen/include/asm-x86/mm.h             |    1 +
 xen/include/asm-x86/pci.h            |    5 +++++
 5 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 1aeacbd..8444610 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -120,6 +120,7 @@
 #include <xen/trace.h>
 #include <asm/setup.h>
 #include <asm/fixmap.h>
+#include <asm/pci.h>
 
 /*
  * Mapping of first 2 or 4 megabytes of memory. This is mapped with 4kB
@@ -5849,6 +5850,25 @@ void arch_dump_shared_mem_info(void)
 }
 #endif
 
+const unsigned long *__init get_platform_badpages(unsigned int *array_size)
+{
+    u32 igd_id;
+    static unsigned long __initdata bad_pages[] = {
+        0x20050000,
+        0x20110000,
+        0x20130000,
+        0x20138000,
+        0x40004000,
+    };
+
+    *array_size = ARRAY_SIZE(bad_pages);
+    igd_id = pci_conf_read32(0, 0, 2, 0, 0);
+    if ( !IS_SNB_GFX(igd_id) )
+        return NULL;
+
+    return bad_pages;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 95bd794..fbdff5c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -151,6 +151,10 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 {
     unsigned long bad_spfn, bad_epfn;
     const char *p;
+#ifdef CONFIG_X86
+    const unsigned long *badpage = NULL;
+    unsigned int i, array_size;
+#endif
 
     ps = round_pgup(ps);
     pe = round_pgdown(pe);
@@ -161,6 +165,25 @@ void __init init_boot_pages(paddr_t ps, paddr_t pe)
 
     bootmem_region_add(ps >> PAGE_SHIFT, pe >> PAGE_SHIFT);
 
+#ifdef CONFIG_X86
+    /*
+     * Here we put platform-specific memory range workarounds, i.e.
+     * memory known to be corrupt or otherwise in need to be reserved on
+     * specific platforms.
+     * We get these certain pages and remove them from memory region list.
+     */
+    badpage = get_platform_badpages(&array_size);
+    if ( badpage )
+    {
+        for ( i = 0; i < array_size; i++ )
+        {
+            bootmem_region_zap(*badpage >> PAGE_SHIFT,
+                               (*badpage >> PAGE_SHIFT) + 1);
+            badpage++;
+        }
+    }
+#endif
+
     /* Check new pages against the bad-page list. */
     p = opt_badpage;
     while ( *p != '\0' )
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index ee87d10..8010f38 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -31,6 +31,7 @@
 #include <xen/keyhandler.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
+#include <asm/pci.h>
 #include <mach_apic.h>
 #include "iommu.h"
 #include "dmar.h"
@@ -47,7 +48,6 @@
 #define IS_CTG(id)    (id == 0x2a408086)
 #define IS_ILK(id)    (id == 0x00408086 || id == 0x00448086 || id== 0x00628086 || id == 0x006A8086)
 #define IS_CPT(id)    (id == 0x01008086 || id == 0x01048086)
-#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 || id == 0x01268086 || id == 0x01028086 || id == 0x01128086 || id == 0x01228086 || id == 0x010A8086)
 
 static u32 __read_mostly ioh_id;
 static u32 __initdata igd_id;
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 2ed53d9..a7bb3bb 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -342,6 +342,7 @@ int is_iomem_page(unsigned long mfn);
 
 void clear_superpage_mark(struct page_info *page);
 
+const unsigned long *get_platform_badpages(unsigned int *array_size);
 /* Per page locks:
  * page_lock() is used for two purposes: pte serialization, and memory sharing.
  *
diff --git a/xen/include/asm-x86/pci.h b/xen/include/asm-x86/pci.h
index 7bcb702..e0598fd 100644
--- a/xen/include/asm-x86/pci.h
+++ b/xen/include/asm-x86/pci.h
@@ -1,6 +1,11 @@
 #ifndef __X86_PCI_H__
 #define __X86_PCI_H__
 
+#define IS_SNB_GFX(id) (id == 0x01068086 || id == 0x01168086 \
+                        || id == 0x01268086 || id == 0x01028086 \
+                        || id == 0x01128086 || id == 0x01228086 \
+                        || id == 0x010A8086 )
+
 struct arch_pci_dev {
     vmask_t used_vectors;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:13:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9SC-0000Rv-D5; Tue, 02 Apr 2013 22:13:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9SB-0000Re-9p
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:19 +0000
Received: from [193.109.254.147:5616] by server-9.bemta-14.messagelabs.com id
	99/4A-04223-EF75B515; Tue, 02 Apr 2013 22:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1364940797!1694072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13572 invoked from network); 2 Apr 2013 22:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9S8-0002HI-Vk
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9S8-0004IZ-TZ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:16 +0000
Date: Tue, 02 Apr 2013 22:13:16 +0000
Message-Id: <E1UN9S8-0004IZ-TZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/EFI: permit setting variable
	with non-zero attributes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d870e41ed8cd624c5390530ca5bf32dc267cb7f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 11:23:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:23:05 2013 +0200

    x86/EFI: permit setting variable with non-zero attributes
    
    This must have been a copy-and-paste mistake - get_variable uses
    op->misc as output only, and wants to make sure it's zero for future
    extensibility. For set_variable, this is an input though, and hence
    the check is wrong.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: 78380c34dfeb27da3d0222bcb7232c5d8e2f5b30
    master date: 2013-03-27 08:46:28 +0100
---
 xen/arch/x86/efi/runtime.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index 1dbe2db..9fbf5b7 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -380,9 +380,6 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         long len;
         unsigned char *data;
 
-        if ( op->misc )
-            return -EINVAL;
-
         len = gwstrlen(guest_handle_cast(op->u.set_variable.name, CHAR16));
         if ( len < 0 )
             return len;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:13:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9SC-0000Rv-D5; Tue, 02 Apr 2013 22:13:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9SB-0000Re-9p
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:19 +0000
Received: from [193.109.254.147:5616] by server-9.bemta-14.messagelabs.com id
	99/4A-04223-EF75B515; Tue, 02 Apr 2013 22:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1364940797!1694072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13572 invoked from network); 2 Apr 2013 22:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9S8-0002HI-Vk
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9S8-0004IZ-TZ
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:16 +0000
Date: Tue, 02 Apr 2013 22:13:16 +0000
Message-Id: <E1UN9S8-0004IZ-TZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/EFI: permit setting variable
	with non-zero attributes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d870e41ed8cd624c5390530ca5bf32dc267cb7f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 11:23:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:23:05 2013 +0200

    x86/EFI: permit setting variable with non-zero attributes
    
    This must have been a copy-and-paste mistake - get_variable uses
    op->misc as output only, and wants to make sure it's zero for future
    extensibility. For set_variable, this is an input though, and hence
    the check is wrong.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master changeset: 78380c34dfeb27da3d0222bcb7232c5d8e2f5b30
    master date: 2013-03-27 08:46:28 +0100
---
 xen/arch/x86/efi/runtime.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index 1dbe2db..9fbf5b7 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -380,9 +380,6 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         long len;
         unsigned char *data;
 
-        if ( op->misc )
-            return -EINVAL;
-
         len = gwstrlen(guest_handle_cast(op->u.set_variable.name, CHAR16));
         if ( len < 0 )
             return len;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:14:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:14:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9TM-0000Wu-Iu; Tue, 02 Apr 2013 22:14:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9TL-0000Wh-2t
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:14:31 +0000
Received: from [85.158.137.99:14220] by server-16.bemta-3.messagelabs.com id
	EC/39-20692-6485B515; Tue, 02 Apr 2013 22:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1364940868!12168166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3581 invoked from network); 2 Apr 2013 22:14:29 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9SJ-0002HO-59
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9SJ-0004Iv-3U
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:27 +0000
Date: Tue, 02 Apr 2013 22:13:27 +0000
Message-Id: <E1UN9SJ-0004Iv-3U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] hvm: Clean up vlapic_reg_write()
	error propagation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70b67e907427c3c891d8b6b1ba656b2136e34418
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Tue Apr 2 11:26:10 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:26:10 2013 +0200

    hvm: Clean up vlapic_reg_write() error propagation.
    
    In particular, correctly propagate errors through vlapic_apicv_write()
    and hvm_x2apic_msr_write().
    
    Signed-off-by: Keir Fraser <keir@xen.org>
    master changeset: 5082cc19524b6687ef1bc0a717538d75aae7cd00
    master date: 2013-03-28 20:16:37 +0000
---
 xen/arch/x86/hvm/vlapic.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index abdb556..52d111b 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -669,10 +669,9 @@ static int vlapic_reg_write(struct vcpu *v,
         break;
 
     case APIC_SELF_IPI:
-        if ( vlapic_x2apic_mode(vlapic) )
-            vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff));
-        else
-            rc = X86EMUL_UNHANDLEABLE;
+        rc = vlapic_x2apic_mode(vlapic)
+            ? vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff))
+            : X86EMUL_UNHANDLEABLE;
         break;
 
     case APIC_ICR:
@@ -827,19 +826,18 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
     uint32_t offset = (msr - MSR_IA32_APICBASE_MSR) << 4;
-    int rc;
 
     if ( !vlapic_x2apic_mode(vlapic) )
-        return 1;
+        return X86EMUL_UNHANDLEABLE;
 
     if ( offset == APIC_ICR )
-        if ( vlapic_reg_write(v, APIC_ICR2 , (uint32_t)(msr_content >> 32)) )
-            return 1;
-
-    rc = vlapic_reg_write(v, offset, (uint32_t)msr_content);
+    {
+        int rc = vlapic_reg_write(v, APIC_ICR2, (uint32_t)(msr_content >> 32));
+        if ( rc )
+            return rc;
+    }
 
-    /* X86EMUL_RETRY for SIPI */
-    return ((rc != X86EMUL_OKAY) && (rc != X86EMUL_RETRY));
+    return vlapic_reg_write(v, offset, (uint32_t)msr_content);
 }
 
 static int vlapic_range(struct vcpu *v, unsigned long addr)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 02 22:14:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 02 Apr 2013 22:14:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UN9TM-0000Wu-Iu; Tue, 02 Apr 2013 22:14:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9TL-0000Wh-2t
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:14:31 +0000
Received: from [85.158.137.99:14220] by server-16.bemta-3.messagelabs.com id
	EC/39-20692-6485B515; Tue, 02 Apr 2013 22:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1364940868!12168166!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3581 invoked from network); 2 Apr 2013 22:14:29 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	2 Apr 2013 22:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9SJ-0002HO-59
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UN9SJ-0004Iv-3U
	for xen-changelog@lists.xensource.com; Tue, 02 Apr 2013 22:13:27 +0000
Date: Tue, 02 Apr 2013 22:13:27 +0000
Message-Id: <E1UN9SJ-0004Iv-3U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] hvm: Clean up vlapic_reg_write()
	error propagation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 70b67e907427c3c891d8b6b1ba656b2136e34418
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Tue Apr 2 11:26:10 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 11:26:10 2013 +0200

    hvm: Clean up vlapic_reg_write() error propagation.
    
    In particular, correctly propagate errors through vlapic_apicv_write()
    and hvm_x2apic_msr_write().
    
    Signed-off-by: Keir Fraser <keir@xen.org>
    master changeset: 5082cc19524b6687ef1bc0a717538d75aae7cd00
    master date: 2013-03-28 20:16:37 +0000
---
 xen/arch/x86/hvm/vlapic.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index abdb556..52d111b 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -669,10 +669,9 @@ static int vlapic_reg_write(struct vcpu *v,
         break;
 
     case APIC_SELF_IPI:
-        if ( vlapic_x2apic_mode(vlapic) )
-            vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff));
-        else
-            rc = X86EMUL_UNHANDLEABLE;
+        rc = vlapic_x2apic_mode(vlapic)
+            ? vlapic_reg_write(v, APIC_ICR, 0x40000 | (val & 0xff))
+            : X86EMUL_UNHANDLEABLE;
         break;
 
     case APIC_ICR:
@@ -827,19 +826,18 @@ int hvm_x2apic_msr_write(struct vcpu *v, unsigned int msr, uint64_t msr_content)
 {
     struct vlapic *vlapic = vcpu_vlapic(v);
     uint32_t offset = (msr - MSR_IA32_APICBASE_MSR) << 4;
-    int rc;
 
     if ( !vlapic_x2apic_mode(vlapic) )
-        return 1;
+        return X86EMUL_UNHANDLEABLE;
 
     if ( offset == APIC_ICR )
-        if ( vlapic_reg_write(v, APIC_ICR2 , (uint32_t)(msr_content >> 32)) )
-            return 1;
-
-    rc = vlapic_reg_write(v, offset, (uint32_t)msr_content);
+    {
+        int rc = vlapic_reg_write(v, APIC_ICR2, (uint32_t)(msr_content >> 32));
+        if ( rc )
+            return rc;
+    }
 
-    /* X86EMUL_RETRY for SIPI */
-    return ((rc != X86EMUL_OKAY) && (rc != X86EMUL_RETRY));
+    return vlapic_reg_write(v, offset, (uint32_t)msr_content);
 }
 
 static int vlapic_range(struct vcpu *v, unsigned long addr)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 03 08:12:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Apr 2013 08:12:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNIo9-0004m7-LP; Wed, 03 Apr 2013 08:12:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNIo8-0004m2-LY
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:12:36 +0000
Received: from [85.158.139.83:10662] by server-10.bemta-5.messagelabs.com id
	A1/C7-23714-374EB515; Wed, 03 Apr 2013 08:12:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1364976675!25113916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24626 invoked from network); 3 Apr 2013 08:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Apr 2013 08:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImp-0007tg-B2
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImp-0001vP-29
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:15 +0000
Date: Wed, 03 Apr 2013 08:11:15 +0000
Message-Id: <E1UNImp-0001vP-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/S3: Restore broken vcpu affinity
	on resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41e71c2607e036f1ac00df898b8f4acb2d4df7ee
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Tue Apr 2 09:52:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 09:52:32 2013 +0200

    x86/S3: Restore broken vcpu affinity on resume
    
    When in SYS_STATE_suspend, and going through the cpu_disable_scheduler
    path, save a copy of the current cpu affinity, and mark a flag to
    restore it later.
    
    Later, in the resume process, when enabling nonboot cpus restore these
    affinities.
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/acpi/power.c |    3 +++
 xen/common/domain.c       |    2 ++
 xen/common/schedule.c     |   45 ++++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/sched.h   |    6 ++++++
 4 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 3c2585c..f41f0de 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -96,7 +96,10 @@ static void thaw_domains(void)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
+    {
+        restore_vcpu_affinity(d);
         domain_unpause(d);
+    }
     rcu_read_unlock(&domlist_read_lock);
 }
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 64ee29d..590548e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -126,6 +126,7 @@ struct vcpu *alloc_vcpu(
 
     if ( !zalloc_cpumask_var(&v->cpu_affinity) ||
          !zalloc_cpumask_var(&v->cpu_affinity_tmp) ||
+         !zalloc_cpumask_var(&v->cpu_affinity_saved) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -155,6 +156,7 @@ struct vcpu *alloc_vcpu(
  fail_free:
         free_cpumask_var(v->cpu_affinity);
         free_cpumask_var(v->cpu_affinity_tmp);
+        free_cpumask_var(v->cpu_affinity_saved);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 83fae4c..7364ff8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -541,6 +541,38 @@ void vcpu_force_reschedule(struct vcpu *v)
     }
 }
 
+void restore_vcpu_affinity(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        vcpu_schedule_lock_irq(v);
+
+        if ( v->affinity_broken )
+        {
+            printk(XENLOG_DEBUG "Restoring affinity for d%dv%d\n",
+                   d->domain_id, v->vcpu_id);
+            cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            v->affinity_broken = 0;
+        }
+
+        if ( v->processor == smp_processor_id() )
+        {
+            set_bit(_VPF_migrating, &v->pause_flags);
+            vcpu_schedule_unlock_irq(v);
+            vcpu_sleep_nosync(v);
+            vcpu_migrate(v);
+        }
+        else
+        {
+            vcpu_schedule_unlock_irq(v);
+        }
+    }
+
+    domain_update_node_affinity(d);
+}
+
 /*
  * This function is used by cpu_hotplug code from stop_machine context
  * and from cpupools to switch schedulers on a cpu.
@@ -554,7 +586,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     int    ret = 0;
 
     c = per_cpu(cpupool, cpu);
-    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
+    if ( c == NULL )
         return ret;
 
     for_each_domain_in_cpupool ( d, c )
@@ -567,8 +599,15 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( cpumask_empty(&online_affinity) &&
                  cpumask_test_cpu(cpu, v->cpu_affinity) )
             {
-                printk("Breaking vcpu affinity for domain %d vcpu %d\n",
-                        v->domain->domain_id, v->vcpu_id);
+                printk(XENLOG_DEBUG "Breaking affinity for d%dv%d\n",
+                        d->domain_id, v->vcpu_id);
+
+                if (system_state == SYS_STATE_suspend)
+                {
+                    cpumask_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    v->affinity_broken = 1;
+                }
+
                 cpumask_setall(v->cpu_affinity);
             }
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index cabaf27..d15d567 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -153,6 +153,9 @@ struct vcpu
     bool_t           defer_shutdown;
     /* VCPU is paused following shutdown request (d->is_shutting_down)? */
     bool_t           paused_for_shutdown;
+    /* VCPU need affinity restored */
+    bool_t           affinity_broken;
+
 
     /*
      * > 0: a single port is being polled;
@@ -175,6 +178,8 @@ struct vcpu
     cpumask_var_t    cpu_affinity;
     /* Used to change affinity temporarily. */
     cpumask_var_t    cpu_affinity_tmp;
+    /* Used to restore affinity across S3. */
+    cpumask_var_t    cpu_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
@@ -697,6 +702,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
+void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 03 08:12:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Apr 2013 08:12:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNIo9-0004m7-LP; Wed, 03 Apr 2013 08:12:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNIo8-0004m2-LY
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:12:36 +0000
Received: from [85.158.139.83:10662] by server-10.bemta-5.messagelabs.com id
	A1/C7-23714-374EB515; Wed, 03 Apr 2013 08:12:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1364976675!25113916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24626 invoked from network); 3 Apr 2013 08:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Apr 2013 08:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImp-0007tg-B2
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImp-0001vP-29
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:15 +0000
Date: Wed, 03 Apr 2013 08:11:15 +0000
Message-Id: <E1UNImp-0001vP-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/S3: Restore broken vcpu affinity
	on resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41e71c2607e036f1ac00df898b8f4acb2d4df7ee
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Tue Apr 2 09:52:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 09:52:32 2013 +0200

    x86/S3: Restore broken vcpu affinity on resume
    
    When in SYS_STATE_suspend, and going through the cpu_disable_scheduler
    path, save a copy of the current cpu affinity, and mark a flag to
    restore it later.
    
    Later, in the resume process, when enabling nonboot cpus restore these
    affinities.
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/acpi/power.c |    3 +++
 xen/common/domain.c       |    2 ++
 xen/common/schedule.c     |   45 ++++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/sched.h   |    6 ++++++
 4 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 3c2585c..f41f0de 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -96,7 +96,10 @@ static void thaw_domains(void)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
+    {
+        restore_vcpu_affinity(d);
         domain_unpause(d);
+    }
     rcu_read_unlock(&domlist_read_lock);
 }
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 64ee29d..590548e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -126,6 +126,7 @@ struct vcpu *alloc_vcpu(
 
     if ( !zalloc_cpumask_var(&v->cpu_affinity) ||
          !zalloc_cpumask_var(&v->cpu_affinity_tmp) ||
+         !zalloc_cpumask_var(&v->cpu_affinity_saved) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -155,6 +156,7 @@ struct vcpu *alloc_vcpu(
  fail_free:
         free_cpumask_var(v->cpu_affinity);
         free_cpumask_var(v->cpu_affinity_tmp);
+        free_cpumask_var(v->cpu_affinity_saved);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 83fae4c..7364ff8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -541,6 +541,38 @@ void vcpu_force_reschedule(struct vcpu *v)
     }
 }
 
+void restore_vcpu_affinity(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        vcpu_schedule_lock_irq(v);
+
+        if ( v->affinity_broken )
+        {
+            printk(XENLOG_DEBUG "Restoring affinity for d%dv%d\n",
+                   d->domain_id, v->vcpu_id);
+            cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            v->affinity_broken = 0;
+        }
+
+        if ( v->processor == smp_processor_id() )
+        {
+            set_bit(_VPF_migrating, &v->pause_flags);
+            vcpu_schedule_unlock_irq(v);
+            vcpu_sleep_nosync(v);
+            vcpu_migrate(v);
+        }
+        else
+        {
+            vcpu_schedule_unlock_irq(v);
+        }
+    }
+
+    domain_update_node_affinity(d);
+}
+
 /*
  * This function is used by cpu_hotplug code from stop_machine context
  * and from cpupools to switch schedulers on a cpu.
@@ -554,7 +586,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     int    ret = 0;
 
     c = per_cpu(cpupool, cpu);
-    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
+    if ( c == NULL )
         return ret;
 
     for_each_domain_in_cpupool ( d, c )
@@ -567,8 +599,15 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( cpumask_empty(&online_affinity) &&
                  cpumask_test_cpu(cpu, v->cpu_affinity) )
             {
-                printk("Breaking vcpu affinity for domain %d vcpu %d\n",
-                        v->domain->domain_id, v->vcpu_id);
+                printk(XENLOG_DEBUG "Breaking affinity for d%dv%d\n",
+                        d->domain_id, v->vcpu_id);
+
+                if (system_state == SYS_STATE_suspend)
+                {
+                    cpumask_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    v->affinity_broken = 1;
+                }
+
                 cpumask_setall(v->cpu_affinity);
             }
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index cabaf27..d15d567 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -153,6 +153,9 @@ struct vcpu
     bool_t           defer_shutdown;
     /* VCPU is paused following shutdown request (d->is_shutting_down)? */
     bool_t           paused_for_shutdown;
+    /* VCPU need affinity restored */
+    bool_t           affinity_broken;
+
 
     /*
      * > 0: a single port is being polled;
@@ -175,6 +178,8 @@ struct vcpu
     cpumask_var_t    cpu_affinity;
     /* Used to change affinity temporarily. */
     cpumask_var_t    cpu_affinity_tmp;
+    /* Used to restore affinity across S3. */
+    cpumask_var_t    cpu_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
@@ -697,6 +702,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
+void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 03 08:13:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Apr 2013 08:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNIoe-0004na-P4; Wed, 03 Apr 2013 08:13:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNIoc-0004nS-U1
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:13:07 +0000
Received: from [85.158.139.211:9154] by server-14.bemta-5.messagelabs.com id
	62/39-13158-294EB515; Wed, 03 Apr 2013 08:13:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1364976783!18840112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26065 invoked from network); 3 Apr 2013 08:13:04 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Apr 2013 08:13:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImd-0007td-0e
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImc-0001ux-Ma
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:02 +0000
Date: Wed, 03 Apr 2013 08:11:02 +0000
Message-Id: <E1UNImc-0001ux-Ma@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: irq_move_cleanup_interrupt() must
	ignore legacy vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af699220ad6d111ba76fc3040342184e423cc9a1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 08:30:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 08:30:03 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/i8259.c |    2 ++
 xen/arch/x86/irq.c   |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index f637ecc..b537c5f 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -416,6 +416,8 @@ void __init init_IRQ(void)
     for (irq = 0; platform_legacy_irq(irq); irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 5e0f463..fff9f1d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -616,7 +616,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
     ack_APIC_irq();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -625,6 +627,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
         if ((int)irq < 0)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 03 08:13:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 03 Apr 2013 08:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNIoe-0004na-P4; Wed, 03 Apr 2013 08:13:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNIoc-0004nS-U1
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:13:07 +0000
Received: from [85.158.139.211:9154] by server-14.bemta-5.messagelabs.com id
	62/39-13158-294EB515; Wed, 03 Apr 2013 08:13:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1364976783!18840112!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26065 invoked from network); 3 Apr 2013 08:13:04 -0000
Received: from unknown (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Apr 2013 08:13:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImd-0007td-0e
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNImc-0001ux-Ma
	for xen-changelog@lists.xensource.com; Wed, 03 Apr 2013 08:11:02 +0000
Date: Wed, 03 Apr 2013 08:11:02 +0000
Message-Id: <E1UNImc-0001ux-Ma@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: irq_move_cleanup_interrupt() must
	ignore legacy vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af699220ad6d111ba76fc3040342184e423cc9a1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 2 08:30:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 2 08:30:03 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/i8259.c |    2 ++
 xen/arch/x86/irq.c   |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index f637ecc..b537c5f 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -416,6 +416,8 @@ void __init init_IRQ(void)
     for (irq = 0; platform_legacy_irq(irq); irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 5e0f463..fff9f1d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -616,7 +616,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
     ack_APIC_irq();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -625,6 +627,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
         if ((int)irq < 0)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 02:22:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 02:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNwI3-0004VW-O4; Fri, 05 Apr 2013 02:22:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwI2-0004VR-7j
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:06 +0000
Received: from [85.158.143.99:62256] by server-2.bemta-4.messagelabs.com id
	A6/4F-12656-D453E515; Fri, 05 Apr 2013 02:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1365128523!27976930!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14171 invoked from network); 5 Apr 2013 02:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 02:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwHz-00018K-Cp
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwHy-0003bs-Q1
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:02 +0000
Date: Fri, 05 Apr 2013 02:22:02 +0000
Message-Id: <E1UNwHy-0003bs-Q1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Always disable SMEP when guest is
	in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d2e673a763bc7c2ddf97fed074eb691d325ecc5
Author:     Stefan Bader <stefan.bader@canonical.com>
AuthorDate: Thu Apr 4 10:37:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 4 10:37:19 2013 +0200

    VMX: Always disable SMEP when guest is in non-paging mode
    
    commit e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
      VMX: disable SMEP feature when guest is in non-paging mode
    
    disabled the SMEP bit if a guest VCPU was using HAP and was not
    in paging mode. However I could observe VCPUs getting stuck in
    the trampoline after the following patch in the Linux kernel
    changed the way CR4 gets set up:
      x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
    
    The change will set CR4 from already set flags which includes the
    SMEP bit. On bare metal this does not matter as the CPU is in non-
    paging mode at that time. But Xen seems to use the emulated non-
    paging mode regardless of HAP (I verified that on the guests I was
    seeing the issue, HAP was not used).
    
    Therefor it seems right to unset the SMEP bit for a VCPU that is
    not in paging-mode, regardless of its HAP usage.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 04dbefb..a869ed4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1162,11 +1162,14 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+        }
+        if ( !hvm_paging_enabled(v) )
+        {
             /*
              * SMEP is disabled if CPU is in non-paging mode in hardware.
              * However Xen always uses paging mode to emulate guest non-paging
-             * mode with HAP. To emulate this behavior, SMEP needs to be 
-             * manually disabled when guest switches to non-paging mode.
+             * mode. To emulate this behavior, SMEP needs to be manually
+             * disabled when guest VCPU is in non-paging mode.
              */
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 02:22:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 02:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNwI3-0004VW-O4; Fri, 05 Apr 2013 02:22:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwI2-0004VR-7j
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:06 +0000
Received: from [85.158.143.99:62256] by server-2.bemta-4.messagelabs.com id
	A6/4F-12656-D453E515; Fri, 05 Apr 2013 02:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1365128523!27976930!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14171 invoked from network); 5 Apr 2013 02:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 02:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwHz-00018K-Cp
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwHy-0003bs-Q1
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:02 +0000
Date: Fri, 05 Apr 2013 02:22:02 +0000
Message-Id: <E1UNwHy-0003bs-Q1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Always disable SMEP when guest is
	in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d2e673a763bc7c2ddf97fed074eb691d325ecc5
Author:     Stefan Bader <stefan.bader@canonical.com>
AuthorDate: Thu Apr 4 10:37:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 4 10:37:19 2013 +0200

    VMX: Always disable SMEP when guest is in non-paging mode
    
    commit e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
      VMX: disable SMEP feature when guest is in non-paging mode
    
    disabled the SMEP bit if a guest VCPU was using HAP and was not
    in paging mode. However I could observe VCPUs getting stuck in
    the trampoline after the following patch in the Linux kernel
    changed the way CR4 gets set up:
      x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
    
    The change will set CR4 from already set flags which includes the
    SMEP bit. On bare metal this does not matter as the CPU is in non-
    paging mode at that time. But Xen seems to use the emulated non-
    paging mode regardless of HAP (I verified that on the guests I was
    seeing the issue, HAP was not used).
    
    Therefor it seems right to unset the SMEP bit for a VCPU that is
    not in paging-mode, regardless of its HAP usage.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 04dbefb..a869ed4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1162,11 +1162,14 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+        }
+        if ( !hvm_paging_enabled(v) )
+        {
             /*
              * SMEP is disabled if CPU is in non-paging mode in hardware.
              * However Xen always uses paging mode to emulate guest non-paging
-             * mode with HAP. To emulate this behavior, SMEP needs to be 
-             * manually disabled when guest switches to non-paging mode.
+             * mode. To emulate this behavior, SMEP needs to be manually
+             * disabled when guest VCPU is in non-paging mode.
              */
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 02:22:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 02:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNwIC-0004WD-RD; Fri, 05 Apr 2013 02:22:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwIC-0004W6-8q
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:16 +0000
Received: from [85.158.143.99:62453] by server-3.bemta-4.messagelabs.com id
	FF/42-02186-7553E515; Fri, 05 Apr 2013 02:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1365128533!27976944!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14581 invoked from network); 5 Apr 2013 02:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 02:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwI9-00018Q-NG
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwI9-0003cz-Hb
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:13 +0000
Date: Fri, 05 Apr 2013 02:22:13 +0000
Message-Id: <E1UNwI9-0003cz-Hb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm/shadow: spurious warning when
	unmapping xenheap pages.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu Mar 28 10:32:17 2013 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Apr 4 10:14:30 2013 +0100

    x86/mm/shadow: spurious warning when unmapping xenheap pages.
    
    Xenheap pages will always have an extra typecount, taken in
    share_xen_page_with_guest(), which doesn't come from a shadow PTE.
    Adjust the warning in sh_remove_all_mappings() to account for it.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 4b576ac..adffa06 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2437,10 +2437,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 02:22:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 02:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UNwIC-0004WD-RD; Fri, 05 Apr 2013 02:22:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwIC-0004W6-8q
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:16 +0000
Received: from [85.158.143.99:62453] by server-3.bemta-4.messagelabs.com id
	FF/42-02186-7553E515; Fri, 05 Apr 2013 02:22:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1365128533!27976944!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14581 invoked from network); 5 Apr 2013 02:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 02:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwI9-00018Q-NG
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UNwI9-0003cz-Hb
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 02:22:13 +0000
Date: Fri, 05 Apr 2013 02:22:13 +0000
Message-Id: <E1UNwI9-0003cz-Hb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mm/shadow: spurious warning when
	unmapping xenheap pages.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu Mar 28 10:32:17 2013 +0000
Commit:     Tim Deegan <tim@xen.org>
CommitDate: Thu Apr 4 10:14:30 2013 +0100

    x86/mm/shadow: spurious warning when unmapping xenheap pages.
    
    Xenheap pages will always have an extra typecount, taken in
    share_xen_page_with_guest(), which doesn't come from a shadow PTE.
    Adjust the warning in sh_remove_all_mappings() to account for it.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 4b576ac..adffa06 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2437,10 +2437,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 17:55:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 17:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOAqy-00067a-W9; Fri, 05 Apr 2013 17:55:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOAqx-00067A-7Q
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 17:55:07 +0000
Received: from [85.158.139.83:17723] by server-2.bemta-5.messagelabs.com id
	EF/A2-23989-AFF0F515; Fri, 05 Apr 2013 17:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1365184504!20666350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3716 invoked from network); 5 Apr 2013 17:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 17:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOAqt-0003eT-QG
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 17:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOAqt-0000Rr-3X
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 17:55:03 +0000
Date: Fri, 05 Apr 2013 17:55:03 +0000
Message-Id: <E1UOAqt-0000Rr-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] defer event channel bucket pointer
	store until after XSM checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bebeac00164b8fd6fdc98db74df943d927aab06
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 5 10:02:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 5 10:02:05 2013 +0200

    defer event channel bucket pointer store until after XSM checks
    
    Otherwise a dangling pointer can be left, which would cause subsequent
    memory corruption as soon as the space got re-allocated for some other
    purpose.
    
    This is CVE-2013-1920 / XSA-47.
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
    master date: 2013-04-05 09:59:03 +0200
---
 xen/common/event_channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 53777f8..46219bd 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -140,7 +140,6 @@ static int get_free_port(struct domain *d)
     chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
     if ( unlikely(chn == NULL) )
         return -ENOMEM;
-    bucket_from_port(d, port) = chn;
 
     for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
     {
@@ -153,6 +152,8 @@ static int get_free_port(struct domain *d)
         }
     }
 
+    bucket_from_port(d, port) = chn;
+
     return port;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 17:55:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 17:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOAqy-00067a-W9; Fri, 05 Apr 2013 17:55:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOAqx-00067A-7Q
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 17:55:07 +0000
Received: from [85.158.139.83:17723] by server-2.bemta-5.messagelabs.com id
	EF/A2-23989-AFF0F515; Fri, 05 Apr 2013 17:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1365184504!20666350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3716 invoked from network); 5 Apr 2013 17:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 17:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOAqt-0003eT-QG
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 17:55:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOAqt-0000Rr-3X
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 17:55:03 +0000
Date: Fri, 05 Apr 2013 17:55:03 +0000
Message-Id: <E1UOAqt-0000Rr-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] defer event channel bucket pointer
	store until after XSM checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bebeac00164b8fd6fdc98db74df943d927aab06
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 5 10:02:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 5 10:02:05 2013 +0200

    defer event channel bucket pointer store until after XSM checks
    
    Otherwise a dangling pointer can be left, which would cause subsequent
    memory corruption as soon as the space got re-allocated for some other
    purpose.
    
    This is CVE-2013-1920 / XSA-47.
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
    master date: 2013-04-05 09:59:03 +0200
---
 xen/common/event_channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 53777f8..46219bd 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -140,7 +140,6 @@ static int get_free_port(struct domain *d)
     chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
     if ( unlikely(chn == NULL) )
         return -ENOMEM;
-    bucket_from_port(d, port) = chn;
 
     for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
     {
@@ -153,6 +152,8 @@ static int get_free_port(struct domain *d)
         }
     }
 
+    bucket_from_port(d, port) = chn;
+
     return port;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 21:55:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 21:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOEbD-0004Et-Ql; Fri, 05 Apr 2013 21:55:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOEbC-0004El-Tz
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 21:55:07 +0000
Received: from [85.158.143.99:50113] by server-3.bemta-4.messagelabs.com id
	E5/AA-02186-A384F515; Fri, 05 Apr 2013 21:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1365198904!27099141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10651 invoked from network); 5 Apr 2013 21:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 21:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOEbA-0006QI-3h
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 21:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOEb9-0006Cu-Jb
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 21:55:03 +0000
Date: Fri, 05 Apr 2013 21:55:03 +0000
Message-Id: <E1UOEb9-0006Cu-Jb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] defer event channel bucket pointer
	store until after XSM checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b10b4af626d95cd432576cad0e2f500769c1e002
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 5 10:04:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 5 10:04:03 2013 +0200

    defer event channel bucket pointer store until after XSM checks
    
    Otherwise a dangling pointer can be left, which would cause subsequent
    memory corruption as soon as the space got re-allocated for some other
    purpose.
    
    This is CVE-2013-1920 / XSA-47.
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
    master date: 2013-04-05 09:59:03 +0200
---
 xen/common/event_channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index fee9a7a..5c7bdb6 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -104,7 +104,6 @@ static int get_free_port(struct domain *d)
     if ( unlikely(chn == NULL) )
         return -ENOMEM;
     memset(chn, 0, EVTCHNS_PER_BUCKET * sizeof(*chn));
-    bucket_from_port(d, port) = chn;
 
     for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
     {
@@ -117,6 +116,8 @@ static int get_free_port(struct domain *d)
         }
     }
 
+    bucket_from_port(d, port) = chn;
+
     return port;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 05 21:55:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 05 Apr 2013 21:55:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOEbD-0004Et-Ql; Fri, 05 Apr 2013 21:55:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOEbC-0004El-Tz
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 21:55:07 +0000
Received: from [85.158.143.99:50113] by server-3.bemta-4.messagelabs.com id
	E5/AA-02186-A384F515; Fri, 05 Apr 2013 21:55:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-216.messagelabs.com!1365198904!27099141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10651 invoked from network); 5 Apr 2013 21:55:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Apr 2013 21:55:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOEbA-0006QI-3h
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 21:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOEb9-0006Cu-Jb
	for xen-changelog@lists.xensource.com; Fri, 05 Apr 2013 21:55:03 +0000
Date: Fri, 05 Apr 2013 21:55:03 +0000
Message-Id: <E1UOEb9-0006Cu-Jb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] defer event channel bucket pointer
	store until after XSM checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b10b4af626d95cd432576cad0e2f500769c1e002
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 5 10:04:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 5 10:04:03 2013 +0200

    defer event channel bucket pointer store until after XSM checks
    
    Otherwise a dangling pointer can be left, which would cause subsequent
    memory corruption as soon as the space got re-allocated for some other
    purpose.
    
    This is CVE-2013-1920 / XSA-47.
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
    master date: 2013-04-05 09:59:03 +0200
---
 xen/common/event_channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index fee9a7a..5c7bdb6 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -104,7 +104,6 @@ static int get_free_port(struct domain *d)
     if ( unlikely(chn == NULL) )
         return -ENOMEM;
     memset(chn, 0, EVTCHNS_PER_BUCKET * sizeof(*chn));
-    bucket_from_port(d, port) = chn;
 
     for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
     {
@@ -117,6 +116,8 @@ static int get_free_port(struct domain *d)
         }
     }
 
+    bucket_from_port(d, port) = chn;
+
     return port;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 12:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 12:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOSIu-0003j3-4P; Sat, 06 Apr 2013 12:33:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOSIs-0003iv-OC
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 12:33:06 +0000
Received: from [85.158.143.99:7204] by server-3.bemta-4.messagelabs.com id
	34/10-02186-10610615; Sat, 06 Apr 2013 12:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1365251584!18150666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11537 invoked from network); 6 Apr 2013 12:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 12:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOSIp-0006QI-PD
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 12:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOSIp-0002IN-4Z
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 12:33:03 +0000
Date: Sat, 06 Apr 2013 12:33:03 +0000
Message-Id: <E1UOSIp-0002IN-4Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] defer event channel bucket pointer
	store until after XSM checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 5 09:59:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 5 09:59:03 2013 +0200

    defer event channel bucket pointer store until after XSM checks
    
    Otherwise a dangling pointer can be left, which would cause subsequent
    memory corruption as soon as the space got re-allocated for some other
    purpose.
    
    This is CVE-2013-1920 / XSA-47.
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/common/event_channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a0f293f..0a6684c 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -140,7 +140,6 @@ static int get_free_port(struct domain *d)
     chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
     if ( unlikely(chn == NULL) )
         return -ENOMEM;
-    bucket_from_port(d, port) = chn;
 
     for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
     {
@@ -153,6 +152,8 @@ static int get_free_port(struct domain *d)
         }
     }
 
+    bucket_from_port(d, port) = chn;
+
     return port;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 12:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 12:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOSIu-0003j3-4P; Sat, 06 Apr 2013 12:33:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOSIs-0003iv-OC
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 12:33:06 +0000
Received: from [85.158.143.99:7204] by server-3.bemta-4.messagelabs.com id
	34/10-02186-10610615; Sat, 06 Apr 2013 12:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1365251584!18150666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11537 invoked from network); 6 Apr 2013 12:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 12:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOSIp-0006QI-PD
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 12:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOSIp-0002IN-4Z
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 12:33:03 +0000
Date: Sat, 06 Apr 2013 12:33:03 +0000
Message-Id: <E1UOSIp-0002IN-4Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] defer event channel bucket pointer
	store until after XSM checks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 5 09:59:03 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 5 09:59:03 2013 +0200

    defer event channel bucket pointer store until after XSM checks
    
    Otherwise a dangling pointer can be left, which would cause subsequent
    memory corruption as soon as the space got re-allocated for some other
    purpose.
    
    This is CVE-2013-1920 / XSA-47.
    
    Reported-by: Wei Liu <wei.liu2@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/common/event_channel.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index a0f293f..0a6684c 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -140,7 +140,6 @@ static int get_free_port(struct domain *d)
     chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET);
     if ( unlikely(chn == NULL) )
         return -ENOMEM;
-    bucket_from_port(d, port) = chn;
 
     for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ )
     {
@@ -153,6 +152,8 @@ static int get_free_port(struct domain *d)
         }
     }
 
+    bucket_from_port(d, port) = chn;
+
     return port;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZct-0001qp-NB; Sat, 06 Apr 2013 20:22:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcr-0001qj-R5
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:14 +0000
Received: from [193.109.254.147:53592] by server-3.bemta-14.messagelabs.com id
	BE/D5-17488-5F380615; Sat, 06 Apr 2013 20:22:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1365279726!8741750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31954 invoked from network); 6 Apr 2013 20:22:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZch-0003F0-Bx
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcg-0004j3-Va
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:03 +0000
Date: Sat, 06 Apr 2013 20:22:02 +0000
Message-Id: <E1UOZcg-0004j3-Va@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] xen-mapcache: replace
	last_address_index with a last_entry pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7cde9aa1a4d36eca1f2517ed38740e84b84a8667
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Apr 2 13:23:40 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 15:23:38 2013 +0000

    xen-mapcache: replace last_address_index with a last_entry pointer
    
    Replace last_address_index and last_address_vaddr with a single pointer
    to the last MapCacheEntry used.
    
    upstream-commit-id: e2deee3ea6136b6189e8cfd26379420b9a398d96
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-mapcache.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/xen-mapcache.c b/xen-mapcache.c
index 31c06dc..52a4ca5 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -74,8 +74,7 @@ typedef struct MapCache {
     QTAILQ_HEAD(map_cache_head, MapCacheRev) locked_entries;
 
     /* For most cases (>99.9%), the page address is the same. */
-    hwaddr last_address_index;
-    uint8_t *last_address_vaddr;
+    MapCacheEntry *last_entry;
     unsigned long max_mcache_size;
     unsigned int mcache_bucket_shift;
 
@@ -105,7 +104,6 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque)
     mapcache->opaque = opaque;
 
     QTAILQ_INIT(&mapcache->locked_entries);
-    mapcache->last_address_index = -1;
 
     if (geteuid() == 0) {
         rlimit_as.rlim_cur = RLIM_INFINITY;
@@ -210,9 +208,11 @@ tryagain:
 
     trace_xen_map_cache(phys_addr);
 
-    if (address_index == mapcache->last_address_index && !lock && !__size) {
-        trace_xen_map_cache_return(mapcache->last_address_vaddr + address_offset);
-        return mapcache->last_address_vaddr + address_offset;
+    if (mapcache->last_entry != NULL &&
+        mapcache->last_entry->paddr_index == address_index &&
+        !lock && !__size) {
+        trace_xen_map_cache_return(mapcache->last_entry->vaddr_base + address_offset);
+        return mapcache->last_entry->vaddr_base + address_offset;
     }
 
     /* size is always a multiple of MCACHE_BUCKET_SIZE */
@@ -249,7 +249,7 @@ tryagain:
 
     if(!test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
                 entry->valid_mapping)) {
-        mapcache->last_address_index = -1;
+        mapcache->last_entry = NULL;
         if (!translated && mapcache->phys_offset_to_gaddr) {
             phys_addr = mapcache->phys_offset_to_gaddr(phys_addr, size, mapcache->opaque);
             translated = true;
@@ -259,19 +259,18 @@ tryagain:
         return NULL;
     }
 
-    mapcache->last_address_index = address_index;
-    mapcache->last_address_vaddr = entry->vaddr_base;
+    mapcache->last_entry = entry;
     if (lock) {
         MapCacheRev *reventry = g_malloc0(sizeof(MapCacheRev));
         entry->lock++;
-        reventry->vaddr_req = mapcache->last_address_vaddr + address_offset;
-        reventry->paddr_index = mapcache->last_address_index;
+        reventry->vaddr_req = mapcache->last_entry->vaddr_base + address_offset;
+        reventry->paddr_index = mapcache->last_entry->paddr_index;
         reventry->size = entry->size;
         QTAILQ_INSERT_HEAD(&mapcache->locked_entries, reventry, next);
     }
 
-    trace_xen_map_cache_return(mapcache->last_address_vaddr + address_offset);
-    return mapcache->last_address_vaddr + address_offset;
+    trace_xen_map_cache_return(mapcache->last_entry->vaddr_base + address_offset);
+    return mapcache->last_entry->vaddr_base + address_offset;
 }
 
 ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
@@ -338,9 +337,9 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next);
     g_free(reventry);
 
-    if (mapcache->last_address_index == paddr_index) {
-        mapcache->last_address_index = -1;
-        mapcache->last_address_vaddr = NULL;
+    if (mapcache->last_entry != NULL &&
+        mapcache->last_entry->paddr_index == paddr_index) {
+        mapcache->last_entry = NULL;
     }
 
     entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
@@ -404,8 +403,7 @@ void xen_invalidate_map_cache(void)
         entry->valid_mapping = NULL;
     }
 
-    mapcache->last_address_index = -1;
-    mapcache->last_address_vaddr = NULL;
+    mapcache->last_entry = NULL;
 
     mapcache_unlock();
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZct-0001qp-NB; Sat, 06 Apr 2013 20:22:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcr-0001qj-R5
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:14 +0000
Received: from [193.109.254.147:53592] by server-3.bemta-14.messagelabs.com id
	BE/D5-17488-5F380615; Sat, 06 Apr 2013 20:22:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1365279726!8741750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31954 invoked from network); 6 Apr 2013 20:22:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZch-0003F0-Bx
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcg-0004j3-Va
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:03 +0000
Date: Sat, 06 Apr 2013 20:22:02 +0000
Message-Id: <E1UOZcg-0004j3-Va@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] xen-mapcache: replace
	last_address_index with a last_entry pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7cde9aa1a4d36eca1f2517ed38740e84b84a8667
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Apr 2 13:23:40 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 15:23:38 2013 +0000

    xen-mapcache: replace last_address_index with a last_entry pointer
    
    Replace last_address_index and last_address_vaddr with a single pointer
    to the last MapCacheEntry used.
    
    upstream-commit-id: e2deee3ea6136b6189e8cfd26379420b9a398d96
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-mapcache.c |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/xen-mapcache.c b/xen-mapcache.c
index 31c06dc..52a4ca5 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -74,8 +74,7 @@ typedef struct MapCache {
     QTAILQ_HEAD(map_cache_head, MapCacheRev) locked_entries;
 
     /* For most cases (>99.9%), the page address is the same. */
-    hwaddr last_address_index;
-    uint8_t *last_address_vaddr;
+    MapCacheEntry *last_entry;
     unsigned long max_mcache_size;
     unsigned int mcache_bucket_shift;
 
@@ -105,7 +104,6 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque)
     mapcache->opaque = opaque;
 
     QTAILQ_INIT(&mapcache->locked_entries);
-    mapcache->last_address_index = -1;
 
     if (geteuid() == 0) {
         rlimit_as.rlim_cur = RLIM_INFINITY;
@@ -210,9 +208,11 @@ tryagain:
 
     trace_xen_map_cache(phys_addr);
 
-    if (address_index == mapcache->last_address_index && !lock && !__size) {
-        trace_xen_map_cache_return(mapcache->last_address_vaddr + address_offset);
-        return mapcache->last_address_vaddr + address_offset;
+    if (mapcache->last_entry != NULL &&
+        mapcache->last_entry->paddr_index == address_index &&
+        !lock && !__size) {
+        trace_xen_map_cache_return(mapcache->last_entry->vaddr_base + address_offset);
+        return mapcache->last_entry->vaddr_base + address_offset;
     }
 
     /* size is always a multiple of MCACHE_BUCKET_SIZE */
@@ -249,7 +249,7 @@ tryagain:
 
     if(!test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
                 entry->valid_mapping)) {
-        mapcache->last_address_index = -1;
+        mapcache->last_entry = NULL;
         if (!translated && mapcache->phys_offset_to_gaddr) {
             phys_addr = mapcache->phys_offset_to_gaddr(phys_addr, size, mapcache->opaque);
             translated = true;
@@ -259,19 +259,18 @@ tryagain:
         return NULL;
     }
 
-    mapcache->last_address_index = address_index;
-    mapcache->last_address_vaddr = entry->vaddr_base;
+    mapcache->last_entry = entry;
     if (lock) {
         MapCacheRev *reventry = g_malloc0(sizeof(MapCacheRev));
         entry->lock++;
-        reventry->vaddr_req = mapcache->last_address_vaddr + address_offset;
-        reventry->paddr_index = mapcache->last_address_index;
+        reventry->vaddr_req = mapcache->last_entry->vaddr_base + address_offset;
+        reventry->paddr_index = mapcache->last_entry->paddr_index;
         reventry->size = entry->size;
         QTAILQ_INSERT_HEAD(&mapcache->locked_entries, reventry, next);
     }
 
-    trace_xen_map_cache_return(mapcache->last_address_vaddr + address_offset);
-    return mapcache->last_address_vaddr + address_offset;
+    trace_xen_map_cache_return(mapcache->last_entry->vaddr_base + address_offset);
+    return mapcache->last_entry->vaddr_base + address_offset;
 }
 
 ram_addr_t xen_ram_addr_from_mapcache(void *ptr)
@@ -338,9 +337,9 @@ void xen_invalidate_map_cache_entry(uint8_t *buffer)
     QTAILQ_REMOVE(&mapcache->locked_entries, reventry, next);
     g_free(reventry);
 
-    if (mapcache->last_address_index == paddr_index) {
-        mapcache->last_address_index = -1;
-        mapcache->last_address_vaddr = NULL;
+    if (mapcache->last_entry != NULL &&
+        mapcache->last_entry->paddr_index == paddr_index) {
+        mapcache->last_entry = NULL;
     }
 
     entry = &mapcache->entry[paddr_index % mapcache->nr_buckets];
@@ -404,8 +403,7 @@ void xen_invalidate_map_cache(void)
         entry->valid_mapping = NULL;
     }
 
-    mapcache->last_address_index = -1;
-    mapcache->last_address_vaddr = NULL;
+    mapcache->last_entry = NULL;
 
     mapcache_unlock();
 }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZcy-0001r4-Pz; Sat, 06 Apr 2013 20:22:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcw-0001qx-TX
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:19 +0000
Received: from [85.158.139.83:2911] by server-9.bemta-5.messagelabs.com id
	1B/EA-08547-AF380615; Sat, 06 Apr 2013 20:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1365279736!24806736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9963 invoked from network); 6 Apr 2013 20:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcu-0003F3-1T
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZct-0004jR-Ob
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:15 +0000
Date: Sat, 06 Apr 2013 20:22:15 +0000
Message-Id: <E1UOZct-0004jR-Ob@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] xen-mapcache: pass the
	right size argument to test_bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 217ecf853bc888858a4dc36554bc5b430d3821ab
Author:     Hanweidong <hanweidong@huawei.com>
AuthorDate: Tue Apr 2 13:22:41 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 15:23:57 2013 +0000

    xen-mapcache: pass the right size argument to test_bits
    
    Compute the correct size for test_bits().
    qemu_get_ram_ptr() and qemu_safe_ram_ptr() will call xen_map_cache()
    with size is 0 if the requested address is in the RAM.  Then
    xen_map_cache() will pass the size 0 to test_bits() for checking if the
    corresponding pfn was mapped in cache. But test_bits() will always
    return 1 when size is 0 without any bit testing. Actually, for this
    case, test_bits should check one bit. So this patch introduced a
    __test_bit_size which is greater than 0 and a multiple of XC_PAGE_SIZE,
    then test_bits can work correctly with __test_bit_size
    >> XC_PAGE_SHIFT as its size.
    
    upstream-commit-id: 044d4e1aae539bd4214175bd9591b3de7986cf18
    
    Signed-off-by: Zhenguo Wang <wangzhenguo@huawei.com>
    Signed-off-by: Weidong Han <hanweidong@huawei.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-mapcache.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen-mapcache.c b/xen-mapcache.c
index 52a4ca5..45c2151 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -200,6 +200,7 @@ uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size,
     hwaddr address_index;
     hwaddr address_offset;
     hwaddr __size = size;
+    hwaddr __test_bit_size = size;
     bool translated = false;
 
 tryagain:
@@ -208,9 +209,23 @@ tryagain:
 
     trace_xen_map_cache(phys_addr);
 
+    /* __test_bit_size is always a multiple of XC_PAGE_SIZE */
+    if (size) {
+        __test_bit_size = size + (phys_addr & (XC_PAGE_SIZE - 1));
+
+        if (__test_bit_size % XC_PAGE_SIZE) {
+            __test_bit_size += XC_PAGE_SIZE - (__test_bit_size % XC_PAGE_SIZE);
+        }
+    } else {
+        __test_bit_size = XC_PAGE_SIZE;
+    }
+
     if (mapcache->last_entry != NULL &&
         mapcache->last_entry->paddr_index == address_index &&
-        !lock && !__size) {
+        !lock && !__size &&
+        test_bits(address_offset >> XC_PAGE_SHIFT,
+                  __test_bit_size >> XC_PAGE_SHIFT,
+                  mapcache->last_entry->valid_mapping)) {
         trace_xen_map_cache_return(mapcache->last_entry->vaddr_base + address_offset);
         return mapcache->last_entry->vaddr_base + address_offset;
     }
@@ -229,7 +244,8 @@ tryagain:
 
     while (entry && entry->lock && entry->vaddr_base &&
             (entry->paddr_index != address_index || entry->size != __size ||
-             !test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
+             !test_bits(address_offset >> XC_PAGE_SHIFT,
+                 __test_bit_size >> XC_PAGE_SHIFT,
                  entry->valid_mapping))) {
         pentry = entry;
         entry = entry->next;
@@ -241,13 +257,15 @@ tryagain:
     } else if (!entry->lock) {
         if (!entry->vaddr_base || entry->paddr_index != address_index ||
                 entry->size != __size ||
-                !test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
+                !test_bits(address_offset >> XC_PAGE_SHIFT,
+                    __test_bit_size >> XC_PAGE_SHIFT,
                     entry->valid_mapping)) {
             xen_remap_bucket(entry, __size, address_index);
         }
     }
 
-    if(!test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
+    if(!test_bits(address_offset >> XC_PAGE_SHIFT,
+                __test_bit_size >> XC_PAGE_SHIFT,
                 entry->valid_mapping)) {
         mapcache->last_entry = NULL;
         if (!translated && mapcache->phys_offset_to_gaddr) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZcy-0001r4-Pz; Sat, 06 Apr 2013 20:22:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcw-0001qx-TX
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:19 +0000
Received: from [85.158.139.83:2911] by server-9.bemta-5.messagelabs.com id
	1B/EA-08547-AF380615; Sat, 06 Apr 2013 20:22:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1365279736!24806736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9963 invoked from network); 6 Apr 2013 20:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZcu-0003F3-1T
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZct-0004jR-Ob
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:15 +0000
Date: Sat, 06 Apr 2013 20:22:15 +0000
Message-Id: <E1UOZct-0004jR-Ob@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] xen-mapcache: pass the
	right size argument to test_bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 217ecf853bc888858a4dc36554bc5b430d3821ab
Author:     Hanweidong <hanweidong@huawei.com>
AuthorDate: Tue Apr 2 13:22:41 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 15:23:57 2013 +0000

    xen-mapcache: pass the right size argument to test_bits
    
    Compute the correct size for test_bits().
    qemu_get_ram_ptr() and qemu_safe_ram_ptr() will call xen_map_cache()
    with size is 0 if the requested address is in the RAM.  Then
    xen_map_cache() will pass the size 0 to test_bits() for checking if the
    corresponding pfn was mapped in cache. But test_bits() will always
    return 1 when size is 0 without any bit testing. Actually, for this
    case, test_bits should check one bit. So this patch introduced a
    __test_bit_size which is greater than 0 and a multiple of XC_PAGE_SIZE,
    then test_bits can work correctly with __test_bit_size
    >> XC_PAGE_SHIFT as its size.
    
    upstream-commit-id: 044d4e1aae539bd4214175bd9591b3de7986cf18
    
    Signed-off-by: Zhenguo Wang <wangzhenguo@huawei.com>
    Signed-off-by: Weidong Han <hanweidong@huawei.com>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-mapcache.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/xen-mapcache.c b/xen-mapcache.c
index 52a4ca5..45c2151 100644
--- a/xen-mapcache.c
+++ b/xen-mapcache.c
@@ -200,6 +200,7 @@ uint8_t *xen_map_cache(hwaddr phys_addr, hwaddr size,
     hwaddr address_index;
     hwaddr address_offset;
     hwaddr __size = size;
+    hwaddr __test_bit_size = size;
     bool translated = false;
 
 tryagain:
@@ -208,9 +209,23 @@ tryagain:
 
     trace_xen_map_cache(phys_addr);
 
+    /* __test_bit_size is always a multiple of XC_PAGE_SIZE */
+    if (size) {
+        __test_bit_size = size + (phys_addr & (XC_PAGE_SIZE - 1));
+
+        if (__test_bit_size % XC_PAGE_SIZE) {
+            __test_bit_size += XC_PAGE_SIZE - (__test_bit_size % XC_PAGE_SIZE);
+        }
+    } else {
+        __test_bit_size = XC_PAGE_SIZE;
+    }
+
     if (mapcache->last_entry != NULL &&
         mapcache->last_entry->paddr_index == address_index &&
-        !lock && !__size) {
+        !lock && !__size &&
+        test_bits(address_offset >> XC_PAGE_SHIFT,
+                  __test_bit_size >> XC_PAGE_SHIFT,
+                  mapcache->last_entry->valid_mapping)) {
         trace_xen_map_cache_return(mapcache->last_entry->vaddr_base + address_offset);
         return mapcache->last_entry->vaddr_base + address_offset;
     }
@@ -229,7 +244,8 @@ tryagain:
 
     while (entry && entry->lock && entry->vaddr_base &&
             (entry->paddr_index != address_index || entry->size != __size ||
-             !test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
+             !test_bits(address_offset >> XC_PAGE_SHIFT,
+                 __test_bit_size >> XC_PAGE_SHIFT,
                  entry->valid_mapping))) {
         pentry = entry;
         entry = entry->next;
@@ -241,13 +257,15 @@ tryagain:
     } else if (!entry->lock) {
         if (!entry->vaddr_base || entry->paddr_index != address_index ||
                 entry->size != __size ||
-                !test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
+                !test_bits(address_offset >> XC_PAGE_SHIFT,
+                    __test_bit_size >> XC_PAGE_SHIFT,
                     entry->valid_mapping)) {
             xen_remap_bucket(entry, __size, address_index);
         }
     }
 
-    if(!test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT,
+    if(!test_bits(address_offset >> XC_PAGE_SHIFT,
+                __test_bit_size >> XC_PAGE_SHIFT,
                 entry->valid_mapping)) {
         mapcache->last_entry = NULL;
         if (!translated && mapcache->phys_offset_to_gaddr) {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZd7-0001rl-Su; Sat, 06 Apr 2013 20:22:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZd7-0001rf-FC
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:29 +0000
Received: from [85.158.138.51:28334] by server-3.bemta-3.messagelabs.com id
	7A/47-26934-40480615; Sat, 06 Apr 2013 20:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1365279746!27995881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25802 invoked from network); 6 Apr 2013 20:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZd4-0003F9-JF
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZd4-0004kS-7u
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:26 +0000
Date: Sat, 06 Apr 2013 20:22:26 +0000
Message-Id: <E1UOZd4-0004kS-7u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Revert "xen: Disable use
	of O_DIRECT by default as it results in crashes."
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6dec8e7a46ae33062c05abaeba73b47bbe9337b9
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Apr 5 23:30:14 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:30:14 2013 +0000

    Revert "xen: Disable use of O_DIRECT by default as it results in crashes."
    
    This reverts commit f3903bbac78a81fcbce1350cdce860764a62783a.
---
 hw/xen_disk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 357f9c1..69e1d9d 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -744,7 +744,7 @@ static int blk_init(struct XenDevice *xendev)
     }
 
     /* read-only ? */
-    qflags = BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
+    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
     if (strcmp(blkdev->mode, "w") == 0) {
         qflags |= BDRV_O_RDWR;
     } else {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZd7-0001rl-Su; Sat, 06 Apr 2013 20:22:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZd7-0001rf-FC
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:29 +0000
Received: from [85.158.138.51:28334] by server-3.bemta-3.messagelabs.com id
	7A/47-26934-40480615; Sat, 06 Apr 2013 20:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1365279746!27995881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25802 invoked from network); 6 Apr 2013 20:22:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZd4-0003F9-JF
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZd4-0004kS-7u
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:26 +0000
Date: Sat, 06 Apr 2013 20:22:26 +0000
Message-Id: <E1UOZd4-0004kS-7u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Revert "xen: Disable use
	of O_DIRECT by default as it results in crashes."
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6dec8e7a46ae33062c05abaeba73b47bbe9337b9
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Apr 5 23:30:14 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:30:14 2013 +0000

    Revert "xen: Disable use of O_DIRECT by default as it results in crashes."
    
    This reverts commit f3903bbac78a81fcbce1350cdce860764a62783a.
---
 hw/xen_disk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 357f9c1..69e1d9d 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -744,7 +744,7 @@ static int blk_init(struct XenDevice *xendev)
     }
 
     /* read-only ? */
-    qflags = BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
+    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
     if (strcmp(blkdev->mode, "w") == 0) {
         qflags |= BDRV_O_RDWR;
     } else {
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdI-0001tG-Vu; Sat, 06 Apr 2013 20:22:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdH-0001t2-LS
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:39 +0000
Received: from [85.158.143.99:43524] by server-1.bemta-4.messagelabs.com id
	67/EF-06203-E0480615; Sat, 06 Apr 2013 20:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1365279757!22100532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8019 invoked from network); 6 Apr 2013 20:22:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdE-0003FH-SP
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdE-0004ks-N1
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:36 +0000
Date: Sat, 06 Apr 2013 20:22:36 +0000
Message-Id: <E1UOZdE-0004ks-N1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Xen PV backend: Move call
	to bdrv_new from blk_init to blk_connect
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d9b78b602494464ccae7667e655c962db9c3a65
Author:     Alex Bligh <alex@alex.org.uk>
AuthorDate: Fri Apr 5 15:45:10 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:30:59 2013 +0000

    Xen PV backend: Move call to bdrv_new from blk_init to blk_connect
    
    This commit delays the point at which bdrv_new (and hence blk_open
    on the underlying device) is called from blk_init to blk_connect.
    This ensures that in an inbound live migrate, the block device is
    not opened until it has been closed at the other end. This is in
    preparation for supporting devices with open/close consistency
    without using O_DIRECT. This commit does NOT itself change O_DIRECT
    semantics.
    
    upstream-commit-id: 86f425db3b1c4b6c4a2927eaec35627f9ab2e703
    
    Signed-off-by: Alex Bligh <alex@alex.org.uk>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |   72 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 40 insertions(+), 32 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 69e1d9d..c3c5904 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -701,7 +701,7 @@ static void blk_alloc(struct XenDevice *xendev)
 static int blk_init(struct XenDevice *xendev)
 {
     struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
-    int index, qflags, info = 0;
+    int info = 0;
 
     /* read xenstore entries */
     if (blkdev->params == NULL) {
@@ -744,10 +744,7 @@ static int blk_init(struct XenDevice *xendev)
     }
 
     /* read-only ? */
-    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
-    if (strcmp(blkdev->mode, "w") == 0) {
-        qflags |= BDRV_O_RDWR;
-    } else {
+    if (strcmp(blkdev->mode, "w")) {
         info  |= VDISK_READONLY;
     }
 
@@ -756,6 +753,41 @@ static int blk_init(struct XenDevice *xendev)
         info  |= VDISK_CDROM;
     }
 
+    blkdev->file_blk  = BLOCK_SIZE;
+
+    /* fill info
+     * blk_connect supplies sector-size and sectors
+     */
+    xenstore_write_be_int(&blkdev->xendev, "feature-flush-cache", 1);
+    xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1);
+    xenstore_write_be_int(&blkdev->xendev, "info", info);
+    return 0;
+
+out_error:
+    g_free(blkdev->params);
+    blkdev->params = NULL;
+    g_free(blkdev->mode);
+    blkdev->mode = NULL;
+    g_free(blkdev->type);
+    blkdev->type = NULL;
+    g_free(blkdev->dev);
+    blkdev->dev = NULL;
+    g_free(blkdev->devtype);
+    blkdev->devtype = NULL;
+    return -1;
+}
+
+static int blk_connect(struct XenDevice *xendev)
+{
+    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
+    int pers, index, qflags;
+
+    /* read-only ? */
+    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
+    if (strcmp(blkdev->mode, "w") == 0) {
+        qflags |= BDRV_O_RDWR;
+    }
+
     /* init qemu block driver */
     index = (blkdev->xendev.dev - 202 * 256) / 16;
     blkdev->dinfo = drive_get(IF_XEN, 0, index);
@@ -771,7 +803,7 @@ static int blk_init(struct XenDevice *xendev)
             }
         }
         if (!blkdev->bs) {
-            goto out_error;
+            return -1;
         }
     } else {
         /* setup via qemu cmdline -> already setup for us */
@@ -779,7 +811,6 @@ static int blk_init(struct XenDevice *xendev)
         blkdev->bs = blkdev->dinfo->bdrv;
     }
     bdrv_attach_dev_nofail(blkdev->bs, blkdev);
-    blkdev->file_blk  = BLOCK_SIZE;
     blkdev->file_size = bdrv_getlength(blkdev->bs);
     if (blkdev->file_size < 0) {
         xen_be_printf(&blkdev->xendev, 1, "bdrv_getlength: %d (%s) | drv %s\n",
@@ -793,33 +824,10 @@ static int blk_init(struct XenDevice *xendev)
                   blkdev->type, blkdev->fileproto, blkdev->filename,
                   blkdev->file_size, blkdev->file_size >> 20);
 
-    /* fill info */
-    xenstore_write_be_int(&blkdev->xendev, "feature-flush-cache", 1);
-    xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1);
-    xenstore_write_be_int(&blkdev->xendev, "info",            info);
-    xenstore_write_be_int(&blkdev->xendev, "sector-size",     blkdev->file_blk);
+    /* Fill in number of sector size and number of sectors */
+    xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk);
     xenstore_write_be_int(&blkdev->xendev, "sectors",
                           blkdev->file_size / blkdev->file_blk);
-    return 0;
-
-out_error:
-    g_free(blkdev->params);
-    blkdev->params = NULL;
-    g_free(blkdev->mode);
-    blkdev->mode = NULL;
-    g_free(blkdev->type);
-    blkdev->type = NULL;
-    g_free(blkdev->dev);
-    blkdev->dev = NULL;
-    g_free(blkdev->devtype);
-    blkdev->devtype = NULL;
-    return -1;
-}
-
-static int blk_connect(struct XenDevice *xendev)
-{
-    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
-    int pers;
 
     if (xenstore_read_fe_int(&blkdev->xendev, "ring-ref", &blkdev->ring_ref) == -1) {
         return -1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdI-0001tG-Vu; Sat, 06 Apr 2013 20:22:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdH-0001t2-LS
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:39 +0000
Received: from [85.158.143.99:43524] by server-1.bemta-4.messagelabs.com id
	67/EF-06203-E0480615; Sat, 06 Apr 2013 20:22:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1365279757!22100532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8019 invoked from network); 6 Apr 2013 20:22:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdE-0003FH-SP
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdE-0004ks-N1
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:36 +0000
Date: Sat, 06 Apr 2013 20:22:36 +0000
Message-Id: <E1UOZdE-0004ks-N1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Xen PV backend: Move call
	to bdrv_new from blk_init to blk_connect
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d9b78b602494464ccae7667e655c962db9c3a65
Author:     Alex Bligh <alex@alex.org.uk>
AuthorDate: Fri Apr 5 15:45:10 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:30:59 2013 +0000

    Xen PV backend: Move call to bdrv_new from blk_init to blk_connect
    
    This commit delays the point at which bdrv_new (and hence blk_open
    on the underlying device) is called from blk_init to blk_connect.
    This ensures that in an inbound live migrate, the block device is
    not opened until it has been closed at the other end. This is in
    preparation for supporting devices with open/close consistency
    without using O_DIRECT. This commit does NOT itself change O_DIRECT
    semantics.
    
    upstream-commit-id: 86f425db3b1c4b6c4a2927eaec35627f9ab2e703
    
    Signed-off-by: Alex Bligh <alex@alex.org.uk>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |   72 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 40 insertions(+), 32 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 69e1d9d..c3c5904 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -701,7 +701,7 @@ static void blk_alloc(struct XenDevice *xendev)
 static int blk_init(struct XenDevice *xendev)
 {
     struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
-    int index, qflags, info = 0;
+    int info = 0;
 
     /* read xenstore entries */
     if (blkdev->params == NULL) {
@@ -744,10 +744,7 @@ static int blk_init(struct XenDevice *xendev)
     }
 
     /* read-only ? */
-    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
-    if (strcmp(blkdev->mode, "w") == 0) {
-        qflags |= BDRV_O_RDWR;
-    } else {
+    if (strcmp(blkdev->mode, "w")) {
         info  |= VDISK_READONLY;
     }
 
@@ -756,6 +753,41 @@ static int blk_init(struct XenDevice *xendev)
         info  |= VDISK_CDROM;
     }
 
+    blkdev->file_blk  = BLOCK_SIZE;
+
+    /* fill info
+     * blk_connect supplies sector-size and sectors
+     */
+    xenstore_write_be_int(&blkdev->xendev, "feature-flush-cache", 1);
+    xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1);
+    xenstore_write_be_int(&blkdev->xendev, "info", info);
+    return 0;
+
+out_error:
+    g_free(blkdev->params);
+    blkdev->params = NULL;
+    g_free(blkdev->mode);
+    blkdev->mode = NULL;
+    g_free(blkdev->type);
+    blkdev->type = NULL;
+    g_free(blkdev->dev);
+    blkdev->dev = NULL;
+    g_free(blkdev->devtype);
+    blkdev->devtype = NULL;
+    return -1;
+}
+
+static int blk_connect(struct XenDevice *xendev)
+{
+    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
+    int pers, index, qflags;
+
+    /* read-only ? */
+    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
+    if (strcmp(blkdev->mode, "w") == 0) {
+        qflags |= BDRV_O_RDWR;
+    }
+
     /* init qemu block driver */
     index = (blkdev->xendev.dev - 202 * 256) / 16;
     blkdev->dinfo = drive_get(IF_XEN, 0, index);
@@ -771,7 +803,7 @@ static int blk_init(struct XenDevice *xendev)
             }
         }
         if (!blkdev->bs) {
-            goto out_error;
+            return -1;
         }
     } else {
         /* setup via qemu cmdline -> already setup for us */
@@ -779,7 +811,6 @@ static int blk_init(struct XenDevice *xendev)
         blkdev->bs = blkdev->dinfo->bdrv;
     }
     bdrv_attach_dev_nofail(blkdev->bs, blkdev);
-    blkdev->file_blk  = BLOCK_SIZE;
     blkdev->file_size = bdrv_getlength(blkdev->bs);
     if (blkdev->file_size < 0) {
         xen_be_printf(&blkdev->xendev, 1, "bdrv_getlength: %d (%s) | drv %s\n",
@@ -793,33 +824,10 @@ static int blk_init(struct XenDevice *xendev)
                   blkdev->type, blkdev->fileproto, blkdev->filename,
                   blkdev->file_size, blkdev->file_size >> 20);
 
-    /* fill info */
-    xenstore_write_be_int(&blkdev->xendev, "feature-flush-cache", 1);
-    xenstore_write_be_int(&blkdev->xendev, "feature-persistent", 1);
-    xenstore_write_be_int(&blkdev->xendev, "info",            info);
-    xenstore_write_be_int(&blkdev->xendev, "sector-size",     blkdev->file_blk);
+    /* Fill in number of sector size and number of sectors */
+    xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk);
     xenstore_write_be_int(&blkdev->xendev, "sectors",
                           blkdev->file_size / blkdev->file_blk);
-    return 0;
-
-out_error:
-    g_free(blkdev->params);
-    blkdev->params = NULL;
-    g_free(blkdev->mode);
-    blkdev->mode = NULL;
-    g_free(blkdev->type);
-    blkdev->type = NULL;
-    g_free(blkdev->dev);
-    blkdev->dev = NULL;
-    g_free(blkdev->devtype);
-    blkdev->devtype = NULL;
-    return -1;
-}
-
-static int blk_connect(struct XenDevice *xendev)
-{
-    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
-    int pers;
 
     if (xenstore_read_fe_int(&blkdev->xendev, "ring-ref", &blkdev->ring_ref) == -1) {
         return -1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdT-0001um-37; Sat, 06 Apr 2013 20:22:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdR-0001uO-Le
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:49 +0000
Received: from [85.158.139.83:3576] by server-12.bemta-5.messagelabs.com id
	E0/B7-11486-81480615; Sat, 06 Apr 2013 20:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1365279767!27677051!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26640 invoked from network); 6 Apr 2013 20:22:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdP-0003FN-1Y
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdO-0004lE-VC
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:47 +0000
Date: Sat, 06 Apr 2013 20:22:46 +0000
Message-Id: <E1UOZdO-0004lE-VC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Xen PV backend: Disable
	use of O_DIRECT by default as it results in crashes.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7714986a9896a3ba25612b7d4739365a9932041f
Author:     Alex Bligh <alex@alex.org.uk>
AuthorDate: Fri Apr 5 15:45:15 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:31:25 2013 +0000

    Xen PV backend: Disable use of O_DIRECT by default as it results in crashes.
    
    Due to what is almost certainly a kernel bug, writes with O_DIRECT may
    continue to reference the page after the write has been marked as
    completed, particularly in the case of TCP retransmit. In other
    scenarios, this "merely" risks data corruption on the write, but with
    Xen pages from domU are only transiently mapped into dom0's memory,
    resulting in kernel panics when they are subsequently accessed.
    
    This brings PV devices in line with emulated devices.  Removing
    O_DIRECT is safe as barrier operations are now correctly passed
    through.
    
    See:
       http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html
    for more details.
    
    upstream-commit-id: c1a88ad1f4ac994cd70695bf08141d161e21533e
    
    Signed-off-by: Alex Bligh <alex@alex.org.uk>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index c3c5904..668cb54 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -783,7 +783,7 @@ static int blk_connect(struct XenDevice *xendev)
     int pers, index, qflags;
 
     /* read-only ? */
-    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
+    qflags = BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
     if (strcmp(blkdev->mode, "w") == 0) {
         qflags |= BDRV_O_RDWR;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:22:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:22:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdT-0001um-37; Sat, 06 Apr 2013 20:22:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdR-0001uO-Le
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:49 +0000
Received: from [85.158.139.83:3576] by server-12.bemta-5.messagelabs.com id
	E0/B7-11486-81480615; Sat, 06 Apr 2013 20:22:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1365279767!27677051!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26640 invoked from network); 6 Apr 2013 20:22:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdP-0003FN-1Y
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdO-0004lE-VC
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:47 +0000
Date: Sat, 06 Apr 2013 20:22:46 +0000
Message-Id: <E1UOZdO-0004lE-VC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Xen PV backend: Disable
	use of O_DIRECT by default as it results in crashes.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7714986a9896a3ba25612b7d4739365a9932041f
Author:     Alex Bligh <alex@alex.org.uk>
AuthorDate: Fri Apr 5 15:45:15 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:31:25 2013 +0000

    Xen PV backend: Disable use of O_DIRECT by default as it results in crashes.
    
    Due to what is almost certainly a kernel bug, writes with O_DIRECT may
    continue to reference the page after the write has been marked as
    completed, particularly in the case of TCP retransmit. In other
    scenarios, this "merely" risks data corruption on the write, but with
    Xen pages from domU are only transiently mapped into dom0's memory,
    resulting in kernel panics when they are subsequently accessed.
    
    This brings PV devices in line with emulated devices.  Removing
    O_DIRECT is safe as barrier operations are now correctly passed
    through.
    
    See:
       http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html
    for more details.
    
    upstream-commit-id: c1a88ad1f4ac994cd70695bf08141d161e21533e
    
    Signed-off-by: Alex Bligh <alex@alex.org.uk>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index c3c5904..668cb54 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -783,7 +783,7 @@ static int blk_connect(struct XenDevice *xendev)
     int pers, index, qflags;
 
     /* read-only ? */
-    qflags = BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
+    qflags = BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO;
     if (strcmp(blkdev->mode, "w") == 0) {
         qflags |= BDRV_O_RDWR;
     }
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:23:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:23:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdd-0001ws-8g; Sat, 06 Apr 2013 20:23:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdb-0001wY-Ti
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:00 +0000
Received: from [85.158.139.211:42929] by server-14.bemta-5.messagelabs.com id
	AF/89-13158-32480615; Sat, 06 Apr 2013 20:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1365279777!18917420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 610 invoked from network); 6 Apr 2013 20:22:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdZ-0003FW-6c
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdZ-0004la-4I
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:57 +0000
Date: Sat, 06 Apr 2013 20:22:57 +0000
Message-Id: <E1UOZdZ-0004la-4I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Introduce 64 bit integer
	write interface to xenstore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b4260da6d510def4067cc06c439c88a457d016e
Author:     Felipe Franciosi <felipe.franciosi@citrix.com>
AuthorDate: Fri Apr 5 15:37:32 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:31:34 2013 +0000

    Introduce 64 bit integer write interface to xenstore
    
    The current implementation of xen_backend only provides 32 bit integer
    functions to write to xenstore. This patch adds two functions that
    allow writing 64 bit integers (one generic function and another for
    the backend only).
    
    This patch also fixes the size of the char arrays used to represent
    these integers as strings (originally 32 bytes, however no more than
    12 bytes are needed for 32 bit integers and no more than 21 bytes are
    needed for 64 bit integers).
    
    upstream-commit-id: 10bb3c623478117aee5117c312736f10833decc2
    
    Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_backend.c |   15 ++++++++++++++-
 hw/xen_backend.h |    2 ++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index f83a1e1..008cdb3 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -85,12 +85,20 @@ char *xenstore_read_str(const char *base, const char *node)
 
 int xenstore_write_int(const char *base, const char *node, int ival)
 {
-    char val[32];
+    char val[12];
 
     snprintf(val, sizeof(val), "%d", ival);
     return xenstore_write_str(base, node, val);
 }
 
+int xenstore_write_int64(const char *base, const char *node, int64_t ival)
+{
+    char val[21];
+
+    snprintf(val, sizeof(val), "%"PRId64, ival);
+    return xenstore_write_str(base, node, val);
+}
+
 int xenstore_read_int(const char *base, const char *node, int *ival)
 {
     char *val;
@@ -114,6 +122,11 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival)
     return xenstore_write_int(xendev->be, node, ival);
 }
 
+int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival)
+{
+    return xenstore_write_int64(xendev->be, node, ival);
+}
+
 char *xenstore_read_be_str(struct XenDevice *xendev, const char *node)
 {
     return xenstore_read_str(xendev->be, node);
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index fea86dd..7b3b09d 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -64,11 +64,13 @@ extern const char *xen_protocol;
 /* xenstore helper functions */
 int xenstore_write_str(const char *base, const char *node, const char *val);
 int xenstore_write_int(const char *base, const char *node, int ival);
+int xenstore_write_int64(const char *base, const char *node, int64_t ival);
 char *xenstore_read_str(const char *base, const char *node);
 int xenstore_read_int(const char *base, const char *node, int *ival);
 
 int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val);
 int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
+int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
 char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
 int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
 char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:23:05 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:23:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdd-0001ws-8g; Sat, 06 Apr 2013 20:23:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdb-0001wY-Ti
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:00 +0000
Received: from [85.158.139.211:42929] by server-14.bemta-5.messagelabs.com id
	AF/89-13158-32480615; Sat, 06 Apr 2013 20:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1365279777!18917420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 610 invoked from network); 6 Apr 2013 20:22:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:22:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdZ-0003FW-6c
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdZ-0004la-4I
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:22:57 +0000
Date: Sat, 06 Apr 2013 20:22:57 +0000
Message-Id: <E1UOZdZ-0004la-4I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Introduce 64 bit integer
	write interface to xenstore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b4260da6d510def4067cc06c439c88a457d016e
Author:     Felipe Franciosi <felipe.franciosi@citrix.com>
AuthorDate: Fri Apr 5 15:37:32 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:31:34 2013 +0000

    Introduce 64 bit integer write interface to xenstore
    
    The current implementation of xen_backend only provides 32 bit integer
    functions to write to xenstore. This patch adds two functions that
    allow writing 64 bit integers (one generic function and another for
    the backend only).
    
    This patch also fixes the size of the char arrays used to represent
    these integers as strings (originally 32 bytes, however no more than
    12 bytes are needed for 32 bit integers and no more than 21 bytes are
    needed for 64 bit integers).
    
    upstream-commit-id: 10bb3c623478117aee5117c312736f10833decc2
    
    Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_backend.c |   15 ++++++++++++++-
 hw/xen_backend.h |    2 ++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index f83a1e1..008cdb3 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -85,12 +85,20 @@ char *xenstore_read_str(const char *base, const char *node)
 
 int xenstore_write_int(const char *base, const char *node, int ival)
 {
-    char val[32];
+    char val[12];
 
     snprintf(val, sizeof(val), "%d", ival);
     return xenstore_write_str(base, node, val);
 }
 
+int xenstore_write_int64(const char *base, const char *node, int64_t ival)
+{
+    char val[21];
+
+    snprintf(val, sizeof(val), "%"PRId64, ival);
+    return xenstore_write_str(base, node, val);
+}
+
 int xenstore_read_int(const char *base, const char *node, int *ival)
 {
     char *val;
@@ -114,6 +122,11 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival)
     return xenstore_write_int(xendev->be, node, ival);
 }
 
+int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival)
+{
+    return xenstore_write_int64(xendev->be, node, ival);
+}
+
 char *xenstore_read_be_str(struct XenDevice *xendev, const char *node)
 {
     return xenstore_read_str(xendev->be, node);
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index fea86dd..7b3b09d 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -64,11 +64,13 @@ extern const char *xen_protocol;
 /* xenstore helper functions */
 int xenstore_write_str(const char *base, const char *node, const char *val);
 int xenstore_write_int(const char *base, const char *node, int ival);
+int xenstore_write_int64(const char *base, const char *node, int64_t ival);
 char *xenstore_read_str(const char *base, const char *node);
 int xenstore_read_int(const char *base, const char *node, int *ival);
 
 int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val);
 int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
+int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
 char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
 int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
 char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:23:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:23:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdn-0001ys-C6; Sat, 06 Apr 2013 20:23:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdl-0001yU-Uj
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:10 +0000
Received: from [85.158.143.99:46014] by server-1.bemta-4.messagelabs.com id
	A5/FF-06203-D2480615; Sat, 06 Apr 2013 20:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1365279787!16550243!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10790 invoked from network); 6 Apr 2013 20:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:23:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdj-0003G5-B7
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdj-0004lx-9o
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:07 +0000
Date: Sat, 06 Apr 2013 20:23:07 +0000
Message-Id: <E1UOZdj-0004lx-9o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Allow xen guests to plug
	disks of 1 TiB or more
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e2155ddd22fe4378030cbbdbbb089a6fa2f3ad44
Author:     Felipe Franciosi <felipe.franciosi@citrix.com>
AuthorDate: Fri Apr 5 15:47:59 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:31:53 2013 +0000

    Allow xen guests to plug disks of 1 TiB or more
    
    The current xen backend driver implementation uses int64_t variables
    to store the size of the corresponding backend disk/file. It also uses
    an int64_t variable to store the block size of that image. When writing
    the number of sectors (file_size/block_size) to xenstore, however, it
    passes these values as 32 bit signed integers. This will cause an
    overflow for any disk of 1 TiB or more.
    
    This patch changes the xen backend driver to use a 64 bit integer write
    xenstore function.
    
    upstream-commit-id: 9246ce881128df2a69178779c1ef33c83df3c70d
    
    Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 668cb54..f484404 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -826,8 +826,8 @@ static int blk_connect(struct XenDevice *xendev)
 
     /* Fill in number of sector size and number of sectors */
     xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk);
-    xenstore_write_be_int(&blkdev->xendev, "sectors",
-                          blkdev->file_size / blkdev->file_blk);
+    xenstore_write_be_int64(&blkdev->xendev, "sectors",
+                            blkdev->file_size / blkdev->file_blk);
 
     if (xenstore_read_fe_int(&blkdev->xendev, "ring-ref", &blkdev->ring_ref) == -1) {
         return -1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 06 20:23:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 06 Apr 2013 20:23:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UOZdn-0001ys-C6; Sat, 06 Apr 2013 20:23:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdl-0001yU-Uj
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:10 +0000
Received: from [85.158.143.99:46014] by server-1.bemta-4.messagelabs.com id
	A5/FF-06203-D2480615; Sat, 06 Apr 2013 20:23:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1365279787!16550243!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10790 invoked from network); 6 Apr 2013 20:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	6 Apr 2013 20:23:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdj-0003G5-B7
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UOZdj-0004lx-9o
	for xen-changelog@lists.xensource.com; Sat, 06 Apr 2013 20:23:07 +0000
Date: Sat, 06 Apr 2013 20:23:07 +0000
Message-Id: <E1UOZdj-0004lx-9o@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Allow xen guests to plug
	disks of 1 TiB or more
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e2155ddd22fe4378030cbbdbbb089a6fa2f3ad44
Author:     Felipe Franciosi <felipe.franciosi@citrix.com>
AuthorDate: Fri Apr 5 15:47:59 2013 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Apr 5 23:31:53 2013 +0000

    Allow xen guests to plug disks of 1 TiB or more
    
    The current xen backend driver implementation uses int64_t variables
    to store the size of the corresponding backend disk/file. It also uses
    an int64_t variable to store the block size of that image. When writing
    the number of sectors (file_size/block_size) to xenstore, however, it
    passes these values as 32 bit signed integers. This will cause an
    overflow for any disk of 1 TiB or more.
    
    This patch changes the xen backend driver to use a 64 bit integer write
    xenstore function.
    
    upstream-commit-id: 9246ce881128df2a69178779c1ef33c83df3c70d
    
    Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_disk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 668cb54..f484404 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -826,8 +826,8 @@ static int blk_connect(struct XenDevice *xendev)
 
     /* Fill in number of sector size and number of sectors */
     xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk);
-    xenstore_write_be_int(&blkdev->xendev, "sectors",
-                          blkdev->file_size / blkdev->file_blk);
+    xenstore_write_be_int64(&blkdev->xendev, "sectors",
+                            blkdev->file_size / blkdev->file_blk);
 
     if (xenstore_read_fe_int(&blkdev->xendev, "ring-ref", &blkdev->ring_ref) == -1) {
         return -1;
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHM-0004Jk-7G; Mon, 08 Apr 2013 22:11:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHK-0004JL-SV
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:07 +0000
Received: from [85.158.139.211:38307] by server-4.bemta-5.messagelabs.com id
	5E/39-01980-A7043615; Mon, 08 Apr 2013 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365459063!18077385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20184 invoked from network); 8 Apr 2013 22:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHH-0001en-8q
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHH-0007o4-1W
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:03 +0000
Date: Mon, 08 Apr 2013 22:11:03 +0000
Message-Id: <E1UPKHH-0007o4-1W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: init sch_plug module based on
	kernel version
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5753fe1c92efb3cc0142dadf8c82d5fb9ea80418
Author:     Shriram Rajagopalan <rshriram@cs.ubc.ca>
AuthorDate: Fri Apr 5 15:16:05 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 16:05:56 2013 +0100

    remus: init sch_plug module based on kernel version
    
    remus: init sch_plug module based on kernel version
    
    sch_plug module, for network buffering, is available as part of linux
    kernel (from 3.4 onwards), as opposed to an out-of-tree module.
    The netlink message format to talk to the in-kernel module is different from
    that of the old version.  So, before initializing the Plug Qdisc, check
    the kernel version and use the appropriate message format.
    
    Also change the names of the constants to reflect the format used by the mainline
    module [CHECKPOINT -> BUFFER , RELEASE -> RELEASE_ONE ].
    
    Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
---
 tools/python/xen/remus/device.py |    4 ++--
 tools/python/xen/remus/qdisc.py  |   23 +++++++++++++++++------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/tools/python/xen/remus/device.py b/tools/python/xen/remus/device.py
index debfaed..970e1ea 100644
--- a/tools/python/xen/remus/device.py
+++ b/tools/python/xen/remus/device.py
@@ -332,12 +332,12 @@ class BufferedNIC(CheckpointedDevice):
         if not self.installed:
             self.install()
 
-        self._sendqmsg(qdisc.TC_PLUG_CHECKPOINT)
+        self._sendqmsg(qdisc.TC_PLUG_BUFFER)
 
     def commit(self):
         '''Called when checkpoint has been acknowledged by
         the backup'''
-        self._sendqmsg(qdisc.TC_PLUG_RELEASE)
+        self._sendqmsg(qdisc.TC_PLUG_RELEASE_ONE)
 
     # private
     def _sendqmsg(self, action):
diff --git a/tools/python/xen/remus/qdisc.py b/tools/python/xen/remus/qdisc.py
index e7d3b70..4d54e01 100644
--- a/tools/python/xen/remus/qdisc.py
+++ b/tools/python/xen/remus/qdisc.py
@@ -1,6 +1,9 @@
 import socket, struct
 
 import netlink
+import platform
+
+kernelversion = platform.platform(terse=True).split("-")[1].split(".")
 
 qdisc_kinds = {}
 
@@ -146,13 +149,18 @@ class CfifoQdisc(Qdisc):
 
 qdisc_kinds['cfifo'] = CfifoQdisc
 
-TC_PLUG_CHECKPOINT = 0
-TC_PLUG_RELEASE = 1
+TC_PLUG_BUFFER = 0
+TC_PLUG_RELEASE_ONE = 1
 
 class PlugQdisc(Qdisc):
-    fmt = 'I'
 
     def __init__(self, qdict=None):
+        if int(kernelversion[0]) >= 3 and int(kernelversion[1]) >= 4:
+            self.fmt = 'iI'
+            self.limit = 10000
+        else:
+            self.fmt = 'I'
+
         if not qdict:
             qdict = {'kind': 'plug',
                      'handle': TC_H_ROOT}
@@ -161,7 +169,10 @@ class PlugQdisc(Qdisc):
         self.action = 0
 
     def pack(self):
-        return struct.pack(self.fmt, self.action)
+        if int(kernelversion[0]) >= 3 and int(kernelversion[1]) >= 4:
+            return struct.pack(self.fmt, self.action, self.limit)
+        else:
+            return struct.pack(self.fmt, self.action)
 
     def parse(self, args):
         if not args:
@@ -169,9 +180,9 @@ class PlugQdisc(Qdisc):
         arg = args[0]
 
         if arg == 'checkpoint':
-            self.action = TC_PLUG_CHECKPOINT
+            self.action = TC_PLUG_BUFFER
         elif arg == 'release':
-            self.action = TC_PLUG_RELEASE
+            self.action = TC_PLUG_RELEASE_ONE
         else:
             raise QdiscException('unknown action')
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHM-0004Jk-7G; Mon, 08 Apr 2013 22:11:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHK-0004JL-SV
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:07 +0000
Received: from [85.158.139.211:38307] by server-4.bemta-5.messagelabs.com id
	5E/39-01980-A7043615; Mon, 08 Apr 2013 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365459063!18077385!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20184 invoked from network); 8 Apr 2013 22:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHH-0001en-8q
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHH-0007o4-1W
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:03 +0000
Date: Mon, 08 Apr 2013 22:11:03 +0000
Message-Id: <E1UPKHH-0007o4-1W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] remus: init sch_plug module based on
	kernel version
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5753fe1c92efb3cc0142dadf8c82d5fb9ea80418
Author:     Shriram Rajagopalan <rshriram@cs.ubc.ca>
AuthorDate: Fri Apr 5 15:16:05 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 16:05:56 2013 +0100

    remus: init sch_plug module based on kernel version
    
    remus: init sch_plug module based on kernel version
    
    sch_plug module, for network buffering, is available as part of linux
    kernel (from 3.4 onwards), as opposed to an out-of-tree module.
    The netlink message format to talk to the in-kernel module is different from
    that of the old version.  So, before initializing the Plug Qdisc, check
    the kernel version and use the appropriate message format.
    
    Also change the names of the constants to reflect the format used by the mainline
    module [CHECKPOINT -> BUFFER , RELEASE -> RELEASE_ONE ].
    
    Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
---
 tools/python/xen/remus/device.py |    4 ++--
 tools/python/xen/remus/qdisc.py  |   23 +++++++++++++++++------
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/tools/python/xen/remus/device.py b/tools/python/xen/remus/device.py
index debfaed..970e1ea 100644
--- a/tools/python/xen/remus/device.py
+++ b/tools/python/xen/remus/device.py
@@ -332,12 +332,12 @@ class BufferedNIC(CheckpointedDevice):
         if not self.installed:
             self.install()
 
-        self._sendqmsg(qdisc.TC_PLUG_CHECKPOINT)
+        self._sendqmsg(qdisc.TC_PLUG_BUFFER)
 
     def commit(self):
         '''Called when checkpoint has been acknowledged by
         the backup'''
-        self._sendqmsg(qdisc.TC_PLUG_RELEASE)
+        self._sendqmsg(qdisc.TC_PLUG_RELEASE_ONE)
 
     # private
     def _sendqmsg(self, action):
diff --git a/tools/python/xen/remus/qdisc.py b/tools/python/xen/remus/qdisc.py
index e7d3b70..4d54e01 100644
--- a/tools/python/xen/remus/qdisc.py
+++ b/tools/python/xen/remus/qdisc.py
@@ -1,6 +1,9 @@
 import socket, struct
 
 import netlink
+import platform
+
+kernelversion = platform.platform(terse=True).split("-")[1].split(".")
 
 qdisc_kinds = {}
 
@@ -146,13 +149,18 @@ class CfifoQdisc(Qdisc):
 
 qdisc_kinds['cfifo'] = CfifoQdisc
 
-TC_PLUG_CHECKPOINT = 0
-TC_PLUG_RELEASE = 1
+TC_PLUG_BUFFER = 0
+TC_PLUG_RELEASE_ONE = 1
 
 class PlugQdisc(Qdisc):
-    fmt = 'I'
 
     def __init__(self, qdict=None):
+        if int(kernelversion[0]) >= 3 and int(kernelversion[1]) >= 4:
+            self.fmt = 'iI'
+            self.limit = 10000
+        else:
+            self.fmt = 'I'
+
         if not qdict:
             qdict = {'kind': 'plug',
                      'handle': TC_H_ROOT}
@@ -161,7 +169,10 @@ class PlugQdisc(Qdisc):
         self.action = 0
 
     def pack(self):
-        return struct.pack(self.fmt, self.action)
+        if int(kernelversion[0]) >= 3 and int(kernelversion[1]) >= 4:
+            return struct.pack(self.fmt, self.action, self.limit)
+        else:
+            return struct.pack(self.fmt, self.action)
 
     def parse(self, args):
         if not args:
@@ -169,9 +180,9 @@ class PlugQdisc(Qdisc):
         arg = args[0]
 
         if arg == 'checkpoint':
-            self.action = TC_PLUG_CHECKPOINT
+            self.action = TC_PLUG_BUFFER
         elif arg == 'release':
-            self.action = TC_PLUG_RELEASE
+            self.action = TC_PLUG_RELEASE_ONE
         else:
             raise QdiscException('unknown action')
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHW-0004MJ-AE; Mon, 08 Apr 2013 22:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHV-0004M6-0y
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:17 +0000
Received: from [85.158.139.211:3033] by server-7.bemta-5.messagelabs.com id
	8C/65-12441-48043615; Mon, 08 Apr 2013 22:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365459073!18077403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20430 invoked from network); 8 Apr 2013 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHR-0001eq-Gh
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHR-0007oS-CM
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:13 +0000
Date: Mon, 08 Apr 2013 22:11:13 +0000
Message-Id: <E1UPKHR-0007oS-CM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vpmu intel: Better names and replacing
	numerals with defines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ad0f74356cb45d5904cc3726fb552cecc9fe16f
Author:     Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
AuthorDate: Mon Apr 8 17:55:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 8 17:55:49 2013 +0200

    vpmu intel: Better names and replacing numerals with defines
    
    This patch renames core2_counters to core2_fix_counters for better
    understanding the code and subtitutes 2 numerals with defines in fixed counter
    handling.
    
    Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c        |   42 +++++++++++++++---------------
 xen/include/asm-x86/hvm/vmx/vpmu_core2.h |   11 +++++--
 2 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 1c6a87c..ceae50b 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -101,7 +101,7 @@ static void handle_pmc_quirk(u64 msr_content)
     }
 }
 
-static const u32 core2_counters_msr[] = {
+static const u32 core2_fix_counters_msr[] = {
     MSR_CORE_PERF_FIXED_CTR0,
     MSR_CORE_PERF_FIXED_CTR1,
     MSR_CORE_PERF_FIXED_CTR2
@@ -119,13 +119,13 @@ struct pmumsr {
     const u32 *msr;
 };
 
-static const struct pmumsr core2_counters = {
-    3,
-    core2_counters_msr
+static const struct pmumsr core2_fix_counters = {
+    VPMU_CORE2_NUM_FIXED,
+    core2_fix_counters_msr
 };
 
 static const struct pmumsr core2_ctrls = {
-    3,
+    VPMU_CORE2_NUM_CTRLS,
     core2_ctrls_msr
 };
 static int arch_pmc_cnt;
@@ -162,16 +162,16 @@ static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)
 {
     int i;
 
-    for ( i = 0; i < core2_counters.num; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
     {
-        if ( core2_counters.msr[i] == msr_index )
+        if ( core2_fix_counters.msr[i] == msr_index )
         {
             *type = MSR_TYPE_COUNTER;
             *index = i;
             return 1;
         }
     }
-    
+
     for ( i = 0; i < core2_ctrls.num; i++ )
     {
         if ( core2_ctrls.msr[i] == msr_index )
@@ -214,10 +214,10 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
     int i;
 
     /* Allow Read/Write PMU Counters MSR Directly. */
-    for ( i = 0; i < core2_counters.num; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
     {
-        clear_bit(msraddr_to_bitpos(core2_counters.msr[i]), msr_bitmap);
-        clear_bit(msraddr_to_bitpos(core2_counters.msr[i]),
+        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
+        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
                   msr_bitmap + 0x800/BYTES_PER_LONG);
     }
     for ( i = 0; i < core2_get_pmc_count(); i++ )
@@ -238,10 +238,10 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
 {
     int i;
 
-    for ( i = 0; i < core2_counters.num; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
     {
-        set_bit(msraddr_to_bitpos(core2_counters.msr[i]), msr_bitmap);
-        set_bit(msraddr_to_bitpos(core2_counters.msr[i]),
+        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
+        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
                 msr_bitmap + 0x800/BYTES_PER_LONG);
     }
     for ( i = 0; i < core2_get_pmc_count(); i++ )
@@ -261,8 +261,8 @@ static inline void __core2_vpmu_save(struct vcpu *v)
     int i;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_counters.num; i++ )
-        rdmsrl(core2_counters.msr[i], core2_vpmu_cxt->counters[i]);
+    for ( i = 0; i < core2_fix_counters.num; i++ )
+        rdmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
     core2_vpmu_cxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
@@ -292,8 +292,8 @@ static inline void __core2_vpmu_load(struct vcpu *v)
     int i;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_counters.num; i++ )
-        wrmsrl(core2_counters.msr[i], core2_vpmu_cxt->counters[i]);
+    for ( i = 0; i < core2_fix_counters.num; i++ )
+        wrmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         wrmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
 
@@ -474,7 +474,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
 
         rdmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, non_global_ctrl);
         global_ctrl = msr_content >> 32;
-        for ( i = 0; i < 3; i++ )
+        for ( i = 0; i < core2_fix_counters.num; i++ )
         {
             core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
                 (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
@@ -486,7 +486,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         non_global_ctrl = msr_content;
         vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
         global_ctrl >>= 32;
-        for ( i = 0; i < 3; i++ )
+        for ( i = 0; i < core2_fix_counters.num; i++ )
         {
             core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
                 (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
@@ -502,7 +502,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
                 (global_ctrl >> tmp) & (msr_content >> 22) & 1;
     }
 
-    for ( i = 0; i < 3; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
         pmu_enable |= core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i];
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         pmu_enable |= core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i];
diff --git a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
index 2a9f346..4128f2a 100644
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
@@ -23,6 +23,11 @@
 #ifndef __ASM_X86_HVM_VPMU_CORE_H_
 #define __ASM_X86_HVM_VPMU_CORE_H_
 
+/* Currently only 3 fixed counters are supported. */
+#define VPMU_CORE2_NUM_FIXED 3
+/* Currently only 3 Non-architectual Performance Control MSRs */
+#define VPMU_CORE2_NUM_CTRLS 3
+
 struct arch_msr_pair {
     u64 counter;
     u64 control;
@@ -30,14 +35,14 @@ struct arch_msr_pair {
 
 struct core2_pmu_enable {
     char ds_area_enable;
-    char fixed_ctr_enable[3];
+    char fixed_ctr_enable[VPMU_CORE2_NUM_FIXED];
     char arch_pmc_enable[1];
 };
 
 struct core2_vpmu_context {
     struct core2_pmu_enable *pmu_enable;
-    u64 counters[3];
-    u64 ctrls[3];
+    u64 fix_counters[VPMU_CORE2_NUM_FIXED];
+    u64 ctrls[VPMU_CORE2_NUM_CTRLS];
     u64 global_ovf_status;
     u32 hw_lapic_lvtpc;
     struct arch_msr_pair arch_msr_pair[1];
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHW-0004MJ-AE; Mon, 08 Apr 2013 22:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHV-0004M6-0y
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:17 +0000
Received: from [85.158.139.211:3033] by server-7.bemta-5.messagelabs.com id
	8C/65-12441-48043615; Mon, 08 Apr 2013 22:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365459073!18077403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20430 invoked from network); 8 Apr 2013 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHR-0001eq-Gh
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHR-0007oS-CM
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:13 +0000
Date: Mon, 08 Apr 2013 22:11:13 +0000
Message-Id: <E1UPKHR-0007oS-CM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vpmu intel: Better names and replacing
	numerals with defines
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7ad0f74356cb45d5904cc3726fb552cecc9fe16f
Author:     Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
AuthorDate: Mon Apr 8 17:55:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 8 17:55:49 2013 +0200

    vpmu intel: Better names and replacing numerals with defines
    
    This patch renames core2_counters to core2_fix_counters for better
    understanding the code and subtitutes 2 numerals with defines in fixed counter
    handling.
    
    Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c        |   42 +++++++++++++++---------------
 xen/include/asm-x86/hvm/vmx/vpmu_core2.h |   11 +++++--
 2 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 1c6a87c..ceae50b 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -101,7 +101,7 @@ static void handle_pmc_quirk(u64 msr_content)
     }
 }
 
-static const u32 core2_counters_msr[] = {
+static const u32 core2_fix_counters_msr[] = {
     MSR_CORE_PERF_FIXED_CTR0,
     MSR_CORE_PERF_FIXED_CTR1,
     MSR_CORE_PERF_FIXED_CTR2
@@ -119,13 +119,13 @@ struct pmumsr {
     const u32 *msr;
 };
 
-static const struct pmumsr core2_counters = {
-    3,
-    core2_counters_msr
+static const struct pmumsr core2_fix_counters = {
+    VPMU_CORE2_NUM_FIXED,
+    core2_fix_counters_msr
 };
 
 static const struct pmumsr core2_ctrls = {
-    3,
+    VPMU_CORE2_NUM_CTRLS,
     core2_ctrls_msr
 };
 static int arch_pmc_cnt;
@@ -162,16 +162,16 @@ static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)
 {
     int i;
 
-    for ( i = 0; i < core2_counters.num; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
     {
-        if ( core2_counters.msr[i] == msr_index )
+        if ( core2_fix_counters.msr[i] == msr_index )
         {
             *type = MSR_TYPE_COUNTER;
             *index = i;
             return 1;
         }
     }
-    
+
     for ( i = 0; i < core2_ctrls.num; i++ )
     {
         if ( core2_ctrls.msr[i] == msr_index )
@@ -214,10 +214,10 @@ static void core2_vpmu_set_msr_bitmap(unsigned long *msr_bitmap)
     int i;
 
     /* Allow Read/Write PMU Counters MSR Directly. */
-    for ( i = 0; i < core2_counters.num; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
     {
-        clear_bit(msraddr_to_bitpos(core2_counters.msr[i]), msr_bitmap);
-        clear_bit(msraddr_to_bitpos(core2_counters.msr[i]),
+        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
+        clear_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
                   msr_bitmap + 0x800/BYTES_PER_LONG);
     }
     for ( i = 0; i < core2_get_pmc_count(); i++ )
@@ -238,10 +238,10 @@ static void core2_vpmu_unset_msr_bitmap(unsigned long *msr_bitmap)
 {
     int i;
 
-    for ( i = 0; i < core2_counters.num; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
     {
-        set_bit(msraddr_to_bitpos(core2_counters.msr[i]), msr_bitmap);
-        set_bit(msraddr_to_bitpos(core2_counters.msr[i]),
+        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]), msr_bitmap);
+        set_bit(msraddr_to_bitpos(core2_fix_counters.msr[i]),
                 msr_bitmap + 0x800/BYTES_PER_LONG);
     }
     for ( i = 0; i < core2_get_pmc_count(); i++ )
@@ -261,8 +261,8 @@ static inline void __core2_vpmu_save(struct vcpu *v)
     int i;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_counters.num; i++ )
-        rdmsrl(core2_counters.msr[i], core2_vpmu_cxt->counters[i]);
+    for ( i = 0; i < core2_fix_counters.num; i++ )
+        rdmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
     core2_vpmu_cxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
@@ -292,8 +292,8 @@ static inline void __core2_vpmu_load(struct vcpu *v)
     int i;
     struct core2_vpmu_context *core2_vpmu_cxt = vcpu_vpmu(v)->context;
 
-    for ( i = 0; i < core2_counters.num; i++ )
-        wrmsrl(core2_counters.msr[i], core2_vpmu_cxt->counters[i]);
+    for ( i = 0; i < core2_fix_counters.num; i++ )
+        wrmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         wrmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
 
@@ -474,7 +474,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
 
         rdmsrl(MSR_CORE_PERF_FIXED_CTR_CTRL, non_global_ctrl);
         global_ctrl = msr_content >> 32;
-        for ( i = 0; i < 3; i++ )
+        for ( i = 0; i < core2_fix_counters.num; i++ )
         {
             core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
                 (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
@@ -486,7 +486,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         non_global_ctrl = msr_content;
         vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, &global_ctrl);
         global_ctrl >>= 32;
-        for ( i = 0; i < 3; i++ )
+        for ( i = 0; i < core2_fix_counters.num; i++ )
         {
             core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
                 (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
@@ -502,7 +502,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
                 (global_ctrl >> tmp) & (msr_content >> 22) & 1;
     }
 
-    for ( i = 0; i < 3; i++ )
+    for ( i = 0; i < core2_fix_counters.num; i++ )
         pmu_enable |= core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i];
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         pmu_enable |= core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i];
diff --git a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
index 2a9f346..4128f2a 100644
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
@@ -23,6 +23,11 @@
 #ifndef __ASM_X86_HVM_VPMU_CORE_H_
 #define __ASM_X86_HVM_VPMU_CORE_H_
 
+/* Currently only 3 fixed counters are supported. */
+#define VPMU_CORE2_NUM_FIXED 3
+/* Currently only 3 Non-architectual Performance Control MSRs */
+#define VPMU_CORE2_NUM_CTRLS 3
+
 struct arch_msr_pair {
     u64 counter;
     u64 control;
@@ -30,14 +35,14 @@ struct arch_msr_pair {
 
 struct core2_pmu_enable {
     char ds_area_enable;
-    char fixed_ctr_enable[3];
+    char fixed_ctr_enable[VPMU_CORE2_NUM_FIXED];
     char arch_pmc_enable[1];
 };
 
 struct core2_vpmu_context {
     struct core2_pmu_enable *pmu_enable;
-    u64 counters[3];
-    u64 ctrls[3];
+    u64 fix_counters[VPMU_CORE2_NUM_FIXED];
+    u64 ctrls[VPMU_CORE2_NUM_CTRLS];
     u64 global_ovf_status;
     u32 hw_lapic_lvtpc;
     struct arch_msr_pair arch_msr_pair[1];
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHh-0004Ne-DS; Mon, 08 Apr 2013 22:11:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHg-0004NO-Ef
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:28 +0000
Received: from [85.158.138.51:52835] by server-7.bemta-3.messagelabs.com id
	33/F9-06591-F8043615; Mon, 08 Apr 2013 22:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365459083!23307169!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6112 invoked from network); 8 Apr 2013 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHb-0001fE-O7
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHb-0007op-Lz
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:23 +0000
Date: Mon, 08 Apr 2013 22:11:23 +0000
Message-Id: <E1UPKHb-0007op-Lz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vpmu intel: Use PMU defines instead of
	numerals and bit masks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d2c79a9fae13993760b0c21473d7c7700759714
Author:     Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
AuthorDate: Mon Apr 8 17:57:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 8 17:57:17 2013 +0200

    vpmu intel: Use PMU defines instead of numerals and bit masks
    
    This patch uses the new defines in Intel vPMU to replace existing numerals and
    bit masks.
    
    Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   61 ++++++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index ceae50b..f14fbee 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -39,6 +39,32 @@
 #include <asm/hvm/vmx/vpmu_core2.h>
 
 /*
+ * See Intel SDM Vol 2a Instruction Set Reference chapter 3 for CPUID
+ * instruction.
+ * cpuid 0xa - Architectural Performance Monitoring Leaf
+ * Register eax
+ */
+#define PMU_VERSION_SHIFT        0  /* Version ID */
+#define PMU_VERSION_BITS         8  /* 8 bits 0..7 */
+#define PMU_VERSION_MASK         (((1 << PMU_VERSION_BITS) - 1) << PMU_VERSION_SHIFT)
+
+#define PMU_GENERAL_NR_SHIFT     8  /* Number of general pmu registers */
+#define PMU_GENERAL_NR_BITS      8  /* 8 bits 8..15 */
+#define PMU_GENERAL_NR_MASK      (((1 << PMU_GENERAL_NR_BITS) - 1) << PMU_GENERAL_NR_SHIFT)
+
+#define PMU_GENERAL_WIDTH_SHIFT 16  /* Width of general pmu registers */
+#define PMU_GENERAL_WIDTH_BITS   8  /* 8 bits 16..23 */
+#define PMU_GENERAL_WIDTH_MASK  (((1 << PMU_GENERAL_WIDTH_BITS) - 1) << PMU_GENERAL_WIDTH_SHIFT)
+/* Register edx */
+#define PMU_FIXED_NR_SHIFT       0  /* Number of fixed pmu registers */
+#define PMU_FIXED_NR_BITS        5  /* 5 bits 0..4 */
+#define PMU_FIXED_NR_MASK        (((1 << PMU_FIXED_NR_BITS) -1) << PMU_FIXED_NR_SHIFT)
+
+#define PMU_FIXED_WIDTH_SHIFT    5  /* Width of fixed pmu registers */
+#define PMU_FIXED_WIDTH_BITS     8  /* 8 bits 5..12 */
+#define PMU_FIXED_WIDTH_MASK     (((1 << PMU_FIXED_WIDTH_BITS) -1) << PMU_FIXED_WIDTH_SHIFT)
+
+/*
  * QUIRK to workaround an issue on Nehalem processors currently seen
  * on family 6 cpus E5520 (model 26) and X7542 (model 46).
  * The issue leads to endless PMC interrupt loops on the processor.
@@ -130,6 +156,9 @@ static const struct pmumsr core2_ctrls = {
 };
 static int arch_pmc_cnt;
 
+/*
+ * Read the number of general counters via CPUID.EAX[0xa].EAX[8..15]
+ */
 static int core2_get_pmc_count(void)
 {
     u32 eax, ebx, ecx, edx;
@@ -137,7 +166,7 @@ static int core2_get_pmc_count(void)
     if ( arch_pmc_cnt == 0 )
     {
         cpuid(0xa, &eax, &ebx, &ecx, &edx);
-        arch_pmc_cnt = (eax & 0xff00) >> 8;
+        arch_pmc_cnt = (eax & PMU_GENERAL_NR_MASK) >> PMU_GENERAL_NR_SHIFT;
     }
 
     return arch_pmc_cnt;
@@ -154,8 +183,9 @@ static u64 core2_calc_intial_glb_ctrl_msr(void)
 static int core2_get_bitwidth_fix_count(void)
 {
     u32 eax, ebx, ecx, edx;
+
     cpuid(0xa, &eax, &ebx, &ecx, &edx);
-    return ((edx & 0x1fe0) >> 5);
+    return ((edx & PMU_FIXED_WIDTH_MASK) >> PMU_FIXED_WIDTH_SHIFT);
 }
 
 static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)
@@ -731,23 +761,6 @@ struct arch_vpmu_ops core2_vpmu_ops = {
     .arch_vpmu_load = core2_vpmu_load
 };
 
-/*
- * See Intel SDM Vol 2a Instruction Set Referenc for CPUID instruction.
- * cpuid 0xa - Architectural Performance Monitoring Leaf
- * Register eax
- */
-#define X86_FEATURE_PMU_VER_OFF   0  /* Version ID */
-#define FEATURE_PMU_VER_BITS      8  /* 8 bits 0..7 */
-#define X86_FEATURE_NUM_GEN_OFF   8  /* Number of general pmu registers */
-#define FEATURE_NUM_GEN_BITS      8  /* 8 bits 8..15 */
-#define X86_FEATURE_GEN_WIDTH_OFF 16 /* Width of general pmu registers */
-#define FEATURE_GEN_WIDTH_BITS    8  /* 8 bits 16..23 */
-/* Register edx */
-#define X86_FEATURE_NUM_FIX_OFF   0  /* Number of fixed pmu registers */
-#define FEATURE_NUM_FIX_BITS      5  /* 5 bits 0..4 */
-#define X86_FEATURE_FIX_WIDTH_OFF 5  /* Width of fixed pmu registers */
-#define FEATURE_FIX_WIDTH_BITS    8  /* 8 bits 5..12 */
-
 static void core2_no_vpmu_do_cpuid(unsigned int input,
                                 unsigned int *eax, unsigned int *ebx,
                                 unsigned int *ecx, unsigned int *edx)
@@ -758,12 +771,12 @@ static void core2_no_vpmu_do_cpuid(unsigned int input,
      */
     if ( input == 0xa )
     {
-        *eax &= ~(((1 << FEATURE_PMU_VER_BITS) -1) << X86_FEATURE_PMU_VER_OFF);
-        *eax &= ~(((1 << FEATURE_NUM_GEN_BITS) -1) << X86_FEATURE_NUM_GEN_OFF);
-        *eax &= ~(((1 << FEATURE_GEN_WIDTH_BITS) -1) << X86_FEATURE_GEN_WIDTH_OFF);
+        *eax &= ~PMU_VERSION_MASK;
+        *eax &= ~PMU_GENERAL_NR_MASK;
+        *eax &= ~PMU_GENERAL_WIDTH_MASK;
 
-        *edx &= ~(((1 << FEATURE_NUM_FIX_BITS) -1) << X86_FEATURE_NUM_FIX_OFF);
-        *edx &= ~(((1 << FEATURE_FIX_WIDTH_BITS) -1) << X86_FEATURE_FIX_WIDTH_OFF);
+        *edx &= ~PMU_FIXED_NR_MASK;
+        *edx &= ~PMU_FIXED_WIDTH_MASK;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHh-0004Ne-DS; Mon, 08 Apr 2013 22:11:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHg-0004NO-Ef
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:28 +0000
Received: from [85.158.138.51:52835] by server-7.bemta-3.messagelabs.com id
	33/F9-06591-F8043615; Mon, 08 Apr 2013 22:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365459083!23307169!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6112 invoked from network); 8 Apr 2013 22:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHb-0001fE-O7
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHb-0007op-Lz
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:23 +0000
Date: Mon, 08 Apr 2013 22:11:23 +0000
Message-Id: <E1UPKHb-0007op-Lz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vpmu intel: Use PMU defines instead of
	numerals and bit masks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d2c79a9fae13993760b0c21473d7c7700759714
Author:     Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
AuthorDate: Mon Apr 8 17:57:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 8 17:57:17 2013 +0200

    vpmu intel: Use PMU defines instead of numerals and bit masks
    
    This patch uses the new defines in Intel vPMU to replace existing numerals and
    bit masks.
    
    Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   61 ++++++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index ceae50b..f14fbee 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -39,6 +39,32 @@
 #include <asm/hvm/vmx/vpmu_core2.h>
 
 /*
+ * See Intel SDM Vol 2a Instruction Set Reference chapter 3 for CPUID
+ * instruction.
+ * cpuid 0xa - Architectural Performance Monitoring Leaf
+ * Register eax
+ */
+#define PMU_VERSION_SHIFT        0  /* Version ID */
+#define PMU_VERSION_BITS         8  /* 8 bits 0..7 */
+#define PMU_VERSION_MASK         (((1 << PMU_VERSION_BITS) - 1) << PMU_VERSION_SHIFT)
+
+#define PMU_GENERAL_NR_SHIFT     8  /* Number of general pmu registers */
+#define PMU_GENERAL_NR_BITS      8  /* 8 bits 8..15 */
+#define PMU_GENERAL_NR_MASK      (((1 << PMU_GENERAL_NR_BITS) - 1) << PMU_GENERAL_NR_SHIFT)
+
+#define PMU_GENERAL_WIDTH_SHIFT 16  /* Width of general pmu registers */
+#define PMU_GENERAL_WIDTH_BITS   8  /* 8 bits 16..23 */
+#define PMU_GENERAL_WIDTH_MASK  (((1 << PMU_GENERAL_WIDTH_BITS) - 1) << PMU_GENERAL_WIDTH_SHIFT)
+/* Register edx */
+#define PMU_FIXED_NR_SHIFT       0  /* Number of fixed pmu registers */
+#define PMU_FIXED_NR_BITS        5  /* 5 bits 0..4 */
+#define PMU_FIXED_NR_MASK        (((1 << PMU_FIXED_NR_BITS) -1) << PMU_FIXED_NR_SHIFT)
+
+#define PMU_FIXED_WIDTH_SHIFT    5  /* Width of fixed pmu registers */
+#define PMU_FIXED_WIDTH_BITS     8  /* 8 bits 5..12 */
+#define PMU_FIXED_WIDTH_MASK     (((1 << PMU_FIXED_WIDTH_BITS) -1) << PMU_FIXED_WIDTH_SHIFT)
+
+/*
  * QUIRK to workaround an issue on Nehalem processors currently seen
  * on family 6 cpus E5520 (model 26) and X7542 (model 46).
  * The issue leads to endless PMC interrupt loops on the processor.
@@ -130,6 +156,9 @@ static const struct pmumsr core2_ctrls = {
 };
 static int arch_pmc_cnt;
 
+/*
+ * Read the number of general counters via CPUID.EAX[0xa].EAX[8..15]
+ */
 static int core2_get_pmc_count(void)
 {
     u32 eax, ebx, ecx, edx;
@@ -137,7 +166,7 @@ static int core2_get_pmc_count(void)
     if ( arch_pmc_cnt == 0 )
     {
         cpuid(0xa, &eax, &ebx, &ecx, &edx);
-        arch_pmc_cnt = (eax & 0xff00) >> 8;
+        arch_pmc_cnt = (eax & PMU_GENERAL_NR_MASK) >> PMU_GENERAL_NR_SHIFT;
     }
 
     return arch_pmc_cnt;
@@ -154,8 +183,9 @@ static u64 core2_calc_intial_glb_ctrl_msr(void)
 static int core2_get_bitwidth_fix_count(void)
 {
     u32 eax, ebx, ecx, edx;
+
     cpuid(0xa, &eax, &ebx, &ecx, &edx);
-    return ((edx & 0x1fe0) >> 5);
+    return ((edx & PMU_FIXED_WIDTH_MASK) >> PMU_FIXED_WIDTH_SHIFT);
 }
 
 static int is_core2_vpmu_msr(u32 msr_index, int *type, int *index)
@@ -731,23 +761,6 @@ struct arch_vpmu_ops core2_vpmu_ops = {
     .arch_vpmu_load = core2_vpmu_load
 };
 
-/*
- * See Intel SDM Vol 2a Instruction Set Referenc for CPUID instruction.
- * cpuid 0xa - Architectural Performance Monitoring Leaf
- * Register eax
- */
-#define X86_FEATURE_PMU_VER_OFF   0  /* Version ID */
-#define FEATURE_PMU_VER_BITS      8  /* 8 bits 0..7 */
-#define X86_FEATURE_NUM_GEN_OFF   8  /* Number of general pmu registers */
-#define FEATURE_NUM_GEN_BITS      8  /* 8 bits 8..15 */
-#define X86_FEATURE_GEN_WIDTH_OFF 16 /* Width of general pmu registers */
-#define FEATURE_GEN_WIDTH_BITS    8  /* 8 bits 16..23 */
-/* Register edx */
-#define X86_FEATURE_NUM_FIX_OFF   0  /* Number of fixed pmu registers */
-#define FEATURE_NUM_FIX_BITS      5  /* 5 bits 0..4 */
-#define X86_FEATURE_FIX_WIDTH_OFF 5  /* Width of fixed pmu registers */
-#define FEATURE_FIX_WIDTH_BITS    8  /* 8 bits 5..12 */
-
 static void core2_no_vpmu_do_cpuid(unsigned int input,
                                 unsigned int *eax, unsigned int *ebx,
                                 unsigned int *ecx, unsigned int *edx)
@@ -758,12 +771,12 @@ static void core2_no_vpmu_do_cpuid(unsigned int input,
      */
     if ( input == 0xa )
     {
-        *eax &= ~(((1 << FEATURE_PMU_VER_BITS) -1) << X86_FEATURE_PMU_VER_OFF);
-        *eax &= ~(((1 << FEATURE_NUM_GEN_BITS) -1) << X86_FEATURE_NUM_GEN_OFF);
-        *eax &= ~(((1 << FEATURE_GEN_WIDTH_BITS) -1) << X86_FEATURE_GEN_WIDTH_OFF);
+        *eax &= ~PMU_VERSION_MASK;
+        *eax &= ~PMU_GENERAL_NR_MASK;
+        *eax &= ~PMU_GENERAL_WIDTH_MASK;
 
-        *edx &= ~(((1 << FEATURE_NUM_FIX_BITS) -1) << X86_FEATURE_NUM_FIX_OFF);
-        *edx &= ~(((1 << FEATURE_FIX_WIDTH_BITS) -1) << X86_FEATURE_FIX_WIDTH_OFF);
+        *edx &= ~PMU_FIXED_NR_MASK;
+        *edx &= ~PMU_FIXED_WIDTH_MASK;
     }
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHq-0004P5-GN; Mon, 08 Apr 2013 22:11:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHp-0004On-1C
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:37 +0000
Received: from [85.158.139.83:55400] by server-16.bemta-5.messagelabs.com id
	35/36-02543-89043615; Mon, 08 Apr 2013 22:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1365459094!23529658!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12117 invoked from network); 8 Apr 2013 22:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHm-0001fM-5X
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHl-0007pF-UP
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:33 +0000
Date: Mon, 08 Apr 2013 22:11:33 +0000
Message-Id: <E1UPKHl-0007pF-UP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vpmu intel: Dump vpmu infos in 'q'
	keyhandler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b0fca9d8354e330e47f7d7bd7a34eda431fb370
Author:     Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
AuthorDate: Mon Apr 8 17:58:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 8 17:58:16 2013 +0200

    vpmu intel: Dump vpmu infos in 'q' keyhandler
    
    This patch extends the printout of the VPCU infos of the keyhandler 'q'.
    If vPMU is enabled is on the VCPU and active lines are printed like
    (when running HVM openSuSE-12.3 with 'perf top');
    
    (XEN)     vPMU running
    (XEN)       general_0: 0x000000ffffff3ae1 ctrl: 0x000000000053003c
    (XEN)       fixed_1:   0x000000ff90799188 ctrl: 0xb
    
    This means general counter 0 and fixed counter 1 are running with showing
    their contents and the contents of their configuration msr.
    
    Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/domain.c             |    3 ++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   63 +++++++++++++++++++++++++++++++++++--
 xen/arch/x86/hvm/vpmu.c           |    9 +++++
 xen/include/asm-x86/hvm/vpmu.h    |    2 +
 4 files changed, 74 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 8d30d08..0d7a40c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2093,6 +2093,9 @@ void arch_dump_domain_info(struct domain *d)
 void arch_dump_vcpu_info(struct vcpu *v)
 {
     paging_dump_vcpu_info(v);
+
+    if ( is_hvm_vcpu(v) )
+        vpmu_dump(v);
 }
 
 void domain_cpuid(
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index f14fbee..2313e39 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -133,6 +133,16 @@ static const u32 core2_fix_counters_msr[] = {
     MSR_CORE_PERF_FIXED_CTR2
 };
 
+/*
+ * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
+ * counters. 4 bits for every counter.
+ */
+#define FIXED_CTR_CTRL_BITS 4
+#define FIXED_CTR_CTRL_MASK ((1 << FIXED_CTR_CTRL_BITS) - 1)
+
+/* The index into the core2_ctrls_msr[] of this MSR used in core2_vpmu_dump() */
+#define MSR_CORE_PERF_FIXED_CTR_CTRL_IDX 0
+
 /* Core 2 Non-architectual Performance Control MSRs. */
 static const u32 core2_ctrls_msr[] = {
     MSR_CORE_PERF_FIXED_CTR_CTRL,
@@ -508,7 +518,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         {
             core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
                 (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
-            non_global_ctrl >>= 4;
+            non_global_ctrl >>= FIXED_CTR_CTRL_BITS;
             global_ctrl >>= 1;
         }
         break;
@@ -565,7 +575,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
             if  ( msr == MSR_IA32_DS_AREA )
                 break;
             /* 4 bits per counter, currently 3 fixed counters implemented. */
-            mask = ~((1ull << (3 * 4)) - 1);
+            mask = ~((1ull << (VPMU_CORE2_NUM_FIXED * FIXED_CTR_CTRL_BITS)) - 1);
             if (msr_content & mask)
                 inject_gp = 1;
             break;
@@ -645,6 +655,52 @@ static void core2_vpmu_do_cpuid(unsigned int input,
     }
 }
 
+/* Dump vpmu info on console, called in the context of keyhandler 'q'. */
+static void core2_vpmu_dump(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    int i, num;
+    struct core2_vpmu_context *core2_vpmu_cxt = NULL;
+    u64 val;
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+         return;
+
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) )
+    {
+        if ( vpmu_set(vpmu, VPMU_CONTEXT_LOADED) )
+            printk("    vPMU loaded\n");
+        else
+            printk("    vPMU allocated\n");
+        return;
+    }
+
+    printk("    vPMU running\n");
+    core2_vpmu_cxt = vpmu->context;
+    num = core2_get_pmc_count();
+    /* Print the contents of the counter and its configuration msr. */
+    for ( i = 0; i < num; i++ )
+    {
+        struct arch_msr_pair* msr_pair = core2_vpmu_cxt->arch_msr_pair;
+        if ( core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i] )
+            printk("      general_%d: 0x%016lx ctrl: 0x%016lx\n",
+                             i, msr_pair[i].counter, msr_pair[i].control);
+    }
+    /*
+     * The configuration of the fixed counter is 4 bits each in the
+     * MSR_CORE_PERF_FIXED_CTR_CTRL.
+     */
+    val = core2_vpmu_cxt->ctrls[MSR_CORE_PERF_FIXED_CTR_CTRL_IDX];
+    for ( i = 0; i < core2_fix_counters.num; i++ )
+    {
+        if ( core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] )
+            printk("      fixed_%d:   0x%016lx ctrl: 0x%lx\n",
+                             i, core2_vpmu_cxt->fix_counters[i],
+                             val & FIXED_CTR_CTRL_MASK);
+        val >>= FIXED_CTR_CTRL_BITS;
+    }
+}
+
 static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
@@ -758,7 +814,8 @@ struct arch_vpmu_ops core2_vpmu_ops = {
     .do_cpuid = core2_vpmu_do_cpuid,
     .arch_vpmu_destroy = core2_vpmu_destroy,
     .arch_vpmu_save = core2_vpmu_save,
-    .arch_vpmu_load = core2_vpmu_load
+    .arch_vpmu_load = core2_vpmu_load,
+    .arch_vpmu_dump = core2_vpmu_dump
 };
 
 static void core2_no_vpmu_do_cpuid(unsigned int input,
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 0b843c1..3b69580 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -154,3 +154,12 @@ void vpmu_destroy(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_destroy(v);
 }
 
+/* Dump some vpmu informations on console. Used in keyhandler dump_domains(). */
+void vpmu_dump(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_dump )
+        vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
+}
+
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 84e4c42..cd31f5e 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -54,6 +54,7 @@ struct arch_vpmu_ops {
     void (*arch_vpmu_destroy)(struct vcpu *v);
     void (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);
+    void (*arch_vpmu_dump)(struct vcpu *v);
 };
 
 int vmx_vpmu_initialise(struct vcpu *, unsigned int flags);
@@ -87,6 +88,7 @@ void vpmu_initialise(struct vcpu *v);
 void vpmu_destroy(struct vcpu *v);
 void vpmu_save(struct vcpu *v);
 void vpmu_load(struct vcpu *v);
+void vpmu_dump(struct vcpu *v);
 
 extern int acquire_pmu_ownership(int pmu_ownership);
 extern void release_pmu_ownership(int pmu_ownership);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKHq-0004P5-GN; Mon, 08 Apr 2013 22:11:38 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHp-0004On-1C
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:37 +0000
Received: from [85.158.139.83:55400] by server-16.bemta-5.messagelabs.com id
	35/36-02543-89043615; Mon, 08 Apr 2013 22:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1365459094!23529658!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12117 invoked from network); 8 Apr 2013 22:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHm-0001fM-5X
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHl-0007pF-UP
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:33 +0000
Date: Mon, 08 Apr 2013 22:11:33 +0000
Message-Id: <E1UPKHl-0007pF-UP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] vpmu intel: Dump vpmu infos in 'q'
	keyhandler
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2b0fca9d8354e330e47f7d7bd7a34eda431fb370
Author:     Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
AuthorDate: Mon Apr 8 17:58:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 8 17:58:16 2013 +0200

    vpmu intel: Dump vpmu infos in 'q' keyhandler
    
    This patch extends the printout of the VPCU infos of the keyhandler 'q'.
    If vPMU is enabled is on the VCPU and active lines are printed like
    (when running HVM openSuSE-12.3 with 'perf top');
    
    (XEN)     vPMU running
    (XEN)       general_0: 0x000000ffffff3ae1 ctrl: 0x000000000053003c
    (XEN)       fixed_1:   0x000000ff90799188 ctrl: 0xb
    
    This means general counter 0 and fixed counter 1 are running with showing
    their contents and the contents of their configuration msr.
    
    Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/domain.c             |    3 ++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   63 +++++++++++++++++++++++++++++++++++--
 xen/arch/x86/hvm/vpmu.c           |    9 +++++
 xen/include/asm-x86/hvm/vpmu.h    |    2 +
 4 files changed, 74 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 8d30d08..0d7a40c 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2093,6 +2093,9 @@ void arch_dump_domain_info(struct domain *d)
 void arch_dump_vcpu_info(struct vcpu *v)
 {
     paging_dump_vcpu_info(v);
+
+    if ( is_hvm_vcpu(v) )
+        vpmu_dump(v);
 }
 
 void domain_cpuid(
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index f14fbee..2313e39 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -133,6 +133,16 @@ static const u32 core2_fix_counters_msr[] = {
     MSR_CORE_PERF_FIXED_CTR2
 };
 
+/*
+ * MSR_CORE_PERF_FIXED_CTR_CTRL contains the configuration of all fixed
+ * counters. 4 bits for every counter.
+ */
+#define FIXED_CTR_CTRL_BITS 4
+#define FIXED_CTR_CTRL_MASK ((1 << FIXED_CTR_CTRL_BITS) - 1)
+
+/* The index into the core2_ctrls_msr[] of this MSR used in core2_vpmu_dump() */
+#define MSR_CORE_PERF_FIXED_CTR_CTRL_IDX 0
+
 /* Core 2 Non-architectual Performance Control MSRs. */
 static const u32 core2_ctrls_msr[] = {
     MSR_CORE_PERF_FIXED_CTR_CTRL,
@@ -508,7 +518,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         {
             core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] =
                 (global_ctrl & 1) & ((non_global_ctrl & 0x3)? 1: 0);
-            non_global_ctrl >>= 4;
+            non_global_ctrl >>= FIXED_CTR_CTRL_BITS;
             global_ctrl >>= 1;
         }
         break;
@@ -565,7 +575,7 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
             if  ( msr == MSR_IA32_DS_AREA )
                 break;
             /* 4 bits per counter, currently 3 fixed counters implemented. */
-            mask = ~((1ull << (3 * 4)) - 1);
+            mask = ~((1ull << (VPMU_CORE2_NUM_FIXED * FIXED_CTR_CTRL_BITS)) - 1);
             if (msr_content & mask)
                 inject_gp = 1;
             break;
@@ -645,6 +655,52 @@ static void core2_vpmu_do_cpuid(unsigned int input,
     }
 }
 
+/* Dump vpmu info on console, called in the context of keyhandler 'q'. */
+static void core2_vpmu_dump(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    int i, num;
+    struct core2_vpmu_context *core2_vpmu_cxt = NULL;
+    u64 val;
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+         return;
+
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) )
+    {
+        if ( vpmu_set(vpmu, VPMU_CONTEXT_LOADED) )
+            printk("    vPMU loaded\n");
+        else
+            printk("    vPMU allocated\n");
+        return;
+    }
+
+    printk("    vPMU running\n");
+    core2_vpmu_cxt = vpmu->context;
+    num = core2_get_pmc_count();
+    /* Print the contents of the counter and its configuration msr. */
+    for ( i = 0; i < num; i++ )
+    {
+        struct arch_msr_pair* msr_pair = core2_vpmu_cxt->arch_msr_pair;
+        if ( core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i] )
+            printk("      general_%d: 0x%016lx ctrl: 0x%016lx\n",
+                             i, msr_pair[i].counter, msr_pair[i].control);
+    }
+    /*
+     * The configuration of the fixed counter is 4 bits each in the
+     * MSR_CORE_PERF_FIXED_CTR_CTRL.
+     */
+    val = core2_vpmu_cxt->ctrls[MSR_CORE_PERF_FIXED_CTR_CTRL_IDX];
+    for ( i = 0; i < core2_fix_counters.num; i++ )
+    {
+        if ( core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i] )
+            printk("      fixed_%d:   0x%016lx ctrl: 0x%lx\n",
+                             i, core2_vpmu_cxt->fix_counters[i],
+                             val & FIXED_CTR_CTRL_MASK);
+        val >>= FIXED_CTR_CTRL_BITS;
+    }
+}
+
 static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
@@ -758,7 +814,8 @@ struct arch_vpmu_ops core2_vpmu_ops = {
     .do_cpuid = core2_vpmu_do_cpuid,
     .arch_vpmu_destroy = core2_vpmu_destroy,
     .arch_vpmu_save = core2_vpmu_save,
-    .arch_vpmu_load = core2_vpmu_load
+    .arch_vpmu_load = core2_vpmu_load,
+    .arch_vpmu_dump = core2_vpmu_dump
 };
 
 static void core2_no_vpmu_do_cpuid(unsigned int input,
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 0b843c1..3b69580 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -154,3 +154,12 @@ void vpmu_destroy(struct vcpu *v)
         vpmu->arch_vpmu_ops->arch_vpmu_destroy(v);
 }
 
+/* Dump some vpmu informations on console. Used in keyhandler dump_domains(). */
+void vpmu_dump(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_dump )
+        vpmu->arch_vpmu_ops->arch_vpmu_dump(v);
+}
+
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 84e4c42..cd31f5e 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -54,6 +54,7 @@ struct arch_vpmu_ops {
     void (*arch_vpmu_destroy)(struct vcpu *v);
     void (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);
+    void (*arch_vpmu_dump)(struct vcpu *v);
 };
 
 int vmx_vpmu_initialise(struct vcpu *, unsigned int flags);
@@ -87,6 +88,7 @@ void vpmu_initialise(struct vcpu *v);
 void vpmu_destroy(struct vcpu *v);
 void vpmu_save(struct vcpu *v);
 void vpmu_load(struct vcpu *v);
+void vpmu_dump(struct vcpu *v);
 
 extern int acquire_pmu_ownership(int pmu_ownership);
 extern void release_pmu_ownership(int pmu_ownership);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKI0-0004R9-LU; Mon, 08 Apr 2013 22:11:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHz-0004Qi-9t
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:47 +0000
Received: from [193.109.254.147:24154] by server-4.bemta-14.messagelabs.com id
	8C/12-17387-2A043615; Mon, 08 Apr 2013 22:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1365459104!8735947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18440 invoked from network); 8 Apr 2013 22:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHw-0001fS-Ai
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHw-0007pb-9S
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:44 +0000
Date: Mon, 08 Apr 2013 22:11:44 +0000
Message-Id: <E1UPKHw-0007pb-9S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: Correct META for libxl
	bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4932b39319229291ff019ba23cab465988e02d8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 3 20:24:47 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 17:00:28 2013 +0100

    tools/ocaml: Correct META for libxl bindings
    
    This was missed by c/s 23936:cdb34816a40a which renamed xl -> xenlight
    
    [ 23936:cdb34816a40a is 7ceaa0c7449e841d7ca7db889c3041dc3fedbb3b in git -iwj ]
    
    Reported-by: alien@rmail.be
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/libs/xl/META.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xl/META.in b/tools/ocaml/libs/xl/META.in
index 9c4405a..fe2c60b 100644
--- a/tools/ocaml/libs/xl/META.in
+++ b/tools/ocaml/libs/xl/META.in
@@ -1,4 +1,4 @@
 version = "@VERSION@"
 description = "Xen Toolstack Library"
-archive(byte) = "xl.cma"
-archive(native) = "xl.cmxa"
+archive(byte) = "xenlight.cma"
+archive(native) = "xenlight.cmxa"
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:11:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:11:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKI0-0004R9-LU; Mon, 08 Apr 2013 22:11:48 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHz-0004Qi-9t
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:47 +0000
Received: from [193.109.254.147:24154] by server-4.bemta-14.messagelabs.com id
	8C/12-17387-2A043615; Mon, 08 Apr 2013 22:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1365459104!8735947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18440 invoked from network); 8 Apr 2013 22:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHw-0001fS-Ai
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKHw-0007pb-9S
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:44 +0000
Date: Mon, 08 Apr 2013 22:11:44 +0000
Message-Id: <E1UPKHw-0007pb-9S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: Correct META for libxl
	bindings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4932b39319229291ff019ba23cab465988e02d8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Apr 3 20:24:47 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 17:00:28 2013 +0100

    tools/ocaml: Correct META for libxl bindings
    
    This was missed by c/s 23936:cdb34816a40a which renamed xl -> xenlight
    
    [ 23936:cdb34816a40a is 7ceaa0c7449e841d7ca7db889c3041dc3fedbb3b in git -iwj ]
    
    Reported-by: alien@rmail.be
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/libs/xl/META.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xl/META.in b/tools/ocaml/libs/xl/META.in
index 9c4405a..fe2c60b 100644
--- a/tools/ocaml/libs/xl/META.in
+++ b/tools/ocaml/libs/xl/META.in
@@ -1,4 +1,4 @@
 version = "@VERSION@"
 description = "Xen Toolstack Library"
-archive(byte) = "xl.cma"
-archive(native) = "xl.cmxa"
+archive(byte) = "xenlight.cma"
+archive(native) = "xenlight.cmxa"
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:12:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:12:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKIB-0004Tf-OU; Mon, 08 Apr 2013 22:11:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIA-0004TH-TZ
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:59 +0000
Received: from [85.158.137.99:43840] by server-1.bemta-3.messagelabs.com id
	14/22-13706-EA043615; Mon, 08 Apr 2013 22:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1365459116!12369475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22067 invoked from network); 8 Apr 2013 22:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKI6-0001ff-OA
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKI6-0007px-Fe
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:54 +0000
Date: Mon, 08 Apr 2013 22:11:54 +0000
Message-Id: <E1UPKI6-0007px-Fe@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: extend autoballoon xl.conf option
	with an "auto" option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 48f4af18b3e1e36bf0eda793455ecaea9a316c65
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Apr 4 17:21:12 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 17:04:52 2013 +0100

    xl: extend autoballoon xl.conf option with an "auto" option
    
    autoballoon=1 is not recommened if dom0_mem was used to reduce the
    amount of dom0 memory.  Instead of requiring users to change xl.conf
    if they do this, extend the autoballoon option with a new choice:
    "auto".
    
    With autoballoon="auto", autoballooning will be disabled if dom0_mem
    was used on the Xen command line.
    
    For consistency, accept "on" and "off" as valid autoballoon options (1
    and 0 are still accepted).
    
    The default remains "on" for now.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.conf.pod.5 |   21 ++++++++++++++-------
 tools/examples/xl.conf |    7 ++++---
 tools/libxl/xl.c       |   36 ++++++++++++++++++++++++++++++++++--
 3 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index 7b9fcac..a4ce3e5 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -45,15 +45,22 @@ The semantics of each C<KEY> defines which form of C<VALUE> is required.
 
 =over 4
 
-=item B<autoballoon=BOOLEAN>
+=item B<autoballoon="off"|"on"|"auto">
 
-If disabled then C<xl> will not attempt to reduce the amount of memory
-assigned to domain 0 in order to create free memory when starting a
-new domain. You are strongly recommended to set this to C<0>
-(C<False>) if you use the C<dom0_mem> hypervisor command line to
-reduce the amount of memory given to domain 0 by default.
+If set to "on" then C<xl> will automatically reduce the amount of
+memory assigned to domain 0 in order to free memory for new domains.
 
-Default: C<1>
+If set to "off" then C<xl> will not automatically reduce the amount of
+domain 0 memory.
+
+If set to "auto" then auto-ballooning will be disabled if the
+C<dom0_mem> option was provided on the Xen command line.
+
+You are strongly recommended to set this to C<"off"> (or C<"auto">) if
+you use the C<dom0_mem> hypervisor command line to reduce the amount
+of memory given to domain 0 by default.
+
+Default: C<"on">
 
 =item B<run_hotplug_scripts=BOOLEAN>
 
diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index b0caa32..50cba2b 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -1,8 +1,9 @@
 ## Global XL config file ##
 
-# automatically balloon down dom0 when xen doesn't have enough free
-# memory to create a domain
-#autoballoon=1
+# Control whether dom0 is ballooned down when xen doesn't have enough
+# free memory to create a domain.  "auto" means only balloon if dom0
+# starts with all the host's memory.
+#autoballoon="auto"
 
 # full path of the lockfile used by xl during domain creation
 #lockfile="/var/lock/xl"
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 4c598db..ac41fcd 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <ctype.h>
 #include <inttypes.h>
+#include <regex.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -48,6 +49,29 @@ enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
+/* Get autoballoon option based on presence of dom0_mem Xen command
+   line option. */
+static int auto_autoballoon(void)
+{
+    const libxl_version_info *info;
+    regex_t regex;
+    int ret;
+
+    info = libxl_get_version_info(ctx);
+    if (!info)
+        return 1; /* default to on */
+
+    ret = regcomp(&regex,
+                  "(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )",
+                  REG_NOSUB | REG_EXTENDED);
+    if (ret)
+        return 1;
+
+    ret = regexec(&regex, info->commandline, 0, NULL, 0);
+    regfree(&regex);
+    return ret == REG_NOMATCH;
+}
+
 static void parse_global_config(const char *configfile,
                               const char *configfile_data,
                               int configfile_len)
@@ -69,8 +93,16 @@ static void parse_global_config(const char *configfile,
         exit(1);
     }
 
-    if (!xlu_cfg_get_long (config, "autoballoon", &l, 0))
-        autoballoon = l;
+    if (!xlu_cfg_get_string(config, "autoballoon", &buf, 0)) {
+        if (!strcmp(buf, "on") || !strcmp(buf, "1"))
+            autoballoon = 1;
+        else if (!strcmp(buf, "off") || !strcmp(buf, "0"))
+            autoballoon = 0;
+        else if (!strcmp(buf, "auto"))
+            autoballoon = auto_autoballoon();
+        else
+            fprintf(stderr, "invalid autoballoon option");
+    }
 
     if (!xlu_cfg_get_long (config, "run_hotplug_scripts", &l, 0))
         run_hotplug_scripts = l;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:12:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:12:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKIB-0004Tf-OU; Mon, 08 Apr 2013 22:11:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIA-0004TH-TZ
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:59 +0000
Received: from [85.158.137.99:43840] by server-1.bemta-3.messagelabs.com id
	14/22-13706-EA043615; Mon, 08 Apr 2013 22:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1365459116!12369475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22067 invoked from network); 8 Apr 2013 22:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKI6-0001ff-OA
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKI6-0007px-Fe
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:11:54 +0000
Date: Mon, 08 Apr 2013 22:11:54 +0000
Message-Id: <E1UPKI6-0007px-Fe@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: extend autoballoon xl.conf option
	with an "auto" option
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 48f4af18b3e1e36bf0eda793455ecaea9a316c65
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Apr 4 17:21:12 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 17:04:52 2013 +0100

    xl: extend autoballoon xl.conf option with an "auto" option
    
    autoballoon=1 is not recommened if dom0_mem was used to reduce the
    amount of dom0 memory.  Instead of requiring users to change xl.conf
    if they do this, extend the autoballoon option with a new choice:
    "auto".
    
    With autoballoon="auto", autoballooning will be disabled if dom0_mem
    was used on the Xen command line.
    
    For consistency, accept "on" and "off" as valid autoballoon options (1
    and 0 are still accepted).
    
    The default remains "on" for now.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.conf.pod.5 |   21 ++++++++++++++-------
 tools/examples/xl.conf |    7 ++++---
 tools/libxl/xl.c       |   36 ++++++++++++++++++++++++++++++++++--
 3 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index 7b9fcac..a4ce3e5 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -45,15 +45,22 @@ The semantics of each C<KEY> defines which form of C<VALUE> is required.
 
 =over 4
 
-=item B<autoballoon=BOOLEAN>
+=item B<autoballoon="off"|"on"|"auto">
 
-If disabled then C<xl> will not attempt to reduce the amount of memory
-assigned to domain 0 in order to create free memory when starting a
-new domain. You are strongly recommended to set this to C<0>
-(C<False>) if you use the C<dom0_mem> hypervisor command line to
-reduce the amount of memory given to domain 0 by default.
+If set to "on" then C<xl> will automatically reduce the amount of
+memory assigned to domain 0 in order to free memory for new domains.
 
-Default: C<1>
+If set to "off" then C<xl> will not automatically reduce the amount of
+domain 0 memory.
+
+If set to "auto" then auto-ballooning will be disabled if the
+C<dom0_mem> option was provided on the Xen command line.
+
+You are strongly recommended to set this to C<"off"> (or C<"auto">) if
+you use the C<dom0_mem> hypervisor command line to reduce the amount
+of memory given to domain 0 by default.
+
+Default: C<"on">
 
 =item B<run_hotplug_scripts=BOOLEAN>
 
diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index b0caa32..50cba2b 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -1,8 +1,9 @@
 ## Global XL config file ##
 
-# automatically balloon down dom0 when xen doesn't have enough free
-# memory to create a domain
-#autoballoon=1
+# Control whether dom0 is ballooned down when xen doesn't have enough
+# free memory to create a domain.  "auto" means only balloon if dom0
+# starts with all the host's memory.
+#autoballoon="auto"
 
 # full path of the lockfile used by xl during domain creation
 #lockfile="/var/lock/xl"
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 4c598db..ac41fcd 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <ctype.h>
 #include <inttypes.h>
+#include <regex.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -48,6 +49,29 @@ enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
+/* Get autoballoon option based on presence of dom0_mem Xen command
+   line option. */
+static int auto_autoballoon(void)
+{
+    const libxl_version_info *info;
+    regex_t regex;
+    int ret;
+
+    info = libxl_get_version_info(ctx);
+    if (!info)
+        return 1; /* default to on */
+
+    ret = regcomp(&regex,
+                  "(^| )dom0_mem=((|min:|max:)[0-9]+[bBkKmMgG]?,?)+($| )",
+                  REG_NOSUB | REG_EXTENDED);
+    if (ret)
+        return 1;
+
+    ret = regexec(&regex, info->commandline, 0, NULL, 0);
+    regfree(&regex);
+    return ret == REG_NOMATCH;
+}
+
 static void parse_global_config(const char *configfile,
                               const char *configfile_data,
                               int configfile_len)
@@ -69,8 +93,16 @@ static void parse_global_config(const char *configfile,
         exit(1);
     }
 
-    if (!xlu_cfg_get_long (config, "autoballoon", &l, 0))
-        autoballoon = l;
+    if (!xlu_cfg_get_string(config, "autoballoon", &buf, 0)) {
+        if (!strcmp(buf, "on") || !strcmp(buf, "1"))
+            autoballoon = 1;
+        else if (!strcmp(buf, "off") || !strcmp(buf, "0"))
+            autoballoon = 0;
+        else if (!strcmp(buf, "auto"))
+            autoballoon = auto_autoballoon();
+        else
+            fprintf(stderr, "invalid autoballoon option");
+    }
 
     if (!xlu_cfg_get_long (config, "run_hotplug_scripts", &l, 0))
         run_hotplug_scripts = l;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:12:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKIK-0004Vf-Sp; Mon, 08 Apr 2013 22:12:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIJ-0004V5-Kn
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:12:07 +0000
Received: from [85.158.137.99:44112] by server-3.bemta-3.messagelabs.com id
	59/9A-26934-6B043615; Mon, 08 Apr 2013 22:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1365459125!14579897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30943 invoked from network); 8 Apr 2013 22:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIH-0001gC-0E
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIG-0007qq-UO
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:12:04 +0000
Date: Mon, 08 Apr 2013 22:12:04 +0000
Message-Id: <E1UPKIG-0007qq-UO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: default autoballoon option to
	"auto"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0e6086a7de36e539d54eb82e61cf94e7f5363c02
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Apr 4 17:21:12 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 17:05:46 2013 +0100

    xl: default autoballoon option to "auto"
    
    In xl.conf, autoballoon="auto" will do the right thing for most
    people.  Make it the default (instead of "on").
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.conf.pod.5 |    2 +-
 tools/libxl/xl.c       |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index a4ce3e5..aaf8da1 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -60,7 +60,7 @@ You are strongly recommended to set this to C<"off"> (or C<"auto">) if
 you use the C<dom0_mem> hypervisor command line to reduce the amount
 of memory given to domain 0 by default.
 
-Default: C<"on">
+Default: C<"auto">
 
 =item B<run_hotplug_scripts=BOOLEAN>
 
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index ac41fcd..16cd3f3 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -38,7 +38,7 @@
 xentoollog_logger_stdiostream *logger;
 int dryrun_only;
 int force_execution;
-int autoballoon = 1;
+int autoballoon = -1;
 char *blkdev_start;
 int run_hotplug_scripts = 1;
 char *lockfile;
@@ -99,10 +99,12 @@ static void parse_global_config(const char *configfile,
         else if (!strcmp(buf, "off") || !strcmp(buf, "0"))
             autoballoon = 0;
         else if (!strcmp(buf, "auto"))
-            autoballoon = auto_autoballoon();
+            autoballoon = -1;
         else
             fprintf(stderr, "invalid autoballoon option");
     }
+    if (autoballoon == -1)
+        autoballoon = auto_autoballoon();
 
     if (!xlu_cfg_get_long (config, "run_hotplug_scripts", &l, 0))
         run_hotplug_scripts = l;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 08 22:12:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 08 Apr 2013 22:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPKIK-0004Vf-Sp; Mon, 08 Apr 2013 22:12:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIJ-0004V5-Kn
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:12:07 +0000
Received: from [85.158.137.99:44112] by server-3.bemta-3.messagelabs.com id
	59/9A-26934-6B043615; Mon, 08 Apr 2013 22:12:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1365459125!14579897!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30943 invoked from network); 8 Apr 2013 22:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Apr 2013 22:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIH-0001gC-0E
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPKIG-0007qq-UO
	for xen-changelog@lists.xensource.com; Mon, 08 Apr 2013 22:12:04 +0000
Date: Mon, 08 Apr 2013 22:12:04 +0000
Message-Id: <E1UPKIG-0007qq-UO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: default autoballoon option to
	"auto"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0e6086a7de36e539d54eb82e61cf94e7f5363c02
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Thu Apr 4 17:21:12 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 17:05:46 2013 +0100

    xl: default autoballoon option to "auto"
    
    In xl.conf, autoballoon="auto" will do the right thing for most
    people.  Make it the default (instead of "on").
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.conf.pod.5 |    2 +-
 tools/libxl/xl.c       |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index a4ce3e5..aaf8da1 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -60,7 +60,7 @@ You are strongly recommended to set this to C<"off"> (or C<"auto">) if
 you use the C<dom0_mem> hypervisor command line to reduce the amount
 of memory given to domain 0 by default.
 
-Default: C<"on">
+Default: C<"auto">
 
 =item B<run_hotplug_scripts=BOOLEAN>
 
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index ac41fcd..16cd3f3 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -38,7 +38,7 @@
 xentoollog_logger_stdiostream *logger;
 int dryrun_only;
 int force_execution;
-int autoballoon = 1;
+int autoballoon = -1;
 char *blkdev_start;
 int run_hotplug_scripts = 1;
 char *lockfile;
@@ -99,10 +99,12 @@ static void parse_global_config(const char *configfile,
         else if (!strcmp(buf, "off") || !strcmp(buf, "0"))
             autoballoon = 0;
         else if (!strcmp(buf, "auto"))
-            autoballoon = auto_autoballoon();
+            autoballoon = -1;
         else
             fprintf(stderr, "invalid autoballoon option");
     }
+    if (autoballoon == -1)
+        autoballoon = auto_autoballoon();
 
     if (!xlu_cfg_get_long (config, "run_hotplug_scripts", &l, 0))
         run_hotplug_scripts = l;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 09 04:11:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Apr 2013 04:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPPtm-0007lD-C9; Tue, 09 Apr 2013 04:11:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtk-0007l2-BS
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:08 +0000
Received: from [85.158.143.99:45168] by server-1.bemta-4.messagelabs.com id
	41/D3-06203-BD493615; Tue, 09 Apr 2013 04:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1365480664!20390082!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6504 invoked from network); 9 Apr 2013 04:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Apr 2013 04:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtf-0004Cj-C9
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPte-00087U-Un
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:03 +0000
Date: Tue, 09 Apr 2013 04:11:02 +0000
Message-Id: <E1UPPte-00087U-Un@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Allow multiple USB devices on
	HVM domain creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac16730d0339d41fd7d129a5cb2d40ed67a303d9
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Tue Apr 2 14:11:33 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 18:00:29 2013 +0100

    libxl: Allow multiple USB devices on HVM domain creation
    
    This patch allows an HVM domain to be created with multiple USB
    devices.
    
    Since the previous interface only allowed the passing of a single
    device, this requires us to add a new element to the hvm struct of
    libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
    old element, usbdevice, remains.
    
    If hvm.usbdevice_list is set, each device listed will cause an extra
    "-usbdevice [foo]" to be appended to the qemu command line.
    
    Callers may set either hvm.usbdevice or hvm.usbdevice_list, but not
    both; libxl will throw an error if both are set.
    
    In order to allow users of libxl to write software compatible with
    older versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.
    If this is defined, callers may use either hvm.usbdevice or
    hvm.usbdevice_list; otherwise, only hvm.usbdevice will be available.
    
    as applied:
     - Fix whitespace errors -iwj
    v3:
     - Duplicate functionality in both "new" and "old", since we're not
       unifying the two anymore.
    v2:
     - Throw an error if both usbdevice and usbdevice_list are set
     - Update and clarify definition based on feedback
     - Previous patches means this works for both traditional and upstream
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.h         |   16 ++++++++++++++++
 tools/libxl/libxl_dm.c      |   38 ++++++++++++++++++++++++++++++++++++--
 tools/libxl/libxl_types.idl |    1 +
 3 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 030aa86..d18d22c 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -273,6 +273,22 @@
 #endif
 #endif
 
+/*
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.usbdevice.  Note
+ * that this means only one device can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 82e30df..d10a58f 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -198,11 +198,28 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice
+            || b_info->u.hvm.usbdevice_list) {
+            if ( b_info->u.hvm.usbdevice && b_info->u.hvm.usbdevice_list )
+            {
+                LOG(ERROR, "%s: Both usbdevice and usbdevice_list set",
+                    __func__);
+                return NULL;
+            }
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
@@ -479,11 +496,28 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_vappend(dm_args, "-boot",
                     libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice
+            || b_info->u.hvm.usbdevice_list) {
+            if ( b_info->u.hvm.usbdevice && b_info->u.hvm.usbdevice_list )
+            {
+                LOG(ERROR, "%s: Both usbdevice and usbdevice_list set",
+                    __func__);
+                return NULL;
+            }
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index f3c212b..6cb6de6 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -330,6 +330,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
+                                       ("usbdevice_list",   libxl_string_list),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 09 04:11:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Apr 2013 04:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPPtm-0007lD-C9; Tue, 09 Apr 2013 04:11:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtk-0007l2-BS
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:08 +0000
Received: from [85.158.143.99:45168] by server-1.bemta-4.messagelabs.com id
	41/D3-06203-BD493615; Tue, 09 Apr 2013 04:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1365480664!20390082!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6504 invoked from network); 9 Apr 2013 04:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Apr 2013 04:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtf-0004Cj-C9
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPte-00087U-Un
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:03 +0000
Date: Tue, 09 Apr 2013 04:11:02 +0000
Message-Id: <E1UPPte-00087U-Un@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Allow multiple USB devices on
	HVM domain creation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac16730d0339d41fd7d129a5cb2d40ed67a303d9
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Tue Apr 2 14:11:33 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 18:00:29 2013 +0100

    libxl: Allow multiple USB devices on HVM domain creation
    
    This patch allows an HVM domain to be created with multiple USB
    devices.
    
    Since the previous interface only allowed the passing of a single
    device, this requires us to add a new element to the hvm struct of
    libxl_domain_build_info -- usbdevice_list.  For API compatibility, the
    old element, usbdevice, remains.
    
    If hvm.usbdevice_list is set, each device listed will cause an extra
    "-usbdevice [foo]" to be appended to the qemu command line.
    
    Callers may set either hvm.usbdevice or hvm.usbdevice_list, but not
    both; libxl will throw an error if both are set.
    
    In order to allow users of libxl to write software compatible with
    older versions of libxl, also define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST.
    If this is defined, callers may use either hvm.usbdevice or
    hvm.usbdevice_list; otherwise, only hvm.usbdevice will be available.
    
    as applied:
     - Fix whitespace errors -iwj
    v3:
     - Duplicate functionality in both "new" and "old", since we're not
       unifying the two anymore.
    v2:
     - Throw an error if both usbdevice and usbdevice_list are set
     - Update and clarify definition based on feedback
     - Previous patches means this works for both traditional and upstream
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.h         |   16 ++++++++++++++++
 tools/libxl/libxl_dm.c      |   38 ++++++++++++++++++++++++++++++++++++--
 tools/libxl/libxl_types.idl |    1 +
 3 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 030aa86..d18d22c 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -273,6 +273,22 @@
 #endif
 #endif
 
+/*
+ * LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ *
+ * If this is defined, then the libxl_domain_build_info structure will
+ * contain hvm.usbdevice_list, a libxl_string_list type that contains
+ * a list of USB devices to specify on the qemu command-line.
+ *
+ * If it is set, callers may use either hvm.usbdevice or
+ * hvm.usbdevice_list, but not both; if both are set, libxl will
+ * throw an error.
+ *
+ * If this is not defined, callers can only use hvm.usbdevice.  Note
+ * that this means only one device can be added at domain build time.
+ */
+#define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 82e30df..d10a58f 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -198,11 +198,28 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice
+            || b_info->u.hvm.usbdevice_list) {
+            if ( b_info->u.hvm.usbdevice && b_info->u.hvm.usbdevice_list )
+            {
+                LOG(ERROR, "%s: Both usbdevice and usbdevice_list set",
+                    __func__);
+                return NULL;
+            }
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
@@ -479,11 +496,28 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             flexarray_vappend(dm_args, "-boot",
                     libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb)
+            || b_info->u.hvm.usbdevice
+            || b_info->u.hvm.usbdevice_list) {
+            if ( b_info->u.hvm.usbdevice && b_info->u.hvm.usbdevice_list )
+            {
+                LOG(ERROR, "%s: Both usbdevice and usbdevice_list set",
+                    __func__);
+                return NULL;
+            }
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
                                   "-usbdevice", b_info->u.hvm.usbdevice, NULL);
+            } else if (b_info->u.hvm.usbdevice_list) {
+                char **p;
+                for (p = b_info->u.hvm.usbdevice_list;
+                     *p;
+                     p++) {
+                    flexarray_vappend(dm_args,
+                                      "-usbdevice",
+                                      *p, NULL);
+                }
             }
         }
         if (b_info->u.hvm.soundhw) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index f3c212b..6cb6de6 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -330,6 +330,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
                                        ("xen_platform_pci", libxl_defbool),
+                                       ("usbdevice_list",   libxl_string_list),
                                        ])),
                  ("pv", Struct(None, [("kernel", string),
                                       ("slack_memkb", MemKB),
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 09 04:11:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Apr 2013 04:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPPtw-0007m6-FB; Tue, 09 Apr 2013 04:11:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtu-0007lu-Er
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:18 +0000
Received: from [85.158.139.83:39844] by server-7.bemta-5.messagelabs.com id
	1A/C8-12441-5E493615; Tue, 09 Apr 2013 04:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1365480675!27440719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26799 invoked from network); 9 Apr 2013 04:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Apr 2013 04:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtq-0004Cm-Tu
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtq-00087s-I0
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:14 +0000
Date: Tue, 09 Apr 2013 04:11:14 +0000
Message-Id: <E1UPPtq-00087s-I0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Accept a list for usbdevice in
	config file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3a2148192705592d38407ba9919eb1eb151a153
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Tue Apr 2 14:10:13 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 18:03:05 2013 +0100

    xl: Accept a list for usbdevice in config file
    
    Allow the "usbdevice" key to accept a list of USB devices, and pass
    them in using the new usbdevice_list domain build element.
    
    For backwards compatibility, still accept singleton values.
    
    Also update the xl.cfg manpage, adding information about how to pass
    through host devices.
    
    as applied:
     - Fix trailing whitespace and wrap some lines in xl_cmdimpl.c -iwj
    v2:
     - Add some verbiage to make it clear that "usb" is for emulated devices
     - Reference qemu manual for more usbdevice options
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5    |   28 +++++++++++++++++++---------
 tools/libxl/xl_cmdimpl.c |   20 ++++++++++++++++++--
 2 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 8db24d7..f8b4576 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1145,17 +1145,27 @@ device.
 
 =item B<usb=BOOLEAN>
 
-Enables or disables a USB bus in the guest.
+Enables or disables an emulated USB bus in the guest.
 
-=item B<usbdevice=DEVICE>
+=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side.
+Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
+enabled using B<usb=1>. The most common use for this option is
+B<usbdevice=['tablet']> which adds pointer device using absolute
+coordinates. Such devices function better than relative coordinate
+devices (such as a standard mouse) since many methods of exporting
+guest graphics (such as VNC) work better in this mode. Note that this
+is independent of the actual pointer device you are using on the
+host/client side.
+
+Host devices can also be passed through in this way, by specifying
+host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
+typically be found by using lsusb or usb-devices.
+
+The form usbdevice=DEVICE is also accepted for backwards compatibility.
+
+More valid options can be found in the "usbdevice" section of the qemu
+documentation.
 
 =back
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2d40f8f..61f7b96 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1533,8 +1533,24 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
-        xlu_cfg_replace_string (config, "usbdevice",
-                                &b_info->u.hvm.usbdevice, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+                                                &b_info->u.hvm.usbdevice_list,
+                                                1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            /* If it's not a valid list, try reading it as an atom,
+             * falling through to an error if it fails */
+            if (!xlu_cfg_replace_string(config, "usbdevice",
+                                        &b_info->u.hvm.usbdevice, 0))
+                break;
+            /* FALLTHRU */
+        default:
+            fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+            exit(-ERROR_FAIL);
+        }
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 09 04:11:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Apr 2013 04:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPPtw-0007m6-FB; Tue, 09 Apr 2013 04:11:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtu-0007lu-Er
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:18 +0000
Received: from [85.158.139.83:39844] by server-7.bemta-5.messagelabs.com id
	1A/C8-12441-5E493615; Tue, 09 Apr 2013 04:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1365480675!27440719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26799 invoked from network); 9 Apr 2013 04:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Apr 2013 04:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtq-0004Cm-Tu
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPPtq-00087s-I0
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 04:11:14 +0000
Date: Tue, 09 Apr 2013 04:11:14 +0000
Message-Id: <E1UPPtq-00087s-I0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Accept a list for usbdevice in
	config file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3a2148192705592d38407ba9919eb1eb151a153
Author:     George Dunlap <george.dunlap@eu.citrix.com>
AuthorDate: Tue Apr 2 14:10:13 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 8 18:03:05 2013 +0100

    xl: Accept a list for usbdevice in config file
    
    Allow the "usbdevice" key to accept a list of USB devices, and pass
    them in using the new usbdevice_list domain build element.
    
    For backwards compatibility, still accept singleton values.
    
    Also update the xl.cfg manpage, adding information about how to pass
    through host devices.
    
    as applied:
     - Fix trailing whitespace and wrap some lines in xl_cmdimpl.c -iwj
    v2:
     - Add some verbiage to make it clear that "usb" is for emulated devices
     - Reference qemu manual for more usbdevice options
    
    Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5    |   28 +++++++++++++++++++---------
 tools/libxl/xl_cmdimpl.c |   20 ++++++++++++++++++--
 2 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 8db24d7..f8b4576 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1145,17 +1145,27 @@ device.
 
 =item B<usb=BOOLEAN>
 
-Enables or disables a USB bus in the guest.
+Enables or disables an emulated USB bus in the guest.
 
-=item B<usbdevice=DEVICE>
+=item B<usbdevice=[ "DEVICE", "DEVICE", ...]>
 
-Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
-B<usb=1>. The most common use for this option is B<usbdevice=tablet>
-which adds pointer device using absolute coordinates. Such devices
-function better than relative coordinate devices (such as a standard
-mouse) since many methods of exporting guest graphics (such as VNC)
-work better in this mode. Note that this is independent of the actual
-pointer device you are using on the host/client side.
+Adds B<DEVICE>s to the emulated USB bus. The USB bus must also be
+enabled using B<usb=1>. The most common use for this option is
+B<usbdevice=['tablet']> which adds pointer device using absolute
+coordinates. Such devices function better than relative coordinate
+devices (such as a standard mouse) since many methods of exporting
+guest graphics (such as VNC) work better in this mode. Note that this
+is independent of the actual pointer device you are using on the
+host/client side.
+
+Host devices can also be passed through in this way, by specifying
+host:USBID, where USBID is of the form xxxx:yyyy.  The USBID can
+typically be found by using lsusb or usb-devices.
+
+The form usbdevice=DEVICE is also accepted for backwards compatibility.
+
+More valid options can be found in the "usbdevice" section of the qemu
+documentation.
 
 =back
 
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2d40f8f..61f7b96 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1533,8 +1533,24 @@ skip_vfb:
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
-        xlu_cfg_replace_string (config, "usbdevice",
-                                &b_info->u.hvm.usbdevice, 0);
+        switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+                                                &b_info->u.hvm.usbdevice_list,
+                                                1))
+        {
+
+        case 0: break; /* Success */
+        case ESRCH: break; /* Option not present */
+        case EINVAL:
+            /* If it's not a valid list, try reading it as an atom,
+             * falling through to an error if it fails */
+            if (!xlu_cfg_replace_string(config, "usbdevice",
+                                        &b_info->u.hvm.usbdevice, 0))
+                break;
+            /* FALLTHRU */
+        default:
+            fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+            exit(-ERROR_FAIL);
+        }
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         xlu_cfg_get_defbool(config, "xen_platform_pci",
                             &b_info->u.hvm.xen_platform_pci, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 09 18:22:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Apr 2013 18:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPdBG-0003Kt-TI; Tue, 09 Apr 2013 18:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPdBF-0003Ki-OI
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 18:22:05 +0000
Received: from [193.109.254.147:31016] by server-9.bemta-14.messagelabs.com id
	8E/D3-04223-D4C54615; Tue, 09 Apr 2013 18:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1365531722!8788177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15877 invoked from network); 9 Apr 2013 18:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Apr 2013 18:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPdBC-0006je-Dh
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 18:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPdBC-0003TT-5T
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 18:22:02 +0000
Date: Tue, 09 Apr 2013 18:22:02 +0000
Message-Id: <E1UPdBC-0003TT-5T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: serialize page table population
	in map_domain_page_global()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 69b0fbfe6036516303a7058b0a182c925c3c56c8
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Apr 9 10:30:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 10:30:33 2013 +0200

    x86: serialize page table population in map_domain_page_global()
    
    Looking at map_domain_page_global, there doesn't seem to be any locking
    preventing two CPUs from populating a page of global-map l1es at the
    same time.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain_page.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index 7421e03..efda6af 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -354,9 +354,10 @@ void *map_domain_page_global(unsigned long mfn)
     set_bit(idx, inuse);
     inuse_cursor = idx + 1;
 
+    pl1e = virt_to_xen_l1e(va);
+
     spin_unlock(&globalmap_lock);
 
-    pl1e = virt_to_xen_l1e(va);
     if ( !pl1e )
         return NULL;
     l1e_write(pl1e, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 09 18:22:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 09 Apr 2013 18:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPdBG-0003Kt-TI; Tue, 09 Apr 2013 18:22:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPdBF-0003Ki-OI
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 18:22:05 +0000
Received: from [193.109.254.147:31016] by server-9.bemta-14.messagelabs.com id
	8E/D3-04223-D4C54615; Tue, 09 Apr 2013 18:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1365531722!8788177!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15877 invoked from network); 9 Apr 2013 18:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	9 Apr 2013 18:22:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPdBC-0006je-Dh
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 18:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPdBC-0003TT-5T
	for xen-changelog@lists.xensource.com; Tue, 09 Apr 2013 18:22:02 +0000
Date: Tue, 09 Apr 2013 18:22:02 +0000
Message-Id: <E1UPdBC-0003TT-5T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: serialize page table population
	in map_domain_page_global()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 69b0fbfe6036516303a7058b0a182c925c3c56c8
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Apr 9 10:30:33 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 10:30:33 2013 +0200

    x86: serialize page table population in map_domain_page_global()
    
    Looking at map_domain_page_global, there doesn't seem to be any locking
    preventing two CPUs from populating a page of global-map l1es at the
    same time.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/domain_page.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index 7421e03..efda6af 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -354,9 +354,10 @@ void *map_domain_page_global(unsigned long mfn)
     set_bit(idx, inuse);
     inuse_cursor = idx + 1;
 
+    pl1e = virt_to_xen_l1e(va);
+
     spin_unlock(&globalmap_lock);
 
-    pl1e = virt_to_xen_l1e(va);
     if ( !pl1e )
         return NULL;
     l1e_write(pl1e, l1e_from_pfn(mfn, __PAGE_HYPERVISOR));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 05:12:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 05:12:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPnKH-0001iN-V2; Wed, 10 Apr 2013 05:12:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPnKG-0001iI-KR
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 05:12:04 +0000
Received: from [85.158.139.211:63322] by server-13.bemta-5.messagelabs.com id
	97/45-20553-3A4F4615; Wed, 10 Apr 2013 05:12:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1365570666!18109142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24900 invoked from network); 10 Apr 2013 05:11:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 05:11:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPnJK-0004Dh-0u
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 05:11:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPnJG-00020m-T4
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 05:11:02 +0000
Date: Wed, 10 Apr 2013 05:11:02 +0000
Message-Id: <E1UPnJG-00020m-T4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: debugging code for platform timer
	wrap problem
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd9be94eb2280e8e662e75f1e5fea7c12eb2589c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 9 13:33:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 13:33:52 2013 +0200

    x86: debugging code for platform timer wrap problem
    
    This is intentionally adding code not well formatted (so it stands out)
    and expected to be reverted as soon as the problem with the timer wraps
    has been spotted.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/time.c |   58 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 56bffdb..b403f47 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -43,6 +43,23 @@
 static char __initdata opt_clocksource[10];
 string_param("clocksource", opt_clocksource);
 
+static int opt_log_time;//temp
+static unsigned int opt_log_time_start;//temp
+static void __init setup_log_time(char *str) {//temp
+ if(!str || !*str) {
+  opt_log_time = -1;
+  opt_log_time_start = -1;
+  return;
+ }
+ opt_log_time = simple_strtoul(str, (const char **)&str, 0);
+ if(*str == ',') {
+  opt_log_time_start = simple_strtoul(str + 1, NULL, 0);
+  if(opt_log_time_start && opt_log_time > 0)
+   opt_log_time = -opt_log_time;
+ }
+}
+custom_param("log_time", setup_log_time);//temp
+
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 DEFINE_SPINLOCK(rtc_lock);
 unsigned long pit0_ticks;
@@ -121,6 +138,7 @@ static inline u64 scale_delta(u64 delta, struct time_scale *scale)
 {
     u64 product;
 
+BUG_ON((s64)delta < 0);//temp
     if ( scale->shift < 0 )
         delta >>= -scale->shift;
     else
@@ -527,12 +545,13 @@ static void plt_overflow(void *unused)
 {
     int i;
     u64 count;
+u64 delta;//temp
     s_time_t now, plt_now, plt_wrap;
 
     spin_lock_irq(&platform_timer_lock);
 
     count = plt_src.read_counter();
-    plt_stamp64 += (count - plt_stamp) & plt_mask;
+    plt_stamp64 += delta = (count - plt_stamp) & plt_mask;
     plt_stamp = count;
 
     now = NOW();
@@ -549,11 +568,21 @@ static void plt_overflow(void *unused)
     {
         static bool_t warned_once;
         if ( !test_and_set_bool(warned_once) )
+{//temp
             printk("Platform timer appears to have unexpectedly wrapped "
                    "%u%s times.\n", i, (i == 10) ? " or more" : "");
+ printk("PLT: n=%012"PRIx64" pn=%012"PRIx64" pm=%012"PRIx64" pw=%012"PRIx64"\n", now, plt_now, plt_mask, plt_wrap);
+}
     }
 
     spin_unlock_irq(&platform_timer_lock);
+if(opt_log_time) printk("PLT: c=%012"PRIx64" d=%06"PRIx64" s=%012"PRIx64"\n", count, delta, plt_stamp64);//temp
+if(opt_log_time > 0) {//temp
+ --opt_log_time;
+} else if (opt_log_time < 0 && !--opt_log_time_start) {
+ opt_log_time = -opt_log_time;
+}
+WARN_ON(platform_timer_stamp && delta < (6 << (plt_src.counter_bits - 4)));//temp
 
     set_timer(&plt_overflow_timer, NOW() + plt_overflow_period);
 }
@@ -568,6 +597,7 @@ static s_time_t read_platform_stime(void)
     spin_lock(&platform_timer_lock);
     count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask);
     stime = __read_platform_stime(count);
+BUG_ON((u64)stime >> 55);//temp
     spin_unlock(&platform_timer_lock);
 
     return stime;
@@ -582,9 +612,11 @@ static void platform_time_calibration(void)
     spin_lock_irqsave(&platform_timer_lock, flags);
     count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask);
     stamp = __read_platform_stime(count);
+BUG_ON((u64)stamp >> 55);//temp
     stime_platform_stamp = stamp;
     platform_timer_stamp = count;
     spin_unlock_irqrestore(&platform_timer_lock, flags);
+if(opt_log_time) printk("PLT: s=%012"PRIx64" c=%012"PRIx64"\n", stamp, count);//temp
 }
 
 static void resume_platform_timer(void)
@@ -651,6 +683,7 @@ static void __init init_platform_timer(void)
 
     printk("Platform timer is %s %s\n",
            freq_string(pts->frequency), pts->name);
+if(opt_log_time) printk("PLT: m=%08x s=%d o=%012"PRIx64"\n", plt_scale.mul_frac, plt_scale.shift, plt_overflow_period);//temp
 }
 
 u64 stime2tsc(s_time_t stime)
@@ -1034,7 +1067,12 @@ static void local_time_calibration(void)
         t->local_tsc_stamp    = c->local_tsc_stamp;
         t->stime_local_stamp  = c->stime_master_stamp;
         t->stime_master_stamp = c->stime_master_stamp;
+curr_local_stime = c->stime_local_stamp;//temp
         local_irq_enable();
+if(opt_log_time > 0) {//temp
+ printk("UPD%02x: t=%012"PRIx64" l=%012"PRIx64" m=%012"PRIx64"\n",
+        smp_processor_id(), t->local_tsc_stamp, curr_local_stime, t->stime_master_stamp);
+}
         update_vcpu_system_time(current);
         goto out;
     }
@@ -1050,14 +1088,14 @@ static void local_time_calibration(void)
     curr_master_stime = c->stime_master_stamp;
     local_irq_enable();
 
-#if 0
-    printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
+if(opt_log_time > 0) {//temp #if 0
+    printk("PRE%02x: t=%012"PRIx64" l=%012"PRIx64" m=%012"PRIx64"\n",
            smp_processor_id(), prev_tsc, prev_local_stime, prev_master_stime);
-    printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64
+    printk("CUR%02x: t=%012"PRIx64" l=%012"PRIx64" m=%012"PRIx64
            " -> %"PRId64"\n",
            smp_processor_id(), curr_tsc, curr_local_stime, curr_master_stime,
            curr_master_stime - curr_local_stime);
-#endif
+}//temp #endif
 
     /* Local time warps forward if it lags behind master time. */
     if ( curr_local_stime < curr_master_stime )
@@ -1124,10 +1162,10 @@ static void local_time_calibration(void)
     if ( error_factor != 0 )
         calibration_mul_frac = mul_frac(calibration_mul_frac, error_factor);
 
-#if 0
-    printk("---%d: %08x %08x %d\n", smp_processor_id(),
-           error_factor, calibration_mul_frac, tsc_shift);
-#endif
+if(opt_log_time > 0) {//temp #if 0
+    printk("NEW%02x: e=%08x m=%08x s=%d\n",
+           smp_processor_id(), error_factor, calibration_mul_frac, tsc_shift);
+}//temp #endif
 
     /* Record new timestamp information, atomically w.r.t. interrupts. */
     local_irq_disable();
@@ -1475,6 +1513,7 @@ int __init init_xen_time(void)
         /* If TSCs are not marked as 'reliable', re-sync during rendezvous. */
         if ( !boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
             time_calibration_rendezvous_fn = time_calibration_tsc_rendezvous;
+printk("Using %s rendezvous\n", boot_cpu_has(X86_FEATURE_TSC_RELIABLE) ? "standard" : "TSC");//temp
     }
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -1502,6 +1541,7 @@ void __init early_time_init(void)
     u64 tmp = init_pit_and_calibrate_tsc();
 
     set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
+if(opt_log_time) printk("INI: m=%08x s=%d\n", this_cpu(cpu_time).tsc_scale.mul_frac, this_cpu(cpu_time).tsc_scale.shift);//temp
 
     do_div(tmp, 1000);
     cpu_khz = (unsigned long)tmp;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 05:12:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 05:12:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPnKH-0001iN-V2; Wed, 10 Apr 2013 05:12:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPnKG-0001iI-KR
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 05:12:04 +0000
Received: from [85.158.139.211:63322] by server-13.bemta-5.messagelabs.com id
	97/45-20553-3A4F4615; Wed, 10 Apr 2013 05:12:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1365570666!18109142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24900 invoked from network); 10 Apr 2013 05:11:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 05:11:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPnJK-0004Dh-0u
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 05:11:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPnJG-00020m-T4
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 05:11:02 +0000
Date: Wed, 10 Apr 2013 05:11:02 +0000
Message-Id: <E1UPnJG-00020m-T4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: debugging code for platform timer
	wrap problem
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bd9be94eb2280e8e662e75f1e5fea7c12eb2589c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 9 13:33:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 13:33:52 2013 +0200

    x86: debugging code for platform timer wrap problem
    
    This is intentionally adding code not well formatted (so it stands out)
    and expected to be reverted as soon as the problem with the timer wraps
    has been spotted.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/time.c |   58 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 56bffdb..b403f47 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -43,6 +43,23 @@
 static char __initdata opt_clocksource[10];
 string_param("clocksource", opt_clocksource);
 
+static int opt_log_time;//temp
+static unsigned int opt_log_time_start;//temp
+static void __init setup_log_time(char *str) {//temp
+ if(!str || !*str) {
+  opt_log_time = -1;
+  opt_log_time_start = -1;
+  return;
+ }
+ opt_log_time = simple_strtoul(str, (const char **)&str, 0);
+ if(*str == ',') {
+  opt_log_time_start = simple_strtoul(str + 1, NULL, 0);
+  if(opt_log_time_start && opt_log_time > 0)
+   opt_log_time = -opt_log_time;
+ }
+}
+custom_param("log_time", setup_log_time);//temp
+
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 DEFINE_SPINLOCK(rtc_lock);
 unsigned long pit0_ticks;
@@ -121,6 +138,7 @@ static inline u64 scale_delta(u64 delta, struct time_scale *scale)
 {
     u64 product;
 
+BUG_ON((s64)delta < 0);//temp
     if ( scale->shift < 0 )
         delta >>= -scale->shift;
     else
@@ -527,12 +545,13 @@ static void plt_overflow(void *unused)
 {
     int i;
     u64 count;
+u64 delta;//temp
     s_time_t now, plt_now, plt_wrap;
 
     spin_lock_irq(&platform_timer_lock);
 
     count = plt_src.read_counter();
-    plt_stamp64 += (count - plt_stamp) & plt_mask;
+    plt_stamp64 += delta = (count - plt_stamp) & plt_mask;
     plt_stamp = count;
 
     now = NOW();
@@ -549,11 +568,21 @@ static void plt_overflow(void *unused)
     {
         static bool_t warned_once;
         if ( !test_and_set_bool(warned_once) )
+{//temp
             printk("Platform timer appears to have unexpectedly wrapped "
                    "%u%s times.\n", i, (i == 10) ? " or more" : "");
+ printk("PLT: n=%012"PRIx64" pn=%012"PRIx64" pm=%012"PRIx64" pw=%012"PRIx64"\n", now, plt_now, plt_mask, plt_wrap);
+}
     }
 
     spin_unlock_irq(&platform_timer_lock);
+if(opt_log_time) printk("PLT: c=%012"PRIx64" d=%06"PRIx64" s=%012"PRIx64"\n", count, delta, plt_stamp64);//temp
+if(opt_log_time > 0) {//temp
+ --opt_log_time;
+} else if (opt_log_time < 0 && !--opt_log_time_start) {
+ opt_log_time = -opt_log_time;
+}
+WARN_ON(platform_timer_stamp && delta < (6 << (plt_src.counter_bits - 4)));//temp
 
     set_timer(&plt_overflow_timer, NOW() + plt_overflow_period);
 }
@@ -568,6 +597,7 @@ static s_time_t read_platform_stime(void)
     spin_lock(&platform_timer_lock);
     count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask);
     stime = __read_platform_stime(count);
+BUG_ON((u64)stime >> 55);//temp
     spin_unlock(&platform_timer_lock);
 
     return stime;
@@ -582,9 +612,11 @@ static void platform_time_calibration(void)
     spin_lock_irqsave(&platform_timer_lock, flags);
     count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask);
     stamp = __read_platform_stime(count);
+BUG_ON((u64)stamp >> 55);//temp
     stime_platform_stamp = stamp;
     platform_timer_stamp = count;
     spin_unlock_irqrestore(&platform_timer_lock, flags);
+if(opt_log_time) printk("PLT: s=%012"PRIx64" c=%012"PRIx64"\n", stamp, count);//temp
 }
 
 static void resume_platform_timer(void)
@@ -651,6 +683,7 @@ static void __init init_platform_timer(void)
 
     printk("Platform timer is %s %s\n",
            freq_string(pts->frequency), pts->name);
+if(opt_log_time) printk("PLT: m=%08x s=%d o=%012"PRIx64"\n", plt_scale.mul_frac, plt_scale.shift, plt_overflow_period);//temp
 }
 
 u64 stime2tsc(s_time_t stime)
@@ -1034,7 +1067,12 @@ static void local_time_calibration(void)
         t->local_tsc_stamp    = c->local_tsc_stamp;
         t->stime_local_stamp  = c->stime_master_stamp;
         t->stime_master_stamp = c->stime_master_stamp;
+curr_local_stime = c->stime_local_stamp;//temp
         local_irq_enable();
+if(opt_log_time > 0) {//temp
+ printk("UPD%02x: t=%012"PRIx64" l=%012"PRIx64" m=%012"PRIx64"\n",
+        smp_processor_id(), t->local_tsc_stamp, curr_local_stime, t->stime_master_stamp);
+}
         update_vcpu_system_time(current);
         goto out;
     }
@@ -1050,14 +1088,14 @@ static void local_time_calibration(void)
     curr_master_stime = c->stime_master_stamp;
     local_irq_enable();
 
-#if 0
-    printk("PRE%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64"\n",
+if(opt_log_time > 0) {//temp #if 0
+    printk("PRE%02x: t=%012"PRIx64" l=%012"PRIx64" m=%012"PRIx64"\n",
            smp_processor_id(), prev_tsc, prev_local_stime, prev_master_stime);
-    printk("CUR%d: tsc=%"PRIu64" stime=%"PRIu64" master=%"PRIu64
+    printk("CUR%02x: t=%012"PRIx64" l=%012"PRIx64" m=%012"PRIx64
            " -> %"PRId64"\n",
            smp_processor_id(), curr_tsc, curr_local_stime, curr_master_stime,
            curr_master_stime - curr_local_stime);
-#endif
+}//temp #endif
 
     /* Local time warps forward if it lags behind master time. */
     if ( curr_local_stime < curr_master_stime )
@@ -1124,10 +1162,10 @@ static void local_time_calibration(void)
     if ( error_factor != 0 )
         calibration_mul_frac = mul_frac(calibration_mul_frac, error_factor);
 
-#if 0
-    printk("---%d: %08x %08x %d\n", smp_processor_id(),
-           error_factor, calibration_mul_frac, tsc_shift);
-#endif
+if(opt_log_time > 0) {//temp #if 0
+    printk("NEW%02x: e=%08x m=%08x s=%d\n",
+           smp_processor_id(), error_factor, calibration_mul_frac, tsc_shift);
+}//temp #endif
 
     /* Record new timestamp information, atomically w.r.t. interrupts. */
     local_irq_disable();
@@ -1475,6 +1513,7 @@ int __init init_xen_time(void)
         /* If TSCs are not marked as 'reliable', re-sync during rendezvous. */
         if ( !boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
             time_calibration_rendezvous_fn = time_calibration_tsc_rendezvous;
+printk("Using %s rendezvous\n", boot_cpu_has(X86_FEATURE_TSC_RELIABLE) ? "standard" : "TSC");//temp
     }
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -1502,6 +1541,7 @@ void __init early_time_init(void)
     u64 tmp = init_pit_and_calibrate_tsc();
 
     set_time_scale(&this_cpu(cpu_time).tsc_scale, tmp);
+if(opt_log_time) printk("INI: m=%08x s=%d\n", this_cpu(cpu_time).tsc_scale.mul_frac, this_cpu(cpu_time).tsc_scale.shift);//temp
 
     do_div(tmp, 1000);
     cpu_khz = (unsigned long)tmp;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvUk-0003Mk-9K; Wed, 10 Apr 2013 13:55:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUi-0003MV-O0
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:24 +0000
Received: from [85.158.138.51:36046] by server-11.bemta-3.messagelabs.com id
	C3/D4-01263-B4F65615; Wed, 10 Apr 2013 13:55:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1365602113!27530438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 349 invoked from network); 10 Apr 2013 13:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUN-0001tB-D0
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUN-0006S2-5u
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:03 +0000
Date: Wed, 10 Apr 2013 13:55:03 +0000
Message-Id: <E1UPvUN-0006S2-5u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: irq_move_cleanup_interrupt()
	must ignore legacy vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7d4d16afe2460a4e988ba237ec44c7fc36b7b1f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 9 16:10:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:10:29 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: af699220ad6d111ba76fc3040342184e423cc9a1
    master date: 2013-04-02 08:30:03 +0200
---
 xen/arch/x86/i8259.c   |    2 ++
 xen/arch/x86/io_apic.c |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 47d7971..b8d535f 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -395,6 +395,8 @@ void __init init_IRQ(void)
         struct irq_desc *desc = irq_to_desc(irq);
         struct irq_cfg *cfg = desc->chip_data;
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cfg->cpu_mask= cpumask_of_cpu(cpu);
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index fb762b8..4378d8e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -499,7 +499,9 @@ fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
     irq_enter();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -509,6 +511,9 @@ fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
         if (irq == -1)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvUk-0003Mk-9K; Wed, 10 Apr 2013 13:55:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUi-0003MV-O0
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:24 +0000
Received: from [85.158.138.51:36046] by server-11.bemta-3.messagelabs.com id
	C3/D4-01263-B4F65615; Wed, 10 Apr 2013 13:55:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1365602113!27530438!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 349 invoked from network); 10 Apr 2013 13:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUN-0001tB-D0
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUN-0006S2-5u
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:03 +0000
Date: Wed, 10 Apr 2013 13:55:03 +0000
Message-Id: <E1UPvUN-0006S2-5u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: irq_move_cleanup_interrupt()
	must ignore legacy vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7d4d16afe2460a4e988ba237ec44c7fc36b7b1f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 9 16:10:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:10:29 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: af699220ad6d111ba76fc3040342184e423cc9a1
    master date: 2013-04-02 08:30:03 +0200
---
 xen/arch/x86/i8259.c   |    2 ++
 xen/arch/x86/io_apic.c |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 47d7971..b8d535f 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -395,6 +395,8 @@ void __init init_IRQ(void)
         struct irq_desc *desc = irq_to_desc(irq);
         struct irq_cfg *cfg = desc->chip_data;
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cfg->cpu_mask= cpumask_of_cpu(cpu);
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index fb762b8..4378d8e 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -499,7 +499,9 @@ fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
     irq_enter();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -509,6 +511,9 @@ fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
         if (irq == -1)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvUm-0003N6-CK; Wed, 10 Apr 2013 13:55:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUk-0003Mi-G4
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:26 +0000
Received: from [85.158.139.83:23470] by server-3.bemta-5.messagelabs.com id
	15/F5-17256-D4F65615; Wed, 10 Apr 2013 13:55:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1365602123!27843276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27619 invoked from network); 10 Apr 2013 13:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUg-0001tM-Sp
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUg-0006SQ-QG
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:22 +0000
Date: Wed, 10 Apr 2013 13:55:22 +0000
Message-Id: <E1UPvUg-0006SQ-QG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/S3: Restore broken vcpu
	affinity on resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 95483087da57c29d778cbc1941a807f60357daf7
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Tue Apr 9 16:13:11 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:13:11 2013 +0200

    x86/S3: Restore broken vcpu affinity on resume
    
    When in SYS_STATE_suspend, and going through the cpu_disable_scheduler
    path, save a copy of the current cpu affinity, and mark a flag to
    restore it later.
    
    Later, in the resume process, when enabling nonboot cpus restore these
    affinities.
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 41e71c2607e036f1ac00df898b8f4acb2d4df7ee
    master date: 2013-04-02 09:52:32 +0200
---
 xen/arch/x86/acpi/power.c |    3 +++
 xen/common/schedule.c     |   45 ++++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/sched.h   |    6 ++++++
 3 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 7a08091..dc37be8 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -96,7 +96,10 @@ static void thaw_domains(void)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
+    {
+        restore_vcpu_affinity(d);
         domain_unpause(d);
+    }
     rcu_read_unlock(&domlist_read_lock);
 }
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 001da3d..edb0177 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -545,6 +545,38 @@ void vcpu_force_reschedule(struct vcpu *v)
     }
 }
 
+void restore_vcpu_affinity(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        vcpu_schedule_lock_irq(v);
+
+        if ( v->affinity_broken )
+        {
+            printk(XENLOG_DEBUG "Restoring affinity for d%dv%d\n",
+                   d->domain_id, v->vcpu_id);
+            cpus_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            v->affinity_broken = 0;
+        }
+
+        if ( v->processor == smp_processor_id() )
+        {
+            set_bit(_VPF_migrating, &v->pause_flags);
+            vcpu_schedule_unlock_irq(v);
+            vcpu_sleep_nosync(v);
+            vcpu_migrate(v);
+        }
+        else
+        {
+            vcpu_schedule_unlock_irq(v);
+        }
+    }
+
+    domain_update_node_affinity(d);
+}
+
 /*
  * This function is used by cpu_hotplug code from stop_machine context
  * and from cpupools to switch schedulers on a cpu.
@@ -559,7 +591,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     bool_t affinity_broken;
 
     c = per_cpu(cpupool, cpu);
-    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
+    if ( c == NULL )
         return ret;
 
     for_each_domain ( d )
@@ -577,8 +609,15 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( cpus_empty(online_affinity) &&
                  cpu_isset(cpu, v->cpu_affinity) )
             {
-                printk("Breaking vcpu affinity for domain %d vcpu %d\n",
-                        v->domain->domain_id, v->vcpu_id);
+                printk(XENLOG_DEBUG "Breaking affinity for d%dv%d\n",
+                        d->domain_id, v->vcpu_id);
+
+                if (system_state == SYS_STATE_suspend)
+                {
+                    cpus_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    v->affinity_broken = 1;
+                }
+
                 cpus_setall(v->cpu_affinity);
                 affinity_broken = 1;
             }
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 35c3a7f..5909d9a 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -143,6 +143,9 @@ struct vcpu
     bool_t           defer_shutdown;
     /* VCPU is paused following shutdown request (d->is_shutting_down)? */
     bool_t           paused_for_shutdown;
+    /* VCPU need affinity restored */
+    bool_t           affinity_broken;
+
 
     /*
      * > 0: a single port is being polled;
@@ -165,6 +168,8 @@ struct vcpu
     cpumask_t        cpu_affinity;
     /* Used to change affinity temporarily. */
     cpumask_t        cpu_affinity_tmp;
+    /* Used to restore affinity across S3. */
+    cpumask_t        cpu_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_t        vcpu_dirty_cpumask;
@@ -619,6 +624,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
 int vcpu_set_affinity(struct vcpu *v, cpumask_t *affinity);
+void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvUm-0003N6-CK; Wed, 10 Apr 2013 13:55:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUk-0003Mi-G4
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:26 +0000
Received: from [85.158.139.83:23470] by server-3.bemta-5.messagelabs.com id
	15/F5-17256-D4F65615; Wed, 10 Apr 2013 13:55:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1365602123!27843276!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27619 invoked from network); 10 Apr 2013 13:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUg-0001tM-Sp
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUg-0006SQ-QG
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:22 +0000
Date: Wed, 10 Apr 2013 13:55:22 +0000
Message-Id: <E1UPvUg-0006SQ-QG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/S3: Restore broken vcpu
	affinity on resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 95483087da57c29d778cbc1941a807f60357daf7
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Tue Apr 9 16:13:11 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:13:11 2013 +0200

    x86/S3: Restore broken vcpu affinity on resume
    
    When in SYS_STATE_suspend, and going through the cpu_disable_scheduler
    path, save a copy of the current cpu affinity, and mark a flag to
    restore it later.
    
    Later, in the resume process, when enabling nonboot cpus restore these
    affinities.
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 41e71c2607e036f1ac00df898b8f4acb2d4df7ee
    master date: 2013-04-02 09:52:32 +0200
---
 xen/arch/x86/acpi/power.c |    3 +++
 xen/common/schedule.c     |   45 ++++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/sched.h   |    6 ++++++
 3 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 7a08091..dc37be8 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -96,7 +96,10 @@ static void thaw_domains(void)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
+    {
+        restore_vcpu_affinity(d);
         domain_unpause(d);
+    }
     rcu_read_unlock(&domlist_read_lock);
 }
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 001da3d..edb0177 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -545,6 +545,38 @@ void vcpu_force_reschedule(struct vcpu *v)
     }
 }
 
+void restore_vcpu_affinity(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        vcpu_schedule_lock_irq(v);
+
+        if ( v->affinity_broken )
+        {
+            printk(XENLOG_DEBUG "Restoring affinity for d%dv%d\n",
+                   d->domain_id, v->vcpu_id);
+            cpus_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            v->affinity_broken = 0;
+        }
+
+        if ( v->processor == smp_processor_id() )
+        {
+            set_bit(_VPF_migrating, &v->pause_flags);
+            vcpu_schedule_unlock_irq(v);
+            vcpu_sleep_nosync(v);
+            vcpu_migrate(v);
+        }
+        else
+        {
+            vcpu_schedule_unlock_irq(v);
+        }
+    }
+
+    domain_update_node_affinity(d);
+}
+
 /*
  * This function is used by cpu_hotplug code from stop_machine context
  * and from cpupools to switch schedulers on a cpu.
@@ -559,7 +591,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     bool_t affinity_broken;
 
     c = per_cpu(cpupool, cpu);
-    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
+    if ( c == NULL )
         return ret;
 
     for_each_domain ( d )
@@ -577,8 +609,15 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( cpus_empty(online_affinity) &&
                  cpu_isset(cpu, v->cpu_affinity) )
             {
-                printk("Breaking vcpu affinity for domain %d vcpu %d\n",
-                        v->domain->domain_id, v->vcpu_id);
+                printk(XENLOG_DEBUG "Breaking affinity for d%dv%d\n",
+                        d->domain_id, v->vcpu_id);
+
+                if (system_state == SYS_STATE_suspend)
+                {
+                    cpus_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    v->affinity_broken = 1;
+                }
+
                 cpus_setall(v->cpu_affinity);
                 affinity_broken = 1;
             }
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 35c3a7f..5909d9a 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -143,6 +143,9 @@ struct vcpu
     bool_t           defer_shutdown;
     /* VCPU is paused following shutdown request (d->is_shutting_down)? */
     bool_t           paused_for_shutdown;
+    /* VCPU need affinity restored */
+    bool_t           affinity_broken;
+
 
     /*
      * > 0: a single port is being polled;
@@ -165,6 +168,8 @@ struct vcpu
     cpumask_t        cpu_affinity;
     /* Used to change affinity temporarily. */
     cpumask_t        cpu_affinity_tmp;
+    /* Used to restore affinity across S3. */
+    cpumask_t        cpu_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_t        vcpu_dirty_cpumask;
@@ -619,6 +624,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
 int vcpu_set_affinity(struct vcpu *v, cpumask_t *affinity);
+void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvUw-0003Oi-GD; Wed, 10 Apr 2013 13:55:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUv-0003OK-1g
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:37 +0000
Received: from [85.158.137.99:21428] by server-3.bemta-3.messagelabs.com id
	4F/39-26934-85F65615; Wed, 10 Apr 2013 13:55:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1365602133!12499928!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11347 invoked from network); 10 Apr 2013 13:55:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUr-0001tR-49
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUq-0006Sn-Vu
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:33 +0000
Date: Wed, 10 Apr 2013 13:55:32 +0000
Message-Id: <E1UPvUq-0006Sn-Vu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/mm/shadow: spurious warning
	when unmapping xenheap pages.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6bd18f4cf30c3e26b44e52a929d18066e0c8ceb
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Apr 9 16:19:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:19:53 2013 +0200

    x86/mm/shadow: spurious warning when unmapping xenheap pages.
    
    Xenheap pages will always have an extra typecount, taken in
    share_xen_page_with_guest(), which doesn't come from a shadow PTE.
    Adjust the warning in sh_remove_all_mappings() to account for it.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
    master date: 2013-04-04 10:14:30 +0100
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 xen/include/asm-x86/mm.h        |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 5e5f9c1..fed3503 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2549,10 +2549,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 2013ba9..cedab73 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -238,7 +238,7 @@ struct spage_info
 #endif
 
 #if defined(__i386__)
-#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
+#define is_xen_heap_page(page) is_xen_heap_mfn(__page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                         \
     unsigned long _mfn = (mfn);                         \
     (_mfn < paddr_to_pfn(xenheap_phys_end));            \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvUw-0003Oi-GD; Wed, 10 Apr 2013 13:55:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUv-0003OK-1g
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:37 +0000
Received: from [85.158.137.99:21428] by server-3.bemta-3.messagelabs.com id
	4F/39-26934-85F65615; Wed, 10 Apr 2013 13:55:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1365602133!12499928!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11347 invoked from network); 10 Apr 2013 13:55:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUr-0001tR-49
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvUq-0006Sn-Vu
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:33 +0000
Date: Wed, 10 Apr 2013 13:55:32 +0000
Message-Id: <E1UPvUq-0006Sn-Vu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86/mm/shadow: spurious warning
	when unmapping xenheap pages.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6bd18f4cf30c3e26b44e52a929d18066e0c8ceb
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Apr 9 16:19:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:19:53 2013 +0200

    x86/mm/shadow: spurious warning when unmapping xenheap pages.
    
    Xenheap pages will always have an extra typecount, taken in
    share_xen_page_with_guest(), which doesn't come from a shadow PTE.
    Adjust the warning in sh_remove_all_mappings() to account for it.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
    master date: 2013-04-04 10:14:30 +0100
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 xen/include/asm-x86/mm.h        |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 5e5f9c1..fed3503 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2549,10 +2549,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 2013ba9..cedab73 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -238,7 +238,7 @@ struct spage_info
 #endif
 
 #if defined(__i386__)
-#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
+#define is_xen_heap_page(page) is_xen_heap_mfn(__page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                         \
     unsigned long _mfn = (mfn);                         \
     (_mfn < paddr_to_pfn(xenheap_phys_end));            \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvV6-0003Qm-J8; Wed, 10 Apr 2013 13:55:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvV4-0003Q7-CK
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:46 +0000
Received: from [85.158.139.83:33624] by server-9.bemta-5.messagelabs.com id
	B4/52-08547-16F65615; Wed, 10 Apr 2013 13:55:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1365602143!27692047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21729 invoked from network); 10 Apr 2013 13:55:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvV1-0001tX-AT
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvV1-0006TM-6q
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:43 +0000
Date: Wed, 10 Apr 2013 13:55:43 +0000
Message-Id: <E1UPvV1-0006TM-6q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] vmx: Simplify cr0 update handling
	by deferring cr4 changes to the cr4 handler.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da7e3cdf0a1c2440886383e0e7f826c88796b8ca
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Tue Apr 9 16:25:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:25:20 2013 +0200

    vmx: Simplify cr0 update handling by deferring cr4 changes to the cr4 handler.
    
    Signed-off-by: Keir Fraser <keir@xen.org>
    master commit: 1453984eab1297559e016d4e907a27e55997191c
    master date: 2013-01-30 09:15:39 -0800
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e9f1323..88eeb9d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1092,20 +1092,18 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
 
         if ( paging_mode_hap(v->domain) )
         {
-            /* We manage GUEST_CR3 when guest CR0.PE is zero or when cr3 memevents are on */            
+            /* Manage GUEST_CR3 when CR0.PE=0. */
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
             if ( !hvm_paging_enabled(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;
 
+            /* Trap CR3 updates if CR3 memory events are enabled. */
             if ( v->domain->arch.hvm_domain.params[HVM_PARAM_MEMORY_EVENT_CR3] )
                 v->arch.hvm_vmx.exec_control |= CPU_BASED_CR3_LOAD_EXITING;
 
             vmx_update_cpu_exec_control(v);
-
-            /* Changing CR0.PE can change some bits in real CR4. */
-            vmx_update_guest_cr(v, 4);
         }
 
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )
@@ -1135,8 +1133,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             {
                 for ( s = x86_seg_cs ; s <= x86_seg_tr ; s++ )
                     vmx_set_segment_register(v, s, &reg[s]);
-                v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_VME;
-                __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
                 v->arch.hvm_vmx.exception_bitmap = 0xffffffff;
                 vmx_update_exception_bitmap(v);
             }
@@ -1146,10 +1142,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
                     if ( !(v->arch.hvm_vmx.vm86_segment_mask & (1<<s)) )
                         vmx_set_segment_register(
                             v, s, &v->arch.hvm_vmx.vm86_saved_seg[s]);
-                v->arch.hvm_vcpu.hw_cr[4] =
-                    ((v->arch.hvm_vcpu.hw_cr[4] & ~X86_CR4_VME)
-                     |(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_VME));
-                __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
                 v->arch.hvm_vmx.exception_bitmap = HVM_TRAP_MASK
                           | (paging_mode_hap(v->domain) ?
                              0 : (1U << TRAP_page_fault))
@@ -1163,6 +1155,9 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;
         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);
         __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
+
+        /* Changing CR0 can change some bits in real CR4. */
+        vmx_update_guest_cr(v, 4);
         break;
     }
     case 2:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:55:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:55:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvV6-0003Qm-J8; Wed, 10 Apr 2013 13:55:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvV4-0003Q7-CK
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:46 +0000
Received: from [85.158.139.83:33624] by server-9.bemta-5.messagelabs.com id
	B4/52-08547-16F65615; Wed, 10 Apr 2013 13:55:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1365602143!27692047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21729 invoked from network); 10 Apr 2013 13:55:44 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvV1-0001tX-AT
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvV1-0006TM-6q
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:43 +0000
Date: Wed, 10 Apr 2013 13:55:43 +0000
Message-Id: <E1UPvV1-0006TM-6q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] vmx: Simplify cr0 update handling
	by deferring cr4 changes to the cr4 handler.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da7e3cdf0a1c2440886383e0e7f826c88796b8ca
Author:     Keir Fraser <keir@xen.org>
AuthorDate: Tue Apr 9 16:25:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:25:20 2013 +0200

    vmx: Simplify cr0 update handling by deferring cr4 changes to the cr4 handler.
    
    Signed-off-by: Keir Fraser <keir@xen.org>
    master commit: 1453984eab1297559e016d4e907a27e55997191c
    master date: 2013-01-30 09:15:39 -0800
---
 xen/arch/x86/hvm/vmx/vmx.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e9f1323..88eeb9d 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1092,20 +1092,18 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
 
         if ( paging_mode_hap(v->domain) )
         {
-            /* We manage GUEST_CR3 when guest CR0.PE is zero or when cr3 memevents are on */            
+            /* Manage GUEST_CR3 when CR0.PE=0. */
             uint32_t cr3_ctls = (CPU_BASED_CR3_LOAD_EXITING |
                                  CPU_BASED_CR3_STORE_EXITING);
             v->arch.hvm_vmx.exec_control &= ~cr3_ctls;
             if ( !hvm_paging_enabled(v) )
                 v->arch.hvm_vmx.exec_control |= cr3_ctls;
 
+            /* Trap CR3 updates if CR3 memory events are enabled. */
             if ( v->domain->arch.hvm_domain.params[HVM_PARAM_MEMORY_EVENT_CR3] )
                 v->arch.hvm_vmx.exec_control |= CPU_BASED_CR3_LOAD_EXITING;
 
             vmx_update_cpu_exec_control(v);
-
-            /* Changing CR0.PE can change some bits in real CR4. */
-            vmx_update_guest_cr(v, 4);
         }
 
         if ( !(v->arch.hvm_vcpu.guest_cr[0] & X86_CR0_TS) )
@@ -1135,8 +1133,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             {
                 for ( s = x86_seg_cs ; s <= x86_seg_tr ; s++ )
                     vmx_set_segment_register(v, s, &reg[s]);
-                v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_VME;
-                __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
                 v->arch.hvm_vmx.exception_bitmap = 0xffffffff;
                 vmx_update_exception_bitmap(v);
             }
@@ -1146,10 +1142,6 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
                     if ( !(v->arch.hvm_vmx.vm86_segment_mask & (1<<s)) )
                         vmx_set_segment_register(
                             v, s, &v->arch.hvm_vmx.vm86_saved_seg[s]);
-                v->arch.hvm_vcpu.hw_cr[4] =
-                    ((v->arch.hvm_vcpu.hw_cr[4] & ~X86_CR4_VME)
-                     |(v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_VME));
-                __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
                 v->arch.hvm_vmx.exception_bitmap = HVM_TRAP_MASK
                           | (paging_mode_hap(v->domain) ?
                              0 : (1U << TRAP_page_fault))
@@ -1163,6 +1155,9 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
             v->arch.hvm_vcpu.guest_cr[0] | hw_cr0_mask;
         __vmwrite(GUEST_CR0, v->arch.hvm_vcpu.hw_cr[0]);
         __vmwrite(CR0_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[0]);
+
+        /* Changing CR0 can change some bits in real CR4. */
+        vmx_update_guest_cr(v, 4);
         break;
     }
     case 2:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:56:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvVJ-0003TE-MJ; Wed, 10 Apr 2013 13:56:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVI-0003Sn-5w
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:00 +0000
Received: from [85.158.139.211:62138] by server-6.bemta-5.messagelabs.com id
	4E/BA-21466-F6F65615; Wed, 10 Apr 2013 13:55:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1365602153!18275938!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7113 invoked from network); 10 Apr 2013 13:55:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVB-0001td-Er
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVB-0006Tn-D6
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:53 +0000
Date: Wed, 10 Apr 2013 13:55:53 +0000
Message-Id: <E1UPvVB-0006Tn-D6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: disable SMEP feature when
	guest is in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a625c40e553907d581aa9fbbab762b64841e2741
Author:     Dongxiao Xu <dongxiao.xu@intel.com>
AuthorDate: Tue Apr 9 16:26:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:26:29 2013 +0200

    VMX: disable SMEP feature when guest is in non-paging mode
    
    SMEP is disabled if CPU is in non-paging mode in hardware.
    However Xen always uses paging mode to emulate guest non-paging
    mode with HAP. To emulate this behavior, SMEP needs to be manually
    disabled when guest switches to non-paging mode.
    
    We met an issue that, SMP Linux guest with recent kernel (enable
    SMEP support, for example, 3.5.3) would crash with triple fault if
    setting unrestricted_guest=0 in grub. This is because Xen uses an
    identity mapping page table to emulate the non-paging mode, where
    the page table is set with USER flag. If SMEP is still enabled in
    this case, guest will meet unhandlable page fault and then crash.
    
    Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
    Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
    master commit: e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
    master date: 2013-01-30 09:17:30 -0800
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 88eeb9d..e720c14 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1186,6 +1186,13 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+            /*
+             * SMEP is disabled if CPU is in non-paging mode in hardware.
+             * However Xen always uses paging mode to emulate guest non-paging
+             * mode with HAP. To emulate this behavior, SMEP needs to be
+             * manually disabled when guest switches to non-paging mode.
+             */
+            v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
         __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
         __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:56:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvVJ-0003TE-MJ; Wed, 10 Apr 2013 13:56:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVI-0003Sn-5w
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:00 +0000
Received: from [85.158.139.211:62138] by server-6.bemta-5.messagelabs.com id
	4E/BA-21466-F6F65615; Wed, 10 Apr 2013 13:55:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1365602153!18275938!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7113 invoked from network); 10 Apr 2013 13:55:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:55:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVB-0001td-Er
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVB-0006Tn-D6
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:55:53 +0000
Date: Wed, 10 Apr 2013 13:55:53 +0000
Message-Id: <E1UPvVB-0006Tn-D6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: disable SMEP feature when
	guest is in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a625c40e553907d581aa9fbbab762b64841e2741
Author:     Dongxiao Xu <dongxiao.xu@intel.com>
AuthorDate: Tue Apr 9 16:26:29 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:26:29 2013 +0200

    VMX: disable SMEP feature when guest is in non-paging mode
    
    SMEP is disabled if CPU is in non-paging mode in hardware.
    However Xen always uses paging mode to emulate guest non-paging
    mode with HAP. To emulate this behavior, SMEP needs to be manually
    disabled when guest switches to non-paging mode.
    
    We met an issue that, SMP Linux guest with recent kernel (enable
    SMEP support, for example, 3.5.3) would crash with triple fault if
    setting unrestricted_guest=0 in grub. This is because Xen uses an
    identity mapping page table to emulate the non-paging mode, where
    the page table is set with USER flag. If SMEP is still enabled in
    this case, guest will meet unhandlable page fault and then crash.
    
    Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
    Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
    master commit: e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
    master date: 2013-01-30 09:17:30 -0800
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 88eeb9d..e720c14 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1186,6 +1186,13 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+            /*
+             * SMEP is disabled if CPU is in non-paging mode in hardware.
+             * However Xen always uses paging mode to emulate guest non-paging
+             * mode with HAP. To emulate this behavior, SMEP needs to be
+             * manually disabled when guest switches to non-paging mode.
+             */
+            v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
         __vmwrite(GUEST_CR4, v->arch.hvm_vcpu.hw_cr[4]);
         __vmwrite(CR4_READ_SHADOW, v->arch.hvm_vcpu.guest_cr[4]);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:56:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:56:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvVS-0003VU-5m; Wed, 10 Apr 2013 13:56:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVQ-0003Uu-U2
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:09 +0000
Received: from [85.158.139.83:43768] by server-14.bemta-5.messagelabs.com id
	62/7B-13158-87F65615; Wed, 10 Apr 2013 13:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1365602166!27706646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29133 invoked from network); 10 Apr 2013 13:56:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:56:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVL-0001uA-Jk
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVL-0006Uu-IU
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:03 +0000
Date: Wed, 10 Apr 2013 13:56:03 +0000
Message-Id: <E1UPvVL-0006Uu-IU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: Always disable SMEP when
	guest is in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2cf4461ac868ca82fd63b370afe9efe9a1291900
Author:     Stefan Bader <stefan.bader@canonical.com>
AuthorDate: Tue Apr 9 16:27:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:27:14 2013 +0200

    VMX: Always disable SMEP when guest is in non-paging mode
    
    commit e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
      VMX: disable SMEP feature when guest is in non-paging mode
    
    disabled the SMEP bit if a guest VCPU was using HAP and was not
    in paging mode. However I could observe VCPUs getting stuck in
    the trampoline after the following patch in the Linux kernel
    changed the way CR4 gets set up:
      x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
    
    The change will set CR4 from already set flags which includes the
    SMEP bit. On bare metal this does not matter as the CPU is in non-
    paging mode at that time. But Xen seems to use the emulated non-
    paging mode regardless of HAP (I verified that on the guests I was
    seeing the issue, HAP was not used).
    
    Therefor it seems right to unset the SMEP bit for a VCPU that is
    not in paging-mode, regardless of its HAP usage.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
    master commit: 0d2e673a763bc7c2ddf97fed074eb691d325ecc5
    master date: 2013-04-04 10:37:19 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e720c14..425030b 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1186,11 +1186,14 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+        }
+        if ( !hvm_paging_enabled(v) )
+        {
             /*
              * SMEP is disabled if CPU is in non-paging mode in hardware.
              * However Xen always uses paging mode to emulate guest non-paging
-             * mode with HAP. To emulate this behavior, SMEP needs to be
-             * manually disabled when guest switches to non-paging mode.
+             * mode. To emulate this behavior, SMEP needs to be manually
+             * disabled when guest VCPU is in non-paging mode.
              */
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 13:56:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 13:56:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPvVS-0003VU-5m; Wed, 10 Apr 2013 13:56:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVQ-0003Uu-U2
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:09 +0000
Received: from [85.158.139.83:43768] by server-14.bemta-5.messagelabs.com id
	62/7B-13158-87F65615; Wed, 10 Apr 2013 13:56:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1365602166!27706646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29133 invoked from network); 10 Apr 2013 13:56:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 13:56:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVL-0001uA-Jk
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPvVL-0006Uu-IU
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 13:56:03 +0000
Date: Wed, 10 Apr 2013 13:56:03 +0000
Message-Id: <E1UPvVL-0006Uu-IU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] VMX: Always disable SMEP when
	guest is in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2cf4461ac868ca82fd63b370afe9efe9a1291900
Author:     Stefan Bader <stefan.bader@canonical.com>
AuthorDate: Tue Apr 9 16:27:14 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:27:14 2013 +0200

    VMX: Always disable SMEP when guest is in non-paging mode
    
    commit e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
      VMX: disable SMEP feature when guest is in non-paging mode
    
    disabled the SMEP bit if a guest VCPU was using HAP and was not
    in paging mode. However I could observe VCPUs getting stuck in
    the trampoline after the following patch in the Linux kernel
    changed the way CR4 gets set up:
      x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
    
    The change will set CR4 from already set flags which includes the
    SMEP bit. On bare metal this does not matter as the CPU is in non-
    paging mode at that time. But Xen seems to use the emulated non-
    paging mode regardless of HAP (I verified that on the guests I was
    seeing the issue, HAP was not used).
    
    Therefor it seems right to unset the SMEP bit for a VCPU that is
    not in paging-mode, regardless of its HAP usage.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
    master commit: 0d2e673a763bc7c2ddf97fed074eb691d325ecc5
    master date: 2013-04-04 10:37:19 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e720c14..425030b 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1186,11 +1186,14 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+        }
+        if ( !hvm_paging_enabled(v) )
+        {
             /*
              * SMEP is disabled if CPU is in non-paging mode in hardware.
              * However Xen always uses paging mode to emulate guest non-paging
-             * mode with HAP. To emulate this behavior, SMEP needs to be
-             * manually disabled when guest switches to non-paging mode.
+             * mode. To emulate this behavior, SMEP needs to be manually
+             * disabled when guest VCPU is in non-paging mode.
              */
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyim-00075q-LC; Wed, 10 Apr 2013 17:22:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyil-00075i-Vl
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:08 +0000
Received: from [85.158.137.99:36612] by server-2.bemta-3.messagelabs.com id
	EA/86-05208-FBF95615; Wed, 10 Apr 2013 17:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1365614525!17268858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26139 invoked from network); 10 Apr 2013 17:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyih-0004ep-17
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyig-0003nZ-S5
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:02 +0000
Date: Wed, 10 Apr 2013 17:22:02 +0000
Message-Id: <E1UPyig-0003nZ-S5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: irq_move_cleanup_interrupt()
	must ignore legacy vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5da556675105169807ae2bfe232a2cc4c3f2ae1e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 9 16:04:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:04:25 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: af699220ad6d111ba76fc3040342184e423cc9a1
    master date: 2013-04-02 08:30:03 +0200
---
 xen/arch/x86/i8259.c |    2 ++
 xen/arch/x86/irq.c   |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 9cfbca8..1ff2a8c 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -406,6 +406,8 @@ void __init init_IRQ(void)
     for (irq = 0; platform_legacy_irq(irq); irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 0964c76..5833612 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -616,7 +616,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
     ack_APIC_irq();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -625,6 +627,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
         if (irq == -1)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyim-00075q-LC; Wed, 10 Apr 2013 17:22:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyil-00075i-Vl
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:08 +0000
Received: from [85.158.137.99:36612] by server-2.bemta-3.messagelabs.com id
	EA/86-05208-FBF95615; Wed, 10 Apr 2013 17:22:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-217.messagelabs.com!1365614525!17268858!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26139 invoked from network); 10 Apr 2013 17:22:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyih-0004ep-17
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyig-0003nZ-S5
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:02 +0000
Date: Wed, 10 Apr 2013 17:22:02 +0000
Message-Id: <E1UPyig-0003nZ-S5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: irq_move_cleanup_interrupt()
	must ignore legacy vectors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5da556675105169807ae2bfe232a2cc4c3f2ae1e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 9 16:04:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:04:25 2013 +0200

    x86: irq_move_cleanup_interrupt() must ignore legacy vectors
    
    Since the main loop in the function includes legacy vectors, and since
    vector_irq[] gets set up for legacy vectors regardless of whether those
    get handled through the IO-APIC, it must not do anything on this vector
    range. In fact, we should never get past the move_cleanup_count check
    for IRQs not handled through the IO-APIC. Adding a respective assertion
    woulkd make those iterations more expensive (due to the lock acquire).
    
    For such an assertion to not have false positives we however ought to
    suppress setting up IRQ2 as an 8259A interrupt (which wasn't correct
    anyway), which is being done here despite the assertion not actually
    getting added.
    
    Furthermore, there's no point iterating over the vectors past
    LAST_HIPRIORITY_VECTOR, so terminate the loop accordingly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: af699220ad6d111ba76fc3040342184e423cc9a1
    master date: 2013-04-02 08:30:03 +0200
---
 xen/arch/x86/i8259.c |    2 ++
 xen/arch/x86/irq.c   |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 9cfbca8..1ff2a8c 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -406,6 +406,8 @@ void __init init_IRQ(void)
     for (irq = 0; platform_legacy_irq(irq); irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         
+        if ( irq == 2 ) /* IRQ2 doesn't exist */
+            continue;
         desc->handler = &i8259A_irq_type;
         per_cpu(vector_irq, cpu)[FIRST_LEGACY_VECTOR + irq] = irq;
         cpumask_copy(desc->arch.cpu_mask, cpumask_of(cpu));
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 0964c76..5833612 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -616,7 +616,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
     ack_APIC_irq();
 
     me = smp_processor_id();
-    for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
+    for ( vector = FIRST_DYNAMIC_VECTOR;
+          vector <= LAST_HIPRIORITY_VECTOR; vector++)
+    {
         unsigned int irq;
         unsigned int irr;
         struct irq_desc *desc;
@@ -625,6 +627,9 @@ void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
         if (irq == -1)
             continue;
 
+        if ( vector >= FIRST_LEGACY_VECTOR && vector <= LAST_LEGACY_VECTOR )
+            continue;
+
         desc = irq_to_desc(irq);
         if (!desc)
             continue;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyix-0007Ax-OQ; Wed, 10 Apr 2013 17:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyiw-0007AJ-5K
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:18 +0000
Received: from [85.158.137.99:37256] by server-15.bemta-3.messagelabs.com id
	D4/28-23142-9CF95615; Wed, 10 Apr 2013 17:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1365614535!17010693!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13064 invoked from network); 10 Apr 2013 17:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyit-0004es-6O
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyit-0003og-3x
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:15 +0000
Date: Wed, 10 Apr 2013 17:22:15 +0000
Message-Id: <E1UPyit-0003og-3x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/S3: Restore broken vcpu
	affinity on resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77cb78851429a5a8509e3dfed466b2580ad5c60d
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Tue Apr 9 16:05:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:05:52 2013 +0200

    x86/S3: Restore broken vcpu affinity on resume
    
    When in SYS_STATE_suspend, and going through the cpu_disable_scheduler
    path, save a copy of the current cpu affinity, and mark a flag to
    restore it later.
    
    Later, in the resume process, when enabling nonboot cpus restore these
    affinities.
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 41e71c2607e036f1ac00df898b8f4acb2d4df7ee
    master date: 2013-04-02 09:52:32 +0200
---
 xen/arch/x86/acpi/power.c |    3 +++
 xen/common/domain.c       |    2 ++
 xen/common/schedule.c     |   45 ++++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/sched.h   |    6 ++++++
 4 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 9e1f989..72adc2f 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -96,7 +96,10 @@ static void thaw_domains(void)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
+    {
+        restore_vcpu_affinity(d);
         domain_unpause(d);
+    }
     rcu_read_unlock(&domlist_read_lock);
 }
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e728819..c09fb73 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -126,6 +126,7 @@ struct vcpu *alloc_vcpu(
 
     if ( !zalloc_cpumask_var(&v->cpu_affinity) ||
          !zalloc_cpumask_var(&v->cpu_affinity_tmp) ||
+         !zalloc_cpumask_var(&v->cpu_affinity_saved) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -155,6 +156,7 @@ struct vcpu *alloc_vcpu(
  fail_free:
         free_cpumask_var(v->cpu_affinity);
         free_cpumask_var(v->cpu_affinity_tmp);
+        free_cpumask_var(v->cpu_affinity_saved);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c2cd9d5..7f298d8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -538,6 +538,38 @@ void vcpu_force_reschedule(struct vcpu *v)
     }
 }
 
+void restore_vcpu_affinity(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        vcpu_schedule_lock_irq(v);
+
+        if ( v->affinity_broken )
+        {
+            printk(XENLOG_DEBUG "Restoring affinity for d%dv%d\n",
+                   d->domain_id, v->vcpu_id);
+            cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            v->affinity_broken = 0;
+        }
+
+        if ( v->processor == smp_processor_id() )
+        {
+            set_bit(_VPF_migrating, &v->pause_flags);
+            vcpu_schedule_unlock_irq(v);
+            vcpu_sleep_nosync(v);
+            vcpu_migrate(v);
+        }
+        else
+        {
+            vcpu_schedule_unlock_irq(v);
+        }
+    }
+
+    domain_update_node_affinity(d);
+}
+
 /*
  * This function is used by cpu_hotplug code from stop_machine context
  * and from cpupools to switch schedulers on a cpu.
@@ -551,7 +583,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     int    ret = 0;
 
     c = per_cpu(cpupool, cpu);
-    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
+    if ( c == NULL )
         return ret;
 
     for_each_domain_in_cpupool ( d, c )
@@ -564,8 +596,15 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( cpumask_empty(&online_affinity) &&
                  cpumask_test_cpu(cpu, v->cpu_affinity) )
             {
-                printk("Breaking vcpu affinity for domain %d vcpu %d\n",
-                        v->domain->domain_id, v->vcpu_id);
+                printk(XENLOG_DEBUG "Breaking affinity for d%dv%d\n",
+                        d->domain_id, v->vcpu_id);
+
+                if (system_state == SYS_STATE_suspend)
+                {
+                    cpumask_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    v->affinity_broken = 1;
+                }
+
                 cpumask_setall(v->cpu_affinity);
             }
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 53804c8..b619269 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -140,6 +140,9 @@ struct vcpu
     bool_t           defer_shutdown;
     /* VCPU is paused following shutdown request (d->is_shutting_down)? */
     bool_t           paused_for_shutdown;
+    /* VCPU need affinity restored */
+    bool_t           affinity_broken;
+
 
     /*
      * > 0: a single port is being polled;
@@ -162,6 +165,8 @@ struct vcpu
     cpumask_var_t    cpu_affinity;
     /* Used to change affinity temporarily. */
     cpumask_var_t    cpu_affinity_tmp;
+    /* Used to restore affinity across S3. */
+    cpumask_var_t    cpu_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
@@ -666,6 +671,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
+void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyix-0007Ax-OQ; Wed, 10 Apr 2013 17:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyiw-0007AJ-5K
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:18 +0000
Received: from [85.158.137.99:37256] by server-15.bemta-3.messagelabs.com id
	D4/28-23142-9CF95615; Wed, 10 Apr 2013 17:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1365614535!17010693!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13064 invoked from network); 10 Apr 2013 17:22:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyit-0004es-6O
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyit-0003og-3x
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:15 +0000
Date: Wed, 10 Apr 2013 17:22:15 +0000
Message-Id: <E1UPyit-0003og-3x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/S3: Restore broken vcpu
	affinity on resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 77cb78851429a5a8509e3dfed466b2580ad5c60d
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Tue Apr 9 16:05:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:05:52 2013 +0200

    x86/S3: Restore broken vcpu affinity on resume
    
    When in SYS_STATE_suspend, and going through the cpu_disable_scheduler
    path, save a copy of the current cpu affinity, and mark a flag to
    restore it later.
    
    Later, in the resume process, when enabling nonboot cpus restore these
    affinities.
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 41e71c2607e036f1ac00df898b8f4acb2d4df7ee
    master date: 2013-04-02 09:52:32 +0200
---
 xen/arch/x86/acpi/power.c |    3 +++
 xen/common/domain.c       |    2 ++
 xen/common/schedule.c     |   45 ++++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/sched.h   |    6 ++++++
 4 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 9e1f989..72adc2f 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -96,7 +96,10 @@ static void thaw_domains(void)
 
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
+    {
+        restore_vcpu_affinity(d);
         domain_unpause(d);
+    }
     rcu_read_unlock(&domlist_read_lock);
 }
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e728819..c09fb73 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -126,6 +126,7 @@ struct vcpu *alloc_vcpu(
 
     if ( !zalloc_cpumask_var(&v->cpu_affinity) ||
          !zalloc_cpumask_var(&v->cpu_affinity_tmp) ||
+         !zalloc_cpumask_var(&v->cpu_affinity_saved) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -155,6 +156,7 @@ struct vcpu *alloc_vcpu(
  fail_free:
         free_cpumask_var(v->cpu_affinity);
         free_cpumask_var(v->cpu_affinity_tmp);
+        free_cpumask_var(v->cpu_affinity_saved);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c2cd9d5..7f298d8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -538,6 +538,38 @@ void vcpu_force_reschedule(struct vcpu *v)
     }
 }
 
+void restore_vcpu_affinity(struct domain *d)
+{
+    struct vcpu *v;
+
+    for_each_vcpu ( d, v )
+    {
+        vcpu_schedule_lock_irq(v);
+
+        if ( v->affinity_broken )
+        {
+            printk(XENLOG_DEBUG "Restoring affinity for d%dv%d\n",
+                   d->domain_id, v->vcpu_id);
+            cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            v->affinity_broken = 0;
+        }
+
+        if ( v->processor == smp_processor_id() )
+        {
+            set_bit(_VPF_migrating, &v->pause_flags);
+            vcpu_schedule_unlock_irq(v);
+            vcpu_sleep_nosync(v);
+            vcpu_migrate(v);
+        }
+        else
+        {
+            vcpu_schedule_unlock_irq(v);
+        }
+    }
+
+    domain_update_node_affinity(d);
+}
+
 /*
  * This function is used by cpu_hotplug code from stop_machine context
  * and from cpupools to switch schedulers on a cpu.
@@ -551,7 +583,7 @@ int cpu_disable_scheduler(unsigned int cpu)
     int    ret = 0;
 
     c = per_cpu(cpupool, cpu);
-    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
+    if ( c == NULL )
         return ret;
 
     for_each_domain_in_cpupool ( d, c )
@@ -564,8 +596,15 @@ int cpu_disable_scheduler(unsigned int cpu)
             if ( cpumask_empty(&online_affinity) &&
                  cpumask_test_cpu(cpu, v->cpu_affinity) )
             {
-                printk("Breaking vcpu affinity for domain %d vcpu %d\n",
-                        v->domain->domain_id, v->vcpu_id);
+                printk(XENLOG_DEBUG "Breaking affinity for d%dv%d\n",
+                        d->domain_id, v->vcpu_id);
+
+                if (system_state == SYS_STATE_suspend)
+                {
+                    cpumask_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    v->affinity_broken = 1;
+                }
+
                 cpumask_setall(v->cpu_affinity);
             }
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 53804c8..b619269 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -140,6 +140,9 @@ struct vcpu
     bool_t           defer_shutdown;
     /* VCPU is paused following shutdown request (d->is_shutting_down)? */
     bool_t           paused_for_shutdown;
+    /* VCPU need affinity restored */
+    bool_t           affinity_broken;
+
 
     /*
      * > 0: a single port is being polled;
@@ -162,6 +165,8 @@ struct vcpu
     cpumask_var_t    cpu_affinity;
     /* Used to change affinity temporarily. */
     cpumask_var_t    cpu_affinity_tmp;
+    /* Used to restore affinity across S3. */
+    cpumask_var_t    cpu_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
@@ -666,6 +671,7 @@ int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
+void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
 uint64_t get_cpu_idle_time(unsigned int cpu);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyj9-0007C4-RI; Wed, 10 Apr 2013 17:22:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyj8-0007Bv-TM
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:31 +0000
Received: from [85.158.143.99:5365] by server-1.bemta-4.messagelabs.com id
	4C/06-06203-6DF95615; Wed, 10 Apr 2013 17:22:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1365614545!20577623!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6730 invoked from network); 10 Apr 2013 17:22:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyj3-0004ey-Bo
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyj3-0003p2-AI
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:25 +0000
Date: Wed, 10 Apr 2013 17:22:25 +0000
Message-Id: <E1UPyj3-0003p2-AI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: Always disable SMEP when
	guest is in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d5483523365e85c324d06e8e2b025829aae95f41
Author:     Stefan Bader <stefan.bader@canonical.com>
AuthorDate: Tue Apr 9 16:06:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:06:44 2013 +0200

    VMX: Always disable SMEP when guest is in non-paging mode
    
    commit e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
      VMX: disable SMEP feature when guest is in non-paging mode
    
    disabled the SMEP bit if a guest VCPU was using HAP and was not
    in paging mode. However I could observe VCPUs getting stuck in
    the trampoline after the following patch in the Linux kernel
    changed the way CR4 gets set up:
      x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
    
    The change will set CR4 from already set flags which includes the
    SMEP bit. On bare metal this does not matter as the CPU is in non-
    paging mode at that time. But Xen seems to use the emulated non-
    paging mode regardless of HAP (I verified that on the guests I was
    seeing the issue, HAP was not used).
    
    Therefor it seems right to unset the SMEP bit for a VCPU that is
    not in paging-mode, regardless of its HAP usage.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
    master commit: 0d2e673a763bc7c2ddf97fed074eb691d325ecc5
    master date: 2013-04-04 10:37:19 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index de6340d..428a5c9 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1227,11 +1227,14 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+        }
+        if ( !hvm_paging_enabled(v) )
+        {
             /*
              * SMEP is disabled if CPU is in non-paging mode in hardware.
              * However Xen always uses paging mode to emulate guest non-paging
-             * mode with HAP. To emulate this behavior, SMEP needs to be
-             * manually disabled when guest switches to non-paging mode.
+             * mode. To emulate this behavior, SMEP needs to be manually
+             * disabled when guest VCPU is in non-paging mode.
              */
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyj9-0007C4-RI; Wed, 10 Apr 2013 17:22:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyj8-0007Bv-TM
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:31 +0000
Received: from [85.158.143.99:5365] by server-1.bemta-4.messagelabs.com id
	4C/06-06203-6DF95615; Wed, 10 Apr 2013 17:22:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-216.messagelabs.com!1365614545!20577623!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6730 invoked from network); 10 Apr 2013 17:22:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyj3-0004ey-Bo
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyj3-0003p2-AI
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:25 +0000
Date: Wed, 10 Apr 2013 17:22:25 +0000
Message-Id: <E1UPyj3-0003p2-AI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VMX: Always disable SMEP when
	guest is in non-paging mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d5483523365e85c324d06e8e2b025829aae95f41
Author:     Stefan Bader <stefan.bader@canonical.com>
AuthorDate: Tue Apr 9 16:06:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:06:44 2013 +0200

    VMX: Always disable SMEP when guest is in non-paging mode
    
    commit e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
      VMX: disable SMEP feature when guest is in non-paging mode
    
    disabled the SMEP bit if a guest VCPU was using HAP and was not
    in paging mode. However I could observe VCPUs getting stuck in
    the trampoline after the following patch in the Linux kernel
    changed the way CR4 gets set up:
      x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
    
    The change will set CR4 from already set flags which includes the
    SMEP bit. On bare metal this does not matter as the CPU is in non-
    paging mode at that time. But Xen seems to use the emulated non-
    paging mode regardless of HAP (I verified that on the guests I was
    seeing the issue, HAP was not used).
    
    Therefor it seems right to unset the SMEP bit for a VCPU that is
    not in paging-mode, regardless of its HAP usage.
    
    Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Dongxiao Xu <dongxiao.xu@intel.com>
    master commit: 0d2e673a763bc7c2ddf97fed074eb691d325ecc5
    master date: 2013-04-04 10:37:19 +0200
---
 xen/arch/x86/hvm/vmx/vmx.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index de6340d..428a5c9 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1227,11 +1227,14 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr)
         {
             v->arch.hvm_vcpu.hw_cr[4] |= X86_CR4_PSE;
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_PAE;
+        }
+        if ( !hvm_paging_enabled(v) )
+        {
             /*
              * SMEP is disabled if CPU is in non-paging mode in hardware.
              * However Xen always uses paging mode to emulate guest non-paging
-             * mode with HAP. To emulate this behavior, SMEP needs to be
-             * manually disabled when guest switches to non-paging mode.
+             * mode. To emulate this behavior, SMEP needs to be manually
+             * disabled when guest VCPU is in non-paging mode.
              */
             v->arch.hvm_vcpu.hw_cr[4] &= ~X86_CR4_SMEP;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyjP-0007Dp-UZ; Wed, 10 Apr 2013 17:22:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyjO-0007Dd-Ei
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:46 +0000
Received: from [85.158.143.99:8011] by server-1.bemta-4.messagelabs.com id
	37/26-06203-5EF95615; Wed, 10 Apr 2013 17:22:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1365614555!22304558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2830 invoked from network); 10 Apr 2013 17:22:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyjD-0004f6-Ko
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyjD-0003pa-Gr
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:35 +0000
Date: Wed, 10 Apr 2013 17:22:35 +0000
Message-Id: <E1UPyjD-0003pa-Gr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/mm/shadow: spurious warning
	when unmapping xenheap pages.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0984c2b63a7c3e9dfa770b29dac51a5124aecaab
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Apr 9 16:07:23 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:07:23 2013 +0200

    x86/mm/shadow: spurious warning when unmapping xenheap pages.
    
    Xenheap pages will always have an extra typecount, taken in
    share_xen_page_with_guest(), which doesn't come from a shadow PTE.
    Adjust the warning in sh_remove_all_mappings() to account for it.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
    master date: 2013-04-04 10:14:30 +0100
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 xen/include/asm-x86/mm.h        |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index dc245be..ef06a03 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2515,10 +2515,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index a7bb3bb..ba92568 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -246,7 +246,7 @@ struct spage_info
 #endif
 
 #if defined(__i386__)
-#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
+#define is_xen_heap_page(page) is_xen_heap_mfn(__page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                         \
     unsigned long _mfn = (mfn);                         \
     (_mfn < paddr_to_pfn(xenheap_phys_end));            \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 10 17:22:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 10 Apr 2013 17:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UPyjP-0007Dp-UZ; Wed, 10 Apr 2013 17:22:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyjO-0007Dd-Ei
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:46 +0000
Received: from [85.158.143.99:8011] by server-1.bemta-4.messagelabs.com id
	37/26-06203-5EF95615; Wed, 10 Apr 2013 17:22:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1365614555!22304558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2830 invoked from network); 10 Apr 2013 17:22:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Apr 2013 17:22:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyjD-0004f6-Ko
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UPyjD-0003pa-Gr
	for xen-changelog@lists.xensource.com; Wed, 10 Apr 2013 17:22:35 +0000
Date: Wed, 10 Apr 2013 17:22:35 +0000
Message-Id: <E1UPyjD-0003pa-Gr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/mm/shadow: spurious warning
	when unmapping xenheap pages.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0984c2b63a7c3e9dfa770b29dac51a5124aecaab
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Tue Apr 9 16:07:23 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 9 16:07:23 2013 +0200

    x86/mm/shadow: spurious warning when unmapping xenheap pages.
    
    Xenheap pages will always have an extra typecount, taken in
    share_xen_page_with_guest(), which doesn't come from a shadow PTE.
    Adjust the warning in sh_remove_all_mappings() to account for it.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cfc515dabe91e3d6c690c68c6a669d6d77fb7ac4
    master date: 2013-04-04 10:14:30 +0100
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 xen/include/asm-x86/mm.h        |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index dc245be..ef06a03 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2515,10 +2515,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index a7bb3bb..ba92568 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -246,7 +246,7 @@ struct spage_info
 #endif
 
 #if defined(__i386__)
-#define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
+#define is_xen_heap_page(page) is_xen_heap_mfn(__page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                         \
     unsigned long _mfn = (mfn);                         \
     (_mfn < paddr_to_pfn(xenheap_phys_end));            \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMto-00081j-2q; Thu, 11 Apr 2013 19:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtm-00081R-IA
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:06 +0000
Received: from [85.158.138.51:57301] by server-10.bemta-3.messagelabs.com id
	A8/E9-19664-9CA07615; Thu, 11 Apr 2013 19:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365707463!23853180!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23828 invoked from network); 11 Apr 2013 19:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtj-0004eB-Jb
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtj-0008BA-GE
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:03 +0000
Date: Thu, 11 Apr 2013 19:11:03 +0000
Message-Id: <E1UQMtj-0008BA-GE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: dump gic debug info from
	arch_dump_domain_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0648a3437e9adc2f297f16286b1d58d598c0b865
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Feb 18 16:02:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 10 16:04:48 2013 +0100

    xen/arm: dump gic debug info from arch_dump_domain_info
    
    Print some useful GIC debug information when arch_dump_domain_info is
    called ('q' debug key).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c     |    6 ++++++
 xen/arch/arm/gic.c        |   27 +++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h |    3 +++
 3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index bca3d89..ac997d6 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -617,6 +617,12 @@ int domain_relinquish_resources(struct domain *d)
 
 void arch_dump_domain_info(struct domain *d)
 {
+	struct vcpu *v;
+
+	for_each_vcpu ( d, v )
+	{
+		gic_dump_info(v);
+	}
 }
 
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 41abdfb..5a380ca 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -657,6 +657,33 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
     }
 }
 
+void gic_dump_info(struct vcpu *v)
+{
+    int i;
+    struct pending_irq *p;
+
+    printk("GICH_LRs (vcpu %d) mask=%llx\n", v->vcpu_id, v->arch.lr_mask);
+    if ( v == current )
+    {
+        for ( i = 0; i < nr_lrs; i++ )
+            printk("   HW_LR[%d]=%x\n", i, GICH[GICH_LR + i]);
+    } else {
+        for ( i = 0; i < nr_lrs; i++ )
+            printk("   VCPU_LR[%d]=%x\n", i, v->arch.gic_lr[i]);
+    }
+
+    list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight )
+    {
+        printk("Inflight irq=%d\n", p->irq);
+    }
+
+    list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue )
+    {
+        printk("Pending irq=%d\n", p->irq);
+    }
+
+}
+
 void __cpuinit init_maintenance_interrupt(void)
 {
     request_irq(25, maintenance_interrupt, 0, "irq-maintenance", NULL);
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index c6535d1..6bf50bb 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -157,6 +157,9 @@ extern int gicv_setup(struct domain *d);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+/* print useful debug info */
+extern void gic_dump_info(struct vcpu *v);
+
 #endif /* __ASSEMBLY__ */
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMto-00081j-2q; Thu, 11 Apr 2013 19:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtm-00081R-IA
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:06 +0000
Received: from [85.158.138.51:57301] by server-10.bemta-3.messagelabs.com id
	A8/E9-19664-9CA07615; Thu, 11 Apr 2013 19:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365707463!23853180!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23828 invoked from network); 11 Apr 2013 19:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtj-0004eB-Jb
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtj-0008BA-GE
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:03 +0000
Date: Thu, 11 Apr 2013 19:11:03 +0000
Message-Id: <E1UQMtj-0008BA-GE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: dump gic debug info from
	arch_dump_domain_info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0648a3437e9adc2f297f16286b1d58d598c0b865
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Feb 18 16:02:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 10 16:04:48 2013 +0100

    xen/arm: dump gic debug info from arch_dump_domain_info
    
    Print some useful GIC debug information when arch_dump_domain_info is
    called ('q' debug key).
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c     |    6 ++++++
 xen/arch/arm/gic.c        |   27 +++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h |    3 +++
 3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index bca3d89..ac997d6 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -617,6 +617,12 @@ int domain_relinquish_resources(struct domain *d)
 
 void arch_dump_domain_info(struct domain *d)
 {
+	struct vcpu *v;
+
+	for_each_vcpu ( d, v )
+	{
+		gic_dump_info(v);
+	}
 }
 
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 41abdfb..5a380ca 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -657,6 +657,33 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
     }
 }
 
+void gic_dump_info(struct vcpu *v)
+{
+    int i;
+    struct pending_irq *p;
+
+    printk("GICH_LRs (vcpu %d) mask=%llx\n", v->vcpu_id, v->arch.lr_mask);
+    if ( v == current )
+    {
+        for ( i = 0; i < nr_lrs; i++ )
+            printk("   HW_LR[%d]=%x\n", i, GICH[GICH_LR + i]);
+    } else {
+        for ( i = 0; i < nr_lrs; i++ )
+            printk("   VCPU_LR[%d]=%x\n", i, v->arch.gic_lr[i]);
+    }
+
+    list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight )
+    {
+        printk("Inflight irq=%d\n", p->irq);
+    }
+
+    list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue )
+    {
+        printk("Pending irq=%d\n", p->irq);
+    }
+
+}
+
 void __cpuinit init_maintenance_interrupt(void)
 {
     request_irq(25, maintenance_interrupt, 0, "irq-maintenance", NULL);
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index c6535d1..6bf50bb 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -157,6 +157,9 @@ extern int gicv_setup(struct domain *d);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+/* print useful debug info */
+extern void gic_dump_info(struct vcpu *v);
+
 #endif /* __ASSEMBLY__ */
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMty-00083E-5x; Thu, 11 Apr 2013 19:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtw-00082z-Ix
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:16 +0000
Received: from [85.158.139.211:16942] by server-9.bemta-5.messagelabs.com id
	1C/7A-08547-3DA07615; Thu, 11 Apr 2013 19:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1365707474!18049914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5940 invoked from network); 11 Apr 2013 19:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtt-0004eE-VB
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtt-0008CD-SS
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:13 +0000
Date: Thu, 11 Apr 2013 19:11:13 +0000
Message-Id: <E1UQMtt-0008CD-SS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: don't set the internal Xen
	timer if virt_timer is masked
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c96513ff9d564b019ab8849d5bd8c4c81b19e871
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Feb 18 16:02:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 10 16:08:36 2013 +0100

    xen/arm: don't set the internal Xen timer if virt_timer is masked
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index dfe3a3e..a68f662 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -80,7 +80,8 @@ int virt_timer_save(struct vcpu *v)
     v->arch.virt_timer.ctl = READ_SYSREG32(CNTV_CTL_EL0);
     WRITE_SYSREG32(v->arch.virt_timer.ctl & ~CNTx_CTL_ENABLE, CNTV_CTL_EL0);
     v->arch.virt_timer.cval = READ_SYSREG64(CNTV_CVAL_EL0);
-    if ( v->arch.virt_timer.ctl & CNTx_CTL_ENABLE )
+    if ( (v->arch.virt_timer.ctl & CNTx_CTL_ENABLE) &&
+         !(v->arch.virt_timer.ctl & CNTx_CTL_MASK))
     {
         set_timer(&v->arch.virt_timer.timer, ticks_to_ns(v->arch.virt_timer.cval +
                   v->arch.virt_timer.offset - boot_count));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMty-00083E-5x; Thu, 11 Apr 2013 19:11:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtw-00082z-Ix
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:16 +0000
Received: from [85.158.139.211:16942] by server-9.bemta-5.messagelabs.com id
	1C/7A-08547-3DA07615; Thu, 11 Apr 2013 19:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1365707474!18049914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5940 invoked from network); 11 Apr 2013 19:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtt-0004eE-VB
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMtt-0008CD-SS
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:13 +0000
Date: Thu, 11 Apr 2013 19:11:13 +0000
Message-Id: <E1UQMtt-0008CD-SS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: don't set the internal Xen
	timer if virt_timer is masked
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c96513ff9d564b019ab8849d5bd8c4c81b19e871
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Mon Feb 18 16:02:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 10 16:08:36 2013 +0100

    xen/arm: don't set the internal Xen timer if virt_timer is masked
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index dfe3a3e..a68f662 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -80,7 +80,8 @@ int virt_timer_save(struct vcpu *v)
     v->arch.virt_timer.ctl = READ_SYSREG32(CNTV_CTL_EL0);
     WRITE_SYSREG32(v->arch.virt_timer.ctl & ~CNTx_CTL_ENABLE, CNTV_CTL_EL0);
     v->arch.virt_timer.cval = READ_SYSREG64(CNTV_CVAL_EL0);
-    if ( v->arch.virt_timer.ctl & CNTx_CTL_ENABLE )
+    if ( (v->arch.virt_timer.ctl & CNTx_CTL_ENABLE) &&
+         !(v->arch.virt_timer.ctl & CNTx_CTL_MASK))
     {
         set_timer(&v->arch.virt_timer.timer, ticks_to_ns(v->arch.virt_timer.cval +
                   v->arch.virt_timer.offset - boot_count));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMu9-00084t-8n; Thu, 11 Apr 2013 19:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMu7-00084U-LL
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:27 +0000
Received: from [193.109.254.147:19313] by server-12.bemta-14.messagelabs.com
	id BD/5A-05449-EDA07615; Thu, 11 Apr 2013 19:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1365707484!9082591!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23989 invoked from network); 11 Apr 2013 19:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMu4-0004eL-8O
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMu4-0008Ca-2p
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:24 +0000
Date: Thu, 11 Apr 2013 19:11:24 +0000
Message-Id: <E1UQMu4-0008Ca-2p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: phys_timer fixes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 94d166c0106f158fa2c86496bfb0ca1fbb8627ec
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Feb 20 18:16:37 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 10 16:12:38 2013 +0100

    xen/arm: phys_timer fixes
    
    Do not unmask the emulated phys_timer when the related Xen timer
    expires.
    Do not inject the phys_timer interrupt if it is masked.
    
    Do not let the user set CNTx_CTL_PENDING directly.
    
    Set CNTx_CTL_PENDING when the phys_timer expires and clear it when the
    phys_timer is disabled or the compare value is changed.
    
    Define offset and cval as uint64_t given that they can't be negative and
    they are used as uint64_t arguments.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c        |   10 +++++++---
 xen/include/asm-arm/domain.h |    4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index a68f662..1cb365e 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -33,8 +33,8 @@ static void phys_timer_expired(void *data)
 {
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_PENDING;
-    t->ctl &= ~CNTx_CTL_MASK;
-    vgic_vcpu_inject_irq(t->v, 30, 1);
+    if ( !(t->ctl & CNTx_CTL_MASK) )
+        vgic_vcpu_inject_irq(t->v, 30, 1);
 }
 
 static void virt_timer_expired(void *data)
@@ -118,7 +118,10 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
         }
         else
         {
-            v->arch.phys_timer.ctl = *r;
+            uint32_t ctl = *r & ~CNTx_CTL_PENDING;
+            if ( ctl & CNTx_CTL_ENABLE )
+                ctl |= v->arch.phys_timer.ctl & CNTx_CTL_PENDING;
+            v->arch.phys_timer.ctl = ctl;
 
             if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
             {
@@ -142,6 +145,7 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
             v->arch.phys_timer.cval = now + ticks_to_ns(*r);
             if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
             {
+                v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
                 set_timer(&v->arch.phys_timer.timer,
                           v->arch.phys_timer.cval + v->arch.phys_timer.offset);
             }
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index bf9caff..3fa266c2 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -96,8 +96,8 @@ struct vtimer {
         int irq;
         struct timer timer;
         uint32_t ctl;
-        s_time_t offset;
-        s_time_t cval;
+        uint64_t offset;
+        uint64_t cval;
 };
 
 struct arch_vcpu
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMu9-00084t-8n; Thu, 11 Apr 2013 19:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMu7-00084U-LL
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:27 +0000
Received: from [193.109.254.147:19313] by server-12.bemta-14.messagelabs.com
	id BD/5A-05449-EDA07615; Thu, 11 Apr 2013 19:11:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1365707484!9082591!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23989 invoked from network); 11 Apr 2013 19:11:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMu4-0004eL-8O
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMu4-0008Ca-2p
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:24 +0000
Date: Thu, 11 Apr 2013 19:11:24 +0000
Message-Id: <E1UQMu4-0008Ca-2p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: phys_timer fixes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 94d166c0106f158fa2c86496bfb0ca1fbb8627ec
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Feb 20 18:16:37 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 10 16:12:38 2013 +0100

    xen/arm: phys_timer fixes
    
    Do not unmask the emulated phys_timer when the related Xen timer
    expires.
    Do not inject the phys_timer interrupt if it is masked.
    
    Do not let the user set CNTx_CTL_PENDING directly.
    
    Set CNTx_CTL_PENDING when the phys_timer expires and clear it when the
    phys_timer is disabled or the compare value is changed.
    
    Define offset and cval as uint64_t given that they can't be negative and
    they are used as uint64_t arguments.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vtimer.c        |   10 +++++++---
 xen/include/asm-arm/domain.h |    4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index a68f662..1cb365e 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -33,8 +33,8 @@ static void phys_timer_expired(void *data)
 {
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_PENDING;
-    t->ctl &= ~CNTx_CTL_MASK;
-    vgic_vcpu_inject_irq(t->v, 30, 1);
+    if ( !(t->ctl & CNTx_CTL_MASK) )
+        vgic_vcpu_inject_irq(t->v, 30, 1);
 }
 
 static void virt_timer_expired(void *data)
@@ -118,7 +118,10 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
         }
         else
         {
-            v->arch.phys_timer.ctl = *r;
+            uint32_t ctl = *r & ~CNTx_CTL_PENDING;
+            if ( ctl & CNTx_CTL_ENABLE )
+                ctl |= v->arch.phys_timer.ctl & CNTx_CTL_PENDING;
+            v->arch.phys_timer.ctl = ctl;
 
             if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
             {
@@ -142,6 +145,7 @@ static int vtimer_emulate_32(struct cpu_user_regs *regs, union hsr hsr)
             v->arch.phys_timer.cval = now + ticks_to_ns(*r);
             if ( v->arch.phys_timer.ctl & CNTx_CTL_ENABLE )
             {
+                v->arch.phys_timer.ctl &= ~CNTx_CTL_PENDING;
                 set_timer(&v->arch.phys_timer.timer,
                           v->arch.phys_timer.cval + v->arch.phys_timer.offset);
             }
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index bf9caff..3fa266c2 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -96,8 +96,8 @@ struct vtimer {
         int irq;
         struct timer timer;
         uint32_t ctl;
-        s_time_t offset;
-        s_time_t cval;
+        uint64_t offset;
+        uint64_t cval;
 };
 
 struct arch_vcpu
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMuJ-00086Y-Bl; Thu, 11 Apr 2013 19:11:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuH-00086D-JC
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:37 +0000
Received: from [85.158.138.51:62439] by server-7.bemta-3.messagelabs.com id
	BA/37-06591-8EA07615; Thu, 11 Apr 2013 19:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1365707494!27965130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23903 invoked from network); 11 Apr 2013 19:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuE-0004eS-EN
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuE-0008D8-C6
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:34 +0000
Date: Thu, 11 Apr 2013 19:11:34 +0000
Message-Id: <E1UQMuE-0008D8-C6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: cleanup to prepare for
	multi-vector MSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe017c59c4c3ce189119954841a38ef0f1e415d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 10 17:30:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 10 17:30:19 2013 +0200

    x86/MSI: cleanup to prepare for multi-vector MSI
    
    The major aspect being the removal of the overload of the MSI entry's
    mask_base field for MSI purposes - a proper union is being installed
    instead, tracking both the config space position needed and the number
    of vectors used (which is going to be 1 until the actual multi-vector
    MSI patches arrive).
    
    It also corrects misleading information from debug key 'M': When
    msi_get_mask_bit() returns a negative value, there's no mask bit, and
    hence output shouldn't give the impression there is.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c        |   41 ++++++++++++++++++++++-------------------
 xen/include/asm-x86/msi.h |    4 ++++
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 37ed8f8..6cc8f7a 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -348,18 +348,16 @@ static void msi_set_mask_bit(struct irq_desc *desc, int flag)
     switch (entry->msi_attrib.type) {
     case PCI_CAP_ID_MSI:
         if (entry->msi_attrib.maskbit) {
-            int pos;
             u32 mask_bits;
             u16 seg = entry->dev->seg;
             u8 bus = entry->dev->bus;
             u8 slot = PCI_SLOT(entry->dev->devfn);
             u8 func = PCI_FUNC(entry->dev->devfn);
 
-            pos = (long)entry->mask_base;
-            mask_bits = pci_conf_read32(seg, bus, slot, func, pos);
+            mask_bits = pci_conf_read32(seg, bus, slot, func, entry->msi.mpos);
             mask_bits &= ~(1);
             mask_bits |= flag;
-            pci_conf_write32(seg, bus, slot, func, pos, mask_bits);
+            pci_conf_write32(seg, bus, slot, func, entry->msi.mpos, mask_bits);
         }
         break;
     case PCI_CAP_ID_MSIX:
@@ -385,7 +383,7 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
         return pci_conf_read32(entry->dev->seg, entry->dev->bus,
                                PCI_SLOT(entry->dev->devfn),
                                PCI_FUNC(entry->dev->devfn),
-                               (unsigned long)entry->mask_base) & 1;
+                               entry->msi.mpos) & 1;
     case PCI_CAP_ID_MSIX:
         return readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) & 1;
     }
@@ -530,6 +528,7 @@ static int msi_capability_init(struct pci_dev *dev,
 {
     struct msi_desc *entry;
     int pos;
+    unsigned int maxvec, mpos;
     u16 control, seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
@@ -538,6 +537,9 @@ static int msi_capability_init(struct pci_dev *dev,
     ASSERT(spin_is_locked(&pcidevs_lock));
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
     control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
+    maxvec = multi_msi_capable(control);
+    control &= ~PCI_MSI_FLAGS_QSIZE;
+
     /* MSI Entry Initialization */
     msi_set_enable(dev, 0); /* Ensure msi is disabled as I set it up */
 
@@ -551,23 +553,20 @@ static int msi_capability_init(struct pci_dev *dev,
     entry->msi_attrib.maskbit = is_mask_bit_support(control);
     entry->msi_attrib.masked = 1;
     entry->msi_attrib.pos = pos;
+    mpos = msi_mask_bits_reg(pos, is_64bit_address(control));
+    entry->msi.nvec = 1;
     entry->irq = irq;
     if ( is_mask_bit_support(control) )
-        entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos,
-                                                                   is_64bit_address(control));
+        entry->msi.mpos = mpos;
     entry->dev = dev;
     if ( entry->msi_attrib.maskbit )
     {
-        unsigned int maskbits, temp;
+        u32 maskbits;
+
         /* All MSIs are unmasked by default, Mask them all */
-        maskbits = pci_conf_read32(seg, bus, slot, func,
-                                   msi_mask_bits_reg(pos, is_64bit_address(control)));
-        temp = (1 << multi_msi_capable(control));
-        temp = ((temp - 1) & ~temp);
-        maskbits |= temp;
-        pci_conf_write32(seg, bus, slot, func,
-                         msi_mask_bits_reg(pos, is_64bit_address(control)),
-                         maskbits);
+        maskbits = pci_conf_read32(seg, bus, slot, func, mpos);
+        maskbits |= ~(u32)0 >> (32 - maxvec);
+        pci_conf_write32(seg, bus, slot, func, mpos, maskbits);
     }
     list_add_tail(&entry->list, &dev->msi_list);
 
@@ -1204,7 +1203,7 @@ static void dump_msi(unsigned char key)
         struct irq_desc *desc = irq_to_desc(irq);
         const struct msi_desc *entry;
         u32 addr, data, dest32;
-        char mask;
+        signed char mask;
         struct msi_attrib attr;
         unsigned long flags;
         const char *type = "???";
@@ -1239,12 +1238,16 @@ static void dump_msi(unsigned char key)
         dest32 = entry->msg.dest32;
         attr = entry->msi_attrib;
         if ( entry->msi_attrib.type )
-            mask = msi_get_mask_bit(entry) ? '1' : '0';
+            mask = msi_get_mask_bit(entry);
         else
-            mask = '?';
+            mask = -1;
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
+        if ( mask >= 0 )
+            mask += '0';
+        else
+            mask = '?';
         printk(" %-6s%4u vec=%02x%7s%6s%3sassert%5s%7s"
                " dest=%08x mask=%d/%d/%c\n",
                type, irq,
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 6fe67dc..d288cfc 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -100,6 +100,10 @@ struct msi_desc {
 
 	union {
 		void __iomem *mask_base;/* va for the entry in mask table */
+		struct {
+			unsigned int nvec;/* number of vectors            */
+			unsigned int mpos;/* location of mask register    */
+		} msi;
 		unsigned int hpet_id;   /* HPET (dev is NULL)             */
 	};
 	struct pci_dev *dev;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMuJ-00086Y-Bl; Thu, 11 Apr 2013 19:11:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuH-00086D-JC
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:37 +0000
Received: from [85.158.138.51:62439] by server-7.bemta-3.messagelabs.com id
	BA/37-06591-8EA07615; Thu, 11 Apr 2013 19:11:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1365707494!27965130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23903 invoked from network); 11 Apr 2013 19:11:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuE-0004eS-EN
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuE-0008D8-C6
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:34 +0000
Date: Thu, 11 Apr 2013 19:11:34 +0000
Message-Id: <E1UQMuE-0008D8-C6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/MSI: cleanup to prepare for
	multi-vector MSI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe017c59c4c3ce189119954841a38ef0f1e415d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 10 17:30:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 10 17:30:19 2013 +0200

    x86/MSI: cleanup to prepare for multi-vector MSI
    
    The major aspect being the removal of the overload of the MSI entry's
    mask_base field for MSI purposes - a proper union is being installed
    instead, tracking both the config space position needed and the number
    of vectors used (which is going to be 1 until the actual multi-vector
    MSI patches arrive).
    
    It also corrects misleading information from debug key 'M': When
    msi_get_mask_bit() returns a negative value, there's no mask bit, and
    hence output shouldn't give the impression there is.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msi.c        |   41 ++++++++++++++++++++++-------------------
 xen/include/asm-x86/msi.h |    4 ++++
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 37ed8f8..6cc8f7a 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -348,18 +348,16 @@ static void msi_set_mask_bit(struct irq_desc *desc, int flag)
     switch (entry->msi_attrib.type) {
     case PCI_CAP_ID_MSI:
         if (entry->msi_attrib.maskbit) {
-            int pos;
             u32 mask_bits;
             u16 seg = entry->dev->seg;
             u8 bus = entry->dev->bus;
             u8 slot = PCI_SLOT(entry->dev->devfn);
             u8 func = PCI_FUNC(entry->dev->devfn);
 
-            pos = (long)entry->mask_base;
-            mask_bits = pci_conf_read32(seg, bus, slot, func, pos);
+            mask_bits = pci_conf_read32(seg, bus, slot, func, entry->msi.mpos);
             mask_bits &= ~(1);
             mask_bits |= flag;
-            pci_conf_write32(seg, bus, slot, func, pos, mask_bits);
+            pci_conf_write32(seg, bus, slot, func, entry->msi.mpos, mask_bits);
         }
         break;
     case PCI_CAP_ID_MSIX:
@@ -385,7 +383,7 @@ static int msi_get_mask_bit(const struct msi_desc *entry)
         return pci_conf_read32(entry->dev->seg, entry->dev->bus,
                                PCI_SLOT(entry->dev->devfn),
                                PCI_FUNC(entry->dev->devfn),
-                               (unsigned long)entry->mask_base) & 1;
+                               entry->msi.mpos) & 1;
     case PCI_CAP_ID_MSIX:
         return readl(entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) & 1;
     }
@@ -530,6 +528,7 @@ static int msi_capability_init(struct pci_dev *dev,
 {
     struct msi_desc *entry;
     int pos;
+    unsigned int maxvec, mpos;
     u16 control, seg = dev->seg;
     u8 bus = dev->bus;
     u8 slot = PCI_SLOT(dev->devfn);
@@ -538,6 +537,9 @@ static int msi_capability_init(struct pci_dev *dev,
     ASSERT(spin_is_locked(&pcidevs_lock));
     pos = pci_find_cap_offset(seg, bus, slot, func, PCI_CAP_ID_MSI);
     control = pci_conf_read16(seg, bus, slot, func, msi_control_reg(pos));
+    maxvec = multi_msi_capable(control);
+    control &= ~PCI_MSI_FLAGS_QSIZE;
+
     /* MSI Entry Initialization */
     msi_set_enable(dev, 0); /* Ensure msi is disabled as I set it up */
 
@@ -551,23 +553,20 @@ static int msi_capability_init(struct pci_dev *dev,
     entry->msi_attrib.maskbit = is_mask_bit_support(control);
     entry->msi_attrib.masked = 1;
     entry->msi_attrib.pos = pos;
+    mpos = msi_mask_bits_reg(pos, is_64bit_address(control));
+    entry->msi.nvec = 1;
     entry->irq = irq;
     if ( is_mask_bit_support(control) )
-        entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos,
-                                                                   is_64bit_address(control));
+        entry->msi.mpos = mpos;
     entry->dev = dev;
     if ( entry->msi_attrib.maskbit )
     {
-        unsigned int maskbits, temp;
+        u32 maskbits;
+
         /* All MSIs are unmasked by default, Mask them all */
-        maskbits = pci_conf_read32(seg, bus, slot, func,
-                                   msi_mask_bits_reg(pos, is_64bit_address(control)));
-        temp = (1 << multi_msi_capable(control));
-        temp = ((temp - 1) & ~temp);
-        maskbits |= temp;
-        pci_conf_write32(seg, bus, slot, func,
-                         msi_mask_bits_reg(pos, is_64bit_address(control)),
-                         maskbits);
+        maskbits = pci_conf_read32(seg, bus, slot, func, mpos);
+        maskbits |= ~(u32)0 >> (32 - maxvec);
+        pci_conf_write32(seg, bus, slot, func, mpos, maskbits);
     }
     list_add_tail(&entry->list, &dev->msi_list);
 
@@ -1204,7 +1203,7 @@ static void dump_msi(unsigned char key)
         struct irq_desc *desc = irq_to_desc(irq);
         const struct msi_desc *entry;
         u32 addr, data, dest32;
-        char mask;
+        signed char mask;
         struct msi_attrib attr;
         unsigned long flags;
         const char *type = "???";
@@ -1239,12 +1238,16 @@ static void dump_msi(unsigned char key)
         dest32 = entry->msg.dest32;
         attr = entry->msi_attrib;
         if ( entry->msi_attrib.type )
-            mask = msi_get_mask_bit(entry) ? '1' : '0';
+            mask = msi_get_mask_bit(entry);
         else
-            mask = '?';
+            mask = -1;
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
+        if ( mask >= 0 )
+            mask += '0';
+        else
+            mask = '?';
         printk(" %-6s%4u vec=%02x%7s%6s%3sassert%5s%7s"
                " dest=%08x mask=%d/%d/%c\n",
                type, irq,
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 6fe67dc..d288cfc 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -100,6 +100,10 @@ struct msi_desc {
 
 	union {
 		void __iomem *mask_base;/* va for the entry in mask table */
+		struct {
+			unsigned int nvec;/* number of vectors            */
+			unsigned int mpos;/* location of mask register    */
+		} msi;
 		unsigned int hpet_id;   /* HPET (dev is NULL)             */
 	};
 	struct pci_dev *dev;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMuT-00088G-Fq; Thu, 11 Apr 2013 19:11:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuR-00087r-Dx
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:47 +0000
Received: from [85.158.138.51:62773] by server-9.bemta-3.messagelabs.com id
	0B/AF-32531-2FA07615; Thu, 11 Apr 2013 19:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1365707504!27774337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21459 invoked from network); 11 Apr 2013 19:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuO-0004eY-LL
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuO-0008DU-JS
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:44 +0000
Date: Thu, 11 Apr 2013 19:11:44 +0000
Message-Id: <E1UQMuO-0008DU-JS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: show handler for Xen-internal
	interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d739470b9431406eb34a14a8feb9fa4a71330b5a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 10 18:27:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 10 18:27:32 2013 +0200

    x86: show handler for Xen-internal interrupts
    
    ... in 'i' debug key output.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/irq.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index fff9f1d..dffb33a 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -17,6 +17,7 @@
 #include <xen/compat.h>
 #include <xen/iocap.h>
 #include <xen/iommu.h>
+#include <xen/symbols.h>
 #include <xen/trace.h>
 #include <xsm/xsm.h>
 #include <asm/msi.h>
@@ -2094,9 +2095,7 @@ static void dump_irqs(unsigned char key)
         if ( ssid )
             printk("Z=%-25s ", ssid);
 
-        if ( !(desc->status & IRQ_GUEST) )
-            printk("mapped, unbound\n");
-        else
+        if ( desc->status & IRQ_GUEST )
         {
             action = (irq_guest_action_t *)desc->action;
 
@@ -2124,6 +2123,10 @@ static void dump_irqs(unsigned char key)
 
             printk("\n");
         }
+        else if ( desc->action )
+            print_symbol("%s\n", (unsigned long)desc->action->handler);
+        else
+            printk("mapped, unbound\n");
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:11:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:11:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMuT-00088G-Fq; Thu, 11 Apr 2013 19:11:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuR-00087r-Dx
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:47 +0000
Received: from [85.158.138.51:62773] by server-9.bemta-3.messagelabs.com id
	0B/AF-32531-2FA07615; Thu, 11 Apr 2013 19:11:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1365707504!27774337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21459 invoked from network); 11 Apr 2013 19:11:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuO-0004eY-LL
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuO-0008DU-JS
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:44 +0000
Date: Thu, 11 Apr 2013 19:11:44 +0000
Message-Id: <E1UQMuO-0008DU-JS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: show handler for Xen-internal
	interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d739470b9431406eb34a14a8feb9fa4a71330b5a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Apr 10 18:27:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 10 18:27:32 2013 +0200

    x86: show handler for Xen-internal interrupts
    
    ... in 'i' debug key output.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/irq.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index fff9f1d..dffb33a 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -17,6 +17,7 @@
 #include <xen/compat.h>
 #include <xen/iocap.h>
 #include <xen/iommu.h>
+#include <xen/symbols.h>
 #include <xen/trace.h>
 #include <xsm/xsm.h>
 #include <asm/msi.h>
@@ -2094,9 +2095,7 @@ static void dump_irqs(unsigned char key)
         if ( ssid )
             printk("Z=%-25s ", ssid);
 
-        if ( !(desc->status & IRQ_GUEST) )
-            printk("mapped, unbound\n");
-        else
+        if ( desc->status & IRQ_GUEST )
         {
             action = (irq_guest_action_t *)desc->action;
 
@@ -2124,6 +2123,10 @@ static void dump_irqs(unsigned char key)
 
             printk("\n");
         }
+        else if ( desc->action )
+            print_symbol("%s\n", (unsigned long)desc->action->handler);
+        else
+            printk("mapped, unbound\n");
 
         spin_unlock_irqrestore(&desc->lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMud-0008Af-JD; Thu, 11 Apr 2013 19:11:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMub-00089u-PM
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:57 +0000
Received: from [193.109.254.147:26185] by server-3.bemta-14.messagelabs.com id
	64/3B-17488-DFA07615; Thu, 11 Apr 2013 19:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1365707515!3411136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15238 invoked from network); 11 Apr 2013 19:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuY-0004ei-TD
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuY-0008Dq-Qm
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:54 +0000
Date: Thu, 11 Apr 2013 19:11:54 +0000
Message-Id: <E1UQMuY-0008Dq-Qm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow AMD MSRs injected via
	xen-mceinj
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0b42dc9a5d097ad515c749d4d121d839b8d083e
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Thu Apr 11 10:11:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 11 10:11:44 2013 +0200

    x86: allow AMD MSRs injected via xen-mceinj
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mce.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 1c69e4e..a22ea48 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1117,6 +1117,15 @@ static int x86_mc_msrinject_verify(struct xen_mc_msrinject *mci)
             case MSR_IA32_MCG_STATUS:
                 break;
 
+            case MSR_F10_MC4_MISC1:
+            case MSR_F10_MC4_MISC2:
+            case MSR_F10_MC4_MISC3:
+                if (c->x86_vendor != X86_VENDOR_AMD)
+                    reason = "only supported on AMD";
+                else if (c->x86 < 0x10)
+                    reason = "only supported on AMD Fam10h+";
+                break;
+
                 /* MSRs that the HV will take care of */
             case MSR_K8_HWCR:
                 if (c->x86_vendor == X86_VENDOR_AMD)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMud-0008Af-JD; Thu, 11 Apr 2013 19:11:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMub-00089u-PM
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:57 +0000
Received: from [193.109.254.147:26185] by server-3.bemta-14.messagelabs.com id
	64/3B-17488-DFA07615; Thu, 11 Apr 2013 19:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1365707515!3411136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15238 invoked from network); 11 Apr 2013 19:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuY-0004ei-TD
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuY-0008Dq-Qm
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:11:54 +0000
Date: Thu, 11 Apr 2013 19:11:54 +0000
Message-Id: <E1UQMuY-0008Dq-Qm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow AMD MSRs injected via
	xen-mceinj
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0b42dc9a5d097ad515c749d4d121d839b8d083e
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Thu Apr 11 10:11:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 11 10:11:44 2013 +0200

    x86: allow AMD MSRs injected via xen-mceinj
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mce.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 1c69e4e..a22ea48 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1117,6 +1117,15 @@ static int x86_mc_msrinject_verify(struct xen_mc_msrinject *mci)
             case MSR_IA32_MCG_STATUS:
                 break;
 
+            case MSR_F10_MC4_MISC1:
+            case MSR_F10_MC4_MISC2:
+            case MSR_F10_MC4_MISC3:
+                if (c->x86_vendor != X86_VENDOR_AMD)
+                    reason = "only supported on AMD";
+                else if (c->x86 < 0x10)
+                    reason = "only supported on AMD Fam10h+";
+                break;
+
                 /* MSRs that the HV will take care of */
             case MSR_K8_HWCR:
                 if (c->x86_vendor == X86_VENDOR_AMD)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMun-0008DN-MS; Thu, 11 Apr 2013 19:12:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMul-0008Ca-Qg
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:07 +0000
Received: from [85.158.139.211:42241] by server-13.bemta-5.messagelabs.com id
	93/45-20553-70B07615; Thu, 11 Apr 2013 19:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1365707525!18420164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24138 invoked from network); 11 Apr 2013 19:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuj-0004fJ-AV
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuj-0008EG-3U
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:05 +0000
Date: Thu, 11 Apr 2013 19:12:05 +0000
Message-Id: <E1UQMuj-0008EG-3U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: initialise VCPU SCTLR in
	vcpu_initialise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c0b352d1980f2dc9c8ab05851d1f4517c8d5a258
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:19:09 2013 +0100

    arm: initialise VCPU SCTLR in vcpu_initialise
    
    Ensuring a sane initial starting state for vcpus other than domain 0s.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain.c       |    2 ++
 xen/arch/arm/domain_build.c |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ac997d6..e308813 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -436,6 +436,8 @@ int vcpu_initialise(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return rc;
 
+    v->arch.sctlr = SCTLR_BASE;
+
     if ( (rc = vcpu_vgic_init(v)) != 0 )
         return rc;
 
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e9c84c7..d4fb74f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -455,8 +455,6 @@ int construct_dom0(struct domain *d)
     }
 #endif
 
-    v->arch.sctlr = SCTLR_BASE;
-
     WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
     isb();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMun-0008DN-MS; Thu, 11 Apr 2013 19:12:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMul-0008Ca-Qg
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:07 +0000
Received: from [85.158.139.211:42241] by server-13.bemta-5.messagelabs.com id
	93/45-20553-70B07615; Thu, 11 Apr 2013 19:12:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1365707525!18420164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24138 invoked from network); 11 Apr 2013 19:12:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuj-0004fJ-AV
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuj-0008EG-3U
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:05 +0000
Date: Thu, 11 Apr 2013 19:12:05 +0000
Message-Id: <E1UQMuj-0008EG-3U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: initialise VCPU SCTLR in
	vcpu_initialise
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c0b352d1980f2dc9c8ab05851d1f4517c8d5a258
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:19:09 2013 +0100

    arm: initialise VCPU SCTLR in vcpu_initialise
    
    Ensuring a sane initial starting state for vcpus other than domain 0s.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain.c       |    2 ++
 xen/arch/arm/domain_build.c |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ac997d6..e308813 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -436,6 +436,8 @@ int vcpu_initialise(struct vcpu *v)
     if ( is_idle_vcpu(v) )
         return rc;
 
+    v->arch.sctlr = SCTLR_BASE;
+
     if ( (rc = vcpu_vgic_init(v)) != 0 )
         return rc;
 
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e9c84c7..d4fb74f 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -455,8 +455,6 @@ int construct_dom0(struct domain *d)
     }
 #endif
 
-    v->arch.sctlr = SCTLR_BASE;
-
     WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
     isb();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMuw-0008Fq-S3; Thu, 11 Apr 2013 19:12:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuw-0008Fa-BU
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:18 +0000
Received: from [85.158.138.51:2454] by server-12.bemta-3.messagelabs.com id
	BF/3B-01357-11B07615; Thu, 11 Apr 2013 19:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1365707535!27813731!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14512 invoked from network); 11 Apr 2013 19:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMut-0004fP-LZ
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMut-0008FN-GX
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:15 +0000
Date: Thu, 11 Apr 2013 19:12:15 +0000
Message-Id: <E1UQMut-0008FN-GX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: consolidate setup of hypervisor
	traps and second stage paging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b806c2736f6e6b03aadb8671f66f3ddc280f63cb
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:27:40 2013 +0100

    arm: consolidate setup of hypervisor traps and second stage paging
    
    In particular be sure to initisalise HCR_EL2 on secondary processors.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    [ ijc -- adjusted due to unapplied "trap guest WFI" by s/HCR_TWI// ]
---
 xen/arch/arm/domain_build.c     |    7 -------
 xen/arch/arm/mm.c               |   10 ++++++++++
 xen/arch/arm/setup.c            |   13 +++----------
 xen/arch/arm/smpboot.c          |    5 +++--
 xen/arch/arm/traps.c            |   11 +++++++++++
 xen/include/asm-arm/mm.h        |    4 +++-
 xen/include/asm-arm/processor.h |    2 ++
 7 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d4fb74f..a6d8e9d 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -404,10 +404,6 @@ int construct_dom0(struct domain *d)
     gic_route_irq_to_guest(d, 46, "lcd");
     gic_route_irq_to_guest(d, 47, "eth");
 
-    /* Enable second stage translation */
-    WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_VM, HCR_EL2);
-    isb();
-
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
 
@@ -455,9 +451,6 @@ int construct_dom0(struct domain *d)
     }
 #endif
 
-    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
-    isb();
-
     local_abort_enable();
 
     return 0;
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 9661f10..ba3140d 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -251,6 +251,16 @@ void __init arch_init_memory(void)
     BUG_ON(IS_ERR(dom_cow));
 }
 
+void __cpuinit setup_virt_paging(void)
+{
+    /* Setup Stage 2 address translation */
+    /* SH0=00, ORGN0=IRGN0=01
+     * SL0=01 (Level-1)
+     * T0SZ=(1)1000 = -8 (40 bit physical addresses)
+     */
+    WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+}
+
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
 void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 566f36c..cfe3d94 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -446,16 +446,9 @@ void __init start_xen(unsigned long boot_phys_offset,
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    /* Setup Hyp vector base */
-    WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
-    isb();
-
-    /* Setup Stage 2 address translation */
-    /* SH0=00, ORGN0=IRGN0=01
-     * SL0=01 (Level-1)
-     * T0SZ=(1)1000 = -8 (40 bit physical addresses)
-     */
-    WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+    init_traps();
+
+    setup_virt_paging();
 
     enable_vfp();
 
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index b2af42e..1bebf86 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -148,8 +148,9 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
     *c = boot_cpu_data;
     identify_cpu(c);
 
-    /* Setup Hyp vector base */
-    WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
+    init_traps();
+
+    setup_virt_paging();
 
     mmu_init_secondary_cpu();
     enable_vfp();
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 600113c..a8b5f15 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -52,6 +52,17 @@ integer_param("debug_stack_lines", debug_stack_lines);
 
 #define stack_words_per_line 8
 
+
+void __cpuinit init_traps(void)
+{
+    /* Setup Hyp vector base */
+    WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
+
+    /* Setup hypervisor traps */
+    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
+    isb();
+}
+
 asmlinkage void __div0(void)
 {
     printk("Division by zero in hypervisor.\n");
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 19e5bc2..4be383e 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -138,8 +138,10 @@ extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
-/* MMU setup for seccondary CPUS (which already have paging enabled) */
+/* MMU setup for secondary CPUS (which already have paging enabled) */
 extern void __cpuinit mmu_init_secondary_cpu(void);
+/* Second stage paging setup, to be called on all CPUs */
+extern void __cpuinit setup_virt_paging(void);
 /* Set up the xenheap: up to 1GB of contiguous, always-mapped memory.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 6fbe2fa..1681ebf 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -353,6 +353,8 @@ union hsr {
 #ifndef __ASSEMBLY__
 extern uint32_t hyp_traps_vector[];
 
+void init_traps(void);
+
 void panic_PAR(uint64_t par);
 
 void show_execution_state(struct cpu_user_regs *regs);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMuw-0008Fq-S3; Thu, 11 Apr 2013 19:12:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMuw-0008Fa-BU
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:18 +0000
Received: from [85.158.138.51:2454] by server-12.bemta-3.messagelabs.com id
	BF/3B-01357-11B07615; Thu, 11 Apr 2013 19:12:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1365707535!27813731!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14512 invoked from network); 11 Apr 2013 19:12:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMut-0004fP-LZ
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMut-0008FN-GX
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:15 +0000
Date: Thu, 11 Apr 2013 19:12:15 +0000
Message-Id: <E1UQMut-0008FN-GX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: consolidate setup of hypervisor
	traps and second stage paging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b806c2736f6e6b03aadb8671f66f3ddc280f63cb
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:27:40 2013 +0100

    arm: consolidate setup of hypervisor traps and second stage paging
    
    In particular be sure to initisalise HCR_EL2 on secondary processors.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    [ ijc -- adjusted due to unapplied "trap guest WFI" by s/HCR_TWI// ]
---
 xen/arch/arm/domain_build.c     |    7 -------
 xen/arch/arm/mm.c               |   10 ++++++++++
 xen/arch/arm/setup.c            |   13 +++----------
 xen/arch/arm/smpboot.c          |    5 +++--
 xen/arch/arm/traps.c            |   11 +++++++++++
 xen/include/asm-arm/mm.h        |    4 +++-
 xen/include/asm-arm/processor.h |    2 ++
 7 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d4fb74f..a6d8e9d 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -404,10 +404,6 @@ int construct_dom0(struct domain *d)
     gic_route_irq_to_guest(d, 46, "lcd");
     gic_route_irq_to_guest(d, 47, "eth");
 
-    /* Enable second stage translation */
-    WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_VM, HCR_EL2);
-    isb();
-
     /* The following loads use the domain's p2m */
     p2m_load_VTTBR(d);
 
@@ -455,9 +451,6 @@ int construct_dom0(struct domain *d)
     }
 #endif
 
-    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
-    isb();
-
     local_abort_enable();
 
     return 0;
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 9661f10..ba3140d 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -251,6 +251,16 @@ void __init arch_init_memory(void)
     BUG_ON(IS_ERR(dom_cow));
 }
 
+void __cpuinit setup_virt_paging(void)
+{
+    /* Setup Stage 2 address translation */
+    /* SH0=00, ORGN0=IRGN0=01
+     * SL0=01 (Level-1)
+     * T0SZ=(1)1000 = -8 (40 bit physical addresses)
+     */
+    WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+}
+
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
 void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 566f36c..cfe3d94 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -446,16 +446,9 @@ void __init start_xen(unsigned long boot_phys_offset,
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    /* Setup Hyp vector base */
-    WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
-    isb();
-
-    /* Setup Stage 2 address translation */
-    /* SH0=00, ORGN0=IRGN0=01
-     * SL0=01 (Level-1)
-     * T0SZ=(1)1000 = -8 (40 bit physical addresses)
-     */
-    WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
+    init_traps();
+
+    setup_virt_paging();
 
     enable_vfp();
 
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index b2af42e..1bebf86 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -148,8 +148,9 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
     *c = boot_cpu_data;
     identify_cpu(c);
 
-    /* Setup Hyp vector base */
-    WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
+    init_traps();
+
+    setup_virt_paging();
 
     mmu_init_secondary_cpu();
     enable_vfp();
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 600113c..a8b5f15 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -52,6 +52,17 @@ integer_param("debug_stack_lines", debug_stack_lines);
 
 #define stack_words_per_line 8
 
+
+void __cpuinit init_traps(void)
+{
+    /* Setup Hyp vector base */
+    WRITE_SYSREG((vaddr_t)hyp_traps_vector, VBAR_EL2);
+
+    /* Setup hypervisor traps */
+    WRITE_SYSREG(HCR_PTW|HCR_BSU_OUTER|HCR_AMO|HCR_IMO|HCR_VM, HCR_EL2);
+    isb();
+}
+
 asmlinkage void __div0(void)
 {
     printk("Division by zero in hypervisor.\n");
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 19e5bc2..4be383e 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -138,8 +138,10 @@ extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
-/* MMU setup for seccondary CPUS (which already have paging enabled) */
+/* MMU setup for secondary CPUS (which already have paging enabled) */
 extern void __cpuinit mmu_init_secondary_cpu(void);
+/* Second stage paging setup, to be called on all CPUs */
+extern void __cpuinit setup_virt_paging(void);
 /* Set up the xenheap: up to 1GB of contiguous, always-mapped memory.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 6fbe2fa..1681ebf 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -353,6 +353,8 @@ union hsr {
 #ifndef __ASSEMBLY__
 extern uint32_t hyp_traps_vector[];
 
+void init_traps(void);
+
 void panic_PAR(uint64_t par);
 
 void show_execution_state(struct cpu_user_regs *regs);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMv7-0008IQ-VD; Thu, 11 Apr 2013 19:12:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMv6-0008I0-M9
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:28 +0000
Received: from [85.158.138.51:18317] by server-15.bemta-3.messagelabs.com id
	06/EC-23142-B1B07615; Thu, 11 Apr 2013 19:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1365707546!18842507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19554 invoked from network); 11 Apr 2013 19:12:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMv3-0004fV-Rg
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMv3-0008Fp-QA
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:25 +0000
Date: Thu, 11 Apr 2013 19:12:25 +0000
Message-Id: <E1UQMv3-0008Fp-QA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: vgic: typo s/securty/security/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 497afc5ad4231b3d36613dd178ef35e68bd3f740
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:27:45 2013 +0100

    arm: vgic: typo s/securty/security/
    
    At least we were consistent, but lets be correct too
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 0d24df0..d9ceaaa 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -286,7 +286,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         return 1;
 
     case GICD_NSACR ... GICD_NSACRN:
-        /* We do not implement securty extensions for guests, read zero */
+        /* We do not implement security extensions for guests, read zero */
         goto read_as_zero;
 
     case GICD_SGIR:
@@ -396,7 +396,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     case GICD_IGROUPR ... GICD_IGROUPRN:
-        /* We do not implement securty extensions for guests, write ignore */
+        /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
@@ -494,7 +494,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         return 1;
 
     case GICD_NSACR ... GICD_NSACRN:
-        /* We do not implement securty extensions for guests, write ignore */
+        /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
 
     case GICD_SGIR:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMv7-0008IQ-VD; Thu, 11 Apr 2013 19:12:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMv6-0008I0-M9
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:28 +0000
Received: from [85.158.138.51:18317] by server-15.bemta-3.messagelabs.com id
	06/EC-23142-B1B07615; Thu, 11 Apr 2013 19:12:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1365707546!18842507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19554 invoked from network); 11 Apr 2013 19:12:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMv3-0004fV-Rg
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMv3-0008Fp-QA
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:25 +0000
Date: Thu, 11 Apr 2013 19:12:25 +0000
Message-Id: <E1UQMv3-0008Fp-QA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: vgic: typo s/securty/security/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 497afc5ad4231b3d36613dd178ef35e68bd3f740
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:27:45 2013 +0100

    arm: vgic: typo s/securty/security/
    
    At least we were consistent, but lets be correct too
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 0d24df0..d9ceaaa 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -286,7 +286,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
         return 1;
 
     case GICD_NSACR ... GICD_NSACRN:
-        /* We do not implement securty extensions for guests, read zero */
+        /* We do not implement security extensions for guests, read zero */
         goto read_as_zero;
 
     case GICD_SGIR:
@@ -396,7 +396,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
 
     case GICD_IGROUPR ... GICD_IGROUPRN:
-        /* We do not implement securty extensions for guests, write ignore */
+        /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
@@ -494,7 +494,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         return 1;
 
     case GICD_NSACR ... GICD_NSACRN:
-        /* We do not implement securty extensions for guests, write ignore */
+        /* We do not implement security extensions for guests, write ignore */
         goto write_ignore;
 
     case GICD_SGIR:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvI-0008Kn-27; Thu, 11 Apr 2013 19:12:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvH-0008KW-1j
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:39 +0000
Received: from [85.158.139.83:27489] by server-6.bemta-5.messagelabs.com id
	2C/2A-21466-62B07615; Thu, 11 Apr 2013 19:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1365707556!16425866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7223 invoked from network); 11 Apr 2013 19:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvE-0004fd-5p
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvD-0008GK-WA
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:36 +0000
Date: Thu, 11 Apr 2013 19:12:35 +0000
Message-Id: <E1UQMvD-0008GK-WA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: vgic: fix race between evtchn
	upcall and evtchnop_send
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db453468d92369e7182663fb13e14d83ec4ce456
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:34 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:31:52 2013 +0100

    arm: vgic: fix race between evtchn upcall and evtchnop_send
    
    On ARM the evtchn upcall is done by using a local PPI interrupt. However the
    guest will clear the evtchn_upcall_pending bit before it EOIs that PPI (which
    happens late). This means vgic_vcpu_inject_irq (called via
    vcpu_mark_events_pending) sees the PPI as in flight and ends up not reinjecting
    it, if this happens after the guest has finished its event channel processing
    loop but before the EOI then we have lost the upcall.
    
    To fix this we need to check if an evtchn upcall is pending when returning to
    the guest and if so reinject the PPI.
    
    We therefore also need to call gic_restore_pending_irqs on the exit to guest
    path in order to pickup any newly inject IRQ and propagate it into a free LR.
    This doesn't currently support bumping a lower priority interrupt out of the
    LRs in order to inject a new higher priority interrupt. We don't yet implement
    interrupt prioritisation (and guests don't use it either) so this will do for
    now.
    
    Since gic_restore_pending_irqs is now called in the return to guest path it is
    called with interrupts disabled and accordingly must use the
    irqsave/irqrestore spinlock primitives.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5a380ca..4124b1d 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -513,17 +513,18 @@ static void gic_restore_pending_irqs(struct vcpu *v)
 {
     int i;
     struct pending_irq *p, *t;
+    unsigned long flags;
 
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
     {
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if ( i >= nr_lrs ) return;
 
-        spin_lock_irq(&gic.lock);
+        spin_lock_irqsave(&gic.lock, flags);
         gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
         list_del_init(&p->lr_queue);
         set_bit(i, &this_cpu(lr_mask));
-        spin_unlock_irq(&gic.lock);
+        spin_unlock_irqrestore(&gic.lock, flags);
     }
 
 }
@@ -546,6 +547,10 @@ static void gic_inject_irq_stop(void)
 
 void gic_inject(void)
 {
+    if ( vcpu_info(current, evtchn_upcall_pending) )
+        vgic_vcpu_inject_irq(current, VGIC_IRQ_EVTCHN_CALLBACK, 1);
+
+    gic_restore_pending_irqs(current);
     if (!this_cpu(lr_mask))
         gic_inject_irq_stop();
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvI-0008Kn-27; Thu, 11 Apr 2013 19:12:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvH-0008KW-1j
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:39 +0000
Received: from [85.158.139.83:27489] by server-6.bemta-5.messagelabs.com id
	2C/2A-21466-62B07615; Thu, 11 Apr 2013 19:12:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1365707556!16425866!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7223 invoked from network); 11 Apr 2013 19:12:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvE-0004fd-5p
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvD-0008GK-WA
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:36 +0000
Date: Thu, 11 Apr 2013 19:12:35 +0000
Message-Id: <E1UQMvD-0008GK-WA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: vgic: fix race between evtchn
	upcall and evtchnop_send
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db453468d92369e7182663fb13e14d83ec4ce456
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:34 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:31:52 2013 +0100

    arm: vgic: fix race between evtchn upcall and evtchnop_send
    
    On ARM the evtchn upcall is done by using a local PPI interrupt. However the
    guest will clear the evtchn_upcall_pending bit before it EOIs that PPI (which
    happens late). This means vgic_vcpu_inject_irq (called via
    vcpu_mark_events_pending) sees the PPI as in flight and ends up not reinjecting
    it, if this happens after the guest has finished its event channel processing
    loop but before the EOI then we have lost the upcall.
    
    To fix this we need to check if an evtchn upcall is pending when returning to
    the guest and if so reinject the PPI.
    
    We therefore also need to call gic_restore_pending_irqs on the exit to guest
    path in order to pickup any newly inject IRQ and propagate it into a free LR.
    This doesn't currently support bumping a lower priority interrupt out of the
    LRs in order to inject a new higher priority interrupt. We don't yet implement
    interrupt prioritisation (and guests don't use it either) so this will do for
    now.
    
    Since gic_restore_pending_irqs is now called in the return to guest path it is
    called with interrupts disabled and accordingly must use the
    irqsave/irqrestore spinlock primitives.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 5a380ca..4124b1d 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -513,17 +513,18 @@ static void gic_restore_pending_irqs(struct vcpu *v)
 {
     int i;
     struct pending_irq *p, *t;
+    unsigned long flags;
 
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
     {
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if ( i >= nr_lrs ) return;
 
-        spin_lock_irq(&gic.lock);
+        spin_lock_irqsave(&gic.lock, flags);
         gic_set_lr(i, p->irq, GICH_LR_PENDING, p->priority);
         list_del_init(&p->lr_queue);
         set_bit(i, &this_cpu(lr_mask));
-        spin_unlock_irq(&gic.lock);
+        spin_unlock_irqrestore(&gic.lock, flags);
     }
 
 }
@@ -546,6 +547,10 @@ static void gic_inject_irq_stop(void)
 
 void gic_inject(void)
 {
+    if ( vcpu_info(current, evtchn_upcall_pending) )
+        vgic_vcpu_inject_irq(current, VGIC_IRQ_EVTCHN_CALLBACK, 1);
+
+    gic_restore_pending_irqs(current);
     if (!this_cpu(lr_mask))
         gic_inject_irq_stop();
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvS-0008My-52; Thu, 11 Apr 2013 19:12:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvQ-0008Mc-Tl
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:49 +0000
Received: from [85.158.143.99:30954] by server-1.bemta-4.messagelabs.com id
	AE/59-06203-03B07615; Thu, 11 Apr 2013 19:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1365707566!22528285!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5108 invoked from network); 11 Apr 2013 19:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvO-0004fj-ES
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvO-0008Gw-AV
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:46 +0000
Date: Thu, 11 Apr 2013 19:12:46 +0000
Message-Id: <E1UQMvO-0008Gw-AV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: gic: fix build on arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8424523b15b89f8252b02d431a5945f2c22bf343
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:35 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:34:58 2013 +0100

    arm: gic: fix build on arm64
    
    lr_mask is a uint64_t and so needs to be printed with PRIx64.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 4124b1d..49f2b20 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -667,7 +667,7 @@ void gic_dump_info(struct vcpu *v)
     int i;
     struct pending_irq *p;
 
-    printk("GICH_LRs (vcpu %d) mask=%llx\n", v->vcpu_id, v->arch.lr_mask);
+    printk("GICH_LRs (vcpu %d) mask=%"PRIx64"\n", v->vcpu_id, v->arch.lr_mask);
     if ( v == current )
     {
         for ( i = 0; i < nr_lrs; i++ )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:12:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvS-0008My-52; Thu, 11 Apr 2013 19:12:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvQ-0008Mc-Tl
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:49 +0000
Received: from [85.158.143.99:30954] by server-1.bemta-4.messagelabs.com id
	AE/59-06203-03B07615; Thu, 11 Apr 2013 19:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1365707566!22528285!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5108 invoked from network); 11 Apr 2013 19:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvO-0004fj-ES
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvO-0008Gw-AV
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:46 +0000
Date: Thu, 11 Apr 2013 19:12:46 +0000
Message-Id: <E1UQMvO-0008Gw-AV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: gic: fix build on arm64
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8424523b15b89f8252b02d431a5945f2c22bf343
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:35 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:34:58 2013 +0100

    arm: gic: fix build on arm64
    
    lr_mask is a uint64_t and so needs to be printed with PRIx64.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 4124b1d..49f2b20 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -667,7 +667,7 @@ void gic_dump_info(struct vcpu *v)
     int i;
     struct pending_irq *p;
 
-    printk("GICH_LRs (vcpu %d) mask=%llx\n", v->vcpu_id, v->arch.lr_mask);
+    printk("GICH_LRs (vcpu %d) mask=%"PRIx64"\n", v->vcpu_id, v->arch.lr_mask);
     if ( v == current )
     {
         for ( i = 0; i < nr_lrs; i++ )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvh-0008Q0-7p; Thu, 11 Apr 2013 19:13:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvf-0008PZ-TF
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:04 +0000
Received: from [85.158.137.99:64638] by server-1.bemta-3.messagelabs.com id
	AA/CF-13706-A3B07615; Thu, 11 Apr 2013 19:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1365707576!12231261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2034 invoked from network); 11 Apr 2013 19:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvY-0004fs-LK
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvY-0008HI-J5
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:56 +0000
Date: Thu, 11 Apr 2013 19:12:56 +0000
Message-Id: <E1UQMvY-0008HI-J5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: tweak/improve logging for host SMP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f749f78224078a3a1d7ae5d9bee45aea64b1e57
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:35:37 2013 +0100

    arm: tweak/improve logging for host SMP
    
    Make the "CPU<n> booted" message fit in with the surrounding logging.
    
    Log which CPU is taking an unexpected trap.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/smpboot.c |    2 +-
 xen/arch/arm/traps.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 1bebf86..bd353c8 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -178,7 +178,7 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
 
     local_irq_enable();
 
-    dprintk(XENLOG_DEBUG, "CPU %u booted.\n", smp_processor_id());
+    printk(XENLOG_DEBUG "CPU %u booted.\n", smp_processor_id());
 
     startup_cpu_idle_loop();
 }
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index a8b5f15..b7487b7 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -577,7 +577,7 @@ void vcpu_show_execution_state(struct vcpu *v)
 
 void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
 {
-    printk("Unexpected Trap: %s\n", msg);
+    printk("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
     show_execution_state(regs);
     while(1);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvh-0008Q0-7p; Thu, 11 Apr 2013 19:13:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvf-0008PZ-TF
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:04 +0000
Received: from [85.158.137.99:64638] by server-1.bemta-3.messagelabs.com id
	AA/CF-13706-A3B07615; Thu, 11 Apr 2013 19:12:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1365707576!12231261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2034 invoked from network); 11 Apr 2013 19:12:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:12:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvY-0004fs-LK
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvY-0008HI-J5
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:12:56 +0000
Date: Thu, 11 Apr 2013 19:12:56 +0000
Message-Id: <E1UQMvY-0008HI-J5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: tweak/improve logging for host SMP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f749f78224078a3a1d7ae5d9bee45aea64b1e57
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Mar 6 08:54:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 09:35:37 2013 +0100

    arm: tweak/improve logging for host SMP
    
    Make the "CPU<n> booted" message fit in with the surrounding logging.
    
    Log which CPU is taking an unexpected trap.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/smpboot.c |    2 +-
 xen/arch/arm/traps.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 1bebf86..bd353c8 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -178,7 +178,7 @@ void __cpuinit start_secondary(unsigned long boot_phys_offset,
 
     local_irq_enable();
 
-    dprintk(XENLOG_DEBUG, "CPU %u booted.\n", smp_processor_id());
+    printk(XENLOG_DEBUG "CPU %u booted.\n", smp_processor_id());
 
     startup_cpu_idle_loop();
 }
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index a8b5f15..b7487b7 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -577,7 +577,7 @@ void vcpu_show_execution_state(struct vcpu *v)
 
 void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
 {
-    printk("Unexpected Trap: %s\n", msg);
+    printk("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
     show_execution_state(regs);
     while(1);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvm-0008RJ-As; Thu, 11 Apr 2013 19:13:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvl-0008R3-CL
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:09 +0000
Received: from [85.158.143.99:33770] by server-2.bemta-4.messagelabs.com id
	A5/3B-12656-44B07615; Thu, 11 Apr 2013 19:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1365707587!16369582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15332 invoked from network); 11 Apr 2013 19:13:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvi-0004gO-Sk
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvi-0008Hn-Pj
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:06 +0000
Date: Thu, 11 Apr 2013 19:13:06 +0000
Message-Id: <E1UQMvi-0008Hn-Pj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: define 64-bit guest
	hypercall calling convention.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d1efb7702b0d112cf6e2f561aa60dc184642d525
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Mar 12 15:48:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 10:05:01 2013 +0100

    xen: arm: define 64-bit guest hypercall calling convention.
    
    As well as using x<N> rather than r<N> registers for passing arguments/results
    as mandate the use of x16 as the hypercall number.
    
    Add some pedantry about struct alignment layout referencing the ARM Procedure
    Calling Standard to avoid confusion with the previous "OABI" convention. While
    at it also mandate that hypercall argument structs are always little endian.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 3333399..e44e90f 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -33,20 +33,31 @@
  * A hypercall is issued using the ARM HVC instruction.
  *
  * A hypercall can take up to 5 arguments. These are passed in
- * registers, the first argument in r0, the second argument in r1, the
- * third in r2, the forth in r3 and the fifth in r4.
+ * registers, the first argument in x0/r0 (for arm64/arm32 guests
+ * respectively irrespective of whether the underlying hypervisor is
+ * 32- or 64-bit), the second argument in x1/r1, the third in x2/r2,
+ * the forth in x3/r3 and the fifth in x4/r4.
  *
- * The hypercall number is passed in r12.
+ * The hypercall number is passed in r12 (arm) or x16 (arm64). In both
+ * cases the relevant ARM procedure calling convention specifies this
+ * is an inter-procedure-call scratch register (e.g. for use in linker
+ * stubs). This use does not conflict with use during a hypercall.
  *
  * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
  *
- * The return value is in r0.
+ * The return value is in x0/r0.
  *
- * The hypercall will clobber r12 and the argument registers used by
- * that hypercall (except r0 which is the return value) i.e. a 2
- * argument hypercall will clobber r1 and a 4 argument hypercall will
- * clobber r1, r2 and r3.
+ * The hypercall will clobber x16/r12 and the argument registers used
+ * by that hypercall (except r0 which is the return value) i.e. in
+ * addition to x16/r12 a 2 argument hypercall will clobber x1/r1 and a
+ * 4 argument hypercall will clobber x1/r1, x2/r2 and x3/r3.
  *
+ * Parameter structs passed to hypercalls are laid out according to
+ * the Procedure Call Standard for the ARM Architecture (AAPCS, AKA
+ * EABI) and Procedure Call Standard for the ARM 64-bit Architecture
+ * (AAPCS64). Where there is a conflict the 64-bit standard should be
+ * used regardless of guest type. Structures which are passed as
+ * hypercall arguments are always little endian.
  */
 
 #define XEN_HYPERCALL_TAG   0XEA1
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvm-0008RJ-As; Thu, 11 Apr 2013 19:13:10 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvl-0008R3-CL
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:09 +0000
Received: from [85.158.143.99:33770] by server-2.bemta-4.messagelabs.com id
	A5/3B-12656-44B07615; Thu, 11 Apr 2013 19:13:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1365707587!16369582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15332 invoked from network); 11 Apr 2013 19:13:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvi-0004gO-Sk
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvi-0008Hn-Pj
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:06 +0000
Date: Thu, 11 Apr 2013 19:13:06 +0000
Message-Id: <E1UQMvi-0008Hn-Pj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: define 64-bit guest
	hypercall calling convention.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d1efb7702b0d112cf6e2f561aa60dc184642d525
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Mar 12 15:48:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 10:05:01 2013 +0100

    xen: arm: define 64-bit guest hypercall calling convention.
    
    As well as using x<N> rather than r<N> registers for passing arguments/results
    as mandate the use of x16 as the hypercall number.
    
    Add some pedantry about struct alignment layout referencing the ARM Procedure
    Calling Standard to avoid confusion with the previous "OABI" convention. While
    at it also mandate that hypercall argument structs are always little endian.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 3333399..e44e90f 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -33,20 +33,31 @@
  * A hypercall is issued using the ARM HVC instruction.
  *
  * A hypercall can take up to 5 arguments. These are passed in
- * registers, the first argument in r0, the second argument in r1, the
- * third in r2, the forth in r3 and the fifth in r4.
+ * registers, the first argument in x0/r0 (for arm64/arm32 guests
+ * respectively irrespective of whether the underlying hypervisor is
+ * 32- or 64-bit), the second argument in x1/r1, the third in x2/r2,
+ * the forth in x3/r3 and the fifth in x4/r4.
  *
- * The hypercall number is passed in r12.
+ * The hypercall number is passed in r12 (arm) or x16 (arm64). In both
+ * cases the relevant ARM procedure calling convention specifies this
+ * is an inter-procedure-call scratch register (e.g. for use in linker
+ * stubs). This use does not conflict with use during a hypercall.
  *
  * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
  *
- * The return value is in r0.
+ * The return value is in x0/r0.
  *
- * The hypercall will clobber r12 and the argument registers used by
- * that hypercall (except r0 which is the return value) i.e. a 2
- * argument hypercall will clobber r1 and a 4 argument hypercall will
- * clobber r1, r2 and r3.
+ * The hypercall will clobber x16/r12 and the argument registers used
+ * by that hypercall (except r0 which is the return value) i.e. in
+ * addition to x16/r12 a 2 argument hypercall will clobber x1/r1 and a
+ * 4 argument hypercall will clobber x1/r1, x2/r2 and x3/r3.
  *
+ * Parameter structs passed to hypercalls are laid out according to
+ * the Procedure Call Standard for the ARM Architecture (AAPCS, AKA
+ * EABI) and Procedure Call Standard for the ARM 64-bit Architecture
+ * (AAPCS64). Where there is a conflict the 64-bit standard should be
+ * used regardless of guest type. Structures which are passed as
+ * hypercall arguments are always little endian.
  */
 
 #define XEN_HYPERCALL_TAG   0XEA1
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvw-0008TZ-E7; Thu, 11 Apr 2013 19:13:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvv-0008TI-Cr
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:19 +0000
Received: from [85.158.143.99:21663] by server-3.bemta-4.messagelabs.com id
	FC/8D-02186-E4B07615; Thu, 11 Apr 2013 19:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1365707597!20293211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8433 invoked from network); 11 Apr 2013 19:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvt-0004gX-4q
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvt-0008Ih-2C
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:17 +0000
Date: Thu, 11 Apr 2013 19:13:17 +0000
Message-Id: <E1UQMvt-0008Ih-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't pass negative time to
	gtime_to_gtsc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb60be3dd870aecfa47bed1118069680389c15f7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 11 12:07:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 11 12:07:55 2013 +0200

    x86: don't pass negative time to gtime_to_gtsc()
    
    scale_delta(), which is being called by that function, doesn't cope
    with that.
    
    Also print a warning message, so hopefully we can eventually figure why
    occasionally a negative value results from the calculation in the first
    place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b403f47..6e94847 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -854,7 +854,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         if ( is_hvm_domain(d) )
         {
             struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+
             stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+            if ( (s64)stime < 0 )
+            {
+                printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
+                       " (offsets %" PRId64 "/%" PRId64 ")\n",
+                       d->domain_id, v->vcpu_id, stime,
+		       pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
+                stime = 0;
+            }
         }
         tsc_stamp = gtime_to_gtsc(d, stime);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMvw-0008TZ-E7; Thu, 11 Apr 2013 19:13:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvv-0008TI-Cr
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:19 +0000
Received: from [85.158.143.99:21663] by server-3.bemta-4.messagelabs.com id
	FC/8D-02186-E4B07615; Thu, 11 Apr 2013 19:13:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1365707597!20293211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8433 invoked from network); 11 Apr 2013 19:13:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvt-0004gX-4q
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMvt-0008Ih-2C
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:17 +0000
Date: Thu, 11 Apr 2013 19:13:17 +0000
Message-Id: <E1UQMvt-0008Ih-2C@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't pass negative time to
	gtime_to_gtsc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb60be3dd870aecfa47bed1118069680389c15f7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 11 12:07:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 11 12:07:55 2013 +0200

    x86: don't pass negative time to gtime_to_gtsc()
    
    scale_delta(), which is being called by that function, doesn't cope
    with that.
    
    Also print a warning message, so hopefully we can eventually figure why
    occasionally a negative value results from the calculation in the first
    place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b403f47..6e94847 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -854,7 +854,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         if ( is_hvm_domain(d) )
         {
             struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+
             stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+            if ( (s64)stime < 0 )
+            {
+                printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
+                       " (offsets %" PRId64 "/%" PRId64 ")\n",
+                       d->domain_id, v->vcpu_id, stime,
+		       pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
+                stime = 0;
+            }
         }
         tsc_stamp = gtime_to_gtsc(d, stime);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMw9-0008WR-J9; Thu, 11 Apr 2013 19:13:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMw8-0008W4-7u
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:32 +0000
Received: from [193.109.254.147:46087] by server-10.bemta-14.messagelabs.com
	id 03/77-11798-B5B07615; Thu, 11 Apr 2013 19:13:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1365707607!8734696!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9063 invoked from network); 11 Apr 2013 19:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMw3-0004gd-DF
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMw3-0008J4-Al
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:27 +0000
Date: Thu, 11 Apr 2013 19:13:27 +0000
Message-Id: <E1UQMw3-0008J4-Al@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Use AC_SYS_LARGEFILE instead of
	calling getconf(1)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1cc48e865b2faa3f8147c15fcec4c24c46b3d63f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: Use AC_SYS_LARGEFILE instead of calling getconf(1)
    
    getconf is not cross-compile friendly since it reports the features of the host
    and not the target. There doesn't appear to be a $triplet-getconf.
    
    AC_SYS_LARGEFILE arranges for #defines to appear in config.h however Xen's
    build system expects these to be part of C{PP}FLAGS. Since I'm not confident
    that everything in Xen includes config.h I instead arrange for the result of
    running AC_SYS_LARGERFILE to end up in CFLAGS.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 config/Tools.mk.in |    2 +
 tools/Rules.mk     |    5 +-
 tools/config.h.in  |    6 +
 tools/configure    | 1292 +++++++++++++++++++++++++++++++++++++++++-----------
 tools/configure.ac |   10 +
 5 files changed, 1042 insertions(+), 273 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index c69c7d2..5e2c6d8 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -60,3 +60,5 @@ CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
+
+FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 8d55e03..3f03a31 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -65,11 +65,12 @@ CFLAGS += -D__XEN_TOOLS__
 CFLAGS += -MMD -MF .$(@F).d
 DEPS = .*.d
 
+ifneq ($(FILE_OFFSET_BITS),)
+CFLAGS  += -D_FILE_OFFSET_BITS=$(FILE_OFFSET_BITS)
+endif
 ifneq ($(XEN_OS),NetBSD)
 # Enable implicit LFS support *and* explicit LFS names.
-CFLAGS  += $(shell getconf LFS_CFLAGS)
 CFLAGS  += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-LDFLAGS += $(shell getconf LFS_LDFLAGS)
 endif
 
 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
diff --git a/tools/config.h.in b/tools/config.h.in
index 6d67503..08e337a 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -68,3 +68,9 @@
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
diff --git a/tools/configure b/tools/configure
index 068fb75..9f73172 100755
--- a/tools/configure
+++ b/tools/configure
@@ -639,13 +639,6 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 SET_MAKE
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
 IASL
 BCC
 LD86
@@ -673,6 +666,14 @@ ocamltools
 xenapi
 monitors
 githttp
+FILE_OFFSET_BITS
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
 host_os
 host_vendor
 host_cpu
@@ -722,6 +723,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_largefile
 enable_githttp
 enable_monitors
 enable_xenapi
@@ -737,6 +739,11 @@ enable_debug
       ac_precious_vars='build_alias
 host_alias
 target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
 PREPEND_INCLUDES
 PREPEND_LIB
 APPEND_INCLUDES
@@ -753,11 +760,6 @@ AS86
 LD86
 BCC
 IASL
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
 CPP
 PKG_CONFIG
 PKG_CONFIG_PATH
@@ -1379,6 +1381,7 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-largefile     omit support for large files
   --enable-githttp        Download GIT repositories via HTTP (default is
                           DISABLED)
   --disable-monitors      Disable xenstat and xentop monitoring tools (default
@@ -1394,6 +1397,13 @@ Optional Features:
   --disable-debug         Disable debug build of tools (default is ENABLED)
 
 Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   PREPEND_INCLUDES
               List of include folders to prepend to CFLAGS (without -I)
   PREPEND_LIB List of library folders to prepend to LDFLAGS (without -L)
@@ -1412,13 +1422,6 @@ Some influential environment variables:
   LD86        Path to ld86 tool
   BCC         Path to bcc tool
   IASL        Path to iasl tool
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
@@ -2266,6 +2269,1004 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5 ; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5 ; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+fi
+
+
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+  FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
+;;
+esac
+
+
 # M4 Macro includes
 
 
@@ -3021,256 +4022,6 @@ $as_echo "$ac_try_echo"; } >&5
   test $ac_status = 0; }
 done
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then :
@@ -5160,8 +5911,7 @@ else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-
-ac_ext=c
+ ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
diff --git a/tools/configure.ac b/tools/configure.ac
index 0d38408..f6e2fec 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -21,6 +21,16 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 
 AC_CANONICAL_HOST
 
+AC_SYS_LARGEFILE
+
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+  FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
+;;
+esac
+AC_SUBST(FILE_OFFSET_BITS)
+
 # M4 Macro includes
 m4_include([../m4/savevar.m4])
 m4_include([../m4/features.m4])
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMw9-0008WR-J9; Thu, 11 Apr 2013 19:13:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMw8-0008W4-7u
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:32 +0000
Received: from [193.109.254.147:46087] by server-10.bemta-14.messagelabs.com
	id 03/77-11798-B5B07615; Thu, 11 Apr 2013 19:13:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1365707607!8734696!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9063 invoked from network); 11 Apr 2013 19:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMw3-0004gd-DF
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMw3-0008J4-Al
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:27 +0000
Date: Thu, 11 Apr 2013 19:13:27 +0000
Message-Id: <E1UQMw3-0008J4-Al@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Use AC_SYS_LARGEFILE instead of
	calling getconf(1)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1cc48e865b2faa3f8147c15fcec4c24c46b3d63f
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: Use AC_SYS_LARGEFILE instead of calling getconf(1)
    
    getconf is not cross-compile friendly since it reports the features of the host
    and not the target. There doesn't appear to be a $triplet-getconf.
    
    AC_SYS_LARGEFILE arranges for #defines to appear in config.h however Xen's
    build system expects these to be part of C{PP}FLAGS. Since I'm not confident
    that everything in Xen includes config.h I instead arrange for the result of
    running AC_SYS_LARGERFILE to end up in CFLAGS.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 config/Tools.mk.in |    2 +
 tools/Rules.mk     |    5 +-
 tools/config.h.in  |    6 +
 tools/configure    | 1292 +++++++++++++++++++++++++++++++++++++++++-----------
 tools/configure.ac |   10 +
 5 files changed, 1042 insertions(+), 273 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index c69c7d2..5e2c6d8 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -60,3 +60,5 @@ CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
+
+FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
diff --git a/tools/Rules.mk b/tools/Rules.mk
index 8d55e03..3f03a31 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -65,11 +65,12 @@ CFLAGS += -D__XEN_TOOLS__
 CFLAGS += -MMD -MF .$(@F).d
 DEPS = .*.d
 
+ifneq ($(FILE_OFFSET_BITS),)
+CFLAGS  += -D_FILE_OFFSET_BITS=$(FILE_OFFSET_BITS)
+endif
 ifneq ($(XEN_OS),NetBSD)
 # Enable implicit LFS support *and* explicit LFS names.
-CFLAGS  += $(shell getconf LFS_CFLAGS)
 CFLAGS  += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-LDFLAGS += $(shell getconf LFS_LDFLAGS)
 endif
 
 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
diff --git a/tools/config.h.in b/tools/config.h.in
index 6d67503..08e337a 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -68,3 +68,9 @@
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
diff --git a/tools/configure b/tools/configure
index 068fb75..9f73172 100755
--- a/tools/configure
+++ b/tools/configure
@@ -639,13 +639,6 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 SET_MAKE
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
 IASL
 BCC
 LD86
@@ -673,6 +666,14 @@ ocamltools
 xenapi
 monitors
 githttp
+FILE_OFFSET_BITS
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
 host_os
 host_vendor
 host_cpu
@@ -722,6 +723,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_largefile
 enable_githttp
 enable_monitors
 enable_xenapi
@@ -737,6 +739,11 @@ enable_debug
       ac_precious_vars='build_alias
 host_alias
 target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
 PREPEND_INCLUDES
 PREPEND_LIB
 APPEND_INCLUDES
@@ -753,11 +760,6 @@ AS86
 LD86
 BCC
 IASL
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
 CPP
 PKG_CONFIG
 PKG_CONFIG_PATH
@@ -1379,6 +1381,7 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-largefile     omit support for large files
   --enable-githttp        Download GIT repositories via HTTP (default is
                           DISABLED)
   --disable-monitors      Disable xenstat and xentop monitoring tools (default
@@ -1394,6 +1397,13 @@ Optional Features:
   --disable-debug         Disable debug build of tools (default is ENABLED)
 
 Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   PREPEND_INCLUDES
               List of include folders to prepend to CFLAGS (without -I)
   PREPEND_LIB List of library folders to prepend to LDFLAGS (without -L)
@@ -1412,13 +1422,6 @@ Some influential environment variables:
   LD86        Path to ld86 tool
   BCC         Path to bcc tool
   IASL        Path to iasl tool
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
@@ -2266,6 +2269,1004 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5 ; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5 ; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5 ; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5 ; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if test "${ac_cv_sys_largefile_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test "${ac_cv_sys_large_files+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+fi
+
+
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+  FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
+;;
+esac
+
+
 # M4 Macro includes
 
 
@@ -3021,256 +4022,6 @@ $as_echo "$ac_try_echo"; } >&5
   test $ac_status = 0; }
 done
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then :
@@ -5160,8 +5911,7 @@ else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-
-ac_ext=c
+ ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
diff --git a/tools/configure.ac b/tools/configure.ac
index 0d38408..f6e2fec 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -21,6 +21,16 @@ APPEND_INCLUDES and APPEND_LIB instead when possible.])
 
 AC_CANONICAL_HOST
 
+AC_SYS_LARGEFILE
+
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+  FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
+;;
+esac
+AC_SUBST(FILE_OFFSET_BITS)
+
 # M4 Macro includes
 m4_include([../m4/savevar.m4])
 m4_include([../m4/features.m4])
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMwR-00008I-PP; Thu, 11 Apr 2013 19:13:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwQ-00007y-BD
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:50 +0000
Received: from [85.158.137.99:10541] by server-13.bemta-3.messagelabs.com id
	C7/A0-25744-D6B07615; Thu, 11 Apr 2013 19:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1365707627!16978903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23219 invoked from network); 11 Apr 2013 19:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwN-0004go-Q0
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwN-0008K2-Nd
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:47 +0000
Date: Thu, 11 Apr 2013 19:13:47 +0000
Message-Id: <E1UQMwN-0008K2-Nd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: only build blktap1 on x86
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc9b8e3f334dc9d6d9e9a3b19065104204aa56f7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:44 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: only build blktap1 on x86
    
    It does not cross-compile for ARM and no sane new port is going to use it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index bea1489..8a30c83 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -21,7 +21,9 @@ SUBDIRS-y += xenmon
 SUBDIRS-y += xenstat
 SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_Linux) += memshr 
+ifeq ($(CONFIG_X86),y)
 SUBDIRS-$(CONFIG_Linux) += blktap
+endif
 SUBDIRS-$(CONFIG_Linux) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_NetBSD) += blktap2
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:13:52 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:13:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMwR-00008I-PP; Thu, 11 Apr 2013 19:13:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwQ-00007y-BD
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:50 +0000
Received: from [85.158.137.99:10541] by server-13.bemta-3.messagelabs.com id
	C7/A0-25744-D6B07615; Thu, 11 Apr 2013 19:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1365707627!16978903!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23219 invoked from network); 11 Apr 2013 19:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwN-0004go-Q0
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwN-0008K2-Nd
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:47 +0000
Date: Thu, 11 Apr 2013 19:13:47 +0000
Message-Id: <E1UQMwN-0008K2-Nd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: only build blktap1 on x86
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cc9b8e3f334dc9d6d9e9a3b19065104204aa56f7
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:44 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: only build blktap1 on x86
    
    It does not cross-compile for ARM and no sane new port is going to use it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index bea1489..8a30c83 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -21,7 +21,9 @@ SUBDIRS-y += xenmon
 SUBDIRS-y += xenstat
 SUBDIRS-$(CONFIG_Linux) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_Linux) += memshr 
+ifeq ($(CONFIG_X86),y)
 SUBDIRS-$(CONFIG_Linux) += blktap
+endif
 SUBDIRS-$(CONFIG_Linux) += blktap2
 SUBDIRS-$(CONFIG_NetBSD) += $(SUBDIRS-libaio)
 SUBDIRS-$(CONFIG_NetBSD) += blktap2
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMwl-0000Ag-SY; Thu, 11 Apr 2013 19:14:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwk-0000AV-KZ
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:10 +0000
Received: from [85.158.138.51:8459] by server-15.bemta-3.messagelabs.com id
	18/FD-23142-18B07615; Thu, 11 Apr 2013 19:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365707648!23853477!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31865 invoked from network); 11 Apr 2013 19:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwi-0004hT-7G
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwi-0008Kl-4G
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:08 +0000
Date: Thu, 11 Apr 2013 19:14:08 +0000
Message-Id: <E1UQMwi-0008Kl-4G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxc: arm64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae4b6f29a983e283657433f5a422d83b4c5ecc74
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:46 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: libxc: arm64 support
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 tools/libxc/xc_core.h |    2 +-
 tools/libxc/xenctrl.h |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 67b56a4..10cbfca 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -151,7 +151,7 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
-#elif defined (__arm__)
+#elif defined (__arm__) || defined(__aarch64__)
 # include "xc_core_arm.h"
 #else
 # error "unsupported architecture"
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 32122fd..50853af 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -79,6 +79,10 @@
 #define xen_mb()   asm volatile ("dmb" : : : "memory")
 #define xen_rmb()  asm volatile ("dmb" : : : "memory")
 #define xen_wmb()  asm volatile ("dmb" : : : "memory")
+#elif defined(__aarch64__)
+#define xen_mb()   asm volatile ("dmb sy" : : : "memory")
+#define xen_rmb()  asm volatile ("dmb sy" : : : "memory")
+#define xen_wmb()  asm volatile ("dmb sy" : : : "memory")
 #else
 #error "Define barriers"
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMwl-0000Ag-SY; Thu, 11 Apr 2013 19:14:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwk-0000AV-KZ
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:10 +0000
Received: from [85.158.138.51:8459] by server-15.bemta-3.messagelabs.com id
	18/FD-23142-18B07615; Thu, 11 Apr 2013 19:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365707648!23853477!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31865 invoked from network); 11 Apr 2013 19:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwi-0004hT-7G
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwi-0008Kl-4G
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:08 +0000
Date: Thu, 11 Apr 2013 19:14:08 +0000
Message-Id: <E1UQMwi-0008Kl-4G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxc: arm64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae4b6f29a983e283657433f5a422d83b4c5ecc74
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:46 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: libxc: arm64 support
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 tools/libxc/xc_core.h |    2 +-
 tools/libxc/xenctrl.h |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_core.h b/tools/libxc/xc_core.h
index 67b56a4..10cbfca 100644
--- a/tools/libxc/xc_core.h
+++ b/tools/libxc/xc_core.h
@@ -151,7 +151,7 @@ int xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width,
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
-#elif defined (__arm__)
+#elif defined (__arm__) || defined(__aarch64__)
 # include "xc_core_arm.h"
 #else
 # error "unsupported architecture"
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 32122fd..50853af 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -79,6 +79,10 @@
 #define xen_mb()   asm volatile ("dmb" : : : "memory")
 #define xen_rmb()  asm volatile ("dmb" : : : "memory")
 #define xen_wmb()  asm volatile ("dmb" : : : "memory")
+#elif defined(__aarch64__)
+#define xen_mb()   asm volatile ("dmb sy" : : : "memory")
+#define xen_rmb()  asm volatile ("dmb sy" : : : "memory")
+#define xen_wmb()  asm volatile ("dmb sy" : : : "memory")
 #else
 #error "Define barriers"
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMwt-0000Bp-VU; Thu, 11 Apr 2013 19:14:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMws-0000Bb-93
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:18 +0000
Received: from [85.158.139.83:43590] by server-15.bemta-5.messagelabs.com id
	EB/42-22815-98B07615; Thu, 11 Apr 2013 19:14:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1365707655!16425941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9456 invoked from network); 11 Apr 2013 19:14:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwY-0004gx-04
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwX-0008KO-Td
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:57 +0000
Date: Thu, 11 Apr 2013 19:13:57 +0000
Message-Id: <E1UQMwX-0008KO-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: only check for Python devel
	tools if not cross-compiling.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a6068822dea6429201f6f44e229663ba7858c27
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:45 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: only check for Python devel tools if not cross-compiling.
    
    tools/python and tools/pygrub are already skipped in tools/Makefile when
    cross-compiling, so no point in checking for the prerequisites either.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/configure    |    8 +++++++-
 tools/configure.ac |    6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/configure b/tools/configure
index a98dd9e..4cd46e0 100755
--- a/tools/configure
+++ b/tools/configure
@@ -5911,7 +5911,8 @@ else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
- ac_ext=c
+
+ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -6308,6 +6309,8 @@ fi
 done
 
 
+if test "$cross_compiling" != yes; then :
+
 
 ac_previous_cppflags=$CPPFLAGS
 ac_previous_ldflags=$LDFLAGS
@@ -6439,6 +6442,9 @@ fi
 CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 
+
+fi
+
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
diff --git a/tools/configure.ac b/tools/configure.ac
index 36a3343..c5eb2b1 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -121,7 +121,11 @@ AS_IF([echo "$PYTHON" | grep -q "^/"], [
 [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
 AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
 AX_CHECK_PYTHON_VERSION([2], [3])
- AX_CHECK_PYTHON_DEVEL()
+
+AS_IF([test "$cross_compiling" != yes], [
+    AX_CHECK_PYTHON_DEVEL()
+])
+
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMwt-0000Bp-VU; Thu, 11 Apr 2013 19:14:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMws-0000Bb-93
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:18 +0000
Received: from [85.158.139.83:43590] by server-15.bemta-5.messagelabs.com id
	EB/42-22815-98B07615; Thu, 11 Apr 2013 19:14:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1365707655!16425941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9456 invoked from network); 11 Apr 2013 19:14:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwY-0004gx-04
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwX-0008KO-Td
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:57 +0000
Date: Thu, 11 Apr 2013 19:13:57 +0000
Message-Id: <E1UQMwX-0008KO-Td@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: only check for Python devel
	tools if not cross-compiling.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2a6068822dea6429201f6f44e229663ba7858c27
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:45 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: only check for Python devel tools if not cross-compiling.
    
    tools/python and tools/pygrub are already skipped in tools/Makefile when
    cross-compiling, so no point in checking for the prerequisites either.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/configure    |    8 +++++++-
 tools/configure.ac |    6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/configure b/tools/configure
index a98dd9e..4cd46e0 100755
--- a/tools/configure
+++ b/tools/configure
@@ -5911,7 +5911,8 @@ else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
- ac_ext=c
+
+ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -6308,6 +6309,8 @@ fi
 done
 
 
+if test "$cross_compiling" != yes; then :
+
 
 ac_previous_cppflags=$CPPFLAGS
 ac_previous_ldflags=$LDFLAGS
@@ -6439,6 +6442,9 @@ fi
 CPPFLAGS=$ac_previous_cppflags
 LDLFAGS=$ac_previous_ldflags
 
+
+fi
+
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
diff --git a/tools/configure.ac b/tools/configure.ac
index 36a3343..c5eb2b1 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -121,7 +121,11 @@ AS_IF([echo "$PYTHON" | grep -q "^/"], [
 [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
 AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
 AX_CHECK_PYTHON_VERSION([2], [3])
- AX_CHECK_PYTHON_DEVEL()
+
+AS_IF([test "$cross_compiling" != yes], [
+    AX_CHECK_PYTHON_DEVEL()
+])
+
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 dnl as86, ld86, bcc and iasl are only required when the host system is x86*.
 dnl "host" here means the platform on which the hypervisor and tools is
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMww-0000CY-26; Thu, 11 Apr 2013 19:14:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwu-0000C2-QY
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:21 +0000
Received: from [193.109.254.147:47651] by server-16.bemta-14.messagelabs.com
	id FC/7D-20064-C8B07615; Thu, 11 Apr 2013 19:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1365707658!1578027!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13981 invoked from network); 11 Apr 2013 19:14:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMws-0004hW-CO
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMws-0008M4-BO
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:18 +0000
Date: Thu, 11 Apr 2013 19:14:18 +0000
Message-Id: <E1UQMws-0008M4-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: memshr: arm64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3dba45ee8a808b71e702df4d8c36c5dbf183b49d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:47 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: memshr: arm64 support
    
    I'm not mad keen on propagating these sorts of asm atomic operations throughout
    our code base. Other options would be:
    
    - use libatomic-ops, http://www.hpl.hp.com/research/linux/atomic_ops/, although
      this doesn't seem to be as widespread as I would like (not in RHEL5 for
      example)
    - use a pthread lock. This is probably the simplest/best option but I wasn't
      able to figure out the locking hierarchy of this code
    
    So I've copped out and just copied the appropriate inlines here.
    
    I also nuked some stray ia64 support and fixed a coment in the arm32 version
    while I was here.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/memshr/bidir-hash.c |   48 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/tools/memshr/bidir-hash.c b/tools/memshr/bidir-hash.c
index 45d473e..bed8179 100644
--- a/tools/memshr/bidir-hash.c
+++ b/tools/memshr/bidir-hash.c
@@ -100,22 +100,13 @@ int            __hash_iterator(struct __hash *h,
                         void *d);
 static void      hash_resize(struct __hash *h);
 
-#if defined(__ia64__)
-#define ia64_fetchadd4_rel(p, inc) do {                         \
-    uint64_t ia64_intri_res;                                    \
-    asm volatile ("fetchadd4.rel %0=[%1],%2"                    \
-                : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
-                : "memory");                                    \
-} while (0)
-static inline void atomic_inc(uint32_t *v) { ia64_fetchadd4_rel(v, 1); }
-static inline void atomic_dec(uint32_t *v) { ia64_fetchadd4_rel(v, -1); }
-#elif defined(__arm__)
+#if defined(__arm__)
 static inline void atomic_inc(uint32_t *v)
 {
         unsigned long tmp;
         int result;
 
-        __asm__ __volatile__("@ atomic_add\n"
+        __asm__ __volatile__("@ atomic_inc\n"
 "1:     ldrex   %0, [%3]\n"
 "       add     %0, %0, #1\n"
 "       strex   %1, %0, [%3]\n"
@@ -130,7 +121,7 @@ static inline void atomic_dec(uint32_t *v)
         unsigned long tmp;
         int result;
 
-        __asm__ __volatile__("@ atomic_sub\n"
+        __asm__ __volatile__("@ atomic_dec\n"
 "1:     ldrex   %0, [%3]\n"
 "       sub     %0, %0, #1\n"
 "       strex   %1, %0, [%3]\n"
@@ -140,6 +131,39 @@ static inline void atomic_dec(uint32_t *v)
         : "r" (v)
         : "cc");
 }
+
+#elif defined(__aarch64__)
+
+static inline void atomic_inc(uint32_t *v)
+{
+        unsigned long tmp;
+        int result;
+
+        asm volatile("// atomic_inc\n"
+"1:     ldxr    %w0, [%3]\n"
+"       add     %w0, %w0, #1\n"
+"       stxr    %w1, %w0, [%3]\n"
+"       cbnz    %w1, 1b"
+        : "=&r" (result), "=&r" (tmp), "+o" (v)
+        : "r" (v)
+        : "cc");
+}
+
+static inline void atomic_dec(uint32_t *v)
+{
+        unsigned long tmp;
+        int result;
+
+        asm volatile("// atomic_dec\n"
+"1:     ldxr    %w0, [%3]\n"
+"       sub     %w0, %w0, #1\n"
+"       stxr    %w1, %w0, [%3]\n"
+"       cbnz    %w1, 1b"
+        : "=&r" (result), "=&r" (tmp), "+o" (v)
+        : "r" (v)
+        : "cc");
+}
+
 #else /* __x86__ */
 static inline void atomic_inc(uint32_t *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:24 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMww-0000CY-26; Thu, 11 Apr 2013 19:14:22 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwu-0000C2-QY
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:21 +0000
Received: from [193.109.254.147:47651] by server-16.bemta-14.messagelabs.com
	id FC/7D-20064-C8B07615; Thu, 11 Apr 2013 19:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1365707658!1578027!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13981 invoked from network); 11 Apr 2013 19:14:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMws-0004hW-CO
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMws-0008M4-BO
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:18 +0000
Date: Thu, 11 Apr 2013 19:14:18 +0000
Message-Id: <E1UQMws-0008M4-BO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: memshr: arm64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3dba45ee8a808b71e702df4d8c36c5dbf183b49d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:47 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    tools: memshr: arm64 support
    
    I'm not mad keen on propagating these sorts of asm atomic operations throughout
    our code base. Other options would be:
    
    - use libatomic-ops, http://www.hpl.hp.com/research/linux/atomic_ops/, although
      this doesn't seem to be as widespread as I would like (not in RHEL5 for
      example)
    - use a pthread lock. This is probably the simplest/best option but I wasn't
      able to figure out the locking hierarchy of this code
    
    So I've copped out and just copied the appropriate inlines here.
    
    I also nuked some stray ia64 support and fixed a coment in the arm32 version
    while I was here.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/memshr/bidir-hash.c |   48 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 36 insertions(+), 12 deletions(-)

diff --git a/tools/memshr/bidir-hash.c b/tools/memshr/bidir-hash.c
index 45d473e..bed8179 100644
--- a/tools/memshr/bidir-hash.c
+++ b/tools/memshr/bidir-hash.c
@@ -100,22 +100,13 @@ int            __hash_iterator(struct __hash *h,
                         void *d);
 static void      hash_resize(struct __hash *h);
 
-#if defined(__ia64__)
-#define ia64_fetchadd4_rel(p, inc) do {                         \
-    uint64_t ia64_intri_res;                                    \
-    asm volatile ("fetchadd4.rel %0=[%1],%2"                    \
-                : "=r"(ia64_intri_res) : "r"(p), "i" (inc)      \
-                : "memory");                                    \
-} while (0)
-static inline void atomic_inc(uint32_t *v) { ia64_fetchadd4_rel(v, 1); }
-static inline void atomic_dec(uint32_t *v) { ia64_fetchadd4_rel(v, -1); }
-#elif defined(__arm__)
+#if defined(__arm__)
 static inline void atomic_inc(uint32_t *v)
 {
         unsigned long tmp;
         int result;
 
-        __asm__ __volatile__("@ atomic_add\n"
+        __asm__ __volatile__("@ atomic_inc\n"
 "1:     ldrex   %0, [%3]\n"
 "       add     %0, %0, #1\n"
 "       strex   %1, %0, [%3]\n"
@@ -130,7 +121,7 @@ static inline void atomic_dec(uint32_t *v)
         unsigned long tmp;
         int result;
 
-        __asm__ __volatile__("@ atomic_sub\n"
+        __asm__ __volatile__("@ atomic_dec\n"
 "1:     ldrex   %0, [%3]\n"
 "       sub     %0, %0, #1\n"
 "       strex   %1, %0, [%3]\n"
@@ -140,6 +131,39 @@ static inline void atomic_dec(uint32_t *v)
         : "r" (v)
         : "cc");
 }
+
+#elif defined(__aarch64__)
+
+static inline void atomic_inc(uint32_t *v)
+{
+        unsigned long tmp;
+        int result;
+
+        asm volatile("// atomic_inc\n"
+"1:     ldxr    %w0, [%3]\n"
+"       add     %w0, %w0, #1\n"
+"       stxr    %w1, %w0, [%3]\n"
+"       cbnz    %w1, 1b"
+        : "=&r" (result), "=&r" (tmp), "+o" (v)
+        : "r" (v)
+        : "cc");
+}
+
+static inline void atomic_dec(uint32_t *v)
+{
+        unsigned long tmp;
+        int result;
+
+        asm volatile("// atomic_dec\n"
+"1:     ldxr    %w0, [%3]\n"
+"       sub     %w0, %w0, #1\n"
+"       stxr    %w1, %w0, [%3]\n"
+"       cbnz    %w1, 1b"
+        : "=&r" (result), "=&r" (tmp), "+o" (v)
+        : "r" (v)
+        : "cc");
+}
+
 #else /* __x86__ */
 static inline void atomic_inc(uint32_t *v)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMx7-0000Ek-5L; Thu, 11 Apr 2013 19:14:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMx5-0000EN-9l
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:31 +0000
Received: from [85.158.139.83:46637] by server-5.bemta-5.messagelabs.com id
	5F/60-02762-69B07615; Thu, 11 Apr 2013 19:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1365707668!20463502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16083 invoked from network); 11 Apr 2013 19:14:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMx2-0004hi-Hy
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMx2-0008MQ-Fd
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:28 +0000
Date: Thu, 11 Apr 2013 19:14:28 +0000
Message-Id: <E1UQMx2-0008MQ-Fd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64 uses the same I/O ABI as
	arm32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0793e96282f0e81c333edfb8ae8e42801b2f3385
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:49 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:26 2013 +0100

    xen: arm64 uses the same I/O ABI as arm32
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/io/protocols.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h
index d932edc..80b196b 100644
--- a/xen/include/public/io/protocols.h
+++ b/xen/include/public/io/protocols.h
@@ -31,7 +31,7 @@
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
 #elif defined(__x86_64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
-#elif defined(__arm__)
+#elif defined(__arm__) || defined(__aarch64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
 #else
 # error arch fixup needed here
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:35 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMx7-0000Ek-5L; Thu, 11 Apr 2013 19:14:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMx5-0000EN-9l
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:31 +0000
Received: from [85.158.139.83:46637] by server-5.bemta-5.messagelabs.com id
	5F/60-02762-69B07615; Thu, 11 Apr 2013 19:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1365707668!20463502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16083 invoked from network); 11 Apr 2013 19:14:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMx2-0004hi-Hy
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMx2-0008MQ-Fd
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:28 +0000
Date: Thu, 11 Apr 2013 19:14:28 +0000
Message-Id: <E1UQMx2-0008MQ-Fd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm64 uses the same I/O ABI as
	arm32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0793e96282f0e81c333edfb8ae8e42801b2f3385
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:49 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:26 2013 +0100

    xen: arm64 uses the same I/O ABI as arm32
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/include/public/io/protocols.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/io/protocols.h b/xen/include/public/io/protocols.h
index d932edc..80b196b 100644
--- a/xen/include/public/io/protocols.h
+++ b/xen/include/public/io/protocols.h
@@ -31,7 +31,7 @@
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
 #elif defined(__x86_64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
-#elif defined(__arm__)
+#elif defined(__arm__) || defined(__aarch64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
 #else
 # error arch fixup needed here
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMxF-0000Go-8Q; Thu, 11 Apr 2013 19:14:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxD-0000GI-Nm
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:39 +0000
Received: from [85.158.139.83:39647] by server-5.bemta-5.messagelabs.com id
	CD/80-02762-E9B07615; Thu, 11 Apr 2013 19:14:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1365707676!23645540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21971 invoked from network); 11 Apr 2013 19:14:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwD-0004gj-Jm
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwD-0008Ja-IF
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:37 +0000
Date: Thu, 11 Apr 2013 19:13:37 +0000
Message-Id: <E1UQMwD-0008Ja-IF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blktap2: use sys/eventfd.h if it is
	available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b073e110e81bc16d17d4d0bcc40f0137685bbf39
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:43 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    blktap2: use sys/eventfd.h if it is available
    
    arm64 only has the eventfd2 system call and using the libc wrapper when
    available hides this from us. eventfd() has been in libc since glibc 2.8.
    
    This code is already Linux specific.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/blktap2/drivers/libaio-compat.h |   12 ++++++++++++
 tools/config.h.in                     |    3 +++
 tools/configure                       |    9 +++++----
 tools/configure.ac                    |    2 +-
 4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/tools/blktap2/drivers/libaio-compat.h b/tools/blktap2/drivers/libaio-compat.h
index 353c36a..47cd96d 100644
--- a/tools/blktap2/drivers/libaio-compat.h
+++ b/tools/blktap2/drivers/libaio-compat.h
@@ -29,6 +29,7 @@
 #ifndef __LIBAIO_COMPAT
 #define __LIBAIO_COMPAT
 
+#include "../../config.h"
 #include <libaio.h>
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -50,6 +51,16 @@ static inline void __io_set_eventfd(struct iocb *iocb, int eventfd)
 	c->resfd = eventfd;
 }
 
+#ifdef HAVE_SYS_EVENTFD_H
+
+#include <sys/eventfd.h>
+
+static inline int tapdisk_sys_eventfd(int initval)
+{
+	return eventfd(initval, 0);
+}
+
+#else /* Fallback */
 #ifndef SYS_eventfd
 #ifndef __NR_eventfd
 # if defined(__alpha__)
@@ -88,5 +99,6 @@ static inline int tapdisk_sys_eventfd(int initval)
 {
 	return syscall(SYS_eventfd, initval, 0);
 }
+#endif
 
 #endif /* __LIBAIO_COMPAT */
diff --git a/tools/config.h.in b/tools/config.h.in
index 08e337a..a67910b 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -27,6 +27,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#undef HAVE_SYS_EVENTFD_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
diff --git a/tools/configure b/tools/configure
index 9f73172..a98dd9e 100755
--- a/tools/configure
+++ b/tools/configure
@@ -7817,12 +7817,13 @@ fi
 
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "yajl/yajl_version.h" "ac_cv_header_yajl_yajl_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_yajl_yajl_version_h" = x""yes; then :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_YAJL_YAJL_VERSION_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
diff --git a/tools/configure.ac b/tools/configure.ac
index f6e2fec..36a3343 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -166,6 +166,6 @@ AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
 AC_SUBST(libiconv)
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
 
 AC_OUTPUT()
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMxF-0000Go-8Q; Thu, 11 Apr 2013 19:14:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxD-0000GI-Nm
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:39 +0000
Received: from [85.158.139.83:39647] by server-5.bemta-5.messagelabs.com id
	CD/80-02762-E9B07615; Thu, 11 Apr 2013 19:14:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1365707676!23645540!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21971 invoked from network); 11 Apr 2013 19:14:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwD-0004gj-Jm
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMwD-0008Ja-IF
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:13:37 +0000
Date: Thu, 11 Apr 2013 19:13:37 +0000
Message-Id: <E1UQMwD-0008Ja-IF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blktap2: use sys/eventfd.h if it is
	available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b073e110e81bc16d17d4d0bcc40f0137685bbf39
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:43 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:25 2013 +0100

    blktap2: use sys/eventfd.h if it is available
    
    arm64 only has the eventfd2 system call and using the libc wrapper when
    available hides this from us. eventfd() has been in libc since glibc 2.8.
    
    This code is already Linux specific.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/blktap2/drivers/libaio-compat.h |   12 ++++++++++++
 tools/config.h.in                     |    3 +++
 tools/configure                       |    9 +++++----
 tools/configure.ac                    |    2 +-
 4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/tools/blktap2/drivers/libaio-compat.h b/tools/blktap2/drivers/libaio-compat.h
index 353c36a..47cd96d 100644
--- a/tools/blktap2/drivers/libaio-compat.h
+++ b/tools/blktap2/drivers/libaio-compat.h
@@ -29,6 +29,7 @@
 #ifndef __LIBAIO_COMPAT
 #define __LIBAIO_COMPAT
 
+#include "../../config.h"
 #include <libaio.h>
 #include <unistd.h>
 #include <sys/syscall.h>
@@ -50,6 +51,16 @@ static inline void __io_set_eventfd(struct iocb *iocb, int eventfd)
 	c->resfd = eventfd;
 }
 
+#ifdef HAVE_SYS_EVENTFD_H
+
+#include <sys/eventfd.h>
+
+static inline int tapdisk_sys_eventfd(int initval)
+{
+	return eventfd(initval, 0);
+}
+
+#else /* Fallback */
 #ifndef SYS_eventfd
 #ifndef __NR_eventfd
 # if defined(__alpha__)
@@ -88,5 +99,6 @@ static inline int tapdisk_sys_eventfd(int initval)
 {
 	return syscall(SYS_eventfd, initval, 0);
 }
+#endif
 
 #endif /* __LIBAIO_COMPAT */
diff --git a/tools/config.h.in b/tools/config.h.in
index 08e337a..a67910b 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -27,6 +27,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the <sys/eventfd.h> header file. */
+#undef HAVE_SYS_EVENTFD_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
diff --git a/tools/configure b/tools/configure
index 9f73172..a98dd9e 100755
--- a/tools/configure
+++ b/tools/configure
@@ -7817,12 +7817,13 @@ fi
 
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "yajl/yajl_version.h" "ac_cv_header_yajl_yajl_version_h" "$ac_includes_default"
-if test "x$ac_cv_header_yajl_yajl_version_h" = x""yes; then :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_YAJL_YAJL_VERSION_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
diff --git a/tools/configure.ac b/tools/configure.ac
index f6e2fec..36a3343 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -166,6 +166,6 @@ AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
 AC_SUBST(libiconv)
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
 
 AC_OUTPUT()
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMxH-0000HZ-Ay; Thu, 11 Apr 2013 19:14:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxF-0000Gm-OV
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:41 +0000
Received: from [85.158.139.83:47447] by server-1.bemta-5.messagelabs.com id
	E2/DB-14063-0AB07615; Thu, 11 Apr 2013 19:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1365707678!27387342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17553 invoked from network); 11 Apr 2013 19:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxC-0004hq-Oa
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxC-0008Mq-Mp
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:38 +0000
Date: Thu, 11 Apr 2013 19:14:38 +0000
Message-Id: <E1UQMxC-0008Mq-Mp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: remove PSR_MODE_MASK from
	public interface.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8dec6c69a6d0cbf19d120b9ecc03bc637fe23e4
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:26 2013 +0100

    xen: arm: remove PSR_MODE_MASK from public interface.
    
    This is also defined in sys/ptrace.h on arm64 which breaks the tools build due
    to multiple definitions. I expect this is really a bug in the kernel and/or
    glibc but we don't really need this symbol in the public headers, at least not
    right now, so move it into include/asm instead.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm32/entry.S    |    1 +
 xen/arch/arm/arm64/entry.S    |    1 +
 xen/include/asm-arm/regs.h    |    6 ++++++
 xen/include/public/arch-arm.h |    3 ---
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 3611427..76814dd 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <asm/asm_defns.h>
+#include <asm/regs.h>
 #include <public/xen.h>
 
 #define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 9d38088..5656f45 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <asm/asm_defns.h>
+#include <asm/regs.h>
 #include <public/xen.h>
 
 /*
diff --git a/xen/include/asm-arm/regs.h b/xen/include/asm-arm/regs.h
index 079c0ca..0130b94 100644
--- a/xen/include/asm-arm/regs.h
+++ b/xen/include/asm-arm/regs.h
@@ -1,6 +1,10 @@
 #ifndef __ARM_REGS_H__
 #define __ARM_REGS_H__
 
+#define PSR_MODE_MASK 0x1f
+
+#ifndef __ASSEMBLY__
+
 #include <xen/types.h>
 #include <public/xen.h>
 #include <asm/processor.h>
@@ -42,6 +46,8 @@
  */
 extern register_t *select_user_reg(struct cpu_user_regs *regs, int reg);
 
+#endif
+
 #endif /* __ARM_REGS_H__ */
 /*
  * Local variables:
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index e44e90f..746df8e 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -206,9 +206,6 @@ typedef uint64_t xen_callback_t;
 
 /* PSR bits (CPSR, SPSR)*/
 
-/* 0-4: Mode */
-#define PSR_MODE_MASK 0x1f
-
 /* 32 bit modes */
 #define PSR_MODE_USR 0x10
 #define PSR_MODE_FIQ 0x11
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 11 19:14:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 11 Apr 2013 19:14:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQMxH-0000HZ-Ay; Thu, 11 Apr 2013 19:14:43 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxF-0000Gm-OV
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:41 +0000
Received: from [85.158.139.83:47447] by server-1.bemta-5.messagelabs.com id
	E2/DB-14063-0AB07615; Thu, 11 Apr 2013 19:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1365707678!27387342!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17553 invoked from network); 11 Apr 2013 19:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	11 Apr 2013 19:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxC-0004hq-Oa
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQMxC-0008Mq-Mp
	for xen-changelog@lists.xensource.com; Thu, 11 Apr 2013 19:14:38 +0000
Date: Thu, 11 Apr 2013 19:14:38 +0000
Message-Id: <E1UQMxC-0008Mq-Mp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: remove PSR_MODE_MASK from
	public interface.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8dec6c69a6d0cbf19d120b9ecc03bc637fe23e4
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Mar 15 13:15:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 11:09:26 2013 +0100

    xen: arm: remove PSR_MODE_MASK from public interface.
    
    This is also defined in sys/ptrace.h on arm64 which breaks the tools build due
    to multiple definitions. I expect this is really a bug in the kernel and/or
    glibc but we don't really need this symbol in the public headers, at least not
    right now, so move it into include/asm instead.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm32/entry.S    |    1 +
 xen/arch/arm/arm64/entry.S    |    1 +
 xen/include/asm-arm/regs.h    |    6 ++++++
 xen/include/public/arch-arm.h |    3 ---
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S
index 3611427..76814dd 100644
--- a/xen/arch/arm/arm32/entry.S
+++ b/xen/arch/arm/arm32/entry.S
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <asm/asm_defns.h>
+#include <asm/regs.h>
 #include <public/xen.h>
 
 #define SAVE_ONE_BANKED(reg)    mrs r11, reg; str r11, [sp, #UREGS_##reg]
diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 9d38088..5656f45 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -1,5 +1,6 @@
 #include <xen/config.h>
 #include <asm/asm_defns.h>
+#include <asm/regs.h>
 #include <public/xen.h>
 
 /*
diff --git a/xen/include/asm-arm/regs.h b/xen/include/asm-arm/regs.h
index 079c0ca..0130b94 100644
--- a/xen/include/asm-arm/regs.h
+++ b/xen/include/asm-arm/regs.h
@@ -1,6 +1,10 @@
 #ifndef __ARM_REGS_H__
 #define __ARM_REGS_H__
 
+#define PSR_MODE_MASK 0x1f
+
+#ifndef __ASSEMBLY__
+
 #include <xen/types.h>
 #include <public/xen.h>
 #include <asm/processor.h>
@@ -42,6 +46,8 @@
  */
 extern register_t *select_user_reg(struct cpu_user_regs *regs, int reg);
 
+#endif
+
 #endif /* __ARM_REGS_H__ */
 /*
  * Local variables:
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index e44e90f..746df8e 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -206,9 +206,6 @@ typedef uint64_t xen_callback_t;
 
 /* PSR bits (CPSR, SPSR)*/
 
-/* 0-4: Mode */
-#define PSR_MODE_MASK 0x1f
-
 /* 32 bit modes */
 #define PSR_MODE_USR 0x10
 #define PSR_MODE_FIQ 0x11
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWC-0002xi-If; Fri, 12 Apr 2013 01:11:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWB-0002xY-3t
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:07 +0000
Received: from [85.158.139.211:30396] by server-8.bemta-5.messagelabs.com id
	D0/AA-05790-A2F57615; Fri, 12 Apr 2013 01:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1365729064!18443213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8249 invoked from network); 12 Apr 2013 01:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSW7-00072c-Sq
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSW7-0000Uf-LV
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:03 +0000
Date: Fri, 12 Apr 2013 01:11:03 +0000
Message-Id: <E1UQSW7-0000Uf-LV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fix xl config parser
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e14c516b6cbac4c676c988e577cea2ef78eebf6
Author:     Choonho Son <choonho.son@gmail.com>
AuthorDate: Wed Apr 10 08:52:54 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 13:17:20 2013 +0100

    xl: fix xl config parser
    
    Bug: xl lexical analyzer cannot parse keyword which has .(dot) character like vif.default.script
    
    ref: 733b9c524dbc2bec318bfc3588ed1652455d30ec
    Error log: /etc/xen/xl.conf:28: config parsing error near `.default.script="vif-bridge"': lexical error
    
    Signed-off-by: Choonho Son <choonho.son@gmail.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/libxl/libxlu_cfg_l.l |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libxl/libxlu_cfg_l.l
index efac884..d5241e1 100644
--- a/tools/libxl/libxlu_cfg_l.l
+++ b/tools/libxl/libxlu_cfg_l.l
@@ -52,7 +52,7 @@ void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
 
 %%
 
-[a-z][_0-9a-z]*         {
+[a-z][._0-9a-z]*         {
                           yylval->string= xlu__cfgl_strdup(ctx,yytext);
                           GOT(IDENT);
                         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWC-0002xi-If; Fri, 12 Apr 2013 01:11:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWB-0002xY-3t
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:07 +0000
Received: from [85.158.139.211:30396] by server-8.bemta-5.messagelabs.com id
	D0/AA-05790-A2F57615; Fri, 12 Apr 2013 01:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1365729064!18443213!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8249 invoked from network); 12 Apr 2013 01:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSW7-00072c-Sq
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSW7-0000Uf-LV
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:03 +0000
Date: Fri, 12 Apr 2013 01:11:03 +0000
Message-Id: <E1UQSW7-0000Uf-LV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: fix xl config parser
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e14c516b6cbac4c676c988e577cea2ef78eebf6
Author:     Choonho Son <choonho.son@gmail.com>
AuthorDate: Wed Apr 10 08:52:54 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 13:17:20 2013 +0100

    xl: fix xl config parser
    
    Bug: xl lexical analyzer cannot parse keyword which has .(dot) character like vif.default.script
    
    ref: 733b9c524dbc2bec318bfc3588ed1652455d30ec
    Error log: /etc/xen/xl.conf:28: config parsing error near `.default.script="vif-bridge"': lexical error
    
    Signed-off-by: Choonho Son <choonho.son@gmail.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/libxl/libxlu_cfg_l.l |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libxl/libxlu_cfg_l.l
index efac884..d5241e1 100644
--- a/tools/libxl/libxlu_cfg_l.l
+++ b/tools/libxl/libxlu_cfg_l.l
@@ -52,7 +52,7 @@ void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
 
 %%
 
-[a-z][_0-9a-z]*         {
+[a-z][._0-9a-z]*         {
                           yylval->string= xlu__cfgl_strdup(ctx,yytext);
                           GOT(IDENT);
                         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWN-0002yc-Ll; Fri, 12 Apr 2013 01:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWM-0002yU-Ug
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:19 +0000
Received: from [85.158.138.51:20898] by server-8.bemta-3.messagelabs.com id
	1F/54-20604-53F57615; Fri, 12 Apr 2013 01:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365729075!23879932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11297 invoked from network); 12 Apr 2013 01:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWI-00072f-LV
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWI-0000Vu-Bo
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:14 +0000
Date: Fri, 12 Apr 2013 01:11:14 +0000
Message-Id: <E1UQSWI-0000Vu-Bo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: add entry for the OCaml
	tools
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 73154a195e4497dc440115ad678d0669b415f848
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Mon Mar 18 15:52:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:04 2013 +0100

    MAINTAINERS: add entry for the OCaml tools
    
    I hereby volunteer myself to maintain the OCaml tools (/tools/ocaml)
    in particular:
      * the OCaml bindings
      * the OCaml xenstored
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3615f3c..438ae49 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -213,6 +213,11 @@ M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 S:	Supported
 F:	extras/mini-os/
 
+OCAML TOOLS
+M:	David Scott <dave.scott@eu.citrix.com>
+S:	Supported
+F:	tools/ocaml/
+
 QEMU-DM
 M:	Ian Jackson <ian.jackson@eu.citrix.com>
 S:	Supported
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWN-0002yc-Ll; Fri, 12 Apr 2013 01:11:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWM-0002yU-Ug
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:19 +0000
Received: from [85.158.138.51:20898] by server-8.bemta-3.messagelabs.com id
	1F/54-20604-53F57615; Fri, 12 Apr 2013 01:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-174.messagelabs.com!1365729075!23879932!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11297 invoked from network); 12 Apr 2013 01:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWI-00072f-LV
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWI-0000Vu-Bo
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:14 +0000
Date: Fri, 12 Apr 2013 01:11:14 +0000
Message-Id: <E1UQSWI-0000Vu-Bo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: add entry for the OCaml
	tools
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 73154a195e4497dc440115ad678d0669b415f848
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Mon Mar 18 15:52:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:04 2013 +0100

    MAINTAINERS: add entry for the OCaml tools
    
    I hereby volunteer myself to maintain the OCaml tools (/tools/ocaml)
    in particular:
      * the OCaml bindings
      * the OCaml xenstored
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 MAINTAINERS |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3615f3c..438ae49 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -213,6 +213,11 @@ M:	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 S:	Supported
 F:	extras/mini-os/
 
+OCAML TOOLS
+M:	David Scott <dave.scott@eu.citrix.com>
+S:	Supported
+F:	tools/ocaml/
+
 QEMU-DM
 M:	Ian Jackson <ian.jackson@eu.citrix.com>
 S:	Supported
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWX-0002zh-P0; Fri, 12 Apr 2013 01:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWW-0002zW-DJ
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:28 +0000
Received: from [193.109.254.147:52063] by server-4.bemta-14.messagelabs.com id
	7C/B5-17387-F3F57615; Fri, 12 Apr 2013 01:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1365729085!9105079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27822 invoked from network); 12 Apr 2013 01:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWT-00072l-53
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWT-0000Wg-3P
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:25 +0000
Date: Fri, 12 Apr 2013 01:11:25 +0000
Message-Id: <E1UQSWT-0000Wg-3P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: Re-add ocaml syslog binding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2f778405fe074ae0801d6328da6ba869e4786d77
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Mar 19 16:42:40 2013 +0000
Commit:     David Scott <dave.scott@eu.citrix.com>
CommitDate: Tue Mar 19 21:15:59 2013 +0000

    oxenstored: Re-add ocaml syslog binding
    
    This was lost in the OCaml xenstored log merge of 10/Oct/2011.
    
    The binding isn't exported as a shared "log" library, instead it is kept
    local to xenstored.
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/xenstored/Makefile       |   13 ++++++++-
 tools/ocaml/xenstored/syslog.ml      |   47 +++++++++++++++++++++++++++++++++
 tools/ocaml/xenstored/syslog.mli     |   41 +++++++++++++++++++++++++++++
 tools/ocaml/xenstored/syslog_stubs.c |   48 ++++++++++++++++++++++++++++++++++
 4 files changed, 147 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 3302d57..b18f190 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -8,6 +8,11 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
+LIBS = syslog.cma syslog.cmxa
+syslog_OBJS = syslog
+syslog_C_OBJS = syslog_stubs
+OCAML_LIBRARY = syslog
+
 OBJS = define \
 	stdext \
 	trie \
@@ -29,9 +34,11 @@ OBJS = define \
 	process \
 	xenstored
 
-INTF = symbol.cmi trie.cmi
+INTF = symbol.cmi trie.cmi syslog.cmi
+
 XENSTOREDLIBS = \
 	unix.cmxa \
+	-ccopt -L -ccopt . syslog.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
@@ -45,10 +52,12 @@ oxenstored_OBJS = $(OBJS)
 
 OCAML_PROGRAM = oxenstored
 
-all: $(INTF) $(PROGRAMS)
+all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
 
+libs: $(LIBS)
+
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PROG) oxenstored $(DESTDIR)$(SBINDIR)
diff --git a/tools/ocaml/xenstored/syslog.ml b/tools/ocaml/xenstored/syslog.ml
new file mode 100644
index 0000000..abeace7
--- /dev/null
+++ b/tools/ocaml/xenstored/syslog.ml
@@ -0,0 +1,47 @@
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+type level = Emerg | Alert | Crit | Err | Warning | Notice | Info | Debug
+type options = Cons | Ndelay | Nowait | Odelay | Perror | Pid
+type facility = Auth | Authpriv | Cron | Daemon | Ftp | Kern
+              | Local0 | Local1 | Local2 | Local3
+	      | Local4 | Local5 | Local6 | Local7
+	      | Lpr | Mail | News | Syslog | User | Uucp
+
+external log : facility -> level -> string -> unit = "stub_syslog"
+
+exception Unknown_facility of string
+let facility_of_string s =
+	match s with
+    |"auth"->Auth
+    |"authpriv"->Authpriv
+    |"cron"->Cron
+    |"daemon"->Daemon
+    |"ftp"->Ftp
+    |"kern"->Kern
+    |"local0"->Local0
+    |"local1"->Local1
+    |"local2"->Local2
+    |"local3"->Local3
+    |"local4"->Local4
+    |"local5"->Local5
+    |"local6"->Local6
+    |"local7"->Local7
+    |"lpr"->Lpr
+    |"mail"->Mail
+    |"news"->News
+    |"syslog"->Syslog
+    |"user"->User
+    |"uucp"->Uucp
+		|_-> raise (Unknown_facility s)
diff --git a/tools/ocaml/xenstored/syslog.mli b/tools/ocaml/xenstored/syslog.mli
new file mode 100644
index 0000000..ecac8a1
--- /dev/null
+++ b/tools/ocaml/xenstored/syslog.mli
@@ -0,0 +1,41 @@
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+type level = Emerg | Alert | Crit | Err | Warning | Notice | Info | Debug
+type facility =
+    Auth
+  | Authpriv
+  | Cron
+  | Daemon
+  | Ftp
+  | Kern
+  | Local0
+  | Local1
+  | Local2
+  | Local3
+  | Local4
+  | Local5
+  | Local6
+  | Local7
+  | Lpr
+  | Mail
+  | News
+  | Syslog
+  | User
+  | Uucp
+
+external log : facility -> level -> string -> unit = "stub_syslog"
+
+
+val facility_of_string : string -> facility
diff --git a/tools/ocaml/xenstored/syslog_stubs.c b/tools/ocaml/xenstored/syslog_stubs.c
new file mode 100644
index 0000000..dd8b9e9
--- /dev/null
+++ b/tools/ocaml/xenstored/syslog_stubs.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <syslog.h>
+#include <string.h>
+#include <caml/mlvalues.h>
+#include <caml/memory.h>
+#include <caml/alloc.h>
+#include <caml/custom.h>
+#include <caml/signals.h>
+
+static int __syslog_level_table[] = {
+	LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING,
+	LOG_NOTICE, LOG_INFO, LOG_DEBUG
+};
+
+static int __syslog_facility_table[] = {
+	LOG_AUTH, LOG_AUTHPRIV, LOG_CRON, LOG_DAEMON, LOG_FTP, LOG_KERN,
+	LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3,
+	LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7,
+	LOG_LPR | LOG_MAIL | LOG_NEWS | LOG_SYSLOG | LOG_USER | LOG_UUCP
+};
+
+value stub_syslog(value facility, value level, value msg)
+{
+	CAMLparam3(facility, level, msg);
+	const char *c_msg = strdup(String_val(msg));
+	int c_facility = __syslog_facility_table[Int_val(facility)]
+	               | __syslog_level_table[Int_val(level)];
+
+	caml_enter_blocking_section();
+	syslog(c_facility, "%s", c_msg);
+	caml_leave_blocking_section();
+	
+	free((void*)c_msg);
+	CAMLreturn(Val_unit);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWX-0002zh-P0; Fri, 12 Apr 2013 01:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWW-0002zW-DJ
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:28 +0000
Received: from [193.109.254.147:52063] by server-4.bemta-14.messagelabs.com id
	7C/B5-17387-F3F57615; Fri, 12 Apr 2013 01:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1365729085!9105079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27822 invoked from network); 12 Apr 2013 01:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWT-00072l-53
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWT-0000Wg-3P
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:25 +0000
Date: Fri, 12 Apr 2013 01:11:25 +0000
Message-Id: <E1UQSWT-0000Wg-3P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: Re-add ocaml syslog binding
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2f778405fe074ae0801d6328da6ba869e4786d77
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Mar 19 16:42:40 2013 +0000
Commit:     David Scott <dave.scott@eu.citrix.com>
CommitDate: Tue Mar 19 21:15:59 2013 +0000

    oxenstored: Re-add ocaml syslog binding
    
    This was lost in the OCaml xenstored log merge of 10/Oct/2011.
    
    The binding isn't exported as a shared "log" library, instead it is kept
    local to xenstored.
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/xenstored/Makefile       |   13 ++++++++-
 tools/ocaml/xenstored/syslog.ml      |   47 +++++++++++++++++++++++++++++++++
 tools/ocaml/xenstored/syslog.mli     |   41 +++++++++++++++++++++++++++++
 tools/ocaml/xenstored/syslog_stubs.c |   48 ++++++++++++++++++++++++++++++++++
 4 files changed, 147 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 3302d57..b18f190 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -8,6 +8,11 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
 	-I $(OCAML_TOPLEVEL)/libs/eventchn
 
+LIBS = syslog.cma syslog.cmxa
+syslog_OBJS = syslog
+syslog_C_OBJS = syslog_stubs
+OCAML_LIBRARY = syslog
+
 OBJS = define \
 	stdext \
 	trie \
@@ -29,9 +34,11 @@ OBJS = define \
 	process \
 	xenstored
 
-INTF = symbol.cmi trie.cmi
+INTF = symbol.cmi trie.cmi syslog.cmi
+
 XENSTOREDLIBS = \
 	unix.cmxa \
+	-ccopt -L -ccopt . syslog.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
@@ -45,10 +52,12 @@ oxenstored_OBJS = $(OBJS)
 
 OCAML_PROGRAM = oxenstored
 
-all: $(INTF) $(PROGRAMS)
+all: $(INTF) $(LIBS) $(PROGRAMS)
 
 bins: $(PROGRAMS)
 
+libs: $(LIBS)
+
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PROG) oxenstored $(DESTDIR)$(SBINDIR)
diff --git a/tools/ocaml/xenstored/syslog.ml b/tools/ocaml/xenstored/syslog.ml
new file mode 100644
index 0000000..abeace7
--- /dev/null
+++ b/tools/ocaml/xenstored/syslog.ml
@@ -0,0 +1,47 @@
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+type level = Emerg | Alert | Crit | Err | Warning | Notice | Info | Debug
+type options = Cons | Ndelay | Nowait | Odelay | Perror | Pid
+type facility = Auth | Authpriv | Cron | Daemon | Ftp | Kern
+              | Local0 | Local1 | Local2 | Local3
+	      | Local4 | Local5 | Local6 | Local7
+	      | Lpr | Mail | News | Syslog | User | Uucp
+
+external log : facility -> level -> string -> unit = "stub_syslog"
+
+exception Unknown_facility of string
+let facility_of_string s =
+	match s with
+    |"auth"->Auth
+    |"authpriv"->Authpriv
+    |"cron"->Cron
+    |"daemon"->Daemon
+    |"ftp"->Ftp
+    |"kern"->Kern
+    |"local0"->Local0
+    |"local1"->Local1
+    |"local2"->Local2
+    |"local3"->Local3
+    |"local4"->Local4
+    |"local5"->Local5
+    |"local6"->Local6
+    |"local7"->Local7
+    |"lpr"->Lpr
+    |"mail"->Mail
+    |"news"->News
+    |"syslog"->Syslog
+    |"user"->User
+    |"uucp"->Uucp
+		|_-> raise (Unknown_facility s)
diff --git a/tools/ocaml/xenstored/syslog.mli b/tools/ocaml/xenstored/syslog.mli
new file mode 100644
index 0000000..ecac8a1
--- /dev/null
+++ b/tools/ocaml/xenstored/syslog.mli
@@ -0,0 +1,41 @@
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+type level = Emerg | Alert | Crit | Err | Warning | Notice | Info | Debug
+type facility =
+    Auth
+  | Authpriv
+  | Cron
+  | Daemon
+  | Ftp
+  | Kern
+  | Local0
+  | Local1
+  | Local2
+  | Local3
+  | Local4
+  | Local5
+  | Local6
+  | Local7
+  | Lpr
+  | Mail
+  | News
+  | Syslog
+  | User
+  | Uucp
+
+external log : facility -> level -> string -> unit = "stub_syslog"
+
+
+val facility_of_string : string -> facility
diff --git a/tools/ocaml/xenstored/syslog_stubs.c b/tools/ocaml/xenstored/syslog_stubs.c
new file mode 100644
index 0000000..dd8b9e9
--- /dev/null
+++ b/tools/ocaml/xenstored/syslog_stubs.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <syslog.h>
+#include <string.h>
+#include <caml/mlvalues.h>
+#include <caml/memory.h>
+#include <caml/alloc.h>
+#include <caml/custom.h>
+#include <caml/signals.h>
+
+static int __syslog_level_table[] = {
+	LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING,
+	LOG_NOTICE, LOG_INFO, LOG_DEBUG
+};
+
+static int __syslog_facility_table[] = {
+	LOG_AUTH, LOG_AUTHPRIV, LOG_CRON, LOG_DAEMON, LOG_FTP, LOG_KERN,
+	LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3,
+	LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7,
+	LOG_LPR | LOG_MAIL | LOG_NEWS | LOG_SYSLOG | LOG_USER | LOG_UUCP
+};
+
+value stub_syslog(value facility, value level, value msg)
+{
+	CAMLparam3(facility, level, msg);
+	const char *c_msg = strdup(String_val(msg));
+	int c_facility = __syslog_facility_table[Int_val(facility)]
+	               | __syslog_level_table[Int_val(level)];
+
+	caml_enter_blocking_section();
+	syslog(c_facility, "%s", c_msg);
+	caml_leave_blocking_section();
+	
+	free((void*)c_msg);
+	CAMLreturn(Val_unit);
+}
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWs-00032D-Sw; Fri, 12 Apr 2013 01:11:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWr-00031h-1R
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:49 +0000
Received: from [85.158.143.99:8118] by server-2.bemta-4.messagelabs.com id
	B3/96-12656-45F57615; Fri, 12 Apr 2013 01:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1365729106!20320822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16862 invoked from network); 12 Apr 2013 01:11:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWn-00072z-RB
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWn-0000YP-PO
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:45 +0000
Date: Fri, 12 Apr 2013 01:11:45 +0000
Message-Id: <E1UQSWn-0000YP-PO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: Allow oxenstored to use
	syslog at levels other than Debug
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f1355fe8d5140308a26e23370459dd749f5efbf
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Mar 19 16:57:34 2013 +0000
Commit:     David Scott <dave.scott@eu.citrix.com>
CommitDate: Tue Mar 19 21:16:04 2013 +0000

    oxenstored: Allow oxenstored to use syslog at levels other than Debug
    
    We now log different kinds of events at different levels. The convention
    is now:
    
    new/end_connection:    Debug
    coalesce:              Debug
    conflict:              Debug
    commit:                Debug
    regular ops:           Info
    start/end_transaction: Debug
    error (ENOENT):        Debug
    error (any other):     Warn
    watch:                 Info
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/xenstored/logging.ml |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/tools/ocaml/xenstored/logging.ml b/tools/ocaml/xenstored/logging.ml
index e26f804..3d4a329 100644
--- a/tools/ocaml/xenstored/logging.ml
+++ b/tools/ocaml/xenstored/logging.ml
@@ -275,7 +275,7 @@ let init_access_log post_rotate = match !access_log_destination with
 	| Syslog facility ->
 		access_logger := Some (make_syslog_logger facility)
 
-let access_logging ~con ~tid ?(data="") access_type =
+let access_logging ~con ~tid ?(data="") ~level access_type =
         try
 		maybe
 			(fun logger ->
@@ -285,18 +285,18 @@ let access_logging ~con ~tid ?(data="") access_type =
 				let data = sanitize_data data in
 				let prefix = prefix !access_log_destination date in
 				let msg = Printf.sprintf "%s %s %s %s" prefix tid access_type data in
-				logger.write msg)
+				logger.write ~level msg)
 			!access_logger
 	with _ -> ()
 
-let new_connection = access_logging Newconn
-let end_connection = access_logging Endconn
+let new_connection = access_logging ~level:Debug Newconn
+let end_connection = access_logging ~level:Debug Endconn
 let read_coalesce ~tid ~con data =
 	if !access_log_read_ops
-	then access_logging Coalesce ~tid ~con ~data:("read "^data)
-let write_coalesce data = access_logging Coalesce ~data:("write "^data)
-let conflict = access_logging Conflict
-let commit = access_logging Commit
+        then access_logging Coalesce ~tid ~con ~data:("read "^data) ~level:Debug
+let write_coalesce data = access_logging Coalesce ~data:("write "^data) ~level:Debug
+let conflict = access_logging Conflict ~level:Debug
+let commit = access_logging Commit ~level:Debug
 
 let xb_op ~tid ~con ~ty data =
 	let print = match ty with
@@ -306,21 +306,21 @@ let xb_op ~tid ~con ~ty data =
 		| Xenbus.Xb.Op.Introduce | Xenbus.Xb.Op.Release | Xenbus.Xb.Op.Getdomainpath | Xenbus.Xb.Op.Isintroduced | Xenbus.Xb.Op.Resume ->
 			!access_log_special_ops
 		| _ -> true in
-	if print then access_logging ~tid ~con ~data (XbOp ty)
+	if print then access_logging ~tid ~con ~data (XbOp ty) ~level:Info
 
 let start_transaction ~tid ~con = 
 	if !access_log_transaction_ops && tid <> 0
-	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_start)
+	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_start) ~level:Debug
 
 let end_transaction ~tid ~con = 
 	if !access_log_transaction_ops && tid <> 0
-	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_end)
+	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_end) ~level:Debug
 
 let xb_answer ~tid ~con ~ty data =
-	let print = match ty with
-		| Xenbus.Xb.Op.Error when String.startswith "ENOENT " data -> !access_log_read_ops
-		| Xenbus.Xb.Op.Error -> true
-		| Xenbus.Xb.Op.Watchevent -> true
-		| _ -> false
+	let print, level = match ty with
+		| Xenbus.Xb.Op.Error when String.startswith "ENOENT" data -> !access_log_read_ops , Warn
+		| Xenbus.Xb.Op.Error -> true , Warn
+		| Xenbus.Xb.Op.Watchevent -> true , Info
+		| _ -> false, Debug
 	in
-	if print then access_logging ~tid ~con ~data (XbOp ty)
+	if print then access_logging ~tid ~con ~data (XbOp ty) ~level
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWs-00032D-Sw; Fri, 12 Apr 2013 01:11:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWr-00031h-1R
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:49 +0000
Received: from [85.158.143.99:8118] by server-2.bemta-4.messagelabs.com id
	B3/96-12656-45F57615; Fri, 12 Apr 2013 01:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-216.messagelabs.com!1365729106!20320822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16862 invoked from network); 12 Apr 2013 01:11:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWn-00072z-RB
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWn-0000YP-PO
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:45 +0000
Date: Fri, 12 Apr 2013 01:11:45 +0000
Message-Id: <E1UQSWn-0000YP-PO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: Allow oxenstored to use
	syslog at levels other than Debug
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f1355fe8d5140308a26e23370459dd749f5efbf
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Mar 19 16:57:34 2013 +0000
Commit:     David Scott <dave.scott@eu.citrix.com>
CommitDate: Tue Mar 19 21:16:04 2013 +0000

    oxenstored: Allow oxenstored to use syslog at levels other than Debug
    
    We now log different kinds of events at different levels. The convention
    is now:
    
    new/end_connection:    Debug
    coalesce:              Debug
    conflict:              Debug
    commit:                Debug
    regular ops:           Info
    start/end_transaction: Debug
    error (ENOENT):        Debug
    error (any other):     Warn
    watch:                 Info
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/xenstored/logging.ml |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/tools/ocaml/xenstored/logging.ml b/tools/ocaml/xenstored/logging.ml
index e26f804..3d4a329 100644
--- a/tools/ocaml/xenstored/logging.ml
+++ b/tools/ocaml/xenstored/logging.ml
@@ -275,7 +275,7 @@ let init_access_log post_rotate = match !access_log_destination with
 	| Syslog facility ->
 		access_logger := Some (make_syslog_logger facility)
 
-let access_logging ~con ~tid ?(data="") access_type =
+let access_logging ~con ~tid ?(data="") ~level access_type =
         try
 		maybe
 			(fun logger ->
@@ -285,18 +285,18 @@ let access_logging ~con ~tid ?(data="") access_type =
 				let data = sanitize_data data in
 				let prefix = prefix !access_log_destination date in
 				let msg = Printf.sprintf "%s %s %s %s" prefix tid access_type data in
-				logger.write msg)
+				logger.write ~level msg)
 			!access_logger
 	with _ -> ()
 
-let new_connection = access_logging Newconn
-let end_connection = access_logging Endconn
+let new_connection = access_logging ~level:Debug Newconn
+let end_connection = access_logging ~level:Debug Endconn
 let read_coalesce ~tid ~con data =
 	if !access_log_read_ops
-	then access_logging Coalesce ~tid ~con ~data:("read "^data)
-let write_coalesce data = access_logging Coalesce ~data:("write "^data)
-let conflict = access_logging Conflict
-let commit = access_logging Commit
+        then access_logging Coalesce ~tid ~con ~data:("read "^data) ~level:Debug
+let write_coalesce data = access_logging Coalesce ~data:("write "^data) ~level:Debug
+let conflict = access_logging Conflict ~level:Debug
+let commit = access_logging Commit ~level:Debug
 
 let xb_op ~tid ~con ~ty data =
 	let print = match ty with
@@ -306,21 +306,21 @@ let xb_op ~tid ~con ~ty data =
 		| Xenbus.Xb.Op.Introduce | Xenbus.Xb.Op.Release | Xenbus.Xb.Op.Getdomainpath | Xenbus.Xb.Op.Isintroduced | Xenbus.Xb.Op.Resume ->
 			!access_log_special_ops
 		| _ -> true in
-	if print then access_logging ~tid ~con ~data (XbOp ty)
+	if print then access_logging ~tid ~con ~data (XbOp ty) ~level:Info
 
 let start_transaction ~tid ~con = 
 	if !access_log_transaction_ops && tid <> 0
-	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_start)
+	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_start) ~level:Debug
 
 let end_transaction ~tid ~con = 
 	if !access_log_transaction_ops && tid <> 0
-	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_end)
+	then access_logging ~tid ~con (XbOp Xenbus.Xb.Op.Transaction_end) ~level:Debug
 
 let xb_answer ~tid ~con ~ty data =
-	let print = match ty with
-		| Xenbus.Xb.Op.Error when String.startswith "ENOENT " data -> !access_log_read_ops
-		| Xenbus.Xb.Op.Error -> true
-		| Xenbus.Xb.Op.Watchevent -> true
-		| _ -> false
+	let print, level = match ty with
+		| Xenbus.Xb.Op.Error when String.startswith "ENOENT" data -> !access_log_read_ops , Warn
+		| Xenbus.Xb.Op.Error -> true , Warn
+		| Xenbus.Xb.Op.Watchevent -> true , Info
+		| _ -> false, Debug
 	in
-	if print then access_logging ~tid ~con ~data (XbOp ty)
+	if print then access_logging ~tid ~con ~data (XbOp ty) ~level
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWs-00032I-WC; Fri, 12 Apr 2013 01:11:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWr-00031l-EL
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:49 +0000
Received: from [85.158.139.83:28894] by server-12.bemta-5.messagelabs.com id
	55/DB-11486-A4F57615; Fri, 12 Apr 2013 01:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1365729095!27970051!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.9 required=7.0 tests=BODY_RANDOM_LONG,INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4476 invoked from network); 12 Apr 2013 01:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWd-00072t-K6
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWd-0000X6-EA
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:35 +0000
Date: Fri, 12 Apr 2013 01:11:35 +0000
Message-Id: <E1UQSWd-0000X6-EA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: enable logging via syslog,
	if specified in the config file.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 24bd2dbb85d12f1d435180c328950035205b0af5
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Mar 19 16:53:01 2013 +0000
Commit:     David Scott <dave.scott@eu.citrix.com>
CommitDate: Tue Mar 19 21:16:04 2013 +0000

    oxenstored: enable logging via syslog, if specified in the config file.
    
    To log to files the config file should contain:
       xenstored-log-file = /var/log/xenstored.log
       access-log-file = /var/log/xenstored-access.log
    
    (These two files are still the built-in defaults. The log format is
    unchanged.)
    
    To log to syslog the config file should contain:
       xenstored-log-file = syslog:<facility>
       access-log-file = syslog:<facility>
    
    where <facility> is the syslog facility to use (e.g. 'daemon' 'local2')
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/xenstored/logging.ml   |  124 ++++++++++++++++++++++++++---------
 tools/ocaml/xenstored/xenstored.ml |    4 +-
 2 files changed, 94 insertions(+), 34 deletions(-)

diff --git a/tools/ocaml/xenstored/logging.ml b/tools/ocaml/xenstored/logging.ml
index bc3a2ea..e26f804 100644
--- a/tools/ocaml/xenstored/logging.ml
+++ b/tools/ocaml/xenstored/logging.ml
@@ -20,11 +20,42 @@ open Printf
 
 (* Logger common *)
 
+type log_destination =
+	| File of string
+	| Syslog of Syslog.facility
+
+let log_destination_of_string s =
+	let prefix = "syslog:" in
+	let len_prefix = String.length prefix in
+	let len = String.length s in
+	if String.startswith prefix s
+	then Syslog(Syslog.facility_of_string (String.sub s len_prefix (len - len_prefix)))
+	else File s
+
+(* The prefix of a log line depends on the log destination *)
+let prefix log_destination ?level ?key date = match log_destination with
+	| File _ ->
+		let level = match level with
+			| Some x -> Printf.sprintf "|%5s" x
+			| None -> "" in
+		let key = match key with
+			| Some x -> "|" ^ x
+			| None -> "" in
+		Printf.sprintf "[%s%s%s] " date level key
+	| Syslog _ ->
+		let key = match key with
+			| Some x -> "[" ^ x ^ "] "
+			| None -> "" in
+		(* Syslog handles the date and level internally *)
+		key
+
+type level = Debug | Info | Warn | Error | Null
+
 type logger =
 		{ stop: unit -> unit;
 		  restart: unit -> unit;
 		  rotate: unit -> unit;
-		  write: 'a. ('a, unit, string, unit) format4 -> 'a }
+		  write: ?level:level -> string -> unit }
 
 let truncate_line nb_chars line = 
 	if String.length line > nb_chars - 1 then
@@ -54,7 +85,7 @@ let log_rotate ref_ch log_file log_nb_files =
 	close_out !ref_ch;
 	ref_ch := open_out log_file
 
-let make_logger log_file log_nb_files log_nb_lines log_nb_chars post_rotate =
+let make_file_logger log_file log_nb_files log_nb_lines log_nb_chars post_rotate =
 	let channel = ref (open_out_gen [Open_append; Open_creat] 0o644 log_file) in
 	let counter = ref 0 in
 	let stop() =
@@ -67,22 +98,17 @@ let make_logger log_file log_nb_files log_nb_lines log_nb_chars post_rotate =
 		log_rotate channel log_file log_nb_files;
 		(post_rotate (): unit);
 		counter := 0 in
-	let output s =
+	let write ?level s =
 		let s = if log_nb_chars > 0 then truncate_line log_nb_chars s else s in
 		let s = s ^ "\n" in
 		output_string !channel s;
 		flush !channel;
 		incr counter;
 		if !counter > log_nb_lines then rotate() in
-	{ stop=stop; restart=restart; rotate=rotate; write = fun fmt -> Printf.ksprintf output fmt }
-
-
-(* Xenstored logger *) 
+	{ stop=stop; restart=restart; rotate=rotate; write=write }
 
 exception Unknown_level of string
 
-type level = Debug | Info | Warn | Error | Null
-
 let int_of_level = function
 	| Debug -> 0 | Info -> 1 | Warn -> 2
 	| Error -> 3 | Null -> max_int
@@ -104,30 +130,56 @@ let string_of_date () =
 		tm.Unix.tm_hour tm.Unix.tm_min tm.Unix.tm_sec
 		(int_of_float (1000.0 *. msec))
 
-let xenstored_log_file = ref "/var/log/xenstored.log"
+let make_syslog_logger facility =
+	(* We defer to syslog for log management *)
+	let nothing () = () in
+	let write ?level s =
+		let level = match level with
+			| Some Error -> Syslog.Err
+			| Some Warn -> Syslog.Warning
+			| Some Info -> Syslog.Info
+			| Some Debug -> Syslog.Debug
+			| Some Null -> Syslog.Debug
+			| None -> Syslog.Debug in
+		(* Syslog handles the date and level internally *)
+		Syslog.log facility level s in
+	{ stop = nothing; restart = nothing; rotate = nothing; write=write }
+
+let xenstored_log_destination = ref (File "/var/log/xenstored.log")
 let xenstored_log_level = ref Warn
 let xenstored_log_nb_files = ref 10
 let xenstored_log_nb_lines = ref 13215
 let xenstored_log_nb_chars = ref (-1)
 let xenstored_logger = ref (None: logger option)
 
-let init_xenstored_log () =
-	if !xenstored_log_level <> Null && !xenstored_log_nb_files > 0 then
-		let logger =
-			make_logger 
-				!xenstored_log_file !xenstored_log_nb_files !xenstored_log_nb_lines
-				!xenstored_log_nb_chars ignore in
-		let date = string_of_date() in
-		logger.write ("[%s|%5s|%s] Xen Storage Daemon, version %d.%d") date "" "startup"
-		  Define.xenstored_major Define.xenstored_minor;
-		xenstored_logger := Some logger
+let set_xenstored_log_destination s =
+	xenstored_log_destination := log_destination_of_string s
+
+let set_xenstored_logger logger =
+	xenstored_logger := Some logger;
+	logger.write ~level:Info (Printf.sprintf "Xen Storage Daemon, version %d.%d"
+	Define.xenstored_major Define.xenstored_minor)
+
+
+let init_xenstored_log () = match !xenstored_log_destination with
+	| File file ->
+		if !xenstored_log_level <> Null && !xenstored_log_nb_files > 0 then
+			let logger =
+				make_file_logger 
+					file !xenstored_log_nb_files !xenstored_log_nb_lines
+					!xenstored_log_nb_chars ignore in
+			set_xenstored_logger logger
+	| Syslog facility ->
+		set_xenstored_logger (make_syslog_logger facility)
+
 
 let xenstored_logging level key (fmt: (_,_,_,_) format4) =
 	match !xenstored_logger with
 	| Some logger when int_of_level level >= int_of_level !xenstored_log_level ->
 			let date = string_of_date() in
-			let level = string_of_level level in
-			logger.write ("[%s|%5s|%s] " ^^ fmt) date level key
+			let level' = string_of_level level in
+			let prefix = prefix !xenstored_log_destination ~level:level' ~key date in
+			Printf.ksprintf (fun s -> logger.write ~level (prefix ^ s)) fmt
 	| _ -> Printf.ksprintf ignore fmt
 
 let debug key = xenstored_logging Debug key
@@ -200,7 +252,7 @@ let sanitize_data data =
 	String.escaped data
 
 let activate_access_log = ref true
-let access_log_file = ref "/var/log/xenstored-access.log"
+let access_log_destination = ref (File "/var/log/xenstored-access.log")
 let access_log_nb_files = ref 20
 let access_log_nb_lines = ref 13215
 let access_log_nb_chars = ref 180
@@ -209,14 +261,20 @@ let access_log_transaction_ops = ref false
 let access_log_special_ops = ref false
 let access_logger = ref None
 
-let init_access_log post_rotate =
-	if !access_log_nb_files > 0 then
-		let logger =
-			make_logger
-				!access_log_file !access_log_nb_files !access_log_nb_lines
-				!access_log_nb_chars post_rotate in
-		access_logger := Some logger
- 
+let set_access_log_destination s =
+	access_log_destination := log_destination_of_string s
+
+let init_access_log post_rotate = match !access_log_destination with
+	| File file ->
+		if !access_log_nb_files > 0 then
+			let logger =
+				make_file_logger
+					file !access_log_nb_files !access_log_nb_lines
+					!access_log_nb_chars post_rotate in
+			access_logger := Some logger
+	| Syslog facility ->
+		access_logger := Some (make_syslog_logger facility)
+
 let access_logging ~con ~tid ?(data="") access_type =
         try
 		maybe
@@ -225,7 +283,9 @@ let access_logging ~con ~tid ?(data="") access_type =
 				let tid = string_of_tid ~con tid in
 				let access_type = string_of_access_type access_type in
 				let data = sanitize_data data in
-				logger.write "[%s] %s %s %s" date tid access_type data)
+				let prefix = prefix !access_log_destination date in
+				let msg = Printf.sprintf "%s %s %s %s" prefix tid access_type data in
+				logger.write msg)
 			!access_logger
 	with _ -> ()
 
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 64cc106..3416666 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -87,13 +87,13 @@ let parse_config filename =
 		("quota-maxsize", Config.Set_int Quota.maxsize);
 		("test-eagain", Config.Set_bool Transaction.test_eagain);
 		("persistent", Config.Set_bool Disk.enable);
-		("xenstored-log-file", Config.Set_string Logging.xenstored_log_file);
+		("xenstored-log-file", Config.String Logging.set_xenstored_log_destination);
 		("xenstored-log-level", Config.String
 			(fun s -> Logging.xenstored_log_level := Logging.level_of_string s));
 		("xenstored-log-nb-files", Config.Set_int Logging.xenstored_log_nb_files);
 		("xenstored-log-nb-lines", Config.Set_int Logging.xenstored_log_nb_lines);
 		("xenstored-log-nb-chars", Config.Set_int Logging.xenstored_log_nb_chars);
-		("access-log-file", Config.Set_string Logging.access_log_file);
+		("access-log-file", Config.String Logging.set_access_log_destination);
 		("access-log-nb-files", Config.Set_int Logging.access_log_nb_files);
 		("access-log-nb-lines", Config.Set_int Logging.access_log_nb_lines);
 		("access-log-nb-chars", Config.Set_int Logging.access_log_nb_chars);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:11:56 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:11:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSWs-00032I-WC; Fri, 12 Apr 2013 01:11:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWr-00031l-EL
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:49 +0000
Received: from [85.158.139.83:28894] by server-12.bemta-5.messagelabs.com id
	55/DB-11486-A4F57615; Fri, 12 Apr 2013 01:11:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1365729095!27970051!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.9 required=7.0 tests=BODY_RANDOM_LONG,INFO_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4476 invoked from network); 12 Apr 2013 01:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWd-00072t-K6
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWd-0000X6-EA
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:35 +0000
Date: Fri, 12 Apr 2013 01:11:35 +0000
Message-Id: <E1UQSWd-0000X6-EA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] oxenstored: enable logging via syslog,
	if specified in the config file.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 24bd2dbb85d12f1d435180c328950035205b0af5
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Mar 19 16:53:01 2013 +0000
Commit:     David Scott <dave.scott@eu.citrix.com>
CommitDate: Tue Mar 19 21:16:04 2013 +0000

    oxenstored: enable logging via syslog, if specified in the config file.
    
    To log to files the config file should contain:
       xenstored-log-file = /var/log/xenstored.log
       access-log-file = /var/log/xenstored-access.log
    
    (These two files are still the built-in defaults. The log format is
    unchanged.)
    
    To log to syslog the config file should contain:
       xenstored-log-file = syslog:<facility>
       access-log-file = syslog:<facility>
    
    where <facility> is the syslog facility to use (e.g. 'daemon' 'local2')
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
---
 tools/ocaml/xenstored/logging.ml   |  124 ++++++++++++++++++++++++++---------
 tools/ocaml/xenstored/xenstored.ml |    4 +-
 2 files changed, 94 insertions(+), 34 deletions(-)

diff --git a/tools/ocaml/xenstored/logging.ml b/tools/ocaml/xenstored/logging.ml
index bc3a2ea..e26f804 100644
--- a/tools/ocaml/xenstored/logging.ml
+++ b/tools/ocaml/xenstored/logging.ml
@@ -20,11 +20,42 @@ open Printf
 
 (* Logger common *)
 
+type log_destination =
+	| File of string
+	| Syslog of Syslog.facility
+
+let log_destination_of_string s =
+	let prefix = "syslog:" in
+	let len_prefix = String.length prefix in
+	let len = String.length s in
+	if String.startswith prefix s
+	then Syslog(Syslog.facility_of_string (String.sub s len_prefix (len - len_prefix)))
+	else File s
+
+(* The prefix of a log line depends on the log destination *)
+let prefix log_destination ?level ?key date = match log_destination with
+	| File _ ->
+		let level = match level with
+			| Some x -> Printf.sprintf "|%5s" x
+			| None -> "" in
+		let key = match key with
+			| Some x -> "|" ^ x
+			| None -> "" in
+		Printf.sprintf "[%s%s%s] " date level key
+	| Syslog _ ->
+		let key = match key with
+			| Some x -> "[" ^ x ^ "] "
+			| None -> "" in
+		(* Syslog handles the date and level internally *)
+		key
+
+type level = Debug | Info | Warn | Error | Null
+
 type logger =
 		{ stop: unit -> unit;
 		  restart: unit -> unit;
 		  rotate: unit -> unit;
-		  write: 'a. ('a, unit, string, unit) format4 -> 'a }
+		  write: ?level:level -> string -> unit }
 
 let truncate_line nb_chars line = 
 	if String.length line > nb_chars - 1 then
@@ -54,7 +85,7 @@ let log_rotate ref_ch log_file log_nb_files =
 	close_out !ref_ch;
 	ref_ch := open_out log_file
 
-let make_logger log_file log_nb_files log_nb_lines log_nb_chars post_rotate =
+let make_file_logger log_file log_nb_files log_nb_lines log_nb_chars post_rotate =
 	let channel = ref (open_out_gen [Open_append; Open_creat] 0o644 log_file) in
 	let counter = ref 0 in
 	let stop() =
@@ -67,22 +98,17 @@ let make_logger log_file log_nb_files log_nb_lines log_nb_chars post_rotate =
 		log_rotate channel log_file log_nb_files;
 		(post_rotate (): unit);
 		counter := 0 in
-	let output s =
+	let write ?level s =
 		let s = if log_nb_chars > 0 then truncate_line log_nb_chars s else s in
 		let s = s ^ "\n" in
 		output_string !channel s;
 		flush !channel;
 		incr counter;
 		if !counter > log_nb_lines then rotate() in
-	{ stop=stop; restart=restart; rotate=rotate; write = fun fmt -> Printf.ksprintf output fmt }
-
-
-(* Xenstored logger *) 
+	{ stop=stop; restart=restart; rotate=rotate; write=write }
 
 exception Unknown_level of string
 
-type level = Debug | Info | Warn | Error | Null
-
 let int_of_level = function
 	| Debug -> 0 | Info -> 1 | Warn -> 2
 	| Error -> 3 | Null -> max_int
@@ -104,30 +130,56 @@ let string_of_date () =
 		tm.Unix.tm_hour tm.Unix.tm_min tm.Unix.tm_sec
 		(int_of_float (1000.0 *. msec))
 
-let xenstored_log_file = ref "/var/log/xenstored.log"
+let make_syslog_logger facility =
+	(* We defer to syslog for log management *)
+	let nothing () = () in
+	let write ?level s =
+		let level = match level with
+			| Some Error -> Syslog.Err
+			| Some Warn -> Syslog.Warning
+			| Some Info -> Syslog.Info
+			| Some Debug -> Syslog.Debug
+			| Some Null -> Syslog.Debug
+			| None -> Syslog.Debug in
+		(* Syslog handles the date and level internally *)
+		Syslog.log facility level s in
+	{ stop = nothing; restart = nothing; rotate = nothing; write=write }
+
+let xenstored_log_destination = ref (File "/var/log/xenstored.log")
 let xenstored_log_level = ref Warn
 let xenstored_log_nb_files = ref 10
 let xenstored_log_nb_lines = ref 13215
 let xenstored_log_nb_chars = ref (-1)
 let xenstored_logger = ref (None: logger option)
 
-let init_xenstored_log () =
-	if !xenstored_log_level <> Null && !xenstored_log_nb_files > 0 then
-		let logger =
-			make_logger 
-				!xenstored_log_file !xenstored_log_nb_files !xenstored_log_nb_lines
-				!xenstored_log_nb_chars ignore in
-		let date = string_of_date() in
-		logger.write ("[%s|%5s|%s] Xen Storage Daemon, version %d.%d") date "" "startup"
-		  Define.xenstored_major Define.xenstored_minor;
-		xenstored_logger := Some logger
+let set_xenstored_log_destination s =
+	xenstored_log_destination := log_destination_of_string s
+
+let set_xenstored_logger logger =
+	xenstored_logger := Some logger;
+	logger.write ~level:Info (Printf.sprintf "Xen Storage Daemon, version %d.%d"
+	Define.xenstored_major Define.xenstored_minor)
+
+
+let init_xenstored_log () = match !xenstored_log_destination with
+	| File file ->
+		if !xenstored_log_level <> Null && !xenstored_log_nb_files > 0 then
+			let logger =
+				make_file_logger 
+					file !xenstored_log_nb_files !xenstored_log_nb_lines
+					!xenstored_log_nb_chars ignore in
+			set_xenstored_logger logger
+	| Syslog facility ->
+		set_xenstored_logger (make_syslog_logger facility)
+
 
 let xenstored_logging level key (fmt: (_,_,_,_) format4) =
 	match !xenstored_logger with
 	| Some logger when int_of_level level >= int_of_level !xenstored_log_level ->
 			let date = string_of_date() in
-			let level = string_of_level level in
-			logger.write ("[%s|%5s|%s] " ^^ fmt) date level key
+			let level' = string_of_level level in
+			let prefix = prefix !xenstored_log_destination ~level:level' ~key date in
+			Printf.ksprintf (fun s -> logger.write ~level (prefix ^ s)) fmt
 	| _ -> Printf.ksprintf ignore fmt
 
 let debug key = xenstored_logging Debug key
@@ -200,7 +252,7 @@ let sanitize_data data =
 	String.escaped data
 
 let activate_access_log = ref true
-let access_log_file = ref "/var/log/xenstored-access.log"
+let access_log_destination = ref (File "/var/log/xenstored-access.log")
 let access_log_nb_files = ref 20
 let access_log_nb_lines = ref 13215
 let access_log_nb_chars = ref 180
@@ -209,14 +261,20 @@ let access_log_transaction_ops = ref false
 let access_log_special_ops = ref false
 let access_logger = ref None
 
-let init_access_log post_rotate =
-	if !access_log_nb_files > 0 then
-		let logger =
-			make_logger
-				!access_log_file !access_log_nb_files !access_log_nb_lines
-				!access_log_nb_chars post_rotate in
-		access_logger := Some logger
- 
+let set_access_log_destination s =
+	access_log_destination := log_destination_of_string s
+
+let init_access_log post_rotate = match !access_log_destination with
+	| File file ->
+		if !access_log_nb_files > 0 then
+			let logger =
+				make_file_logger
+					file !access_log_nb_files !access_log_nb_lines
+					!access_log_nb_chars post_rotate in
+			access_logger := Some logger
+	| Syslog facility ->
+		access_logger := Some (make_syslog_logger facility)
+
 let access_logging ~con ~tid ?(data="") access_type =
         try
 		maybe
@@ -225,7 +283,9 @@ let access_logging ~con ~tid ?(data="") access_type =
 				let tid = string_of_tid ~con tid in
 				let access_type = string_of_access_type access_type in
 				let data = sanitize_data data in
-				logger.write "[%s] %s %s %s" date tid access_type data)
+				let prefix = prefix !access_log_destination date in
+				let msg = Printf.sprintf "%s %s %s %s" prefix tid access_type data in
+				logger.write msg)
 			!access_logger
 	with _ -> ()
 
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 64cc106..3416666 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -87,13 +87,13 @@ let parse_config filename =
 		("quota-maxsize", Config.Set_int Quota.maxsize);
 		("test-eagain", Config.Set_bool Transaction.test_eagain);
 		("persistent", Config.Set_bool Disk.enable);
-		("xenstored-log-file", Config.Set_string Logging.xenstored_log_file);
+		("xenstored-log-file", Config.String Logging.set_xenstored_log_destination);
 		("xenstored-log-level", Config.String
 			(fun s -> Logging.xenstored_log_level := Logging.level_of_string s));
 		("xenstored-log-nb-files", Config.Set_int Logging.xenstored_log_nb_files);
 		("xenstored-log-nb-lines", Config.Set_int Logging.xenstored_log_nb_lines);
 		("xenstored-log-nb-chars", Config.Set_int Logging.xenstored_log_nb_chars);
-		("access-log-file", Config.Set_string Logging.access_log_file);
+		("access-log-file", Config.String Logging.set_access_log_destination);
 		("access-log-nb-files", Config.Set_int Logging.access_log_nb_files);
 		("access-log-nb-lines", Config.Set_int Logging.access_log_nb_lines);
 		("access-log-nb-chars", Config.Set_int Logging.access_log_nb_chars);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSX3-00034Y-4m; Fri, 12 Apr 2013 01:12:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSX1-000345-Q8
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:59 +0000
Received: from [85.158.139.211:19581] by server-3.bemta-5.messagelabs.com id
	16/5E-17256-E5F57615; Fri, 12 Apr 2013 01:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365729116!18441500!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16503 invoked from network); 12 Apr 2013 01:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWy-000735-1N
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWx-0000Yl-Vl
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:56 +0000
Date: Fri, 12 Apr 2013 01:11:55 +0000
Message-Id: <E1UQSWx-0000Yl-Vl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'xenstore-syslog' of
	git://github.com/djs55/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b1161e03753114ee149c7d65c1912fcbc3cf5df
Merge: 73154a195e4497dc440115ad678d0669b415f848 6f1355fe8d5140308a26e23370459dd749f5efbf
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Apr 11 11:47:06 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    Merge branch 'xenstore-syslog' of git://github.com/djs55/xen into staging

 tools/ocaml/xenstored/Makefile       |   13 +++-
 tools/ocaml/xenstored/logging.ml     |  156 +++++++++++++++++++++++-----------
 tools/ocaml/xenstored/syslog.ml      |   47 ++++++++++
 tools/ocaml/xenstored/syslog.mli     |   41 +++++++++
 tools/ocaml/xenstored/syslog_stubs.c |   48 +++++++++++
 tools/ocaml/xenstored/xenstored.ml   |    4 +-
 6 files changed, 257 insertions(+), 52 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:02 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSX3-00034Y-4m; Fri, 12 Apr 2013 01:12:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSX1-000345-Q8
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:59 +0000
Received: from [85.158.139.211:19581] by server-3.bemta-5.messagelabs.com id
	16/5E-17256-E5F57615; Fri, 12 Apr 2013 01:11:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365729116!18441500!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16503 invoked from network); 12 Apr 2013 01:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWy-000735-1N
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSWx-0000Yl-Vl
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:11:56 +0000
Date: Fri, 12 Apr 2013 01:11:55 +0000
Message-Id: <E1UQSWx-0000Yl-Vl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'xenstore-syslog' of
	git://github.com/djs55/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b1161e03753114ee149c7d65c1912fcbc3cf5df
Merge: 73154a195e4497dc440115ad678d0669b415f848 6f1355fe8d5140308a26e23370459dd749f5efbf
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Apr 11 11:47:06 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    Merge branch 'xenstore-syslog' of git://github.com/djs55/xen into staging

 tools/ocaml/xenstored/Makefile       |   13 +++-
 tools/ocaml/xenstored/logging.ml     |  156 +++++++++++++++++++++++-----------
 tools/ocaml/xenstored/syslog.ml      |   47 ++++++++++
 tools/ocaml/xenstored/syslog.mli     |   41 +++++++++
 tools/ocaml/xenstored/syslog_stubs.c |   48 +++++++++++
 tools/ocaml/xenstored/xenstored.ml   |    4 +-
 6 files changed, 257 insertions(+), 52 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXD-00036m-7p; Fri, 12 Apr 2013 01:12:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXB-00036F-El
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:09 +0000
Received: from [193.109.254.147:2025] by server-14.bemta-14.messagelabs.com id
	69/58-05867-86F57615; Fri, 12 Apr 2013 01:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1365729126!9250522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14185 invoked from network); 12 Apr 2013 01:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSX8-00073l-8y
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSX8-0000Z9-6T
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:06 +0000
Date: Fri, 12 Apr 2013 01:12:06 +0000
Message-Id: <E1UQSX8-0000Z9-6T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: add a 'type t' to
	represent an event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dfb9738cdc8cdbdf38747edfcdcf1bae46f074f2
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    ocaml: eventchn: add a 'type t' to represent an event channel
    
    It's a common OCaml convention to add a 'type t' in a module to
    represent the main "thing" that the module is about. We add an
    opaque type t and to_int/of_int functions for those who really
    need it, in particular:
    
      1. to_int is needed for debug logging; and
      2. both to_int and of_int are needed for anyone who communicates
         a port number through xenstore.
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.ml  |    6 ++++++
 tools/ocaml/libs/eventchn/xeneventchn.mli |   17 +++++++++++------
 tools/ocaml/xenstored/domain.ml           |   28 ++++++++++++++++++++--------
 tools/ocaml/xenstored/event.ml            |    6 +++---
 tools/ocaml/xenstored/xenstored.ml        |    2 +-
 5 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.ml b/tools/ocaml/libs/eventchn/xeneventchn.ml
index 79ad9b1..acebe10 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.ml
+++ b/tools/ocaml/libs/eventchn/xeneventchn.ml
@@ -20,6 +20,9 @@ type handle
 
 external init: unit -> handle = "stub_eventchn_init"
 external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
+
+type t = int
+
 external notify: handle -> int -> unit = "stub_eventchn_notify"
 external bind_interdomain: handle -> int -> int -> int = "stub_eventchn_bind_interdomain"
 external bind_dom_exc_virq: handle -> int = "stub_eventchn_bind_dom_exc_virq"
@@ -27,4 +30,7 @@ external unbind: handle -> int -> unit = "stub_eventchn_unbind"
 external pending: handle -> int = "stub_eventchn_pending"
 external unmask: handle -> int -> unit = "stub_eventchn_unmask"
 
+let to_int x = x
+let of_int x = x
+
 let _ = Callback.register_exception "eventchn.error" (Error "register_callback")
diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index 394acc2..2b582cd 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -18,14 +18,19 @@ exception Error of string
 
 type handle
 
+type t
+
+val to_int: t -> int
+val of_int: int -> t
+
 external init : unit -> handle = "stub_eventchn_init"
 external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
 
-external notify : handle -> int -> unit = "stub_eventchn_notify"
-external bind_interdomain : handle -> int -> int -> int
+external notify : handle -> t -> unit = "stub_eventchn_notify"
+external bind_interdomain : handle -> int -> int -> t
   = "stub_eventchn_bind_interdomain"
-external bind_dom_exc_virq : handle -> int = "stub_eventchn_bind_dom_exc_virq"
-external unbind : handle -> int -> unit = "stub_eventchn_unbind"
-external pending : handle -> int = "stub_eventchn_pending"
-external unmask : handle -> int -> unit
+external bind_dom_exc_virq : handle -> t = "stub_eventchn_bind_dom_exc_virq"
+external unbind : handle -> t -> unit = "stub_eventchn_unbind"
+external pending : handle -> t = "stub_eventchn_pending"
+external unmask : handle -> t -> unit
   = "stub_eventchn_unmask"
diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
index c17f567..85ab282 100644
--- a/tools/ocaml/xenstored/domain.ml
+++ b/tools/ocaml/xenstored/domain.ml
@@ -17,6 +17,7 @@
 open Printf
 
 let debug fmt = Logging.debug "domain" fmt
+let warn  fmt = Logging.warn  "domain" fmt
 
 type t =
 {
@@ -25,7 +26,7 @@ type t =
 	remote_port: int;
 	interface: Xenmmap.mmap_interface;
 	eventchn: Event.t;
-	mutable port: int;
+	mutable port: Xeneventchn.t option;
 }
 
 let get_path dom = "/local/domain/" ^ (sprintf "%u" dom.id)
@@ -34,19 +35,30 @@ let get_interface d = d.interface
 let get_mfn d = d.mfn
 let get_remote_port d = d.remote_port
 
+let string_of_port = function
+| None -> "None"
+| Some x -> string_of_int (Xeneventchn.to_int x)
+
 let dump d chan =
-	fprintf chan "dom,%d,%nd,%d\n" d.id d.mfn d.port
+	fprintf chan "dom,%d,%nd,%s\n" d.id d.mfn (string_of_port d.port)
 
-let notify dom = Event.notify dom.eventchn dom.port; ()
+let notify dom = match dom.port with
+| None ->
+	warn "domain %d: attempt to notify on unknown port" dom.id
+| Some port ->
+	Event.notify dom.eventchn port
 
 let bind_interdomain dom =
-	dom.port <- Event.bind_interdomain dom.eventchn dom.id dom.remote_port;
-	debug "domain %d bound port %d" dom.id dom.port
+	dom.port <- Some (Event.bind_interdomain dom.eventchn dom.id dom.remote_port);
+	debug "domain %d bound port %s" dom.id (string_of_port dom.port)
 
 
 let close dom =
-	debug "domain %d unbound port %d" dom.id dom.port;
-	Event.unbind dom.eventchn dom.port;
+	debug "domain %d unbound port %s" dom.id (string_of_port dom.port);
+	begin match dom.port with
+	| None -> ()
+	| Some port -> Event.unbind dom.eventchn port
+	end;
 	Xenmmap.unmap dom.interface;
 	()
 
@@ -56,7 +68,7 @@ let make id mfn remote_port interface eventchn = {
 	remote_port = remote_port;
 	interface = interface;
 	eventchn = eventchn;
-	port = -1
+	port = None
 }
 
 let is_dom0 d = d.id = 0
diff --git a/tools/ocaml/xenstored/event.ml b/tools/ocaml/xenstored/event.ml
index cca8d93..ccca90b 100644
--- a/tools/ocaml/xenstored/event.ml
+++ b/tools/ocaml/xenstored/event.ml
@@ -17,12 +17,12 @@
 (**************** high level binding ****************)
 type t = {
 	handle: Xeneventchn.handle;
-	mutable virq_port: int;
+	mutable virq_port: Xeneventchn.t option;
 }
 
-let init () = { handle = Xeneventchn.init (); virq_port = -1; }
+let init () = { handle = Xeneventchn.init (); virq_port = None; }
 let fd eventchn = Xeneventchn.fd eventchn.handle
-let bind_dom_exc_virq eventchn = eventchn.virq_port <- Xeneventchn.bind_dom_exc_virq eventchn.handle
+let bind_dom_exc_virq eventchn = eventchn.virq_port <- Some (Xeneventchn.bind_dom_exc_virq eventchn.handle)
 let bind_interdomain eventchn domid port = Xeneventchn.bind_interdomain eventchn.handle domid port
 let unbind eventchn port = Xeneventchn.unbind eventchn.handle port
 let notify eventchn port = Xeneventchn.notify eventchn.handle port
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 3416666..4045aed 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -300,7 +300,7 @@ let _ =
 		and handle_eventchn fd =
 			let port = Event.pending eventchn in
 			finally (fun () ->
-				if port = eventchn.Event.virq_port then (
+				if Some port = eventchn.Event.virq_port then (
 					let (notify, deaddom) = Domains.cleanup xc domains in
 					List.iter (Connections.del_domain cons) deaddom;
 					if deaddom <> [] || notify then
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXD-00036m-7p; Fri, 12 Apr 2013 01:12:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXB-00036F-El
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:09 +0000
Received: from [193.109.254.147:2025] by server-14.bemta-14.messagelabs.com id
	69/58-05867-86F57615; Fri, 12 Apr 2013 01:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1365729126!9250522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14185 invoked from network); 12 Apr 2013 01:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSX8-00073l-8y
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSX8-0000Z9-6T
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:06 +0000
Date: Fri, 12 Apr 2013 01:12:06 +0000
Message-Id: <E1UQSX8-0000Z9-6T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: add a 'type t' to
	represent an event channel
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dfb9738cdc8cdbdf38747edfcdcf1bae46f074f2
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:42 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    ocaml: eventchn: add a 'type t' to represent an event channel
    
    It's a common OCaml convention to add a 'type t' in a module to
    represent the main "thing" that the module is about. We add an
    opaque type t and to_int/of_int functions for those who really
    need it, in particular:
    
      1. to_int is needed for debug logging; and
      2. both to_int and of_int are needed for anyone who communicates
         a port number through xenstore.
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.ml  |    6 ++++++
 tools/ocaml/libs/eventchn/xeneventchn.mli |   17 +++++++++++------
 tools/ocaml/xenstored/domain.ml           |   28 ++++++++++++++++++++--------
 tools/ocaml/xenstored/event.ml            |    6 +++---
 tools/ocaml/xenstored/xenstored.ml        |    2 +-
 5 files changed, 41 insertions(+), 18 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.ml b/tools/ocaml/libs/eventchn/xeneventchn.ml
index 79ad9b1..acebe10 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.ml
+++ b/tools/ocaml/libs/eventchn/xeneventchn.ml
@@ -20,6 +20,9 @@ type handle
 
 external init: unit -> handle = "stub_eventchn_init"
 external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
+
+type t = int
+
 external notify: handle -> int -> unit = "stub_eventchn_notify"
 external bind_interdomain: handle -> int -> int -> int = "stub_eventchn_bind_interdomain"
 external bind_dom_exc_virq: handle -> int = "stub_eventchn_bind_dom_exc_virq"
@@ -27,4 +30,7 @@ external unbind: handle -> int -> unit = "stub_eventchn_unbind"
 external pending: handle -> int = "stub_eventchn_pending"
 external unmask: handle -> int -> unit = "stub_eventchn_unmask"
 
+let to_int x = x
+let of_int x = x
+
 let _ = Callback.register_exception "eventchn.error" (Error "register_callback")
diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index 394acc2..2b582cd 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -18,14 +18,19 @@ exception Error of string
 
 type handle
 
+type t
+
+val to_int: t -> int
+val of_int: int -> t
+
 external init : unit -> handle = "stub_eventchn_init"
 external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
 
-external notify : handle -> int -> unit = "stub_eventchn_notify"
-external bind_interdomain : handle -> int -> int -> int
+external notify : handle -> t -> unit = "stub_eventchn_notify"
+external bind_interdomain : handle -> int -> int -> t
   = "stub_eventchn_bind_interdomain"
-external bind_dom_exc_virq : handle -> int = "stub_eventchn_bind_dom_exc_virq"
-external unbind : handle -> int -> unit = "stub_eventchn_unbind"
-external pending : handle -> int = "stub_eventchn_pending"
-external unmask : handle -> int -> unit
+external bind_dom_exc_virq : handle -> t = "stub_eventchn_bind_dom_exc_virq"
+external unbind : handle -> t -> unit = "stub_eventchn_unbind"
+external pending : handle -> t = "stub_eventchn_pending"
+external unmask : handle -> t -> unit
   = "stub_eventchn_unmask"
diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain.ml
index c17f567..85ab282 100644
--- a/tools/ocaml/xenstored/domain.ml
+++ b/tools/ocaml/xenstored/domain.ml
@@ -17,6 +17,7 @@
 open Printf
 
 let debug fmt = Logging.debug "domain" fmt
+let warn  fmt = Logging.warn  "domain" fmt
 
 type t =
 {
@@ -25,7 +26,7 @@ type t =
 	remote_port: int;
 	interface: Xenmmap.mmap_interface;
 	eventchn: Event.t;
-	mutable port: int;
+	mutable port: Xeneventchn.t option;
 }
 
 let get_path dom = "/local/domain/" ^ (sprintf "%u" dom.id)
@@ -34,19 +35,30 @@ let get_interface d = d.interface
 let get_mfn d = d.mfn
 let get_remote_port d = d.remote_port
 
+let string_of_port = function
+| None -> "None"
+| Some x -> string_of_int (Xeneventchn.to_int x)
+
 let dump d chan =
-	fprintf chan "dom,%d,%nd,%d\n" d.id d.mfn d.port
+	fprintf chan "dom,%d,%nd,%s\n" d.id d.mfn (string_of_port d.port)
 
-let notify dom = Event.notify dom.eventchn dom.port; ()
+let notify dom = match dom.port with
+| None ->
+	warn "domain %d: attempt to notify on unknown port" dom.id
+| Some port ->
+	Event.notify dom.eventchn port
 
 let bind_interdomain dom =
-	dom.port <- Event.bind_interdomain dom.eventchn dom.id dom.remote_port;
-	debug "domain %d bound port %d" dom.id dom.port
+	dom.port <- Some (Event.bind_interdomain dom.eventchn dom.id dom.remote_port);
+	debug "domain %d bound port %s" dom.id (string_of_port dom.port)
 
 
 let close dom =
-	debug "domain %d unbound port %d" dom.id dom.port;
-	Event.unbind dom.eventchn dom.port;
+	debug "domain %d unbound port %s" dom.id (string_of_port dom.port);
+	begin match dom.port with
+	| None -> ()
+	| Some port -> Event.unbind dom.eventchn port
+	end;
 	Xenmmap.unmap dom.interface;
 	()
 
@@ -56,7 +68,7 @@ let make id mfn remote_port interface eventchn = {
 	remote_port = remote_port;
 	interface = interface;
 	eventchn = eventchn;
-	port = -1
+	port = None
 }
 
 let is_dom0 d = d.id = 0
diff --git a/tools/ocaml/xenstored/event.ml b/tools/ocaml/xenstored/event.ml
index cca8d93..ccca90b 100644
--- a/tools/ocaml/xenstored/event.ml
+++ b/tools/ocaml/xenstored/event.ml
@@ -17,12 +17,12 @@
 (**************** high level binding ****************)
 type t = {
 	handle: Xeneventchn.handle;
-	mutable virq_port: int;
+	mutable virq_port: Xeneventchn.t option;
 }
 
-let init () = { handle = Xeneventchn.init (); virq_port = -1; }
+let init () = { handle = Xeneventchn.init (); virq_port = None; }
 let fd eventchn = Xeneventchn.fd eventchn.handle
-let bind_dom_exc_virq eventchn = eventchn.virq_port <- Xeneventchn.bind_dom_exc_virq eventchn.handle
+let bind_dom_exc_virq eventchn = eventchn.virq_port <- Some (Xeneventchn.bind_dom_exc_virq eventchn.handle)
 let bind_interdomain eventchn domid port = Xeneventchn.bind_interdomain eventchn.handle domid port
 let unbind eventchn port = Xeneventchn.unbind eventchn.handle port
 let notify eventchn port = Xeneventchn.notify eventchn.handle port
diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml
index 3416666..4045aed 100644
--- a/tools/ocaml/xenstored/xenstored.ml
+++ b/tools/ocaml/xenstored/xenstored.ml
@@ -300,7 +300,7 @@ let _ =
 		and handle_eventchn fd =
 			let port = Event.pending eventchn in
 			finally (fun () ->
-				if port = eventchn.Event.virq_port then (
+				if Some port = eventchn.Event.virq_port then (
 					let (notify, deaddom) = Domains.cleanup xc domains in
 					List.iter (Connections.del_domain cons) deaddom;
 					if deaddom <> [] || notify then
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXN-00038z-Bo; Fri, 12 Apr 2013 01:12:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXL-00038U-Ch
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:19 +0000
Received: from [193.109.254.147:61658] by server-7.bemta-14.messagelabs.com id
	7C/9F-19255-27F57615; Fri, 12 Apr 2013 01:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1365729136!3433125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25167 invoked from network); 12 Apr 2013 01:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXI-00073o-HF
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXI-0000ZX-D4
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:16 +0000
Date: Fri, 12 Apr 2013 01:12:16 +0000
Message-Id: <E1UQSXI-0000ZX-D4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: in the interface,
	we don't have to give implementation details
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5aca10972b1b37f3bfebab52f5b89b0ebb617abf
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:43 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    ocaml: eventchn: in the interface, we don't have to give implementation details
    
    Remove the mention of the C function names from the .mli -- this is only
    needed in the implementation .ml
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.mli |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index 2b582cd..74e581b 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -23,14 +23,13 @@ type t
 val to_int: t -> int
 val of_int: int -> t
 
-external init : unit -> handle = "stub_eventchn_init"
-external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
+val init: unit -> handle
+val fd: handle -> Unix.file_descr
 
-external notify : handle -> t -> unit = "stub_eventchn_notify"
-external bind_interdomain : handle -> int -> int -> t
-  = "stub_eventchn_bind_interdomain"
-external bind_dom_exc_virq : handle -> t = "stub_eventchn_bind_dom_exc_virq"
-external unbind : handle -> t -> unit = "stub_eventchn_unbind"
-external pending : handle -> t = "stub_eventchn_pending"
-external unmask : handle -> t -> unit
-  = "stub_eventchn_unmask"
+val notify : handle -> t -> unit
+val bind_interdomain : handle -> int -> int -> t
+
+val bind_dom_exc_virq : handle -> t
+val unbind : handle -> t -> unit
+val pending : handle -> t
+val unmask : handle -> t -> unit
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXN-00038z-Bo; Fri, 12 Apr 2013 01:12:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXL-00038U-Ch
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:19 +0000
Received: from [193.109.254.147:61658] by server-7.bemta-14.messagelabs.com id
	7C/9F-19255-27F57615; Fri, 12 Apr 2013 01:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1365729136!3433125!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25167 invoked from network); 12 Apr 2013 01:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXI-00073o-HF
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXI-0000ZX-D4
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:16 +0000
Date: Fri, 12 Apr 2013 01:12:16 +0000
Message-Id: <E1UQSXI-0000ZX-D4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: in the interface,
	we don't have to give implementation details
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5aca10972b1b37f3bfebab52f5b89b0ebb617abf
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:43 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    ocaml: eventchn: in the interface, we don't have to give implementation details
    
    Remove the mention of the C function names from the .mli -- this is only
    needed in the implementation .ml
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.mli |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index 2b582cd..74e581b 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -23,14 +23,13 @@ type t
 val to_int: t -> int
 val of_int: int -> t
 
-external init : unit -> handle = "stub_eventchn_init"
-external fd: handle -> Unix.file_descr = "stub_eventchn_fd"
+val init: unit -> handle
+val fd: handle -> Unix.file_descr
 
-external notify : handle -> t -> unit = "stub_eventchn_notify"
-external bind_interdomain : handle -> int -> int -> t
-  = "stub_eventchn_bind_interdomain"
-external bind_dom_exc_virq : handle -> t = "stub_eventchn_bind_dom_exc_virq"
-external unbind : handle -> t -> unit = "stub_eventchn_unbind"
-external pending : handle -> t = "stub_eventchn_pending"
-external unmask : handle -> t -> unit
-  = "stub_eventchn_unmask"
+val notify : handle -> t -> unit
+val bind_interdomain : handle -> int -> int -> t
+
+val bind_dom_exc_virq : handle -> t
+val unbind : handle -> t -> unit
+val pending : handle -> t
+val unmask : handle -> t -> unit
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXX-0003BA-FY; Fri, 12 Apr 2013 01:12:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXV-0003Ae-No
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:29 +0000
Received: from [85.158.143.99:10656] by server-2.bemta-4.messagelabs.com id
	0E/D6-12656-D7F57615; Fri, 12 Apr 2013 01:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1365729147!27320956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27667 invoked from network); 12 Apr 2013 01:12:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXS-00073u-Qy
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXS-0000Zt-MR
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:26 +0000
Date: Fri, 12 Apr 2013 01:12:26 +0000
Message-Id: <E1UQSXS-0000Zt-MR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: add ocamldoc strings
	to the interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f417daeef0530176e69d3a6f16a7c390054eafb0
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:44 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    ocaml: eventchn: add ocamldoc strings to the interface
    
    Also add a reference to tools/libxc/xenctrl.h, which is where
    the underlying C functions are defined.
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.mli |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index 74e581b..a35743b 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -14,22 +14,51 @@
  * GNU Lesser General Public License for more details.
  *)
 
+(** Event channel bindings: see tools/libxc/xenctrl.h *)
+
 exception Error of string
 
 type handle
+(** An initialised event channel interface. *)
 
 type t
+(** A local event channel. *)
 
 val to_int: t -> int
+
 val of_int: int -> t
 
 val init: unit -> handle
+(** Return an initialised event channel interface. On error it
+    will throw a Failure exception. *)
+
 val fd: handle -> Unix.file_descr
+(** Return a file descriptor suitable for Unix.select. When
+    the descriptor becomes readable, it is safe to call 'pending'.
+    On error it will throw a Failure exception. *)
 
 val notify : handle -> t -> unit
+(** Notify the given event channel. On error it will throw a
+    Failure exception. *)
+
 val bind_interdomain : handle -> int -> int -> t
+(** [bind_interdomain h domid remote_port] returns a local event
+    channel connected to domid:remote_port. On error it will
+    throw a Failure exception. *)
 
 val bind_dom_exc_virq : handle -> t
+(** Binds a local event channel to the VIRQ_DOM_EXC
+    (domain exception VIRQ). On error it will throw a Failure
+    exception. *)
+
 val unbind : handle -> t -> unit
+(** Unbinds the given event channel. On error it will throw a
+    Failure exception. *)
+
 val pending : handle -> t
+(** Returns the next event channel to become pending. On error it
+    will throw a Failure exception. *)
+
 val unmask : handle -> t -> unit
+(** Unmasks the given event channel. On error it will throw a
+    Failure exception. *)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXX-0003BA-FY; Fri, 12 Apr 2013 01:12:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXV-0003Ae-No
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:29 +0000
Received: from [85.158.143.99:10656] by server-2.bemta-4.messagelabs.com id
	0E/D6-12656-D7F57615; Fri, 12 Apr 2013 01:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1365729147!27320956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27667 invoked from network); 12 Apr 2013 01:12:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXS-00073u-Qy
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXS-0000Zt-MR
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:26 +0000
Date: Fri, 12 Apr 2013 01:12:26 +0000
Message-Id: <E1UQSXS-0000Zt-MR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: add ocamldoc strings
	to the interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f417daeef0530176e69d3a6f16a7c390054eafb0
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:44 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:11 2013 +0100

    ocaml: eventchn: add ocamldoc strings to the interface
    
    Also add a reference to tools/libxc/xenctrl.h, which is where
    the underlying C functions are defined.
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.mli |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index 74e581b..a35743b 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -14,22 +14,51 @@
  * GNU Lesser General Public License for more details.
  *)
 
+(** Event channel bindings: see tools/libxc/xenctrl.h *)
+
 exception Error of string
 
 type handle
+(** An initialised event channel interface. *)
 
 type t
+(** A local event channel. *)
 
 val to_int: t -> int
+
 val of_int: int -> t
 
 val init: unit -> handle
+(** Return an initialised event channel interface. On error it
+    will throw a Failure exception. *)
+
 val fd: handle -> Unix.file_descr
+(** Return a file descriptor suitable for Unix.select. When
+    the descriptor becomes readable, it is safe to call 'pending'.
+    On error it will throw a Failure exception. *)
 
 val notify : handle -> t -> unit
+(** Notify the given event channel. On error it will throw a
+    Failure exception. *)
+
 val bind_interdomain : handle -> int -> int -> t
+(** [bind_interdomain h domid remote_port] returns a local event
+    channel connected to domid:remote_port. On error it will
+    throw a Failure exception. *)
 
 val bind_dom_exc_virq : handle -> t
+(** Binds a local event channel to the VIRQ_DOM_EXC
+    (domain exception VIRQ). On error it will throw a Failure
+    exception. *)
+
 val unbind : handle -> t -> unit
+(** Unbinds the given event channel. On error it will throw a
+    Failure exception. *)
+
 val pending : handle -> t
+(** Returns the next event channel to become pending. On error it
+    will throw a Failure exception. *)
+
 val unmask : handle -> t -> unit
+(** Unmasks the given event channel. On error it will throw a
+    Failure exception. *)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXh-0003D4-IX; Fri, 12 Apr 2013 01:12:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXg-0003Ci-JT
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:40 +0000
Received: from [85.158.137.99:36588] by server-6.bemta-3.messagelabs.com id
	86/3A-11048-78F57615; Fri, 12 Apr 2013 01:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1365729157!13866759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20023 invoked from network); 12 Apr 2013 01:12:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXd-000747-DC
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXc-0000aR-VP
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:37 +0000
Date: Fri, 12 Apr 2013 01:12:36 +0000
Message-Id: <E1UQSXc-0000aR-VP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: remove the unused
	exception 'Eventchn.Error'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 814963a6647e9df3a42461d28f2f0c6e3d063016
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:45 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:12 2013 +0100

    ocaml: eventchn: remove the unused exception 'Eventchn.Error'
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.ml  |    4 ----
 tools/ocaml/libs/eventchn/xeneventchn.mli |    2 --
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.ml b/tools/ocaml/libs/eventchn/xeneventchn.ml
index acebe10..89edb92 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.ml
+++ b/tools/ocaml/libs/eventchn/xeneventchn.ml
@@ -14,8 +14,6 @@
  * GNU Lesser General Public License for more details.
  *)
 
-exception Error of string
-
 type handle
 
 external init: unit -> handle = "stub_eventchn_init"
@@ -32,5 +30,3 @@ external unmask: handle -> int -> unit = "stub_eventchn_unmask"
 
 let to_int x = x
 let of_int x = x
-
-let _ = Callback.register_exception "eventchn.error" (Error "register_callback")
diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index a35743b..e4e02a4 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -16,8 +16,6 @@
 
 (** Event channel bindings: see tools/libxc/xenctrl.h *)
 
-exception Error of string
-
 type handle
 (** An initialised event channel interface. *)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXh-0003D4-IX; Fri, 12 Apr 2013 01:12:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXg-0003Ci-JT
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:40 +0000
Received: from [85.158.137.99:36588] by server-6.bemta-3.messagelabs.com id
	86/3A-11048-78F57615; Fri, 12 Apr 2013 01:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1365729157!13866759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20023 invoked from network); 12 Apr 2013 01:12:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXd-000747-DC
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXc-0000aR-VP
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:37 +0000
Date: Fri, 12 Apr 2013 01:12:36 +0000
Message-Id: <E1UQSXc-0000aR-VP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ocaml: eventchn: remove the unused
	exception 'Eventchn.Error'
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 814963a6647e9df3a42461d28f2f0c6e3d063016
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Wed Mar 20 20:24:45 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:03:12 2013 +0100

    ocaml: eventchn: remove the unused exception 'Eventchn.Error'
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/libs/eventchn/xeneventchn.ml  |    4 ----
 tools/ocaml/libs/eventchn/xeneventchn.mli |    2 --
 2 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/eventchn/xeneventchn.ml b/tools/ocaml/libs/eventchn/xeneventchn.ml
index acebe10..89edb92 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.ml
+++ b/tools/ocaml/libs/eventchn/xeneventchn.ml
@@ -14,8 +14,6 @@
  * GNU Lesser General Public License for more details.
  *)
 
-exception Error of string
-
 type handle
 
 external init: unit -> handle = "stub_eventchn_init"
@@ -32,5 +30,3 @@ external unmask: handle -> int -> unit = "stub_eventchn_unmask"
 
 let to_int x = x
 let of_int x = x
-
-let _ = Callback.register_exception "eventchn.error" (Error "register_callback")
diff --git a/tools/ocaml/libs/eventchn/xeneventchn.mli b/tools/ocaml/libs/eventchn/xeneventchn.mli
index a35743b..e4e02a4 100644
--- a/tools/ocaml/libs/eventchn/xeneventchn.mli
+++ b/tools/ocaml/libs/eventchn/xeneventchn.mli
@@ -16,8 +16,6 @@
 
 (** Event channel bindings: see tools/libxc/xenctrl.h *)
 
-exception Error of string
-
 type handle
 (** An initialised event channel interface. *)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXq-0003En-Ll; Fri, 12 Apr 2013 01:12:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXq-0003Ea-A3
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:50 +0000
Received: from [193.109.254.147:2781] by server-6.bemta-14.messagelabs.com id
	99/24-31180-19F57615; Fri, 12 Apr 2013 01:12:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1365729167!9250562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15063 invoked from network); 12 Apr 2013 01:12:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXn-00074F-MS
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXn-0000bW-Jg
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:47 +0000
Date: Fri, 12 Apr 2013 01:12:47 +0000
Message-Id: <E1UQSXn-0000bW-Jg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add myself as VTPM
	maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3056b0fefc3c18990c281bc33de81c8046ab2f0
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Mon Apr 1 09:40:22 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:17:04 2013 +0100

    MAINTAINERS: Add myself as VTPM maintainer
    
    Matthew Fioravante will no longer be maintaining the vTPM code.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 MAINTAINERS |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 438ae49..7c24152 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -281,14 +281,10 @@ T:	hg http://xenbits.xen.org/linux-2.6.18-xen.hg
 F:	drivers/xen/usb*/
 
 VTPM
-M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
+M:	Daniel De Graaf <dgdegra@tycho.nsa.gov>
 S:	Supported
-F:	extras/minios-os/tpmfront.c
-F:	extras/minios-os/tpmback.c
-F:	extras/minios-os/tpm-tis.c
-F:	extras/minios-os/include/tpmfront.h
-F:	extras/minios-os/include/tpmback.h
-F:	extras/minios-os/include/tpm-tis.h
+F:	extras/mini-os/tpm*
+F:	extras/mini-os/include/tpm*
 F:	stubdom/vtpm/
 F:	stubdom/vtpmmgr/
 F:	docs/misc/vtpm.txt
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:12:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSXq-0003En-Ll; Fri, 12 Apr 2013 01:12:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXq-0003Ea-A3
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:50 +0000
Received: from [193.109.254.147:2781] by server-6.bemta-14.messagelabs.com id
	99/24-31180-19F57615; Fri, 12 Apr 2013 01:12:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1365729167!9250562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15063 invoked from network); 12 Apr 2013 01:12:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXn-00074F-MS
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXn-0000bW-Jg
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:47 +0000
Date: Fri, 12 Apr 2013 01:12:47 +0000
Message-Id: <E1UQSXn-0000bW-Jg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add myself as VTPM
	maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f3056b0fefc3c18990c281bc33de81c8046ab2f0
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Mon Apr 1 09:40:22 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 12:17:04 2013 +0100

    MAINTAINERS: Add myself as VTPM maintainer
    
    Matthew Fioravante will no longer be maintaining the vTPM code.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 MAINTAINERS |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 438ae49..7c24152 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -281,14 +281,10 @@ T:	hg http://xenbits.xen.org/linux-2.6.18-xen.hg
 F:	drivers/xen/usb*/
 
 VTPM
-M:	Matthew Fioravante <matthew.fioravante@jhuapl.edu>
+M:	Daniel De Graaf <dgdegra@tycho.nsa.gov>
 S:	Supported
-F:	extras/minios-os/tpmfront.c
-F:	extras/minios-os/tpmback.c
-F:	extras/minios-os/tpm-tis.c
-F:	extras/minios-os/include/tpmfront.h
-F:	extras/minios-os/include/tpmback.h
-F:	extras/minios-os/include/tpm-tis.h
+F:	extras/mini-os/tpm*
+F:	extras/mini-os/include/tpm*
 F:	stubdom/vtpm/
 F:	stubdom/vtpmmgr/
 F:	docs/misc/vtpm.txt
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSY5-0003Hb-PI; Fri, 12 Apr 2013 01:13:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSY4-0003HC-M0
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:04 +0000
Received: from [85.158.139.83:33560] by server-16.bemta-5.messagelabs.com id
	48/79-02543-C9F57615; Fri, 12 Apr 2013 01:13:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1365729178!27970178!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7535 invoked from network); 12 Apr 2013 01:12:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXx-00074O-UH
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXx-0000bs-Sg
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:57 +0000
Date: Fri, 12 Apr 2013 01:12:57 +0000
Message-Id: <E1UQSXx-0000bs-Sg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	xenbits.xen.org:/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1386ee2fc211b1c9cc245e6f56160fff03ead7ca
Merge: 9e14c516b6cbac4c676c988e577cea2ef78eebf6 f3056b0fefc3c18990c281bc33de81c8046ab2f0
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Apr 11 13:18:40 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 13:18:40 2013 +0100

    Merge branch 'staging' of xenbits.xen.org:/home/xen/git/xen into staging

 MAINTAINERS                               |   15 +-
 config/Tools.mk.in                        |    2 +
 tools/Makefile                            |    2 +
 tools/Rules.mk                            |    5 +-
 tools/blktap2/drivers/libaio-compat.h     |   12 +
 tools/config.h.in                         |    9 +
 tools/configure                           | 1519 +++++++++++++++++++++--------
 tools/configure.ac                        |   18 +-
 tools/libxc/xc_core.h                     |    2 +-
 tools/libxc/xenctrl.h                     |    4 +
 tools/memshr/bidir-hash.c                 |   48 +-
 tools/ocaml/libs/eventchn/xeneventchn.ml  |    8 +-
 tools/ocaml/libs/eventchn/xeneventchn.mli |   55 +-
 tools/ocaml/xenstored/Makefile            |   13 +-
 tools/ocaml/xenstored/domain.ml           |   28 +-
 tools/ocaml/xenstored/event.ml            |    6 +-
 tools/ocaml/xenstored/logging.ml          |  156 ++-
 tools/ocaml/xenstored/syslog.ml           |   47 +
 tools/ocaml/xenstored/syslog.mli          |   41 +
 tools/ocaml/xenstored/syslog_stubs.c      |   48 +
 tools/ocaml/xenstored/xenstored.ml        |    6 +-
 xen/arch/arm/arm32/entry.S                |    1 +
 xen/arch/arm/arm64/entry.S                |    1 +
 xen/arch/arm/domain.c                     |    8 +
 xen/arch/arm/domain_build.c               |    9 -
 xen/arch/arm/gic.c                        |   36 +-
 xen/arch/arm/mm.c                         |   10 +
 xen/arch/arm/setup.c                      |   13 +-
 xen/arch/arm/smpboot.c                    |    7 +-
 xen/arch/arm/traps.c                      |   13 +-
 xen/arch/arm/vgic.c                       |    6 +-
 xen/arch/arm/vtimer.c                     |   13 +-
 xen/arch/x86/cpu/mcheck/mce.c             |    9 +
 xen/arch/x86/irq.c                        |    9 +-
 xen/arch/x86/msi.c                        |   41 +-
 xen/arch/x86/time.c                       |    9 +
 xen/include/asm-arm/domain.h              |    4 +-
 xen/include/asm-arm/gic.h                 |    3 +
 xen/include/asm-arm/mm.h                  |    4 +-
 xen/include/asm-arm/processor.h           |    2 +
 xen/include/asm-arm/regs.h                |    6 +
 xen/include/asm-x86/msi.h                 |    4 +
 xen/include/public/arch-arm.h             |   30 +-
 xen/include/public/io/protocols.h         |    2 +-
 44 files changed, 1731 insertions(+), 553 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSY5-0003Hb-PI; Fri, 12 Apr 2013 01:13:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSY4-0003HC-M0
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:04 +0000
Received: from [85.158.139.83:33560] by server-16.bemta-5.messagelabs.com id
	48/79-02543-C9F57615; Fri, 12 Apr 2013 01:13:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1365729178!27970178!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7535 invoked from network); 12 Apr 2013 01:12:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:12:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXx-00074O-UH
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSXx-0000bs-Sg
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:12:57 +0000
Date: Fri, 12 Apr 2013 01:12:57 +0000
Message-Id: <E1UQSXx-0000bs-Sg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	xenbits.xen.org:/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1386ee2fc211b1c9cc245e6f56160fff03ead7ca
Merge: 9e14c516b6cbac4c676c988e577cea2ef78eebf6 f3056b0fefc3c18990c281bc33de81c8046ab2f0
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Apr 11 13:18:40 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 13:18:40 2013 +0100

    Merge branch 'staging' of xenbits.xen.org:/home/xen/git/xen into staging

 MAINTAINERS                               |   15 +-
 config/Tools.mk.in                        |    2 +
 tools/Makefile                            |    2 +
 tools/Rules.mk                            |    5 +-
 tools/blktap2/drivers/libaio-compat.h     |   12 +
 tools/config.h.in                         |    9 +
 tools/configure                           | 1519 +++++++++++++++++++++--------
 tools/configure.ac                        |   18 +-
 tools/libxc/xc_core.h                     |    2 +-
 tools/libxc/xenctrl.h                     |    4 +
 tools/memshr/bidir-hash.c                 |   48 +-
 tools/ocaml/libs/eventchn/xeneventchn.ml  |    8 +-
 tools/ocaml/libs/eventchn/xeneventchn.mli |   55 +-
 tools/ocaml/xenstored/Makefile            |   13 +-
 tools/ocaml/xenstored/domain.ml           |   28 +-
 tools/ocaml/xenstored/event.ml            |    6 +-
 tools/ocaml/xenstored/logging.ml          |  156 ++-
 tools/ocaml/xenstored/syslog.ml           |   47 +
 tools/ocaml/xenstored/syslog.mli          |   41 +
 tools/ocaml/xenstored/syslog_stubs.c      |   48 +
 tools/ocaml/xenstored/xenstored.ml        |    6 +-
 xen/arch/arm/arm32/entry.S                |    1 +
 xen/arch/arm/arm64/entry.S                |    1 +
 xen/arch/arm/domain.c                     |    8 +
 xen/arch/arm/domain_build.c               |    9 -
 xen/arch/arm/gic.c                        |   36 +-
 xen/arch/arm/mm.c                         |   10 +
 xen/arch/arm/setup.c                      |   13 +-
 xen/arch/arm/smpboot.c                    |    7 +-
 xen/arch/arm/traps.c                      |   13 +-
 xen/arch/arm/vgic.c                       |    6 +-
 xen/arch/arm/vtimer.c                     |   13 +-
 xen/arch/x86/cpu/mcheck/mce.c             |    9 +
 xen/arch/x86/irq.c                        |    9 +-
 xen/arch/x86/msi.c                        |   41 +-
 xen/arch/x86/time.c                       |    9 +
 xen/include/asm-arm/domain.h              |    4 +-
 xen/include/asm-arm/gic.h                 |    3 +
 xen/include/asm-arm/mm.h                  |    4 +-
 xen/include/asm-arm/processor.h           |    2 +
 xen/include/asm-arm/regs.h                |    6 +
 xen/include/asm-x86/msi.h                 |    4 +
 xen/include/public/arch-arm.h             |   30 +-
 xen/include/public/io/protocols.h         |    2 +-
 44 files changed, 1731 insertions(+), 553 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYH-0003Jz-US; Fri, 12 Apr 2013 01:13:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYG-0003JF-Bh
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:16 +0000
Received: from [85.158.139.83:37813] by server-10.bemta-5.messagelabs.com id
	F9/A1-23714-8AF57615; Fri, 12 Apr 2013 01:13:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1365729188!27874199!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4745 invoked from network); 12 Apr 2013 01:13:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSY8-00074u-4I
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSY8-0000cF-1x
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:08 +0000
Date: Fri, 12 Apr 2013 01:13:08 +0000
Message-Id: <E1UQSY8-0000cF-1x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/Linux: Remove hardcoded paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3e27e36ca5f995063612e8833c84de2faef66552
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Feb 5 16:19:52 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 13:19:57 2013 +0100

    hotplug/Linux: Remove hardcoded paths
    
    Use xen-hotplugpath.sh (as NetBSD does) which allows PREFIX etc to change.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/hotplug/Linux/init.d/xen-watchdog |    4 +++-
 tools/hotplug/Linux/init.d/xencommons   |   24 ++++++++++++------------
 tools/hotplug/Linux/init.d/xend         |   16 +++++++++-------
 tools/hotplug/Linux/init.d/xendomains   |    6 ++++--
 4 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xen-watchdog b/tools/hotplug/Linux/init.d/xen-watchdog
index 55dd091..3592fda 100644
--- a/tools/hotplug/Linux/init.d/xen-watchdog
+++ b/tools/hotplug/Linux/init.d/xen-watchdog
@@ -17,7 +17,9 @@
 ### END INIT INFO
 #
 
-DAEMON=/usr/sbin/xenwatchdogd
+. /etc/xen/scripts/hotplugpath.sh
+
+DAEMON=${SBINDIR}/xenwatchdogd
 base=$(basename $DAEMON)
 
 # Source function library.
diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
index 20afcc0..a2e633b 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -18,6 +18,8 @@
 # Description:       Starts and stops the daemons neeeded for xl/xend
 ### END INIT INFO
 
+. /etc/xen/scripts/hotplugpath.sh
+
 if [ -d /etc/sysconfig ]; then
 	xencommons_config=/etc/sysconfig
 else
@@ -72,7 +74,7 @@ do_start () {
 	modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
 	mkdir -p /var/run/xen
 
-	if ! `xenstore-read -s / >/dev/null 2>&1`
+	if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
 	then
 		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
@@ -81,19 +83,19 @@ do_start () {
 		if [ -n "$XENSTORED" ] ; then
 		    echo -n Starting $XENSTORED...
 		    $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-		elif [ -x /usr/sbin/oxenstored ] ; then
+		elif [ -x ${SBINDIR}/oxenstored ] ; then
 		    echo -n Starting oxenstored...
-		    /usr/sbin/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-		elif [ -x /usr/sbin/xenstored ] ; then
+		    ${SBINDIR}/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+		elif [ -x ${SBINDIR}/xenstored ] ; then
 		    echo -n Starting C xenstored...
-		    /usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+		    ${SBINDIR}/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
 		else
 		    echo "No xenstored found"
 		    exit 1
 		fi
 
 		# Wait for xenstored to actually come up, timing out after 30 seconds
-                while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do
+                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
                     echo -n .
 		    time=$(($time+1))
                     sleep 1
@@ -107,16 +109,14 @@ do_start () {
 		fi
 
 		echo Setting domain 0 name...
-		xenstore-write "/local/domain/0/name" "Domain-0"
+		${BINDIR}/xenstore-write "/local/domain/0/name" "Domain-0"
 	fi
 
 	echo Starting xenconsoled...
 	test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
-	xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
-	test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
-	test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
+	${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
 	echo Starting QEMU as disk backend for dom0
-	test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
+	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386"
 	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
 		-monitor /dev/null -serial /dev/null -parallel /dev/null \
 		-pidfile $QEMU_PIDFILE
@@ -144,7 +144,7 @@ case "$1" in
 	do_start
 	;;
   status)
-        xenstore-read -s /
+        ${BINDIR}/xenstore-read -s /
 	;;
   stop)
 	do_stop
diff --git a/tools/hotplug/Linux/init.d/xend b/tools/hotplug/Linux/init.d/xend
index 0fd7b16..5f92cdc 100755
--- a/tools/hotplug/Linux/init.d/xend
+++ b/tools/hotplug/Linux/init.d/xend
@@ -18,6 +18,8 @@
 # Description:       Starts and stops the Xen control daemon.
 ### END INIT INFO
 
+. /etc/xen/scripts/hotplugpath.sh
+
 shopt -s extglob
 
 # Wait for Xend to be up
@@ -25,12 +27,12 @@ function await_daemons_up
 {
 	i=1
 	rets=10
-	xend status
+	${SBINDIR}/xend status
 	while [ $? -ne 0 -a $i -lt $rets ]; do
 	    sleep 1
 	    echo -n .
 	    i=$(($i + 1))
-	    xend status
+	    ${SBINDIR}/xend status
 	done
 }
 
@@ -48,21 +50,21 @@ case "$1" in
 	else
 		touch /var/lock/xend
 	fi
-	xend start
+	${SBINDIR}/xend start
 	await_daemons_up
 	;;
   stop)
-	xend stop
+	${SBINDIR}/xend stop
 	rm -f /var/lock/subsys/xend /var/lock/xend
 	;;
   status)
-	xend status
+	${SBINDIR}/xend status
 	;;
   reload)
-        xend reload
+        ${SBINDIR}/xend reload
         ;;
   restart|force-reload)
-	xend restart
+	${SBINDIR}/xend restart
 	await_daemons_up
 	;;
   *)
diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 00e5944..2a1999a 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -27,11 +27,13 @@
 #                    boots / shuts down.
 ### END INIT INFO
 
-CMD=xm
+. /etc/xen/scripts/hotplugpath.sh
+
+CMD=${SBINDIR}/xm
 $CMD list &> /dev/null
 if test $? -ne 0
 then
-	CMD=xl
+	CMD=${SBINDIR}/xl
 fi
 
 $CMD list &> /dev/null
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYH-0003Jz-US; Fri, 12 Apr 2013 01:13:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYG-0003JF-Bh
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:16 +0000
Received: from [85.158.139.83:37813] by server-10.bemta-5.messagelabs.com id
	F9/A1-23714-8AF57615; Fri, 12 Apr 2013 01:13:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1365729188!27874199!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4745 invoked from network); 12 Apr 2013 01:13:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSY8-00074u-4I
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSY8-0000cF-1x
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:08 +0000
Date: Fri, 12 Apr 2013 01:13:08 +0000
Message-Id: <E1UQSY8-0000cF-1x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/Linux: Remove hardcoded paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3e27e36ca5f995063612e8833c84de2faef66552
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Feb 5 16:19:52 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 13:19:57 2013 +0100

    hotplug/Linux: Remove hardcoded paths
    
    Use xen-hotplugpath.sh (as NetBSD does) which allows PREFIX etc to change.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/hotplug/Linux/init.d/xen-watchdog |    4 +++-
 tools/hotplug/Linux/init.d/xencommons   |   24 ++++++++++++------------
 tools/hotplug/Linux/init.d/xend         |   16 +++++++++-------
 tools/hotplug/Linux/init.d/xendomains   |    6 ++++--
 4 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xen-watchdog b/tools/hotplug/Linux/init.d/xen-watchdog
index 55dd091..3592fda 100644
--- a/tools/hotplug/Linux/init.d/xen-watchdog
+++ b/tools/hotplug/Linux/init.d/xen-watchdog
@@ -17,7 +17,9 @@
 ### END INIT INFO
 #
 
-DAEMON=/usr/sbin/xenwatchdogd
+. /etc/xen/scripts/hotplugpath.sh
+
+DAEMON=${SBINDIR}/xenwatchdogd
 base=$(basename $DAEMON)
 
 # Source function library.
diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
index 20afcc0..a2e633b 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -18,6 +18,8 @@
 # Description:       Starts and stops the daemons neeeded for xl/xend
 ### END INIT INFO
 
+. /etc/xen/scripts/hotplugpath.sh
+
 if [ -d /etc/sysconfig ]; then
 	xencommons_config=/etc/sysconfig
 else
@@ -72,7 +74,7 @@ do_start () {
 	modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null
 	mkdir -p /var/run/xen
 
-	if ! `xenstore-read -s / >/dev/null 2>&1`
+	if ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1`
 	then
 		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
@@ -81,19 +83,19 @@ do_start () {
 		if [ -n "$XENSTORED" ] ; then
 		    echo -n Starting $XENSTORED...
 		    $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-		elif [ -x /usr/sbin/oxenstored ] ; then
+		elif [ -x ${SBINDIR}/oxenstored ] ; then
 		    echo -n Starting oxenstored...
-		    /usr/sbin/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-		elif [ -x /usr/sbin/xenstored ] ; then
+		    ${SBINDIR}/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+		elif [ -x ${SBINDIR}/xenstored ] ; then
 		    echo -n Starting C xenstored...
-		    /usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
+		    ${SBINDIR}/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
 		else
 		    echo "No xenstored found"
 		    exit 1
 		fi
 
 		# Wait for xenstored to actually come up, timing out after 30 seconds
-                while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do
+                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
                     echo -n .
 		    time=$(($time+1))
                     sleep 1
@@ -107,16 +109,14 @@ do_start () {
 		fi
 
 		echo Setting domain 0 name...
-		xenstore-write "/local/domain/0/name" "Domain-0"
+		${BINDIR}/xenstore-write "/local/domain/0/name" "Domain-0"
 	fi
 
 	echo Starting xenconsoled...
 	test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE"
-	xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
-	test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
-	test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
+	${SBINDIR}/xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
 	echo Starting QEMU as disk backend for dom0
-	test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386
+	test -z "$QEMU_XEN" && QEMU_XEN="${LIBEXEC}/qemu-system-i386"
 	$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
 		-monitor /dev/null -serial /dev/null -parallel /dev/null \
 		-pidfile $QEMU_PIDFILE
@@ -144,7 +144,7 @@ case "$1" in
 	do_start
 	;;
   status)
-        xenstore-read -s /
+        ${BINDIR}/xenstore-read -s /
 	;;
   stop)
 	do_stop
diff --git a/tools/hotplug/Linux/init.d/xend b/tools/hotplug/Linux/init.d/xend
index 0fd7b16..5f92cdc 100755
--- a/tools/hotplug/Linux/init.d/xend
+++ b/tools/hotplug/Linux/init.d/xend
@@ -18,6 +18,8 @@
 # Description:       Starts and stops the Xen control daemon.
 ### END INIT INFO
 
+. /etc/xen/scripts/hotplugpath.sh
+
 shopt -s extglob
 
 # Wait for Xend to be up
@@ -25,12 +27,12 @@ function await_daemons_up
 {
 	i=1
 	rets=10
-	xend status
+	${SBINDIR}/xend status
 	while [ $? -ne 0 -a $i -lt $rets ]; do
 	    sleep 1
 	    echo -n .
 	    i=$(($i + 1))
-	    xend status
+	    ${SBINDIR}/xend status
 	done
 }
 
@@ -48,21 +50,21 @@ case "$1" in
 	else
 		touch /var/lock/xend
 	fi
-	xend start
+	${SBINDIR}/xend start
 	await_daemons_up
 	;;
   stop)
-	xend stop
+	${SBINDIR}/xend stop
 	rm -f /var/lock/subsys/xend /var/lock/xend
 	;;
   status)
-	xend status
+	${SBINDIR}/xend status
 	;;
   reload)
-        xend reload
+        ${SBINDIR}/xend reload
         ;;
   restart|force-reload)
-	xend restart
+	${SBINDIR}/xend restart
 	await_daemons_up
 	;;
   *)
diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 00e5944..2a1999a 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -27,11 +27,13 @@
 #                    boots / shuts down.
 ### END INIT INFO
 
-CMD=xm
+. /etc/xen/scripts/hotplugpath.sh
+
+CMD=${SBINDIR}/xm
 $CMD list &> /dev/null
 if test $? -ne 0
 then
-	CMD=xl
+	CMD=${SBINDIR}/xl
 fi
 
 $CMD list &> /dev/null
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYN-0003LG-19; Fri, 12 Apr 2013 01:13:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYL-0003Ku-L8
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:21 +0000
Received: from [85.158.137.99:58809] by server-14.bemta-3.messagelabs.com id
	C6/C6-27076-0BF57615; Fri, 12 Apr 2013 01:13:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1365729198!16878790!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4857 invoked from network); 12 Apr 2013 01:13:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYI-000750-9h
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYI-0000cd-8X
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:18 +0000
Date: Fri, 12 Apr 2013 01:13:18 +0000
Message-Id: <E1UQSYI-0000cd-8X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Save/Restore GICH_APR register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b952c687fa17d4eab4b59f9dbb215c1e4a644fbf
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Apr 4 21:36:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 14:23:31 2013 +0100

    xen/arm: Save/Restore GICH_APR register
    
    Linux uses GICC_CTLR.EOImodeNS set to 0, which means both priority drop and
    deactivate interrupt functionality are made when something is written in
    GICC_EOIR.
    
    As the ARM manual specifies: "having an active interrupt in the List registers
    with a priority that is not set in the corresponding Active Priorities
    register" when GICV_CTLR.EOImode (ie GICC_CTLR.EOImodeNS in the guest context)
    result in unpredicable behavior, we need to save/restore GICH_APR.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 49f2b20..3124da3 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -70,6 +70,7 @@ void gic_save_state(struct vcpu *v)
         v->arch.gic_lr[i] = GICH[GICH_LR + i];
     v->arch.lr_mask = this_cpu(lr_mask);
     spin_unlock_irq(&gic.lock);
+    v->arch.gic_apr = GICH[GICH_APR];
     /* Disable until next VCPU scheduled */
     GICH[GICH_HCR] = 0;
     isb();
@@ -87,6 +88,7 @@ void gic_restore_state(struct vcpu *v)
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
     spin_unlock_irq(&gic.lock);
+    GICH[GICH_APR] = v->arch.gic_apr;
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYN-0003LG-19; Fri, 12 Apr 2013 01:13:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYL-0003Ku-L8
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:21 +0000
Received: from [85.158.137.99:58809] by server-14.bemta-3.messagelabs.com id
	C6/C6-27076-0BF57615; Fri, 12 Apr 2013 01:13:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1365729198!16878790!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4857 invoked from network); 12 Apr 2013 01:13:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYI-000750-9h
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYI-0000cd-8X
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:18 +0000
Date: Fri, 12 Apr 2013 01:13:18 +0000
Message-Id: <E1UQSYI-0000cd-8X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Save/Restore GICH_APR register
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b952c687fa17d4eab4b59f9dbb215c1e4a644fbf
Author:     Julien Grall <julien.grall@citrix.com>
AuthorDate: Thu Apr 4 21:36:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 14:23:31 2013 +0100

    xen/arm: Save/Restore GICH_APR register
    
    Linux uses GICC_CTLR.EOImodeNS set to 0, which means both priority drop and
    deactivate interrupt functionality are made when something is written in
    GICC_EOIR.
    
    As the ARM manual specifies: "having an active interrupt in the List registers
    with a priority that is not set in the corresponding Active Priorities
    register" when GICV_CTLR.EOImode (ie GICC_CTLR.EOImodeNS in the guest context)
    result in unpredicable behavior, we need to save/restore GICH_APR.
    
    Signed-off-by: Julien Grall <julien.grall@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 49f2b20..3124da3 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -70,6 +70,7 @@ void gic_save_state(struct vcpu *v)
         v->arch.gic_lr[i] = GICH[GICH_LR + i];
     v->arch.lr_mask = this_cpu(lr_mask);
     spin_unlock_irq(&gic.lock);
+    v->arch.gic_apr = GICH[GICH_APR];
     /* Disable until next VCPU scheduled */
     GICH[GICH_HCR] = 0;
     isb();
@@ -87,6 +88,7 @@ void gic_restore_state(struct vcpu *v)
     for ( i=0; i<nr_lrs; i++)
         GICH[GICH_LR + i] = v->arch.gic_lr[i];
     spin_unlock_irq(&gic.lock);
+    GICH[GICH_APR] = v->arch.gic_apr;
     GICH[GICH_HCR] = GICH_HCR_EN;
     isb();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYa-0003Nz-4T; Fri, 12 Apr 2013 01:13:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYY-0003NX-Ke
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:34 +0000
Received: from [193.109.254.147:60508] by server-7.bemta-14.messagelabs.com id
	CA/00-19255-EBF57615; Fri, 12 Apr 2013 01:13:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1365729208!8757508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12858 invoked from network); 12 Apr 2013 01:13:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYS-00075B-G3
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYS-0000cz-Di
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:28 +0000
Date: Fri, 12 Apr 2013 01:13:28 +0000
Message-Id: <E1UQSYS-0000cz-Di@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: fix comment in HTCR setup.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7186e6718e70250900f934f6f95a5c60edffbfa6
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu Mar 28 10:07:48 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 14:25:30 2013 +0100

    arm: fix comment in HTCR setup.
    
    Reported-by: Gihun Jung <gihun.jung@gmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S |    2 +-
 xen/arch/arm/arm64/head.S |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index db3baa0..f2f581d 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -189,7 +189,7 @@ skip_bss:
 
         /* Set up the HTCR:
          * PT walks use Outer-Shareable accesses,
-         * PT walks are write-back, no-write-allocate in both cache levels,
+         * PT walks are write-back, write-allocate in both cache levels,
          * Full 32-bit address space goes through this table. */
         ldr   r0, =0x80002500
         mcr   CP32(r0, HTCR)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index b7ab251..bbde419 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -173,7 +173,7 @@ skip_bss:
          * PASize -- 4G
          * Top byte is used
          * PT walks use Outer-Shareable accesses,
-         * PT walks are write-back, no-write-allocate in both cache levels,
+         * PT walks are write-back, write-allocate in both cache levels,
          * Full 64-bit address space goes through this table. */
         ldr   x0, =0x80802500
         msr   tcr_el2, x0
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYa-0003Nz-4T; Fri, 12 Apr 2013 01:13:36 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYY-0003NX-Ke
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:34 +0000
Received: from [193.109.254.147:60508] by server-7.bemta-14.messagelabs.com id
	CA/00-19255-EBF57615; Fri, 12 Apr 2013 01:13:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1365729208!8757508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12858 invoked from network); 12 Apr 2013 01:13:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYS-00075B-G3
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYS-0000cz-Di
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:28 +0000
Date: Fri, 12 Apr 2013 01:13:28 +0000
Message-Id: <E1UQSYS-0000cz-Di@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: fix comment in HTCR setup.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7186e6718e70250900f934f6f95a5c60edffbfa6
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Thu Mar 28 10:07:48 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 14:25:30 2013 +0100

    arm: fix comment in HTCR setup.
    
    Reported-by: Gihun Jung <gihun.jung@gmail.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm32/head.S |    2 +-
 xen/arch/arm/arm64/head.S |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index db3baa0..f2f581d 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -189,7 +189,7 @@ skip_bss:
 
         /* Set up the HTCR:
          * PT walks use Outer-Shareable accesses,
-         * PT walks are write-back, no-write-allocate in both cache levels,
+         * PT walks are write-back, write-allocate in both cache levels,
          * Full 32-bit address space goes through this table. */
         ldr   r0, =0x80002500
         mcr   CP32(r0, HTCR)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index b7ab251..bbde419 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -173,7 +173,7 @@ skip_bss:
          * PASize -- 4G
          * Top byte is used
          * PT walks use Outer-Shareable accesses,
-         * PT walks are write-back, no-write-allocate in both cache levels,
+         * PT walks are write-back, write-allocate in both cache levels,
          * Full 64-bit address space goes through this table. */
         ldr   x0, =0x80802500
         msr   tcr_el2, x0
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYh-0003PV-7O; Fri, 12 Apr 2013 01:13:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYf-0003PG-HK
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:41 +0000
Received: from [85.158.143.99:14554] by server-3.bemta-4.messagelabs.com id
	0C/D9-02186-4CF57615; Fri, 12 Apr 2013 01:13:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1365729219!27865479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20676 invoked from network); 12 Apr 2013 01:13:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYc-00075E-MU
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYc-0000dP-LO
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:38 +0000
Date: Fri, 12 Apr 2013 01:13:38 +0000
Message-Id: <E1UQSYc-0000dP-LO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/Makefile: Fix gmp extract rule
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be8d8d634d1babbf52a83cda139554e0605660c5
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:29 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 15:20:50 2013 +0100

    stubdom/Makefile: Fix gmp extract rule
    
    When NEWLIB_STAMPFILE is updated but gmp has already been extracted, the mv
    command will incorrectly create a subdirectory instead of renaming. Remove the
    old target before renaming to fix this.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index ddb97f4..674132a 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -162,6 +162,7 @@ ifeq ($(XEN_TARGET_ARCH), x86_32)
 endif
 gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
 	tar xjf $<
+	rm $@ -rf || :
 	mv gmp-$(GMP_VERSION) $@
 	#patch -d $@ -p0 < gmp.patch
 	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYh-0003PV-7O; Fri, 12 Apr 2013 01:13:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYf-0003PG-HK
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:41 +0000
Received: from [85.158.143.99:14554] by server-3.bemta-4.messagelabs.com id
	0C/D9-02186-4CF57615; Fri, 12 Apr 2013 01:13:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-216.messagelabs.com!1365729219!27865479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20676 invoked from network); 12 Apr 2013 01:13:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYc-00075E-MU
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYc-0000dP-LO
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:38 +0000
Date: Fri, 12 Apr 2013 01:13:38 +0000
Message-Id: <E1UQSYc-0000dP-LO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/Makefile: Fix gmp extract rule
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit be8d8d634d1babbf52a83cda139554e0605660c5
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:29 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 15:20:50 2013 +0100

    stubdom/Makefile: Fix gmp extract rule
    
    When NEWLIB_STAMPFILE is updated but gmp has already been extracted, the mv
    command will incorrectly create a subdirectory instead of renaming. Remove the
    old target before renaming to fix this.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 stubdom/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index ddb97f4..674132a 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -162,6 +162,7 @@ ifeq ($(XEN_TARGET_ARCH), x86_32)
 endif
 gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
 	tar xjf $<
+	rm $@ -rf || :
 	mv gmp-$(GMP_VERSION) $@
 	#patch -d $@ -p0 < gmp.patch
 	cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYt-0003SB-Ap; Fri, 12 Apr 2013 01:13:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYs-0003Ro-5F
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:54 +0000
Received: from [85.158.137.99:39478] by server-3.bemta-3.messagelabs.com id
	F0/E7-26934-1DF57615; Fri, 12 Apr 2013 01:13:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1365729229!12258515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26100 invoked from network); 12 Apr 2013 01:13:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYm-00075N-UC
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYm-0000eH-Sw
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:48 +0000
Date: Fri, 12 Apr 2013 01:13:48 +0000
Message-Id: <E1UQSYm-0000eH-Sw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: implement poll(2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b7720cd4b7a27e3b2c4ab67641d42c2aec31964
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Mar 25 11:17:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 15:42:39 2013 +0100

    mini-os: implement poll(2)
    
    It is just a wrapper around select(2). This implementation mimics Linux's
    do_poll.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/include/posix/poll.h |    1 +
 extras/mini-os/lib/sys.c            |  117 ++++++++++++++++++++++++++++++++++-
 2 files changed, 117 insertions(+), 1 deletions(-)

diff --git a/extras/mini-os/include/posix/poll.h b/extras/mini-os/include/posix/poll.h
new file mode 100644
index 0000000..06fb41a
--- /dev/null
+++ b/extras/mini-os/include/posix/poll.h
@@ -0,0 +1 @@
+#include <sys/poll.h>
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 3cc3340..cfbdc90 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -31,6 +31,7 @@
 #include <tpm_tis.h>
 #include <xenbus.h>
 #include <xenstore.h>
+#include <poll.h>
 
 #include <sys/types.h>
 #include <sys/unistd.h>
@@ -678,6 +679,29 @@ static void dump_set(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
 #define dump_set(nfds, readfds, writefds, exceptfds, timeout)
 #endif
 
+#ifdef LIBC_DEBUG
+static void dump_pollfds(struct pollfd *pfd, int nfds, int timeout)
+{
+    int i, comma, fd;
+
+    printk("[");
+    comma = 0;
+    for (i = 0; i < nfds; i++) {
+        fd = pfd[i].fd;
+        if (comma)
+            printk(", ");
+        printk("%d(%c)/%02x", fd, file_types[files[fd].type],
+            pfd[i].events);
+            comma = 1;
+    }
+    printk("]");
+
+    printk(", %d, %d", nfds, timeout);
+}
+#else
+#define dump_pollfds(pfds, nfds, timeout)
+#endif
+
 /* Just poll without blocking */
 static int select_poll(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
 {
@@ -983,6 +1007,98 @@ out:
     return ret;
 }
 
+/* Wrap around select */
+int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout)
+{
+    int n, ret;
+    int i, fd;
+    struct timeval _timeo, *timeo = NULL;
+    fd_set rfds, wfds, efds;
+    int max_fd = -1;
+
+    DEBUG("poll(");
+    dump_pollfds(_pfd, _nfds, _timeout);
+    DEBUG(")\n");
+
+    FD_ZERO(&rfds);
+    FD_ZERO(&wfds);
+    FD_ZERO(&efds);
+
+    n = 0;
+
+    for (i = 0; i < _nfds; i++) {
+        fd = _pfd[i].fd;
+        _pfd[i].revents = 0;
+
+        /* fd < 0, revents = 0, which is already set */
+        if (fd < 0) continue;
+
+        /* fd is invalid, revents = POLLNVAL, increment counter */
+        if (fd >= NOFILE || files[fd].type == FTYPE_NONE) {
+            n++;
+            _pfd[i].revents |= POLLNVAL;
+            continue;
+        }
+
+        /* normal case, map POLL* into readfds and writefds:
+         * POLLIN  -> readfds
+         * POLLOUT -> writefds
+         * POLL*   -> none
+         */
+        if (_pfd[i].events & POLLIN)
+            FD_SET(fd, &rfds);
+        if (_pfd[i].events & POLLOUT)
+            FD_SET(fd, &wfds);
+        /* always set exceptfds */
+        FD_SET(fd, &efds);
+        if (fd > max_fd)
+            max_fd = fd;
+    }
+
+    /* should never sleep when we already have events */
+    if (n) {
+        _timeo.tv_sec  = 0;
+        _timeo.tv_usec = 0;
+        timeo = &_timeo;
+    } else if (_timeout >= 0) {
+        /* normal case, construct _timeout, might sleep */
+        _timeo.tv_sec  = _timeout / 1000;
+        _timeo.tv_usec = (_timeout % 1000) * 1000;
+        timeo = &_timeo;
+    } else {
+        /* _timeout < 0, block forever */
+        timeo = NULL;
+    }
+
+
+    ret = select(max_fd+1, &rfds, &wfds, &efds, timeo);
+    /* error in select, just return, errno is set by select() */
+    if (ret < 0)
+        return ret;
+
+    for (i = 0; i < _nfds; i++) {
+        fd = _pfd[i].fd;
+
+        /* the revents has already been set for all error case */
+        if (fd < 0 || fd >= NOFILE || files[fd].type == FTYPE_NONE)
+            continue;
+
+        if (FD_ISSET(fd, &rfds) || FD_ISSET(fd, &wfds) || FD_ISSET(fd, &efds))
+            n++;
+        if (FD_ISSET(fd, &efds)) {
+            /* anything bad happens we set POLLERR */
+            _pfd[i].revents |= POLLERR;
+            continue;
+        }
+        if (FD_ISSET(fd, &rfds))
+            _pfd[i].revents |= POLLIN;
+        if (FD_ISSET(fd, &wfds))
+            _pfd[i].revents |= POLLOUT;
+    }
+
+    return n;
+}
+
 #ifdef HAVE_LWIP
 int socket(int domain, int type, int protocol)
 {
@@ -1360,7 +1476,6 @@ unsupported_function(int, tcgetattr, 0);
 unsupported_function(int, grantpt, -1);
 unsupported_function(int, unlockpt, -1);
 unsupported_function(char *, ptsname, NULL);
-unsupported_function(int, poll, -1);
 
 /* net/if.h */
 unsupported_function_log(unsigned int, if_nametoindex, -1);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:13:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:13:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSYt-0003SB-Ap; Fri, 12 Apr 2013 01:13:55 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYs-0003Ro-5F
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:54 +0000
Received: from [85.158.137.99:39478] by server-3.bemta-3.messagelabs.com id
	F0/E7-26934-1DF57615; Fri, 12 Apr 2013 01:13:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-217.messagelabs.com!1365729229!12258515!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26100 invoked from network); 12 Apr 2013 01:13:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:13:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYm-00075N-UC
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYm-0000eH-Sw
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:48 +0000
Date: Fri, 12 Apr 2013 01:13:48 +0000
Message-Id: <E1UQSYm-0000eH-Sw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: implement poll(2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1b7720cd4b7a27e3b2c4ab67641d42c2aec31964
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Mar 25 11:17:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 15:42:39 2013 +0100

    mini-os: implement poll(2)
    
    It is just a wrapper around select(2). This implementation mimics Linux's
    do_poll.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/include/posix/poll.h |    1 +
 extras/mini-os/lib/sys.c            |  117 ++++++++++++++++++++++++++++++++++-
 2 files changed, 117 insertions(+), 1 deletions(-)

diff --git a/extras/mini-os/include/posix/poll.h b/extras/mini-os/include/posix/poll.h
new file mode 100644
index 0000000..06fb41a
--- /dev/null
+++ b/extras/mini-os/include/posix/poll.h
@@ -0,0 +1 @@
+#include <sys/poll.h>
diff --git a/extras/mini-os/lib/sys.c b/extras/mini-os/lib/sys.c
index 3cc3340..cfbdc90 100644
--- a/extras/mini-os/lib/sys.c
+++ b/extras/mini-os/lib/sys.c
@@ -31,6 +31,7 @@
 #include <tpm_tis.h>
 #include <xenbus.h>
 #include <xenstore.h>
+#include <poll.h>
 
 #include <sys/types.h>
 #include <sys/unistd.h>
@@ -678,6 +679,29 @@ static void dump_set(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
 #define dump_set(nfds, readfds, writefds, exceptfds, timeout)
 #endif
 
+#ifdef LIBC_DEBUG
+static void dump_pollfds(struct pollfd *pfd, int nfds, int timeout)
+{
+    int i, comma, fd;
+
+    printk("[");
+    comma = 0;
+    for (i = 0; i < nfds; i++) {
+        fd = pfd[i].fd;
+        if (comma)
+            printk(", ");
+        printk("%d(%c)/%02x", fd, file_types[files[fd].type],
+            pfd[i].events);
+            comma = 1;
+    }
+    printk("]");
+
+    printk(", %d, %d", nfds, timeout);
+}
+#else
+#define dump_pollfds(pfds, nfds, timeout)
+#endif
+
 /* Just poll without blocking */
 static int select_poll(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
 {
@@ -983,6 +1007,98 @@ out:
     return ret;
 }
 
+/* Wrap around select */
+int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout)
+{
+    int n, ret;
+    int i, fd;
+    struct timeval _timeo, *timeo = NULL;
+    fd_set rfds, wfds, efds;
+    int max_fd = -1;
+
+    DEBUG("poll(");
+    dump_pollfds(_pfd, _nfds, _timeout);
+    DEBUG(")\n");
+
+    FD_ZERO(&rfds);
+    FD_ZERO(&wfds);
+    FD_ZERO(&efds);
+
+    n = 0;
+
+    for (i = 0; i < _nfds; i++) {
+        fd = _pfd[i].fd;
+        _pfd[i].revents = 0;
+
+        /* fd < 0, revents = 0, which is already set */
+        if (fd < 0) continue;
+
+        /* fd is invalid, revents = POLLNVAL, increment counter */
+        if (fd >= NOFILE || files[fd].type == FTYPE_NONE) {
+            n++;
+            _pfd[i].revents |= POLLNVAL;
+            continue;
+        }
+
+        /* normal case, map POLL* into readfds and writefds:
+         * POLLIN  -> readfds
+         * POLLOUT -> writefds
+         * POLL*   -> none
+         */
+        if (_pfd[i].events & POLLIN)
+            FD_SET(fd, &rfds);
+        if (_pfd[i].events & POLLOUT)
+            FD_SET(fd, &wfds);
+        /* always set exceptfds */
+        FD_SET(fd, &efds);
+        if (fd > max_fd)
+            max_fd = fd;
+    }
+
+    /* should never sleep when we already have events */
+    if (n) {
+        _timeo.tv_sec  = 0;
+        _timeo.tv_usec = 0;
+        timeo = &_timeo;
+    } else if (_timeout >= 0) {
+        /* normal case, construct _timeout, might sleep */
+        _timeo.tv_sec  = _timeout / 1000;
+        _timeo.tv_usec = (_timeout % 1000) * 1000;
+        timeo = &_timeo;
+    } else {
+        /* _timeout < 0, block forever */
+        timeo = NULL;
+    }
+
+
+    ret = select(max_fd+1, &rfds, &wfds, &efds, timeo);
+    /* error in select, just return, errno is set by select() */
+    if (ret < 0)
+        return ret;
+
+    for (i = 0; i < _nfds; i++) {
+        fd = _pfd[i].fd;
+
+        /* the revents has already been set for all error case */
+        if (fd < 0 || fd >= NOFILE || files[fd].type == FTYPE_NONE)
+            continue;
+
+        if (FD_ISSET(fd, &rfds) || FD_ISSET(fd, &wfds) || FD_ISSET(fd, &efds))
+            n++;
+        if (FD_ISSET(fd, &efds)) {
+            /* anything bad happens we set POLLERR */
+            _pfd[i].revents |= POLLERR;
+            continue;
+        }
+        if (FD_ISSET(fd, &rfds))
+            _pfd[i].revents |= POLLIN;
+        if (FD_ISSET(fd, &wfds))
+            _pfd[i].revents |= POLLOUT;
+    }
+
+    return n;
+}
+
 #ifdef HAVE_LWIP
 int socket(int domain, int type, int protocol)
 {
@@ -1360,7 +1476,6 @@ unsupported_function(int, tcgetattr, 0);
 unsupported_function(int, grantpt, -1);
 unsupported_function(int, unlockpt, -1);
 unsupported_function(char *, ptsname, NULL);
-unsupported_function(int, poll, -1);
 
 /* net/if.h */
 unsupported_function_log(unsigned int, if_nametoindex, -1);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:14:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSZ1-0003Ts-E2; Fri, 12 Apr 2013 01:14:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSZ0-0003TT-2A
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:14:02 +0000
Received: from [193.109.254.147:10089] by server-1.bemta-14.messagelabs.com id
	05/6D-22449-9DF57615; Fri, 12 Apr 2013 01:14:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1365729239!9155654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19932 invoked from network); 12 Apr 2013 01:14:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:14:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYx-00075W-4e
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYx-0000ed-2B
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:59 +0000
Date: Fri, 12 Apr 2013 01:13:59 +0000
Message-Id: <E1UQSYx-0000ed-2B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Switch to poll() in cxenstored's IO
	loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit edb13df2aece2acf5a50f20aab79599173e55b2e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Mar 25 11:17:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 15:42:44 2013 +0100

    Switch to poll() in cxenstored's IO loop
    
    Poll() can support more file descriptors than select(). We've done this for
    xenconsoled, now do this for cxenstored as well.
    
    The code is taken from xenconsoled and modified to adapt to cxenstored.
    
    Note that poll() semantic is a bit different from select(). In Linux, if a fd
    is set in IN/OUT fd_set and error occurs inside select(), this fd is still
    considered readable / writable, and it is set in the returned IN/OUT fd_set.
    So in later handle_input / handle_output, the connection will eventually be
    talloc_free'ed(). After switching to poll(), we should take care of any error
    right away, making the code clearer.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/xenstored_core.c |  191 +++++++++++++++++++++++++++------------
 tools/xenstore/xenstored_core.h |    2 +
 2 files changed, 133 insertions(+), 60 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index bd44645..a2cf2a6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -19,7 +19,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/select.h>
+#include <poll.h>
 #ifndef NO_SOCKETS
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -55,6 +55,12 @@
 #include "hashtable.h"
 
 extern xc_evtchn *xce_handle; /* in xenstored_domain.c */
+static int xce_pollfd_idx = -1;
+static struct pollfd *fds;
+static unsigned int current_array_size;
+static unsigned int nr_fds;
+
+#define ROUNDUP(_x, _w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
 static bool verbose = false;
 LIST_HEAD(connections);
@@ -62,6 +68,7 @@ static int tracefd = -1;
 static bool recovery = true;
 static bool remove_local = true;
 static int reopen_log_pipe[2];
+static int reopen_log_pipe0_pollfd_idx = -1;
 static char *tracefile = NULL;
 static TDB_CONTEXT *tdb_ctx = NULL;
 
@@ -199,7 +206,7 @@ void trace_destroy(const void *data, const char *type)
 /**
  * Signal handler for SIGHUP, which requests that the trace log is reopened
  * (in the main loop).  A single byte is written to reopen_log_pipe, to awaken
- * the select() in the main loop.
+ * the poll() in the main loop.
  */
 static void trigger_reopen_log(int signal __attribute__((unused)))
 {
@@ -279,15 +286,12 @@ static int destroy_conn(void *_conn)
 
 	/* Flush outgoing if possible, but don't block. */
 	if (!conn->domain) {
-		fd_set set;
-		struct timeval none;
-
-		FD_ZERO(&set);
-		FD_SET(conn->fd, &set);
-		none.tv_sec = none.tv_usec = 0;
+		struct pollfd pfd;
+		pfd.fd = conn->fd;
+		pfd.events = POLLOUT;
 
 		while (!list_empty(&conn->out_list)
-		       && select(conn->fd+1, NULL, &set, NULL, &none) == 1)
+		       && poll(&pfd, 1, 0) == 1)
 			if (!write_messages(conn))
 				break;
 		close(conn->fd);
@@ -299,53 +303,77 @@ static int destroy_conn(void *_conn)
 	return 0;
 }
 
-
-static void set_fd(int fd, fd_set *set, int *max)
+/* This function returns index inside the array if succeed, -1 if fail */
+static int set_fd(int fd, short events)
 {
-	if (fd < 0)
-		return;
-	FD_SET(fd, set);
-	if (fd > *max)
-		*max = fd;
-}
+	int ret;
+	if (current_array_size < nr_fds + 1) {
+		struct pollfd *new_fds = NULL;
+		unsigned long newsize;
+
+		/* Round up to 2^8 boundary, in practice this just
+		 * make newsize larger than current_array_size.
+		 */
+		newsize = ROUNDUP(nr_fds + 1, 8);
+
+		new_fds = realloc(fds, sizeof(struct pollfd)*newsize);
+		if (!new_fds)
+			goto fail;
+		fds = new_fds;
+
+		memset(&fds[0] + current_array_size, 0,
+		       sizeof(struct pollfd ) * (newsize-current_array_size));
+		current_array_size = newsize;
+	}
 
+	fds[nr_fds].fd = fd;
+	fds[nr_fds].events = events;
+	ret = nr_fds;
+	nr_fds++;
 
-static int initialize_set(fd_set *inset, fd_set *outset, int sock, int ro_sock,
-			  struct timeval **ptimeout)
+	return ret;
+fail:
+	syslog(LOG_ERR, "realloc failed, ignoring fd %d\n", fd);
+	return -1;
+}
+
+static void initialize_fds(int sock, int *p_sock_pollfd_idx,
+			   int ro_sock, int *p_ro_sock_pollfd_idx,
+			   int *ptimeout)
 {
-	static struct timeval zero_timeout = { 0 };
 	struct connection *conn;
-	int max = -1;
 
-	*ptimeout = NULL;
+	if (fds)
+		memset(fds, 0, sizeof(struct pollfd) * current_array_size);
+	nr_fds = 0;
 
-	FD_ZERO(inset);
-	FD_ZERO(outset);
+	*ptimeout = -1;
 
 	if (sock != -1)
-		set_fd(sock, inset, &max);
+		*p_sock_pollfd_idx = set_fd(sock, POLLIN|POLLPRI);
 	if (ro_sock != -1)
-		set_fd(ro_sock, inset, &max);
+		*p_ro_sock_pollfd_idx = set_fd(ro_sock, POLLIN|POLLPRI);
 	if (reopen_log_pipe[0] != -1)
-		set_fd(reopen_log_pipe[0], inset, &max);
+		reopen_log_pipe0_pollfd_idx =
+			set_fd(reopen_log_pipe[0], POLLIN|POLLPRI);
 
 	if (xce_handle != NULL)
-		set_fd(xc_evtchn_fd(xce_handle), inset, &max);
+		xce_pollfd_idx = set_fd(xc_evtchn_fd(xce_handle),
+					POLLIN|POLLPRI);
 
 	list_for_each_entry(conn, &connections, list) {
 		if (conn->domain) {
 			if (domain_can_read(conn) ||
 			    (domain_can_write(conn) &&
 			     !list_empty(&conn->out_list)))
-				*ptimeout = &zero_timeout;
+				*ptimeout = 0;
 		} else {
-			set_fd(conn->fd, inset, &max);
+			short events = POLLIN|POLLPRI;
 			if (!list_empty(&conn->out_list))
-				FD_SET(conn->fd, outset);
+				events |= POLLOUT;
+			conn->pollfd_idx = set_fd(conn->fd, events);
 		}
 	}
-
-	return max;
 }
 
 /* Is child a subnode of parent, or equal? */
@@ -1330,6 +1358,7 @@ struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 		return NULL;
 
 	new->fd = -1;
+	new->pollfd_idx = -1;
 	new->write = write;
 	new->read = read;
 	new->can_write = true;
@@ -1770,14 +1799,13 @@ int priv_domid = 0;
 
 int main(int argc, char *argv[])
 {
-	int opt, *sock, *ro_sock, max;
-	fd_set inset, outset;
+	int opt, *sock, *ro_sock;
+	int sock_pollfd_idx = -1, ro_sock_pollfd_idx = -1;
 	bool dofork = true;
 	bool outputpid = false;
 	bool no_domain_init = false;
 	const char *pidfile = NULL;
-	int evtchn_fd = -1;
-	struct timeval *timeout;
+	int timeout;
 
 	while ((opt = getopt_long(argc, argv, "DE:F:HNPS:t:T:RLVW:", options,
 				  NULL)) != -1) {
@@ -1880,11 +1908,9 @@ int main(int argc, char *argv[])
 
 	signal(SIGHUP, trigger_reopen_log);
 
-	if (xce_handle != NULL)
-		evtchn_fd = xc_evtchn_fd(xce_handle);
-
 	/* Get ready to listen to the tools. */
-	max = initialize_set(&inset, &outset, *sock, *ro_sock, &timeout);
+	initialize_fds(*sock, &sock_pollfd_idx, *ro_sock, &ro_sock_pollfd_idx,
+		       &timeout);
 
 	/* Tell the kernel we're up and running. */
 	xenbus_notify_running();
@@ -1893,27 +1919,57 @@ int main(int argc, char *argv[])
 	for (;;) {
 		struct connection *conn, *next;
 
-		if (select(max+1, &inset, &outset, NULL, timeout) < 0) {
+		if (poll(fds, nr_fds, timeout) < 0) {
 			if (errno == EINTR)
 				continue;
-			barf_perror("Select failed");
+			barf_perror("Poll failed");
 		}
 
-		if (reopen_log_pipe[0] != -1 && FD_ISSET(reopen_log_pipe[0], &inset)) {
-			char c;
-			if (read(reopen_log_pipe[0], &c, 1) != 1)
-				barf_perror("read failed");
-			reopen_log();
+		if (reopen_log_pipe0_pollfd_idx != -1) {
+			if (fds[reopen_log_pipe0_pollfd_idx].revents
+			    & ~POLLIN) {
+				close(reopen_log_pipe[0]);
+				close(reopen_log_pipe[1]);
+				init_pipe(reopen_log_pipe);
+			} else if (fds[reopen_log_pipe0_pollfd_idx].revents
+				   & POLLIN) {
+				char c;
+				if (read(reopen_log_pipe[0], &c, 1) != 1)
+					barf_perror("read failed");
+				reopen_log();
+			}
+			reopen_log_pipe0_pollfd_idx = -1;
 		}
 
-		if (*sock != -1 && FD_ISSET(*sock, &inset))
-			accept_connection(*sock, true);
+		if (sock_pollfd_idx != -1) {
+			if (fds[sock_pollfd_idx].revents & ~POLLIN) {
+				barf_perror("sock poll failed");
+				break;
+			} else if (fds[sock_pollfd_idx].revents & POLLIN) {
+				accept_connection(*sock, true);
+				sock_pollfd_idx = -1;
+			}
+		}
 
-		if (*ro_sock != -1 && FD_ISSET(*ro_sock, &inset))
-			accept_connection(*ro_sock, false);
+		if (ro_sock_pollfd_idx != -1) {
+			if (fds[ro_sock_pollfd_idx].revents & ~POLLIN) {
+				barf_perror("ro sock poll failed");
+				break;
+			} else if (fds[ro_sock_pollfd_idx].revents & POLLIN) {
+				accept_connection(*ro_sock, false);
+				ro_sock_pollfd_idx = -1;
+			}
+		}
 
-		if (evtchn_fd != -1 && FD_ISSET(evtchn_fd, &inset))
-			handle_event();
+		if (xce_pollfd_idx != -1) {
+			if (fds[xce_pollfd_idx].revents & ~POLLIN) {
+				barf_perror("xce_handle poll failed");
+				break;
+			} else if (fds[xce_pollfd_idx].revents & POLLIN) {
+				handle_event();
+				xce_pollfd_idx = -1;
+			}
+		}
 
 		next = list_entry(connections.next, typeof(*conn), list);
 		if (&next->list != &connections)
@@ -1939,21 +1995,36 @@ int main(int argc, char *argv[])
 				if (talloc_free(conn) == 0)
 					continue;
 			} else {
-				if (FD_ISSET(conn->fd, &inset))
-					handle_input(conn);
+				if (conn->pollfd_idx != -1) {
+					if (fds[conn->pollfd_idx].revents
+					    & ~(POLLIN|POLLOUT))
+						talloc_free(conn);
+					else if (fds[conn->pollfd_idx].revents
+						 & POLLIN)
+						handle_input(conn);
+				}
 				if (talloc_free(conn) == 0)
 					continue;
 
 				talloc_increase_ref_count(conn);
-				if (FD_ISSET(conn->fd, &outset))
-					handle_output(conn);
+
+				if (conn->pollfd_idx != -1) {
+					if (fds[conn->pollfd_idx].revents
+					    & ~(POLLIN|POLLOUT))
+						talloc_free(conn);
+					else if (fds[conn->pollfd_idx].revents
+						 & POLLOUT)
+						handle_output(conn);
+				}
 				if (talloc_free(conn) == 0)
 					continue;
+
+				conn->pollfd_idx = -1;
 			}
 		}
 
-		max = initialize_set(&inset, &outset, *sock, *ro_sock,
-				     &timeout);
+		initialize_fds(*sock, &sock_pollfd_idx, *ro_sock,
+			       &ro_sock_pollfd_idx, &timeout);
 	}
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 492ca0d..cfbcf6f 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -60,6 +60,8 @@ struct connection
 
 	/* The file descriptor we came in on. */
 	int fd;
+	/* The index of pollfd in global pollfd array */
+	int pollfd_idx;
 
 	/* Who am I? 0 for socket connections. */
 	unsigned int id;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 01:14:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 01:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQSZ1-0003Ts-E2; Fri, 12 Apr 2013 01:14:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSZ0-0003TT-2A
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:14:02 +0000
Received: from [193.109.254.147:10089] by server-1.bemta-14.messagelabs.com id
	05/6D-22449-9DF57615; Fri, 12 Apr 2013 01:14:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1365729239!9155654!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19932 invoked from network); 12 Apr 2013 01:14:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 01:14:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYx-00075W-4e
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQSYx-0000ed-2B
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 01:13:59 +0000
Date: Fri, 12 Apr 2013 01:13:59 +0000
Message-Id: <E1UQSYx-0000ed-2B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Switch to poll() in cxenstored's IO
	loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit edb13df2aece2acf5a50f20aab79599173e55b2e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Mar 25 11:17:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 11 15:42:44 2013 +0100

    Switch to poll() in cxenstored's IO loop
    
    Poll() can support more file descriptors than select(). We've done this for
    xenconsoled, now do this for cxenstored as well.
    
    The code is taken from xenconsoled and modified to adapt to cxenstored.
    
    Note that poll() semantic is a bit different from select(). In Linux, if a fd
    is set in IN/OUT fd_set and error occurs inside select(), this fd is still
    considered readable / writable, and it is set in the returned IN/OUT fd_set.
    So in later handle_input / handle_output, the connection will eventually be
    talloc_free'ed(). After switching to poll(), we should take care of any error
    right away, making the code clearer.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/xenstored_core.c |  191 +++++++++++++++++++++++++++------------
 tools/xenstore/xenstored_core.h |    2 +
 2 files changed, 133 insertions(+), 60 deletions(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index bd44645..a2cf2a6 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -19,7 +19,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/select.h>
+#include <poll.h>
 #ifndef NO_SOCKETS
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -55,6 +55,12 @@
 #include "hashtable.h"
 
 extern xc_evtchn *xce_handle; /* in xenstored_domain.c */
+static int xce_pollfd_idx = -1;
+static struct pollfd *fds;
+static unsigned int current_array_size;
+static unsigned int nr_fds;
+
+#define ROUNDUP(_x, _w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
 
 static bool verbose = false;
 LIST_HEAD(connections);
@@ -62,6 +68,7 @@ static int tracefd = -1;
 static bool recovery = true;
 static bool remove_local = true;
 static int reopen_log_pipe[2];
+static int reopen_log_pipe0_pollfd_idx = -1;
 static char *tracefile = NULL;
 static TDB_CONTEXT *tdb_ctx = NULL;
 
@@ -199,7 +206,7 @@ void trace_destroy(const void *data, const char *type)
 /**
  * Signal handler for SIGHUP, which requests that the trace log is reopened
  * (in the main loop).  A single byte is written to reopen_log_pipe, to awaken
- * the select() in the main loop.
+ * the poll() in the main loop.
  */
 static void trigger_reopen_log(int signal __attribute__((unused)))
 {
@@ -279,15 +286,12 @@ static int destroy_conn(void *_conn)
 
 	/* Flush outgoing if possible, but don't block. */
 	if (!conn->domain) {
-		fd_set set;
-		struct timeval none;
-
-		FD_ZERO(&set);
-		FD_SET(conn->fd, &set);
-		none.tv_sec = none.tv_usec = 0;
+		struct pollfd pfd;
+		pfd.fd = conn->fd;
+		pfd.events = POLLOUT;
 
 		while (!list_empty(&conn->out_list)
-		       && select(conn->fd+1, NULL, &set, NULL, &none) == 1)
+		       && poll(&pfd, 1, 0) == 1)
 			if (!write_messages(conn))
 				break;
 		close(conn->fd);
@@ -299,53 +303,77 @@ static int destroy_conn(void *_conn)
 	return 0;
 }
 
-
-static void set_fd(int fd, fd_set *set, int *max)
+/* This function returns index inside the array if succeed, -1 if fail */
+static int set_fd(int fd, short events)
 {
-	if (fd < 0)
-		return;
-	FD_SET(fd, set);
-	if (fd > *max)
-		*max = fd;
-}
+	int ret;
+	if (current_array_size < nr_fds + 1) {
+		struct pollfd *new_fds = NULL;
+		unsigned long newsize;
+
+		/* Round up to 2^8 boundary, in practice this just
+		 * make newsize larger than current_array_size.
+		 */
+		newsize = ROUNDUP(nr_fds + 1, 8);
+
+		new_fds = realloc(fds, sizeof(struct pollfd)*newsize);
+		if (!new_fds)
+			goto fail;
+		fds = new_fds;
+
+		memset(&fds[0] + current_array_size, 0,
+		       sizeof(struct pollfd ) * (newsize-current_array_size));
+		current_array_size = newsize;
+	}
 
+	fds[nr_fds].fd = fd;
+	fds[nr_fds].events = events;
+	ret = nr_fds;
+	nr_fds++;
 
-static int initialize_set(fd_set *inset, fd_set *outset, int sock, int ro_sock,
-			  struct timeval **ptimeout)
+	return ret;
+fail:
+	syslog(LOG_ERR, "realloc failed, ignoring fd %d\n", fd);
+	return -1;
+}
+
+static void initialize_fds(int sock, int *p_sock_pollfd_idx,
+			   int ro_sock, int *p_ro_sock_pollfd_idx,
+			   int *ptimeout)
 {
-	static struct timeval zero_timeout = { 0 };
 	struct connection *conn;
-	int max = -1;
 
-	*ptimeout = NULL;
+	if (fds)
+		memset(fds, 0, sizeof(struct pollfd) * current_array_size);
+	nr_fds = 0;
 
-	FD_ZERO(inset);
-	FD_ZERO(outset);
+	*ptimeout = -1;
 
 	if (sock != -1)
-		set_fd(sock, inset, &max);
+		*p_sock_pollfd_idx = set_fd(sock, POLLIN|POLLPRI);
 	if (ro_sock != -1)
-		set_fd(ro_sock, inset, &max);
+		*p_ro_sock_pollfd_idx = set_fd(ro_sock, POLLIN|POLLPRI);
 	if (reopen_log_pipe[0] != -1)
-		set_fd(reopen_log_pipe[0], inset, &max);
+		reopen_log_pipe0_pollfd_idx =
+			set_fd(reopen_log_pipe[0], POLLIN|POLLPRI);
 
 	if (xce_handle != NULL)
-		set_fd(xc_evtchn_fd(xce_handle), inset, &max);
+		xce_pollfd_idx = set_fd(xc_evtchn_fd(xce_handle),
+					POLLIN|POLLPRI);
 
 	list_for_each_entry(conn, &connections, list) {
 		if (conn->domain) {
 			if (domain_can_read(conn) ||
 			    (domain_can_write(conn) &&
 			     !list_empty(&conn->out_list)))
-				*ptimeout = &zero_timeout;
+				*ptimeout = 0;
 		} else {
-			set_fd(conn->fd, inset, &max);
+			short events = POLLIN|POLLPRI;
 			if (!list_empty(&conn->out_list))
-				FD_SET(conn->fd, outset);
+				events |= POLLOUT;
+			conn->pollfd_idx = set_fd(conn->fd, events);
 		}
 	}
-
-	return max;
 }
 
 /* Is child a subnode of parent, or equal? */
@@ -1330,6 +1358,7 @@ struct connection *new_connection(connwritefn_t *write, connreadfn_t *read)
 		return NULL;
 
 	new->fd = -1;
+	new->pollfd_idx = -1;
 	new->write = write;
 	new->read = read;
 	new->can_write = true;
@@ -1770,14 +1799,13 @@ int priv_domid = 0;
 
 int main(int argc, char *argv[])
 {
-	int opt, *sock, *ro_sock, max;
-	fd_set inset, outset;
+	int opt, *sock, *ro_sock;
+	int sock_pollfd_idx = -1, ro_sock_pollfd_idx = -1;
 	bool dofork = true;
 	bool outputpid = false;
 	bool no_domain_init = false;
 	const char *pidfile = NULL;
-	int evtchn_fd = -1;
-	struct timeval *timeout;
+	int timeout;
 
 	while ((opt = getopt_long(argc, argv, "DE:F:HNPS:t:T:RLVW:", options,
 				  NULL)) != -1) {
@@ -1880,11 +1908,9 @@ int main(int argc, char *argv[])
 
 	signal(SIGHUP, trigger_reopen_log);
 
-	if (xce_handle != NULL)
-		evtchn_fd = xc_evtchn_fd(xce_handle);
-
 	/* Get ready to listen to the tools. */
-	max = initialize_set(&inset, &outset, *sock, *ro_sock, &timeout);
+	initialize_fds(*sock, &sock_pollfd_idx, *ro_sock, &ro_sock_pollfd_idx,
+		       &timeout);
 
 	/* Tell the kernel we're up and running. */
 	xenbus_notify_running();
@@ -1893,27 +1919,57 @@ int main(int argc, char *argv[])
 	for (;;) {
 		struct connection *conn, *next;
 
-		if (select(max+1, &inset, &outset, NULL, timeout) < 0) {
+		if (poll(fds, nr_fds, timeout) < 0) {
 			if (errno == EINTR)
 				continue;
-			barf_perror("Select failed");
+			barf_perror("Poll failed");
 		}
 
-		if (reopen_log_pipe[0] != -1 && FD_ISSET(reopen_log_pipe[0], &inset)) {
-			char c;
-			if (read(reopen_log_pipe[0], &c, 1) != 1)
-				barf_perror("read failed");
-			reopen_log();
+		if (reopen_log_pipe0_pollfd_idx != -1) {
+			if (fds[reopen_log_pipe0_pollfd_idx].revents
+			    & ~POLLIN) {
+				close(reopen_log_pipe[0]);
+				close(reopen_log_pipe[1]);
+				init_pipe(reopen_log_pipe);
+			} else if (fds[reopen_log_pipe0_pollfd_idx].revents
+				   & POLLIN) {
+				char c;
+				if (read(reopen_log_pipe[0], &c, 1) != 1)
+					barf_perror("read failed");
+				reopen_log();
+			}
+			reopen_log_pipe0_pollfd_idx = -1;
 		}
 
-		if (*sock != -1 && FD_ISSET(*sock, &inset))
-			accept_connection(*sock, true);
+		if (sock_pollfd_idx != -1) {
+			if (fds[sock_pollfd_idx].revents & ~POLLIN) {
+				barf_perror("sock poll failed");
+				break;
+			} else if (fds[sock_pollfd_idx].revents & POLLIN) {
+				accept_connection(*sock, true);
+				sock_pollfd_idx = -1;
+			}
+		}
 
-		if (*ro_sock != -1 && FD_ISSET(*ro_sock, &inset))
-			accept_connection(*ro_sock, false);
+		if (ro_sock_pollfd_idx != -1) {
+			if (fds[ro_sock_pollfd_idx].revents & ~POLLIN) {
+				barf_perror("ro sock poll failed");
+				break;
+			} else if (fds[ro_sock_pollfd_idx].revents & POLLIN) {
+				accept_connection(*ro_sock, false);
+				ro_sock_pollfd_idx = -1;
+			}
+		}
 
-		if (evtchn_fd != -1 && FD_ISSET(evtchn_fd, &inset))
-			handle_event();
+		if (xce_pollfd_idx != -1) {
+			if (fds[xce_pollfd_idx].revents & ~POLLIN) {
+				barf_perror("xce_handle poll failed");
+				break;
+			} else if (fds[xce_pollfd_idx].revents & POLLIN) {
+				handle_event();
+				xce_pollfd_idx = -1;
+			}
+		}
 
 		next = list_entry(connections.next, typeof(*conn), list);
 		if (&next->list != &connections)
@@ -1939,21 +1995,36 @@ int main(int argc, char *argv[])
 				if (talloc_free(conn) == 0)
 					continue;
 			} else {
-				if (FD_ISSET(conn->fd, &inset))
-					handle_input(conn);
+				if (conn->pollfd_idx != -1) {
+					if (fds[conn->pollfd_idx].revents
+					    & ~(POLLIN|POLLOUT))
+						talloc_free(conn);
+					else if (fds[conn->pollfd_idx].revents
+						 & POLLIN)
+						handle_input(conn);
+				}
 				if (talloc_free(conn) == 0)
 					continue;
 
 				talloc_increase_ref_count(conn);
-				if (FD_ISSET(conn->fd, &outset))
-					handle_output(conn);
+
+				if (conn->pollfd_idx != -1) {
+					if (fds[conn->pollfd_idx].revents
+					    & ~(POLLIN|POLLOUT))
+						talloc_free(conn);
+					else if (fds[conn->pollfd_idx].revents
+						 & POLLOUT)
+						handle_output(conn);
+				}
 				if (talloc_free(conn) == 0)
 					continue;
+
+				conn->pollfd_idx = -1;
 			}
 		}
 
-		max = initialize_set(&inset, &outset, *sock, *ro_sock,
-				     &timeout);
+		initialize_fds(*sock, &sock_pollfd_idx, *ro_sock,
+			       &ro_sock_pollfd_idx, &timeout);
 	}
 }
 
diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_core.h
index 492ca0d..cfbcf6f 100644
--- a/tools/xenstore/xenstored_core.h
+++ b/tools/xenstore/xenstored_core.h
@@ -60,6 +60,8 @@ struct connection
 
 	/* The file descriptor we came in on. */
 	int fd;
+	/* The index of pollfd in global pollfd array */
+	int pollfd_idx;
 
 	/* Who am I? 0 for socket connections. */
 	unsigned int id;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 09:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 09:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQaM1-0002b5-5G; Fri, 12 Apr 2013 09:33:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaLz-0002aw-Ap
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:07 +0000
Received: from [193.109.254.147:34921] by server-8.bemta-14.messagelabs.com id
	D7/EC-07222-2D4D7615; Fri, 12 Apr 2013 09:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1365759183!8832852!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18199 invoked from network); 12 Apr 2013 09:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 09:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaLv-0004ye-27
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaLu-00045w-RI
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:02 +0000
Date: Fri, 12 Apr 2013 09:33:02 +0000
Message-Id: <E1UQaLu-00045w-RI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: run
	libxl__arch_domain_create() much earlier.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c70ce4614ea99bc31450141359ec6c5c53a9f7b2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Apr 9 15:44:07 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 9 15:44:07 2013 +0100

    libxl: run libxl__arch_domain_create() much earlier.
    
    Among other things, arch_domain_create() sets the shadow(/hap/p2m)
    memory allocation, which must happen after vcpus are assigned (or the
    shadow op will fail) but before memory is allocated (or we might run
    out of p2m memory).
    
    libxl__build_pre(), which already sets similar things like maxmem,
    semes like a reasonable spot for it.  That needed a bit of plumbing to
    get the right datastructure from the caller.
    
    As a side-effect, the return code from libxl__arch_domain_create() is
    no longer ignored.
    
    This bug was analysed in:
        From: "Jan Beulich" <JBeulich@xxxxxxxx>
        "Re: [Xen-devel] [xen-unstable test] 16788: regressions - FAIL"
        Date: Mon, 04 Mar 2013 16:34:53 +0000
        http://lists.xen.org/archives/html/xen-devel/2013-03/msg00191.html
    
    Reported-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    
    (Cherry-picked from 650354dbc2626b643c12873275ca67782f1382c8.)
    
    Conflicts:
    	tools/libxl/libxl_dom.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_create.c   |   10 +++++-----
 tools/libxl/libxl_dm.c       |    2 +-
 tools/libxl/libxl_dom.c      |   10 +++++++---
 tools/libxl/libxl_internal.h |    5 +++--
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e9a5148..c6011fa 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -328,15 +328,16 @@ static int init_console_info(libxl__device_console *console, int dev_num)
 }
 
 int libxl__domain_build(libxl__gc *gc,
-                        libxl_domain_build_info *info,
+                        libxl_domain_config *d_config,
                         uint32_t domid,
                         libxl__domain_build_state *state)
 {
+    libxl_domain_build_info *const info = &d_config->b_info;
     char **vments = NULL, **localents = NULL;
     struct timeval start_time;
     int i, ret;
 
-    ret = libxl__build_pre(gc, domid, info, state);
+    ret = libxl__build_pre(gc, domid, d_config, state);
     if (ret)
         goto out;
 
@@ -761,14 +762,14 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     dcs->dmss.callback = domcreate_devmodel_started;
 
     if ( restore_fd < 0 ) {
-        rc = libxl__domain_build(gc, &d_config->b_info, domid, state);
+        rc = libxl__domain_build(gc, d_config, domid, state);
         domcreate_rebuild_done(egc, dcs, rc);
         return;
     }
 
     /* Restore */
 
-    rc = libxl__build_pre(gc, domid, info, state);
+    rc = libxl__build_pre(gc, domid, d_config, state);
     if (rc)
         goto out;
 
@@ -1127,7 +1128,6 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
         }
     }
 
-    libxl__arch_domain_create(gc, d_config, domid);
     domcreate_console_available(egc, dcs);
 
     domcreate_complete(egc, dcs, 0);
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 423e4a4..80b4973 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -817,7 +817,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     if (ret)
         goto out;
     uint32_t dm_domid = sdss->pvqemu.guest_domid;
-    ret = libxl__domain_build(gc, &dm_config->b_info, dm_domid, stubdom_state);
+    ret = libxl__domain_build(gc, dm_config, dm_domid, stubdom_state);
     if (ret)
         goto out;
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 95da18e..3e6622c 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -18,6 +18,7 @@
 #include <glob.h>
 
 #include "libxl_internal.h"
+#include "libxl_arch.h"
 
 #include <xc_dom.h>
 #include <xen/hvm/hvm_info_table.h>
@@ -199,12 +200,14 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 }
 
 int libxl__build_pre(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info, libxl__domain_build_state *state)
+              libxl_domain_config *d_config, libxl__domain_build_state *state)
 {
+    libxl_domain_build_info *const info = &d_config->b_info;
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int tsc_mode;
     char *xs_domid, *con_domid;
     uint32_t rtc_timeoffset;
+    int rc;
 
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
 
@@ -218,7 +221,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
      * whatever that turns out to be.
      */
     if (libxl_defbool_val(info->numa_placement)) {
-        int rc;
 
         if (!libxl_bitmap_is_full(&info->cpumap)) {
             LOG(ERROR, "Can run NUMA placement only if no vcpu "
@@ -288,7 +290,9 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->console_domid);
     state->vm_generationid_addr = 0;
 
-    return 0;
+    rc = libxl__arch_domain_create(gc, d_config, domid);
+
+    return rc;
 }
 
 int libxl__build_post(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 9603b99..13fa509 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -881,7 +881,8 @@ typedef struct {
 } libxl__domain_build_state;
 
 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info, libxl__domain_build_state *state);
+              libxl_domain_config * const d_config,
+              libxl__domain_build_state *state);
 _hidden int libxl__build_post(libxl__gc *gc, uint32_t domid,
                libxl_domain_build_info *info, libxl__domain_build_state *state,
                char **vms_ents, char **local_ents);
@@ -1274,7 +1275,7 @@ _hidden int libxl__domain_make(libxl__gc *gc,
                                uint32_t *domid);
 
 _hidden int libxl__domain_build(libxl__gc *gc,
-                                libxl_domain_build_info *info,
+                                libxl_domain_config *d_config,
                                 uint32_t domid,
                                 libxl__domain_build_state *state);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 09:33:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 09:33:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQaM1-0002b5-5G; Fri, 12 Apr 2013 09:33:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaLz-0002aw-Ap
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:07 +0000
Received: from [193.109.254.147:34921] by server-8.bemta-14.messagelabs.com id
	D7/EC-07222-2D4D7615; Fri, 12 Apr 2013 09:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1365759183!8832852!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18199 invoked from network); 12 Apr 2013 09:33:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 09:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaLv-0004ye-27
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaLu-00045w-RI
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:02 +0000
Date: Fri, 12 Apr 2013 09:33:02 +0000
Message-Id: <E1UQaLu-00045w-RI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: run
	libxl__arch_domain_create() much earlier.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c70ce4614ea99bc31450141359ec6c5c53a9f7b2
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Tue Apr 9 15:44:07 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 9 15:44:07 2013 +0100

    libxl: run libxl__arch_domain_create() much earlier.
    
    Among other things, arch_domain_create() sets the shadow(/hap/p2m)
    memory allocation, which must happen after vcpus are assigned (or the
    shadow op will fail) but before memory is allocated (or we might run
    out of p2m memory).
    
    libxl__build_pre(), which already sets similar things like maxmem,
    semes like a reasonable spot for it.  That needed a bit of plumbing to
    get the right datastructure from the caller.
    
    As a side-effect, the return code from libxl__arch_domain_create() is
    no longer ignored.
    
    This bug was analysed in:
        From: "Jan Beulich" <JBeulich@xxxxxxxx>
        "Re: [Xen-devel] [xen-unstable test] 16788: regressions - FAIL"
        Date: Mon, 04 Mar 2013 16:34:53 +0000
        http://lists.xen.org/archives/html/xen-devel/2013-03/msg00191.html
    
    Reported-by: Jan Beulich <JBeulich@suse.com>
    Signed-off-by: Tim Deegan <tim@xen.org>
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    
    (Cherry-picked from 650354dbc2626b643c12873275ca67782f1382c8.)
    
    Conflicts:
    	tools/libxl/libxl_dom.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_create.c   |   10 +++++-----
 tools/libxl/libxl_dm.c       |    2 +-
 tools/libxl/libxl_dom.c      |   10 +++++++---
 tools/libxl/libxl_internal.h |    5 +++--
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e9a5148..c6011fa 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -328,15 +328,16 @@ static int init_console_info(libxl__device_console *console, int dev_num)
 }
 
 int libxl__domain_build(libxl__gc *gc,
-                        libxl_domain_build_info *info,
+                        libxl_domain_config *d_config,
                         uint32_t domid,
                         libxl__domain_build_state *state)
 {
+    libxl_domain_build_info *const info = &d_config->b_info;
     char **vments = NULL, **localents = NULL;
     struct timeval start_time;
     int i, ret;
 
-    ret = libxl__build_pre(gc, domid, info, state);
+    ret = libxl__build_pre(gc, domid, d_config, state);
     if (ret)
         goto out;
 
@@ -761,14 +762,14 @@ static void domcreate_bootloader_done(libxl__egc *egc,
     dcs->dmss.callback = domcreate_devmodel_started;
 
     if ( restore_fd < 0 ) {
-        rc = libxl__domain_build(gc, &d_config->b_info, domid, state);
+        rc = libxl__domain_build(gc, d_config, domid, state);
         domcreate_rebuild_done(egc, dcs, rc);
         return;
     }
 
     /* Restore */
 
-    rc = libxl__build_pre(gc, domid, info, state);
+    rc = libxl__build_pre(gc, domid, d_config, state);
     if (rc)
         goto out;
 
@@ -1127,7 +1128,6 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
         }
     }
 
-    libxl__arch_domain_create(gc, d_config, domid);
     domcreate_console_available(egc, dcs);
 
     domcreate_complete(egc, dcs, 0);
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 423e4a4..80b4973 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -817,7 +817,7 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     if (ret)
         goto out;
     uint32_t dm_domid = sdss->pvqemu.guest_domid;
-    ret = libxl__domain_build(gc, &dm_config->b_info, dm_domid, stubdom_state);
+    ret = libxl__domain_build(gc, dm_config, dm_domid, stubdom_state);
     if (ret)
         goto out;
 
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 95da18e..3e6622c 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -18,6 +18,7 @@
 #include <glob.h>
 
 #include "libxl_internal.h"
+#include "libxl_arch.h"
 
 #include <xc_dom.h>
 #include <xen/hvm/hvm_info_table.h>
@@ -199,12 +200,14 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 }
 
 int libxl__build_pre(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info, libxl__domain_build_state *state)
+              libxl_domain_config *d_config, libxl__domain_build_state *state)
 {
+    libxl_domain_build_info *const info = &d_config->b_info;
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int tsc_mode;
     char *xs_domid, *con_domid;
     uint32_t rtc_timeoffset;
+    int rc;
 
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
 
@@ -218,7 +221,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
      * whatever that turns out to be.
      */
     if (libxl_defbool_val(info->numa_placement)) {
-        int rc;
 
         if (!libxl_bitmap_is_full(&info->cpumap)) {
             LOG(ERROR, "Can run NUMA placement only if no vcpu "
@@ -288,7 +290,9 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->console_domid);
     state->vm_generationid_addr = 0;
 
-    return 0;
+    rc = libxl__arch_domain_create(gc, d_config, domid);
+
+    return rc;
 }
 
 int libxl__build_post(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 9603b99..13fa509 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -881,7 +881,8 @@ typedef struct {
 } libxl__domain_build_state;
 
 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
-              libxl_domain_build_info *info, libxl__domain_build_state *state);
+              libxl_domain_config * const d_config,
+              libxl__domain_build_state *state);
 _hidden int libxl__build_post(libxl__gc *gc, uint32_t domid,
                libxl_domain_build_info *info, libxl__domain_build_state *state,
                char **vms_ents, char **local_ents);
@@ -1274,7 +1275,7 @@ _hidden int libxl__domain_make(libxl__gc *gc,
                                uint32_t *domid);
 
 _hidden int libxl__domain_build(libxl__gc *gc,
-                                libxl_domain_build_info *info,
+                                libxl_domain_config *d_config,
                                 uint32_t domid,
                                 libxl__domain_build_state *state);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 09:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 09:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQaMP-0002dL-8W; Fri, 12 Apr 2013 09:33:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaMN-0002d6-9s
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:31 +0000
Received: from [193.109.254.147:64682] by server-15.bemta-14.messagelabs.com
	id C6/A2-14305-AE4D7615; Fri, 12 Apr 2013 09:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1365759193!9458259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12172 invoked from network); 12 Apr 2013 09:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 09:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaM5-0004yk-6K
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaM5-00046K-58
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:13 +0000
Date: Fri, 12 Apr 2013 09:33:13 +0000
Message-Id: <E1UQaM5-00046K-58@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: Retry blktap2 tapdisk
	message on interrupt.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5b9f23485aa3709bec753badbcb989fde390925
Author:     Dr. Greg Wettstein <greg@wind.enjellic.com>
AuthorDate: Tue Mar 19 07:26:33 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 12:31:13 2013 +0100

    tools: Retry blktap2 tapdisk message on interrupt.
    
    Re-start blktap2 IPC select call on interrupt.
    
    We hunted this miserable bug for a long time.
    
    The teardown of a blktap2 tapdisk instance is being carried out
    inconsistently up to and including the 4.2.1 release.  The
    problem appears to be a classic 'Heisenbug' which disappears if a
    single function call is added to the tapdisk shutdown path.  It
    is likely this bug has been in existence for the life of the
    blktap2 code.
    
    Control messages to manipulate a tapdisk instance are sent over a
    UNIX domain socket.  A select call is used on both the read and
    write paths to wait on I/O and to set a timeout for the
    transmission and reception of the control plane messages.
    
    The existing code fails receipt or transmission of the control message
    on any type of error return from the select call.  The xl control
    process receives an interrupt while waiting in the select call which
    in turn causes an error return with SIGINT as the return code.
    
    This prematurely terminates the teardown of the tapdisk instance
    leaving it in various states of shutdown.  Since multiple messages
    are needed to implement a full teardown the tapdisk instance can be
    left in various states ranging from fully connected to only the minor
    being left allocated.
    
    The fix is straight forward.  Check the return code from the
    select call and re-try read or write of the control message if
    errno is sent to EINTR.  The problem manifests itself in the read
    path but there appears to be little reason to not add the fix to
    the write path as well.  Both paths appear to be cut-and-paste
    copies of each other.
    
    Signed-off-by: Dr. Greg Wettstein <greg@enjellic.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 6cffb2b469a55032a2900ccb8776c0082f346758)
---
 tools/blktap2/control/tap-ctl-ipc.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap2/control/tap-ctl-ipc.c
index cc6160e..c8aad1c 100644
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap2/control/tap-ctl-ipc.c
@@ -64,8 +64,11 @@ tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
 		FD_SET(fd, &readfds);
 
 		ret = select(fd + 1, &readfds, NULL, NULL, t);
-		if (ret == -1)
+		if (ret == -1) {
+			if (errno == EINTR)
+				continue;
 			break;
+		}
 		else if (FD_ISSET(fd, &readfds)) {
 			ret = read(fd, message + offset, len - offset);
 			if (ret <= 0)
@@ -114,8 +117,11 @@ tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
 		 * bit more time than expected. */
 
 		ret = select(fd + 1, NULL, &writefds, NULL, t);
-		if (ret == -1)
+		if (ret == -1) {
+			if (errno == EINTR)
+				continue;
 			break;
+		}
 		else if (FD_ISSET(fd, &writefds)) {
 			ret = write(fd, message + offset, len - offset);
 			if (ret <= 0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 09:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 09:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQaMP-0002dL-8W; Fri, 12 Apr 2013 09:33:33 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaMN-0002d6-9s
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:31 +0000
Received: from [193.109.254.147:64682] by server-15.bemta-14.messagelabs.com
	id C6/A2-14305-AE4D7615; Fri, 12 Apr 2013 09:33:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1365759193!9458259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12172 invoked from network); 12 Apr 2013 09:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 09:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaM5-0004yk-6K
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQaM5-00046K-58
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 09:33:13 +0000
Date: Fri, 12 Apr 2013 09:33:13 +0000
Message-Id: <E1UQaM5-00046K-58@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools: Retry blktap2 tapdisk
	message on interrupt.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e5b9f23485aa3709bec753badbcb989fde390925
Author:     Dr. Greg Wettstein <greg@wind.enjellic.com>
AuthorDate: Tue Mar 19 07:26:33 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 11 12:31:13 2013 +0100

    tools: Retry blktap2 tapdisk message on interrupt.
    
    Re-start blktap2 IPC select call on interrupt.
    
    We hunted this miserable bug for a long time.
    
    The teardown of a blktap2 tapdisk instance is being carried out
    inconsistently up to and including the 4.2.1 release.  The
    problem appears to be a classic 'Heisenbug' which disappears if a
    single function call is added to the tapdisk shutdown path.  It
    is likely this bug has been in existence for the life of the
    blktap2 code.
    
    Control messages to manipulate a tapdisk instance are sent over a
    UNIX domain socket.  A select call is used on both the read and
    write paths to wait on I/O and to set a timeout for the
    transmission and reception of the control plane messages.
    
    The existing code fails receipt or transmission of the control message
    on any type of error return from the select call.  The xl control
    process receives an interrupt while waiting in the select call which
    in turn causes an error return with SIGINT as the return code.
    
    This prematurely terminates the teardown of the tapdisk instance
    leaving it in various states of shutdown.  Since multiple messages
    are needed to implement a full teardown the tapdisk instance can be
    left in various states ranging from fully connected to only the minor
    being left allocated.
    
    The fix is straight forward.  Check the return code from the
    select call and re-try read or write of the control message if
    errno is sent to EINTR.  The problem manifests itself in the read
    path but there appears to be little reason to not add the fix to
    the write path as well.  Both paths appear to be cut-and-paste
    copies of each other.
    
    Signed-off-by: Dr. Greg Wettstein <greg@enjellic.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit 6cffb2b469a55032a2900ccb8776c0082f346758)
---
 tools/blktap2/control/tap-ctl-ipc.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap2/control/tap-ctl-ipc.c
index cc6160e..c8aad1c 100644
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap2/control/tap-ctl-ipc.c
@@ -64,8 +64,11 @@ tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
 		FD_SET(fd, &readfds);
 
 		ret = select(fd + 1, &readfds, NULL, NULL, t);
-		if (ret == -1)
+		if (ret == -1) {
+			if (errno == EINTR)
+				continue;
 			break;
+		}
 		else if (FD_ISSET(fd, &readfds)) {
 			ret = read(fd, message + offset, len - offset);
 			if (ret <= 0)
@@ -114,8 +117,11 @@ tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
 		 * bit more time than expected. */
 
 		ret = select(fd + 1, NULL, &writefds, NULL, t);
-		if (ret == -1)
+		if (ret == -1) {
+			if (errno == EINTR)
+				continue;
 			break;
+		}
 		else if (FD_ISSET(fd, &writefds)) {
 			ret = write(fd, message + offset, len - offset);
 			if (ret <= 0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 19:11:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 19:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQjNN-0001Ks-LA; Fri, 12 Apr 2013 19:11:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNM-0001Km-Na
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:09 +0000
Received: from [85.158.137.99:44740] by server-9.bemta-3.messagelabs.com id
	84/4D-32531-B4C58615; Fri, 12 Apr 2013 19:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1365793865!14013502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12593 invoked from network); 12 Apr 2013 19:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 19:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNH-0003NF-H5
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNH-0001Rq-9Z
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:03 +0000
Date: Fri, 12 Apr 2013 19:11:03 +0000
Message-Id: <E1UQjNH-0001Rq-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: regenerate libxlu cfg parser
	after 9e14c516b6cb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf38606aad623cdb4de4de81e86d44f514fa0c8e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 08:55:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 08:55:18 2013 +0100

    libxl: regenerate libxlu cfg parser after 9e14c516b6cb
    
    Fixup whitespace alignment while I'm there.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxlu_cfg_l.c |   58 ++++++++++++++++++++++----------------------
 tools/libxl/libxlu_cfg_l.l |    2 +-
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_l.c b/tools/libxl/libxlu_cfg_l.c
index e906ff9..df352aa 100644
--- a/tools/libxl/libxlu_cfg_l.c
+++ b/tools/libxl/libxlu_cfg_l.c
@@ -393,16 +393,16 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    2,    1,    4,    5,    1,    1,    1,    6,    7,
-        7,    1,    7,    8,    7,    7,    1,    9,    9,    9,
-        9,    9,    9,    9,    9,    9,    9,    7,   10,    1,
-       11,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        7,    1,    7,    8,    7,    9,    1,   10,   10,   10,
+       10,   10,   10,   10,   10,   10,   10,    7,   11,    1,
+       12,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-       12,   13,   14,    1,   15,    1,   16,   16,   16,   16,
+       13,   14,   15,    1,   16,    1,   17,   17,   17,   17,
 
-       16,   16,   17,   17,   17,   17,   17,   17,   17,   17,
-       17,   17,   17,   17,   17,   17,   17,   17,   17,   16,
-       17,   17,    1,    1,    1,    1,    1,    1,    1,    1,
+       17,   17,   18,   18,   18,   18,   18,   18,   18,   18,
+       18,   18,   18,   18,   18,   18,   18,   18,   18,   17,
+       18,   18,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -419,18 +419,18 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static yyconst flex_int32_t yy_meta[18] =
+static yyconst flex_int32_t yy_meta[19] =
     {   0,
-        1,    2,    3,    1,    1,    1,    1,    1,    4,    1,
-        1,    1,    1,    1,    4,    4,    4
+        1,    2,    3,    1,    1,    1,    1,    1,    4,    4,
+        1,    1,    1,    1,    1,    4,    4,    4
     } ;
 
 static yyconst flex_int16_t yy_base[41] =
     {   0,
-        0,    0,   16,   18,   50,   56,   56,   56,   18,   39,
-       17,   56,   56,   16,   56,   56,   56,   56,    0,    0,
-       56,   56,   20,   56,    0,   26,   56,   21,   56,    0,
-       19,    0,    0,   56,   35,   39,   43,   47,   22,   51
+        0,    0,   17,   19,   44,   58,   58,   58,   19,   28,
+       18,   58,   58,   17,   58,   58,   58,   58,    0,    0,
+       58,   58,   21,   58,    0,   26,   58,   22,   58,    0,
+       20,    0,    0,   58,   37,   41,   45,   49,   22,   53
     } ;
 
 static yyconst flex_int16_t yy_def[41] =
@@ -441,28 +441,28 @@ static yyconst flex_int16_t yy_def[41] =
        34,   39,   40,    0,   34,   34,   34,   34,   34,   34
     } ;
 
-static yyconst flex_int16_t yy_nxt[74] =
+static yyconst flex_int16_t yy_nxt[77] =
     {   0,
-        6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
-       16,   17,    6,   18,    6,   19,   19,   21,   22,   21,
-       22,   24,   29,   24,   31,   32,   29,   31,   27,   30,
-       25,   31,   25,   30,   31,   20,   20,   20,   20,   23,
-       23,   27,   23,   26,   26,   26,   26,   28,   28,   34,
-       28,   33,   34,   34,   33,    5,   34,   34,   34,   34,
+        6,    7,    8,    9,   10,   11,   12,   13,   12,   14,
+       15,   16,   17,    6,   18,    6,   19,   19,   21,   22,
+       21,   22,   24,   29,   24,   32,   31,   29,   27,   31,
+       27,   30,   25,   31,   25,   30,   31,   20,   20,   20,
+       20,   23,   23,   34,   23,   26,   26,   26,   26,   28,
+       28,   34,   28,   33,   34,   34,   33,    5,   34,   34,
        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
-       34,   34,   34
+       34,   34,   34,   34,   34,   34
     } ;
 
-static yyconst flex_int16_t yy_chk[74] =
+static yyconst flex_int16_t yy_chk[77] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    3,    3,    4,
-        4,    9,   11,   23,   14,   39,   28,   31,   26,   11,
-        9,   14,   23,   28,   31,   35,   35,   35,   35,   36,
-       36,   10,   36,   37,   37,   37,   37,   38,   38,    5,
-       38,   40,    0,    0,   40,   34,   34,   34,   34,   34,
+        1,    1,    1,    1,    1,    1,    1,    1,    3,    3,
+        4,    4,    9,   11,   23,   39,   14,   28,   26,   31,
+       10,   11,    9,   14,   23,   28,   31,   35,   35,   35,
+       35,   36,   36,    5,   36,   37,   37,   37,   37,   38,
+       38,    0,   38,   40,    0,    0,   40,   34,   34,   34,
        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
-       34,   34,   34
+       34,   34,   34,   34,   34,   34
     } ;
 
 /* Table of booleans, true if rule could match eol. */
diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libxl/libxlu_cfg_l.l
index d5241e1..e0ea8cf 100644
--- a/tools/libxl/libxlu_cfg_l.l
+++ b/tools/libxl/libxlu_cfg_l.l
@@ -52,7 +52,7 @@ void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
 
 %%
 
-[a-z][._0-9a-z]*         {
+[a-z][._0-9a-z]*        {
                           yylval->string= xlu__cfgl_strdup(ctx,yytext);
                           GOT(IDENT);
                         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 19:11:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 19:11:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQjNN-0001Ks-LA; Fri, 12 Apr 2013 19:11:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNM-0001Km-Na
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:09 +0000
Received: from [85.158.137.99:44740] by server-9.bemta-3.messagelabs.com id
	84/4D-32531-B4C58615; Fri, 12 Apr 2013 19:11:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1365793865!14013502!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12593 invoked from network); 12 Apr 2013 19:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 19:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNH-0003NF-H5
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNH-0001Rq-9Z
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:03 +0000
Date: Fri, 12 Apr 2013 19:11:03 +0000
Message-Id: <E1UQjNH-0001Rq-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: regenerate libxlu cfg parser
	after 9e14c516b6cb
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cf38606aad623cdb4de4de81e86d44f514fa0c8e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 08:55:18 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 08:55:18 2013 +0100

    libxl: regenerate libxlu cfg parser after 9e14c516b6cb
    
    Fixup whitespace alignment while I'm there.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxlu_cfg_l.c |   58 ++++++++++++++++++++++----------------------
 tools/libxl/libxlu_cfg_l.l |    2 +-
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxlu_cfg_l.c b/tools/libxl/libxlu_cfg_l.c
index e906ff9..df352aa 100644
--- a/tools/libxl/libxlu_cfg_l.c
+++ b/tools/libxl/libxlu_cfg_l.c
@@ -393,16 +393,16 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    2,    1,    4,    5,    1,    1,    1,    6,    7,
-        7,    1,    7,    8,    7,    7,    1,    9,    9,    9,
-        9,    9,    9,    9,    9,    9,    9,    7,   10,    1,
-       11,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        7,    1,    7,    8,    7,    9,    1,   10,   10,   10,
+       10,   10,   10,   10,   10,   10,   10,    7,   11,    1,
+       12,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-       12,   13,   14,    1,   15,    1,   16,   16,   16,   16,
+       13,   14,   15,    1,   16,    1,   17,   17,   17,   17,
 
-       16,   16,   17,   17,   17,   17,   17,   17,   17,   17,
-       17,   17,   17,   17,   17,   17,   17,   17,   17,   16,
-       17,   17,    1,    1,    1,    1,    1,    1,    1,    1,
+       17,   17,   18,   18,   18,   18,   18,   18,   18,   18,
+       18,   18,   18,   18,   18,   18,   18,   18,   18,   17,
+       18,   18,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -419,18 +419,18 @@ static yyconst flex_int32_t yy_ec[256] =
         1,    1,    1,    1,    1
     } ;
 
-static yyconst flex_int32_t yy_meta[18] =
+static yyconst flex_int32_t yy_meta[19] =
     {   0,
-        1,    2,    3,    1,    1,    1,    1,    1,    4,    1,
-        1,    1,    1,    1,    4,    4,    4
+        1,    2,    3,    1,    1,    1,    1,    1,    4,    4,
+        1,    1,    1,    1,    1,    4,    4,    4
     } ;
 
 static yyconst flex_int16_t yy_base[41] =
     {   0,
-        0,    0,   16,   18,   50,   56,   56,   56,   18,   39,
-       17,   56,   56,   16,   56,   56,   56,   56,    0,    0,
-       56,   56,   20,   56,    0,   26,   56,   21,   56,    0,
-       19,    0,    0,   56,   35,   39,   43,   47,   22,   51
+        0,    0,   17,   19,   44,   58,   58,   58,   19,   28,
+       18,   58,   58,   17,   58,   58,   58,   58,    0,    0,
+       58,   58,   21,   58,    0,   26,   58,   22,   58,    0,
+       20,    0,    0,   58,   37,   41,   45,   49,   22,   53
     } ;
 
 static yyconst flex_int16_t yy_def[41] =
@@ -441,28 +441,28 @@ static yyconst flex_int16_t yy_def[41] =
        34,   39,   40,    0,   34,   34,   34,   34,   34,   34
     } ;
 
-static yyconst flex_int16_t yy_nxt[74] =
+static yyconst flex_int16_t yy_nxt[77] =
     {   0,
-        6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
-       16,   17,    6,   18,    6,   19,   19,   21,   22,   21,
-       22,   24,   29,   24,   31,   32,   29,   31,   27,   30,
-       25,   31,   25,   30,   31,   20,   20,   20,   20,   23,
-       23,   27,   23,   26,   26,   26,   26,   28,   28,   34,
-       28,   33,   34,   34,   33,    5,   34,   34,   34,   34,
+        6,    7,    8,    9,   10,   11,   12,   13,   12,   14,
+       15,   16,   17,    6,   18,    6,   19,   19,   21,   22,
+       21,   22,   24,   29,   24,   32,   31,   29,   27,   31,
+       27,   30,   25,   31,   25,   30,   31,   20,   20,   20,
+       20,   23,   23,   34,   23,   26,   26,   26,   26,   28,
+       28,   34,   28,   33,   34,   34,   33,    5,   34,   34,
        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
-       34,   34,   34
+       34,   34,   34,   34,   34,   34
     } ;
 
-static yyconst flex_int16_t yy_chk[74] =
+static yyconst flex_int16_t yy_chk[77] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    3,    3,    4,
-        4,    9,   11,   23,   14,   39,   28,   31,   26,   11,
-        9,   14,   23,   28,   31,   35,   35,   35,   35,   36,
-       36,   10,   36,   37,   37,   37,   37,   38,   38,    5,
-       38,   40,    0,    0,   40,   34,   34,   34,   34,   34,
+        1,    1,    1,    1,    1,    1,    1,    1,    3,    3,
+        4,    4,    9,   11,   23,   39,   14,   28,   26,   31,
+       10,   11,    9,   14,   23,   28,   31,   35,   35,   35,
+       35,   36,   36,    5,   36,   37,   37,   37,   37,   38,
+       38,    0,   38,   40,    0,    0,   40,   34,   34,   34,
        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
-       34,   34,   34
+       34,   34,   34,   34,   34,   34
     } ;
 
 /* Table of booleans, true if rule could match eol. */
diff --git a/tools/libxl/libxlu_cfg_l.l b/tools/libxl/libxlu_cfg_l.l
index d5241e1..e0ea8cf 100644
--- a/tools/libxl/libxlu_cfg_l.l
+++ b/tools/libxl/libxlu_cfg_l.l
@@ -52,7 +52,7 @@ void xlu__cfg_yyset_column(int  column_no, yyscan_t yyscanner);
 
 %%
 
-[a-z][._0-9a-z]*         {
+[a-z][._0-9a-z]*        {
                           yylval->string= xlu__cfgl_strdup(ctx,yytext);
                           GOT(IDENT);
                         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 12 19:11:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 19:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQjNX-0001LT-Nu; Fri, 12 Apr 2013 19:11:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNW-0001LN-UG
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:19 +0000
Received: from [85.158.143.99:12393] by server-2.bemta-4.messagelabs.com id
	AB/1E-12656-65C58615; Fri, 12 Apr 2013 19:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1365793875!18380298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6466 invoked from network); 12 Apr 2013 19:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 19:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNT-0003NI-Jw
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNT-0001SF-HO
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:15 +0000
Date: Fri, 12 Apr 2013 19:11:15 +0000
Message-Id: <E1UQjNT-0001SF-HO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools+stubdom: install under
	/usr/local by default.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3022961836661685130=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3022961836661685130==
Content-Type: text/plain

commit 13d68fab40051e82a40c01e968ca6167ecb92dbd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Feb 5 16:19:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 10:20:25 2013 +0100

    tools+stubdom: install under /usr/local by default.
    
    Now that the hotplug scripts have been fixed to remove hardcoded paths lets
    try this again. From 26470:acaf29203cf9:
    
    	This is the defacto (or FHS mandated?) standard location for software
    	built from source, in order to avoid clashing with packaged software
    	which is installed under /usr/bin etc.
    
    	I think there is benefit in having Xen's install behave more like the
    	majority of other OSS software out there.
    
    	The major downside here is in the transition from 4.2 to 4.3 where
    	people who have built from source will innevitably discover breakage
    	because 4.3 no longer overwrites stuff in /usr like it used to so they
    	pickup old stale bits from /usr instead of new stuff from /usr/local.
    
    	Packages will use ./configure --prefix=/usr or whatever helper macro
    	their package manager gives them. I have confirmed that doing this
    	results in the same list of installed files as before this patch was
    	applied.
    
    	The hypervisor remains in /boot/ and there is no intention to move it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 configure            |    2 --
 configure.ac         |    1 -
 docs/configure       |    2 --
 docs/configure.ac    |    1 -
 stubdom/configure    |    2 --
 stubdom/configure.ac |    1 -
 tools/configure      |    2 --
 tools/configure.ac   |    1 -
 8 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 06c0e99..d15b539 100755
--- a/configure
+++ b/configure
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="./xen/common/kernel.c"
-ac_default_prefix=/usr
 enable_option_checking=no
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
@@ -1684,7 +1683,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_config_files="$ac_config_files ./config/Toplevel.mk"
 
 
-
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/configure.ac b/configure.ac
index 83342f7..ce06dad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([./xen/common/kernel.c])
 AC_CONFIG_FILES([./config/Toplevel.mk])
-AC_PREFIX_DEFAULT([/usr])
 
 AC_CANONICAL_HOST
 
diff --git a/docs/configure b/docs/configure
index be4934d..d623d19 100755
--- a/docs/configure
+++ b/docs/configure
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="misc/xen-command-line.markdown"
-ac_default_prefix=/usr
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 MARKDOWN
@@ -1664,7 +1663,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_config_files="$ac_config_files ../config/Docs.mk"
 
-
 ac_aux_dir=
 for ac_dir in ../ "$srcdir"/../; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/docs/configure.ac b/docs/configure.ac
index 5c3f5e8..ea0552e 100644
--- a/docs/configure.ac
+++ b/docs/configure.ac
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Documentation], m4_esyscmd([../version.sh ../xen/Makefil
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([misc/xen-command-line.markdown])
 AC_CONFIG_FILES([../config/Docs.mk])
-AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([../])
 
 # M4 Macro includes
diff --git a/stubdom/configure b/stubdom/configure
index ab9219a..51ca676 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="../extras/mini-os/kernel.c"
-ac_default_prefix=/usr
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 STUBDOM_INSTALL
@@ -1792,7 +1791,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_config_files="$ac_config_files ../config/Stubdom.mk"
 
-
 ac_aux_dir=
 for ac_dir in ../ "$srcdir"/../; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 2b7b275..de29fb5 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh ../xen/Makefile
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([../extras/mini-os/kernel.c])
 AC_CONFIG_FILES([../config/Stubdom.mk])
-AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([../])
 
 # M4 Macro includes
diff --git a/tools/configure b/tools/configure
index 4cd46e0..7b8cef8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -558,7 +558,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="libxl/libxl.c"
-ac_default_prefix=/usr
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -2153,7 +2152,6 @@ ac_config_files="$ac_config_files ../config/Tools.mk"
 
 ac_config_headers="$ac_config_headers config.h"
 
-
 ac_aux_dir=
 for ac_dir in ../ "$srcdir"/../; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/tools/configure.ac b/tools/configure.ac
index c5eb2b1..4f5e688 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -7,7 +7,6 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
 AC_CONFIG_HEADERS([config.h])
-AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([../])
 
 # Check if CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is set and print a warning
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3022961836661685130==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3022961836661685130==--

From xen-changelog-bounces@lists.xen.org Fri Apr 12 19:11:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 12 Apr 2013 19:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQjNX-0001LT-Nu; Fri, 12 Apr 2013 19:11:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNW-0001LN-UG
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:19 +0000
Received: from [85.158.143.99:12393] by server-2.bemta-4.messagelabs.com id
	AB/1E-12656-65C58615; Fri, 12 Apr 2013 19:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1365793875!18380298!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6466 invoked from network); 12 Apr 2013 19:11:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Apr 2013 19:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNT-0003NI-Jw
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQjNT-0001SF-HO
	for xen-changelog@lists.xensource.com; Fri, 12 Apr 2013 19:11:15 +0000
Date: Fri, 12 Apr 2013 19:11:15 +0000
Message-Id: <E1UQjNT-0001SF-HO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools+stubdom: install under
	/usr/local by default.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3022961836661685130=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3022961836661685130==
Content-Type: text/plain

commit 13d68fab40051e82a40c01e968ca6167ecb92dbd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Feb 5 16:19:53 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 10:20:25 2013 +0100

    tools+stubdom: install under /usr/local by default.
    
    Now that the hotplug scripts have been fixed to remove hardcoded paths lets
    try this again. From 26470:acaf29203cf9:
    
    	This is the defacto (or FHS mandated?) standard location for software
    	built from source, in order to avoid clashing with packaged software
    	which is installed under /usr/bin etc.
    
    	I think there is benefit in having Xen's install behave more like the
    	majority of other OSS software out there.
    
    	The major downside here is in the transition from 4.2 to 4.3 where
    	people who have built from source will innevitably discover breakage
    	because 4.3 no longer overwrites stuff in /usr like it used to so they
    	pickup old stale bits from /usr instead of new stuff from /usr/local.
    
    	Packages will use ./configure --prefix=/usr or whatever helper macro
    	their package manager gives them. I have confirmed that doing this
    	results in the same list of installed files as before this patch was
    	applied.
    
    	The hypervisor remains in /boot/ and there is no intention to move it.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 configure            |    2 --
 configure.ac         |    1 -
 docs/configure       |    2 --
 docs/configure.ac    |    1 -
 stubdom/configure    |    2 --
 stubdom/configure.ac |    1 -
 tools/configure      |    2 --
 tools/configure.ac   |    1 -
 8 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 06c0e99..d15b539 100755
--- a/configure
+++ b/configure
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="./xen/common/kernel.c"
-ac_default_prefix=/usr
 enable_option_checking=no
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
@@ -1684,7 +1683,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 ac_config_files="$ac_config_files ./config/Toplevel.mk"
 
 
-
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/configure.ac b/configure.ac
index 83342f7..ce06dad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([./xen/common/kernel.c])
 AC_CONFIG_FILES([./config/Toplevel.mk])
-AC_PREFIX_DEFAULT([/usr])
 
 AC_CANONICAL_HOST
 
diff --git a/docs/configure b/docs/configure
index be4934d..d623d19 100755
--- a/docs/configure
+++ b/docs/configure
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="misc/xen-command-line.markdown"
-ac_default_prefix=/usr
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 MARKDOWN
@@ -1664,7 +1663,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_config_files="$ac_config_files ../config/Docs.mk"
 
-
 ac_aux_dir=
 for ac_dir in ../ "$srcdir"/../; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/docs/configure.ac b/docs/configure.ac
index 5c3f5e8..ea0552e 100644
--- a/docs/configure.ac
+++ b/docs/configure.ac
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Documentation], m4_esyscmd([../version.sh ../xen/Makefil
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([misc/xen-command-line.markdown])
 AC_CONFIG_FILES([../config/Docs.mk])
-AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([../])
 
 # M4 Macro includes
diff --git a/stubdom/configure b/stubdom/configure
index ab9219a..51ca676 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -557,7 +557,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="../extras/mini-os/kernel.c"
-ac_default_prefix=/usr
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 STUBDOM_INSTALL
@@ -1792,7 +1791,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_config_files="$ac_config_files ../config/Stubdom.mk"
 
-
 ac_aux_dir=
 for ac_dir in ../ "$srcdir"/../; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 2b7b275..de29fb5 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -6,7 +6,6 @@ AC_INIT([Xen Hypervisor Stub Domains], m4_esyscmd([../version.sh ../xen/Makefile
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([../extras/mini-os/kernel.c])
 AC_CONFIG_FILES([../config/Stubdom.mk])
-AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([../])
 
 # M4 Macro includes
diff --git a/tools/configure b/tools/configure
index 4cd46e0..7b8cef8 100755
--- a/tools/configure
+++ b/tools/configure
@@ -558,7 +558,6 @@ PACKAGE_BUGREPORT='xen-devel@lists.xen.org'
 PACKAGE_URL='http://www.xen.org/'
 
 ac_unique_file="libxl/libxl.c"
-ac_default_prefix=/usr
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -2153,7 +2152,6 @@ ac_config_files="$ac_config_files ../config/Tools.mk"
 
 ac_config_headers="$ac_config_headers config.h"
 
-
 ac_aux_dir=
 for ac_dir in ../ "$srcdir"/../; do
   if test -f "$ac_dir/install-sh"; then
diff --git a/tools/configure.ac b/tools/configure.ac
index c5eb2b1..4f5e688 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -7,7 +7,6 @@ AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
 AC_CONFIG_HEADERS([config.h])
-AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([../])
 
 # Check if CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is set and print a warning
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3022961836661685130==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3022961836661685130==--

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgQ-00060i-8S; Sat, 13 Apr 2013 01:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgP-00060d-4q
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:13 +0000
Received: from [85.158.139.83:23725] by server-1.bemta-5.messagelabs.com id
	9D/8F-14063-00BB8615; Sat, 13 Apr 2013 01:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1365818110!28047171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23589 invoked from network); 13 Apr 2013 01:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgG-0006DF-4R
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgF-0002fo-JJ
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:03 +0000
Date: Sat, 13 Apr 2013 01:55:03 +0000
Message-Id: <E1UQpgF-0002fo-JJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: beautify json with YAJL2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c1f0b214536773630cd5f16bf3d275015373555b
Author:     M A Young <m.a.young@durham.ac.uk>
AuthorDate: Fri Apr 12 00:02:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 12:21:02 2013 +0100

    libxl: beautify json with YAJL2
    
    xl list -l should produce readable output when built with yajl2 so
    it is compatible with the xendomains script.
    
    Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_json.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index 1464459..a4dd8fc 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -54,7 +54,11 @@ static inline yajl_handle libxl__yajl_alloc(const yajl_callbacks *callbacks,
 
 static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
-    return yajl_gen_alloc(allocFuncs);
+    yajl_gen g;
+    g = yajl_gen_alloc(allocFuncs);
+    if (g)
+        yajl_gen_config(g, yajl_gen_beautify, 1);
+    return g;
 }
 
 #else /* !HAVE_YAJL_V2 */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgQ-00060i-8S; Sat, 13 Apr 2013 01:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgP-00060d-4q
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:13 +0000
Received: from [85.158.139.83:23725] by server-1.bemta-5.messagelabs.com id
	9D/8F-14063-00BB8615; Sat, 13 Apr 2013 01:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1365818110!28047171!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23589 invoked from network); 13 Apr 2013 01:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgG-0006DF-4R
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgF-0002fo-JJ
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:03 +0000
Date: Sat, 13 Apr 2013 01:55:03 +0000
Message-Id: <E1UQpgF-0002fo-JJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: beautify json with YAJL2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c1f0b214536773630cd5f16bf3d275015373555b
Author:     M A Young <m.a.young@durham.ac.uk>
AuthorDate: Fri Apr 12 00:02:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 12:21:02 2013 +0100

    libxl: beautify json with YAJL2
    
    xl list -l should produce readable output when built with yajl2 so
    it is compatible with the xendomains script.
    
    Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_json.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index 1464459..a4dd8fc 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -54,7 +54,11 @@ static inline yajl_handle libxl__yajl_alloc(const yajl_callbacks *callbacks,
 
 static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
-    return yajl_gen_alloc(allocFuncs);
+    yajl_gen g;
+    g = yajl_gen_alloc(allocFuncs);
+    if (g)
+        yajl_gen_config(g, yajl_gen_beautify, 1);
+    return g;
 }
 
 #else /* !HAVE_YAJL_V2 */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgd-00061O-BS; Sat, 13 Apr 2013 01:55:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgb-00061B-83
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:25 +0000
Received: from [85.158.138.51:42253] by server-2.bemta-3.messagelabs.com id
	B7/46-05208-C0BB8615; Sat, 13 Apr 2013 01:55:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1365818120!27806794!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5503 invoked from network); 13 Apr 2013 01:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgW-0006DI-AY
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgW-0002gC-1j
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:20 +0000
Date: Sat, 13 Apr 2013 01:55:20 +0000
Message-Id: <E1UQpgW-0002gC-1j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpm{back,
	front}: Change shared page ABI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f494d9f3c37542435239236085be25c820912304
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Apr 11 12:20:25 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpm{back, front}: Change shared page ABI
    
    This changes the vTPM shared page ABI from a copy of the Xen network
    interface to a single-page interface that better reflects the expected
    behavior of a TPM: only a single request packet can be sent at any given
    time, and every packet sent generates a single response packet. This
    protocol change should also increase efficiency as it avoids mapping and
    unmapping grants when possible. The vtpm xenbus device now requires a
    feature-protocol-v2 node in xenstore to avoid conflicts with existing
    (xen-patched) kernels supporting the old interface.
    
    While the contents of the shared page have been defined to allow packets
    larger than a single page (actually 4088 bytes) by allowing the client
    to add extra grant references, the mapping of these extra references has
    not been implemented; a feature node in xenstore may be used in the
    future to indicate full support for the multi-page protocol. Most uses
    of the TPM should not require this feature.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Cc: Jan Beulich <JBeulich@suse.com>
---
 extras/mini-os/include/tpmback.h  |    1 +
 extras/mini-os/include/tpmfront.h |    7 +-
 extras/mini-os/tpmback.c          |  166 ++++++++++++++++++------------------
 extras/mini-os/tpmfront.c         |  144 +++++++++++++++++---------------
 xen/include/public/io/tpmif.h     |   66 +++++++++++++++
 5 files changed, 232 insertions(+), 152 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..d68ad2b 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
    unsigned int i, j;
    tpmif_t* tmp;
    char* err;
+   char path[512];
 
    local_irq_save(flags);
 
@@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
 
    local_irq_restore(flags);
 
+   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsigned int) tpmif->domid, tpmif->handle);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      /* if we got an error here we should carefully remove the interface and then return */
+      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+      free(err);
+      remove_tpmif(tpmif);
+      goto error_post_irq;
+   }
+
    /*Listen for state changes on the new interface */
    if((err = xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path, &gtpmdev.events)))
    {
@@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
       remove_tpmif(tpmif);
       goto error_post_irq;
    }
-
    return 0;
 error:
    local_irq_restore(flags);
@@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,15 +526,28 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
-      return;
-
-   TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
-   tpmif_req_ready(tpmif);
-   wake_up(&waitq);
+   vtpm_shared_page_t* pg = tpmif->page;
 
+   switch (pg->state)
+   {
+   case VTPM_STATE_SUBMIT:
+      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+      tpmif_req_ready(tpmif);
+      wake_up(&waitq);
+      break;
+   case VTPM_STATE_CANCEL:
+      /* If we are busy with a request, do nothing */
+      if (tpmif->flags & TPMIF_REQ_READY)
+         return;
+      /* Acknowledge the cancellation if we are idle */
+      pg->state = VTPM_STATE_IDLE;
+      wmb();
+      notify_remote_via_evtchn(tpmif->evtchn);
+      return;
+   default:
+      /* Spurious wakeup; do nothing */
+      return;
+   }
 }
 
 /* Connect to frontend */
@@ -584,12 +594,25 @@ int connect_fe(tpmif_t* tpmif)
    }
    free(value);
 
+   /* Check that protocol v2 is being used */
+   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Unable to read %s during tpmback initialization! error = %s\n", path, err);
+      free(err);
+      return -1;
+   }
+   if(strcmp(value, "1")) {
+      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      return -1;
+   }
+   free(value);
+
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,7 +641,7 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
@@ -633,9 +656,9 @@ static int frontend_changed(tpmif_t* tpmif)
 
    switch (state) {
       case XenbusStateInitialising:
-      case XenbusStateInitialised:
 	 break;
 
+      case XenbusStateInitialised:
       case XenbusStateConnected:
 	 if(connect_fe(tpmif)) {
 	    TPMBACK_ERR("Failed to connect to front end %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -874,6 +897,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +908,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+   int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +923,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +969,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +1000,9 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   barrier();
+   shr->state = VTPM_STATE_FINISH;
+   wmb();
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..9f930b5 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -47,11 +47,21 @@
 
 void tpmfront_handler(evtchn_port_t port, struct pt_regs *regs, void *data) {
    struct tpmfront_dev* dev = (struct tpmfront_dev*) data;
+   vtpm_shared_page_t* shr = dev->page;
    /*If we get a response when we didnt make a request, just ignore it */
    if(!dev->waiting) {
       return;
    }
 
+   switch (shr->state) {
+   case VTPM_STATE_FINISH: /* request was completed */
+   case VTPM_STATE_IDLE:   /* request was cancelled */
+      break;
+   default:
+      /* Spurious wakeup; do nothing, request is still pending */
+      return;
+   }
+
    dev->waiting = 0;
 #ifdef HAVE_LIBC
    if(dev->fd >= 0) {
@@ -176,7 +186,7 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
       default:
-	 break;
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +200,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +238,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +250,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -279,6 +288,15 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
+   /* Publish protocol v2 feature */
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+      free(err);
+      goto error;
+   }
+
    /* Create and publish grant reference and event channel */
    if (tpmfront_connect(dev)) {
       goto error;
@@ -289,18 +307,19 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
+   /* Ensure backend is also using protocol v2 */
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
       goto error;
    }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
+   if(strcmp(value, "1")) {
+      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      goto error;
    }
+   free(value);
 
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
@@ -314,8 +333,6 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
@@ -349,27 +366,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +389,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
    int i;
-   tpmif_tx_request_t* tx = NULL;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +413,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = VTPM_STATE_SUBMIT;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -429,49 +432,50 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
       files[dev->fd].tpmfront.offset = 0;
    }
 #endif
+   wmb();
    notify_remote_via_evtchn(dev->evtchn);
    return 0;
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
 
    /* Initialize */
    *msg = NULL;
    *length = 0;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (shr->state != VTPM_STATE_FINISH)
+      goto quit;
+
+   *length = shr->length;
+
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +508,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index fca2c4e..dcc5e57 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -64,6 +64,72 @@ struct tpmif_tx_interface {
 };
 typedef struct tpmif_tx_interface tpmif_tx_interface_t;
 
+/******************************************************************************
+ * TPM I/O interface for Xen guest OSes, v2
+ *
+ * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
+ *
+ * This protocol emulates the request/response behavior of a TPM using a Xen
+ * shared memory interface. All interaction with the TPM is at the direction
+ * of the frontend, since a TPM (hardware or virtual) is a passive device -
+ * the backend only processes commands as requested by the frontend.
+ *
+ * The frontend sends a request to the TPM by populating the shared page with
+ * the request packet, changing the state to VTPM_STATE_SUBMIT, and sending
+ * and event channel notification. When the backend is finished, it will set
+ * the state to VTPM_STATE_FINISH and send an event channel notification.
+ *
+ * In order to allow long-running commands to be canceled, the frontend can
+ * at any time change the state to VTPM_STATE_CANCEL and send a notification.
+ * The TPM can either finish the command (changing state to VTPM_STATE_FINISH)
+ * or can cancel the command and change the state to VTPM_STATE_IDLE. The TPM
+ * can also change the state to VTPM_STATE_IDLE instead of VTPM_STATE_FINISH
+ * if another reason for cancellation is required - for example, a physical
+ * TPM may cancel a command if the interface is seized by another locality.
+ *
+ * The TPM command format is defined by the TCG, and is available at
+ * http://www.trustedcomputinggroup.org/resources/tpm_main_specification
+ */
+
+enum vtpm_state {
+    VTPM_STATE_IDLE,         /* no contents / vTPM idle / cancel complete */
+    VTPM_STATE_SUBMIT,       /* request ready / vTPM working */
+    VTPM_STATE_FINISH,       /* response ready / vTPM idle */
+    VTPM_STATE_CANCEL,       /* cancel requested / vTPM working */
+};
+/* Note: The backend should only change state to IDLE or FINISH, while the
+ * frontend should only change to SUBMIT or CANCEL. Status changes do not need
+ * to use atomic operations.
+ */
+
+
+/* The shared page for vTPM request/response packets looks like:
+ *
+ *  Offset               Contents
+ *  =================================================
+ *  0                    struct vtpm_shared_page
+ *  16                   [optional] List of grant IDs
+ *  16+4*nr_extra_pages  TPM packet data
+ *
+ * If the TPM packet data extends beyond the end of a single page, the grant IDs
+ * defined in extra_pages are used as if they were mapped immediately following
+ * the primary shared page. The grants are allocated by the frontend and mapped
+ * by the backend. Before sending a request spanning multiple pages, the
+ * frontend should verify that the TPM supports such large requests by querying
+ * the TPM_CAP_PROP_INPUT_BUFFER property from the TPM.
+ */
+struct vtpm_shared_page {
+    uint32_t length;         /* request/response length in bytes */
+
+    uint8_t state;           /* enum vtpm_state */
+    uint8_t locality;        /* for the current request */
+    uint8_t pad;             /* should be zero */
+
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
+};
+typedef struct vtpm_shared_page vtpm_shared_page_t;
+
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:33 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgd-00061O-BS; Sat, 13 Apr 2013 01:55:27 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgb-00061B-83
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:25 +0000
Received: from [85.158.138.51:42253] by server-2.bemta-3.messagelabs.com id
	B7/46-05208-C0BB8615; Sat, 13 Apr 2013 01:55:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1365818120!27806794!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5503 invoked from network); 13 Apr 2013 01:55:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgW-0006DI-AY
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgW-0002gC-1j
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:20 +0000
Date: Sat, 13 Apr 2013 01:55:20 +0000
Message-Id: <E1UQpgW-0002gC-1j@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpm{back,
	front}: Change shared page ABI
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f494d9f3c37542435239236085be25c820912304
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Apr 11 12:20:25 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpm{back, front}: Change shared page ABI
    
    This changes the vTPM shared page ABI from a copy of the Xen network
    interface to a single-page interface that better reflects the expected
    behavior of a TPM: only a single request packet can be sent at any given
    time, and every packet sent generates a single response packet. This
    protocol change should also increase efficiency as it avoids mapping and
    unmapping grants when possible. The vtpm xenbus device now requires a
    feature-protocol-v2 node in xenstore to avoid conflicts with existing
    (xen-patched) kernels supporting the old interface.
    
    While the contents of the shared page have been defined to allow packets
    larger than a single page (actually 4088 bytes) by allowing the client
    to add extra grant references, the mapping of these extra references has
    not been implemented; a feature node in xenstore may be used in the
    future to indicate full support for the multi-page protocol. Most uses
    of the TPM should not require this feature.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Cc: Jan Beulich <JBeulich@suse.com>
---
 extras/mini-os/include/tpmback.h  |    1 +
 extras/mini-os/include/tpmfront.h |    7 +-
 extras/mini-os/tpmback.c          |  166 ++++++++++++++++++------------------
 extras/mini-os/tpmfront.c         |  144 +++++++++++++++++---------------
 xen/include/public/io/tpmif.h     |   66 +++++++++++++++
 5 files changed, 232 insertions(+), 152 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ff86732..ec9eda4 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -43,6 +43,7 @@
 
 struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
+   uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
    unsigned char uuid[16];			/* uuid of the tpm interface */
 
diff --git a/extras/mini-os/include/tpmfront.h b/extras/mini-os/include/tpmfront.h
index fd2cb17..a0c7c4d 100644
--- a/extras/mini-os/include/tpmfront.h
+++ b/extras/mini-os/include/tpmfront.h
@@ -37,9 +37,7 @@ struct tpmfront_dev {
    grant_ref_t ring_ref;
    evtchn_port_t evtchn;
 
-   tpmif_tx_interface_t* tx;
-
-   void** pages;
+   vtpm_shared_page_t *page;
 
    domid_t bedomid;
    char* nodename;
@@ -77,6 +75,9 @@ void shutdown_tpmfront(struct tpmfront_dev* dev);
  * */
 int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t** resp, size_t* resplen);
 
+/* Set the locality used for communicating with a vTPM */
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality);
+
 #ifdef HAVE_LIBC
 #include <sys/stat.h>
 /* POSIX IO functions:
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 658fed1..d68ad2b 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -86,10 +86,7 @@ struct tpmif {
    evtchn_port_t evtchn;
 
    /* Shared page */
-   tpmif_tx_interface_t* tx;
-
-   /* pointer to TPMIF_RX_RING_SIZE pages */
-   void** pages;
+   vtpm_shared_page_t *page;
 
    enum xenbus_state state;
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
@@ -266,6 +263,7 @@ int insert_tpmif(tpmif_t* tpmif)
    unsigned int i, j;
    tpmif_t* tmp;
    char* err;
+   char path[512];
 
    local_irq_save(flags);
 
@@ -303,6 +301,16 @@ int insert_tpmif(tpmif_t* tpmif)
 
    local_irq_restore(flags);
 
+   snprintf(path, 512, "backend/vtpm/%u/%u/feature-protocol-v2", (unsigned int) tpmif->domid, tpmif->handle);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      /* if we got an error here we should carefully remove the interface and then return */
+      TPMBACK_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+      free(err);
+      remove_tpmif(tpmif);
+      goto error_post_irq;
+   }
+
    /*Listen for state changes on the new interface */
    if((err = xenbus_watch_path_token(XBT_NIL, tpmif->fe_state_path, tpmif->fe_state_path, &gtpmdev.events)))
    {
@@ -312,7 +320,6 @@ int insert_tpmif(tpmif_t* tpmif)
       remove_tpmif(tpmif);
       goto error_post_irq;
    }
-
    return 0;
 error:
    local_irq_restore(flags);
@@ -386,8 +393,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->fe_state_path = NULL;
    tpmif->state = XenbusStateInitialising;
    tpmif->status = DISCONNECTED;
-   tpmif->tx = NULL;
-   tpmif->pages = NULL;
+   tpmif->page = NULL;
    tpmif->flags = 0;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
@@ -395,9 +401,6 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
 
 void __free_tpmif(tpmif_t* tpmif)
 {
-   if(tpmif->pages) {
-      free(tpmif->pages);
-   }
    if(tpmif->fe_path) {
       free(tpmif->fe_path);
    }
@@ -430,12 +433,6 @@ tpmif_t* new_tpmif(domid_t domid, unsigned int handle)
       goto error;
    }
 
-   /* allocate pages to be used for shared mapping */
-   if((tpmif->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE)) == NULL) {
-      goto error;
-   }
-   memset(tpmif->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-
    if(tpmif_change_state(tpmif, XenbusStateInitWait)) {
       goto error;
    }
@@ -486,7 +483,7 @@ void free_tpmif(tpmif_t* tpmif)
       tpmif->status = DISCONNECTING;
       mask_evtchn(tpmif->evtchn);
 
-      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1)) {
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
 	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
       }
 
@@ -529,15 +526,28 @@ void free_tpmif(tpmif_t* tpmif)
 void tpmback_handler(evtchn_port_t port, struct pt_regs *regs, void *data)
 {
    tpmif_t* tpmif = (tpmif_t*) data;
-   tpmif_tx_request_t* tx = &tpmif->tx->ring[0].req;
-   /* Throw away 0 size events, these can trigger from event channel unmasking */
-   if(tx->size == 0)
-      return;
-
-   TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
-   tpmif_req_ready(tpmif);
-   wake_up(&waitq);
+   vtpm_shared_page_t* pg = tpmif->page;
 
+   switch (pg->state)
+   {
+   case VTPM_STATE_SUBMIT:
+      TPMBACK_DEBUG("EVENT CHANNEL FIRE %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
+      tpmif_req_ready(tpmif);
+      wake_up(&waitq);
+      break;
+   case VTPM_STATE_CANCEL:
+      /* If we are busy with a request, do nothing */
+      if (tpmif->flags & TPMIF_REQ_READY)
+         return;
+      /* Acknowledge the cancellation if we are idle */
+      pg->state = VTPM_STATE_IDLE;
+      wmb();
+      notify_remote_via_evtchn(tpmif->evtchn);
+      return;
+   default:
+      /* Spurious wakeup; do nothing */
+      return;
+   }
 }
 
 /* Connect to frontend */
@@ -584,12 +594,25 @@ int connect_fe(tpmif_t* tpmif)
    }
    free(value);
 
+   /* Check that protocol v2 is being used */
+   snprintf(path, 512, "%s/feature-protocol-v2", tpmif->fe_path);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMBACK_ERR("Unable to read %s during tpmback initialization! error = %s\n", path, err);
+      free(err);
+      return -1;
+   }
+   if(strcmp(value, "1")) {
+      TPMBACK_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      return -1;
+   }
+   free(value);
+
    domid = tpmif->domid;
-   if((tpmif->tx = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
+   if((tpmif->page = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &ringref, PROT_READ | PROT_WRITE)) == NULL) {
       TPMBACK_ERR("Failed to map grant reference %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
       return -1;
    }
-   memset(tpmif->tx, 0, PAGE_SIZE);
 
    /*Bind the event channel */
    if((evtchn_bind_interdomain(tpmif->domid, evtchn, tpmback_handler, tpmif, &tpmif->evtchn)))
@@ -618,7 +641,7 @@ error_post_evtchn:
    mask_evtchn(tpmif->evtchn);
    unbind_evtchn(tpmif->evtchn);
 error_post_map:
-   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->tx, 1);
+   gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1);
    return -1;
 }
 
@@ -633,9 +656,9 @@ static int frontend_changed(tpmif_t* tpmif)
 
    switch (state) {
       case XenbusStateInitialising:
-      case XenbusStateInitialised:
 	 break;
 
+      case XenbusStateInitialised:
       case XenbusStateConnected:
 	 if(connect_fe(tpmif)) {
 	    TPMBACK_ERR("Failed to connect to front end %u/%u\n", (unsigned int) tpmif->domid, tpmif->handle);
@@ -874,6 +897,7 @@ void shutdown_tpmback(void)
 inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
 {
    tpmcmd->domid = domid;
+   tpmcmd->locality = -1;
    tpmcmd->handle = handle;
    memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
    tpmcmd->req = NULL;
@@ -884,12 +908,12 @@ inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, un
 
 tpmcmd_t* get_request(tpmif_t* tpmif) {
    tpmcmd_t* cmd;
-   tpmif_tx_request_t* tx;
-   int offset;
-   int tocopy;
-   int i;
-   uint32_t domid;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+   int i;
+#endif
 
    local_irq_save(flags);
 
@@ -899,35 +923,22 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    }
    init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
 
-   tx = &tpmif->tx->ring[0].req;
-   cmd->req_len = tx->size;
+   shr = tpmif->page;
+   cmd->req_len = shr->length;
+   cmd->locality = shr->locality;
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->req_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
+   }
    /* Allocate the buffer */
    if(cmd->req_len) {
       if((cmd->req = malloc(cmd->req_len)) == NULL) {
 	 goto error;
       }
    }
-   /* Copy the bits from the shared pages */
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->req_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_READ)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during read!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->req_len - offset, PAGE_SIZE);
-      memcpy(&cmd->req[offset], tpmif->pages[i], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
-
-   }
+   /* Copy the bits from the shared page(s) */
+   memcpy(cmd->req, offset + (uint8_t*)shr, cmd->req_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Received Tpm Command from %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->req_len);
@@ -958,38 +969,24 @@ error:
 
 void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 {
-   tpmif_tx_request_t* tx;
-   int offset;
-   int i;
-   uint32_t domid;
-   int tocopy;
+   vtpm_shared_page_t* shr;
+   unsigned int offset;
    int flags;
+#ifdef TPMBACK_PRINT_DEBUG
+int i;
+#endif
 
    local_irq_save(flags);
 
-   tx = &tpmif->tx->ring[0].req;
-   tx->size = cmd->resp_len;
-
-   offset = 0;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && offset < cmd->resp_len; ++i) {
-      tx = &tpmif->tx->ring[i].req;
-
-      /* Map the page with the data */
-      domid = (uint32_t)tpmif->domid;
-      if((tpmif->pages[i] = gntmap_map_grant_refs(&gtpmdev.map, 1, &domid, 0, &tx->ref, PROT_WRITE)) == NULL) {
-	 TPMBACK_ERR("%u/%u Unable to map shared page during write!\n", (unsigned int) tpmif->domid, tpmif->handle);
-	 goto error;
-      }
-
-      /* do the copy now */
-      tocopy = min(cmd->resp_len - offset, PAGE_SIZE);
-      memcpy(tpmif->pages[i], &cmd->resp[offset], tocopy);
-      offset += tocopy;
-
-      /* release the page */
-      gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->pages[i], 1);
+   shr = tpmif->page;
+   shr->length = cmd->resp_len;
 
+   offset = sizeof(*shr) + 4*shr->nr_extra_pages;
+   if (offset > PAGE_SIZE || offset + cmd->resp_len > PAGE_SIZE) {
+      TPMBACK_ERR("%u/%u Command size too long for shared page!\n", (unsigned int) tpmif->domid, tpmif->handle);
+      goto error;
    }
+   memcpy(offset + (uint8_t*)shr, cmd->resp, cmd->resp_len);
 
 #ifdef TPMBACK_PRINT_DEBUG
    TPMBACK_DEBUG("Sent response to %u/%u of size %u", (unsigned int) tpmif->domid, tpmif->handle, cmd->resp_len);
@@ -1003,6 +1000,9 @@ void send_response(tpmcmd_t* cmd, tpmif_t* tpmif)
 #endif
    /* clear the ready flag and send the event channel notice to the frontend */
    tpmif_req_finished(tpmif);
+   barrier();
+   shr->state = VTPM_STATE_FINISH;
+   wmb();
    notify_remote_via_evtchn(tpmif->evtchn);
 error:
    local_irq_restore(flags);
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 0218d7f..9f930b5 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -47,11 +47,21 @@
 
 void tpmfront_handler(evtchn_port_t port, struct pt_regs *regs, void *data) {
    struct tpmfront_dev* dev = (struct tpmfront_dev*) data;
+   vtpm_shared_page_t* shr = dev->page;
    /*If we get a response when we didnt make a request, just ignore it */
    if(!dev->waiting) {
       return;
    }
 
+   switch (shr->state) {
+   case VTPM_STATE_FINISH: /* request was completed */
+   case VTPM_STATE_IDLE:   /* request was cancelled */
+      break;
+   default:
+      /* Spurious wakeup; do nothing, request is still pending */
+      return;
+   }
+
    dev->waiting = 0;
 #ifdef HAVE_LIBC
    if(dev->fd >= 0) {
@@ -176,7 +186,7 @@ static int wait_for_backend_state_changed(struct tpmfront_dev* dev, XenbusState
 	 ret = wait_for_backend_closed(&events, path);
 	 break;
       default:
-	 break;
+         TPMFRONT_ERR("Bad wait state %d, ignoring\n", state);
    }
 
    if((err = xenbus_unwatch_path_token(XBT_NIL, path, path))) {
@@ -190,13 +200,13 @@ static int tpmfront_connect(struct tpmfront_dev* dev)
 {
    char* err;
    /* Create shared page */
-   dev->tx = (tpmif_tx_interface_t*) alloc_page();
-   if(dev->tx == NULL) {
+   dev->page = (vtpm_shared_page_t*) alloc_page();
+   if(dev->page == NULL) {
       TPMFRONT_ERR("Unable to allocate page for shared memory\n");
       goto error;
    }
-   memset(dev->tx, 0, PAGE_SIZE);
-   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->tx), 0);
+   memset(dev->page, 0, PAGE_SIZE);
+   dev->ring_ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->page), 0);
    TPMFRONT_DEBUG("grant ref is %lu\n", (unsigned long) dev->ring_ref);
 
    /*Create event channel */
@@ -228,7 +238,7 @@ error_postevtchn:
       unbind_evtchn(dev->evtchn);
 error_postmap:
       gnttab_end_access(dev->ring_ref);
-      free_page(dev->tx);
+      free_page(dev->page);
 error:
    return -1;
 }
@@ -240,7 +250,6 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
    char path[512];
    char* value, *err;
    unsigned long long ival;
-   int i;
 
    printk("============= Init TPM Front ================\n");
 
@@ -279,6 +288,15 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
+   /* Publish protocol v2 feature */
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->nodename);
+   if ((err = xenbus_write(XBT_NIL, path, "1")))
+   {
+      TPMFRONT_ERR("Unable to write feature-protocol-v2 node: %s\n", err);
+      free(err);
+      goto error;
+   }
+
    /* Create and publish grant reference and event channel */
    if (tpmfront_connect(dev)) {
       goto error;
@@ -289,18 +307,19 @@ struct tpmfront_dev* init_tpmfront(const char* _nodename)
       goto error;
    }
 
-   /* Allocate pages that will contain the messages */
-   dev->pages = malloc(sizeof(void*) * TPMIF_TX_RING_SIZE);
-   if(dev->pages == NULL) {
+   /* Ensure backend is also using protocol v2 */
+   snprintf(path, 512, "%s/feature-protocol-v2", dev->bepath);
+   if((err = xenbus_read(XBT_NIL, path, &value))) {
+      TPMFRONT_ERR("Unable to read %s during tpmfront initialization! error = %s\n", path, err);
+      free(err);
       goto error;
    }
-   memset(dev->pages, 0, sizeof(void*) * TPMIF_TX_RING_SIZE);
-   for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-      dev->pages[i] = (void*)alloc_page();
-      if(dev->pages[i] == NULL) {
-	 goto error;
-      }
+   if(strcmp(value, "1")) {
+      TPMFRONT_ERR("%s has an invalid value (%s)\n", path, value);
+      free(value);
+      goto error;
    }
+   free(value);
 
    TPMFRONT_LOG("Initialization Completed successfully\n");
 
@@ -314,8 +333,6 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 {
    char* err;
    char path[512];
-   int i;
-   tpmif_tx_request_t* tx;
    if(dev == NULL) {
       return;
    }
@@ -349,27 +366,12 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
-      /* Cleanup any shared pages */
-      if(dev->pages) {
-	 for(i = 0; i < TPMIF_TX_RING_SIZE; ++i) {
-	    if(dev->pages[i]) {
-	       tx = &dev->tx->ring[i].req;
-	       if(tx->ref != 0) {
-		  gnttab_end_access(tx->ref);
-	       }
-	       free_page(dev->pages[i]);
-	    }
-	 }
-	 free(dev->pages);
-      }
-
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
       gnttab_end_access(dev->ring_ref);
 
-      free_page(dev->tx);
-
+      free_page(dev->page);
    }
 
    /* Cleanup memory usage */
@@ -387,13 +389,17 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
 
 int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 {
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
    int i;
-   tpmif_tx_request_t* tx = NULL;
+#endif
    /* Error Checking */
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to send message through disconnected frontend\n");
       return -1;
    }
+   shr = dev->page;
 
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Sending Msg to backend size=%u", (unsigned int) length);
@@ -407,19 +413,16 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
 #endif
 
    /* Copy to shared pages now */
-   for(i = 0; length > 0 && i < TPMIF_TX_RING_SIZE; ++i) {
-      /* Share the page */
-      tx = &dev->tx->ring[i].req;
-      tx->unused = 0;
-      tx->addr = virt_to_mach(dev->pages[i]);
-      tx->ref = gnttab_grant_access(dev->bedomid, virt_to_mfn(dev->pages[i]), 0);
-      /* Copy the bits to the page */
-      tx->size = length > PAGE_SIZE ? PAGE_SIZE : length;
-      memcpy(dev->pages[i], &msg[i * PAGE_SIZE], tx->size);
-
-      /* Update counters */
-      length -= tx->size;
+   offset = sizeof(*shr);
+   if (length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Message too long for shared page\n");
+      return -1;
    }
+   memcpy(offset + (uint8_t*)shr, msg, length);
+   shr->length = length;
+   barrier();
+   shr->state = VTPM_STATE_SUBMIT;
+
    dev->waiting = 1;
    dev->resplen = 0;
 #ifdef HAVE_LIBC
@@ -429,49 +432,50 @@ int tpmfront_send(struct tpmfront_dev* dev, const uint8_t* msg, size_t length)
       files[dev->fd].tpmfront.offset = 0;
    }
 #endif
+   wmb();
    notify_remote_via_evtchn(dev->evtchn);
    return 0;
 }
 int tpmfront_recv(struct tpmfront_dev* dev, uint8_t** msg, size_t *length)
 {
-   tpmif_tx_request_t* tx;
-   int i;
+   unsigned int offset;
+   vtpm_shared_page_t* shr = NULL;
+#ifdef TPMFRONT_PRINT_DEBUG
+int i;
+#endif
    if(dev == NULL || dev->state != XenbusStateConnected) {
       TPMFRONT_ERR("Tried to receive message from disconnected frontend\n");
       return -1;
    }
    /*Wait for the response */
    wait_event(dev->waitq, (!dev->waiting));
+   shr = dev->page;
 
    /* Initialize */
    *msg = NULL;
    *length = 0;
+   offset = sizeof(*shr);
 
-   /* special case, just quit */
-   tx = &dev->tx->ring[0].req;
-   if(tx->size == 0 ) {
-       goto quit;
-   }
-   /* Get the total size */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      *length += tx->size;
+   if (shr->state != VTPM_STATE_FINISH)
+      goto quit;
+
+   *length = shr->length;
+
+   if (*length + offset > PAGE_SIZE) {
+      TPMFRONT_ERR("Reply too long for shared page\n");
+      return -1;
    }
+
    /* Alloc the buffer */
    if(dev->respbuf) {
       free(dev->respbuf);
    }
    *msg = dev->respbuf = malloc(*length);
    dev->resplen = *length;
+
    /* Copy the bits */
-   tx = &dev->tx->ring[0].req;
-   for(i = 0; i < TPMIF_TX_RING_SIZE && tx->size > 0; ++i) {
-      tx = &dev->tx->ring[i].req;
-      memcpy(&(*msg)[i * PAGE_SIZE], dev->pages[i], tx->size);
-      gnttab_end_access(tx->ref);
-      tx->ref = 0;
-   }
+   memcpy(*msg, offset + (uint8_t*)shr, *length);
+
 #ifdef TPMFRONT_PRINT_DEBUG
    TPMFRONT_DEBUG("Received response from backend size=%u", (unsigned int) *length);
    for(i = 0; i < *length; ++i) {
@@ -504,6 +508,14 @@ int tpmfront_cmd(struct tpmfront_dev* dev, uint8_t* req, size_t reqlen, uint8_t*
    return 0;
 }
 
+int tpmfront_set_locality(struct tpmfront_dev* dev, int locality)
+{
+   if (!dev || !dev->page)
+      return -1;
+   dev->page->locality = locality;
+   return 0;
+}
+
 #ifdef HAVE_LIBC
 #include <errno.h>
 int tpmfront_open(struct tpmfront_dev* dev)
diff --git a/xen/include/public/io/tpmif.h b/xen/include/public/io/tpmif.h
index fca2c4e..dcc5e57 100644
--- a/xen/include/public/io/tpmif.h
+++ b/xen/include/public/io/tpmif.h
@@ -64,6 +64,72 @@ struct tpmif_tx_interface {
 };
 typedef struct tpmif_tx_interface tpmif_tx_interface_t;
 
+/******************************************************************************
+ * TPM I/O interface for Xen guest OSes, v2
+ *
+ * Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
+ *
+ * This protocol emulates the request/response behavior of a TPM using a Xen
+ * shared memory interface. All interaction with the TPM is at the direction
+ * of the frontend, since a TPM (hardware or virtual) is a passive device -
+ * the backend only processes commands as requested by the frontend.
+ *
+ * The frontend sends a request to the TPM by populating the shared page with
+ * the request packet, changing the state to VTPM_STATE_SUBMIT, and sending
+ * and event channel notification. When the backend is finished, it will set
+ * the state to VTPM_STATE_FINISH and send an event channel notification.
+ *
+ * In order to allow long-running commands to be canceled, the frontend can
+ * at any time change the state to VTPM_STATE_CANCEL and send a notification.
+ * The TPM can either finish the command (changing state to VTPM_STATE_FINISH)
+ * or can cancel the command and change the state to VTPM_STATE_IDLE. The TPM
+ * can also change the state to VTPM_STATE_IDLE instead of VTPM_STATE_FINISH
+ * if another reason for cancellation is required - for example, a physical
+ * TPM may cancel a command if the interface is seized by another locality.
+ *
+ * The TPM command format is defined by the TCG, and is available at
+ * http://www.trustedcomputinggroup.org/resources/tpm_main_specification
+ */
+
+enum vtpm_state {
+    VTPM_STATE_IDLE,         /* no contents / vTPM idle / cancel complete */
+    VTPM_STATE_SUBMIT,       /* request ready / vTPM working */
+    VTPM_STATE_FINISH,       /* response ready / vTPM idle */
+    VTPM_STATE_CANCEL,       /* cancel requested / vTPM working */
+};
+/* Note: The backend should only change state to IDLE or FINISH, while the
+ * frontend should only change to SUBMIT or CANCEL. Status changes do not need
+ * to use atomic operations.
+ */
+
+
+/* The shared page for vTPM request/response packets looks like:
+ *
+ *  Offset               Contents
+ *  =================================================
+ *  0                    struct vtpm_shared_page
+ *  16                   [optional] List of grant IDs
+ *  16+4*nr_extra_pages  TPM packet data
+ *
+ * If the TPM packet data extends beyond the end of a single page, the grant IDs
+ * defined in extra_pages are used as if they were mapped immediately following
+ * the primary shared page. The grants are allocated by the frontend and mapped
+ * by the backend. Before sending a request spanning multiple pages, the
+ * frontend should verify that the TPM supports such large requests by querying
+ * the TPM_CAP_PROP_INPUT_BUFFER property from the TPM.
+ */
+struct vtpm_shared_page {
+    uint32_t length;         /* request/response length in bytes */
+
+    uint8_t state;           /* enum vtpm_state */
+    uint8_t locality;        /* for the current request */
+    uint8_t pad;             /* should be zero */
+
+    uint8_t nr_extra_pages;  /* extra pages for long packets; may be zero */
+    uint32_t extra_pages[0]; /* grant IDs; length is actually nr_extra_pages */
+};
+typedef struct vtpm_shared_page vtpm_shared_page_t;
+
 #endif
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgl-00062S-HO; Sat, 13 Apr 2013 01:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgk-00062F-AA
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:34 +0000
Received: from [85.158.137.99:6128] by server-11.bemta-3.messagelabs.com id
	D0/AE-01263-51BB8615; Sat, 13 Apr 2013 01:55:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1365818131!17186521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2261 invoked from network); 13 Apr 2013 01:55:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgg-0006DQ-N3
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgg-0002gZ-FC
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:30 +0000
Date: Sat, 13 Apr 2013 01:55:30 +0000
Message-Id: <E1UQpgg-0002gZ-FC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpm{back,
	front}: Allow device repoens
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e66cb3294f3aa815ae6741b7030dfeb2ea801284
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:19 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpm{back, front}: Allow device repoens
    
    Allow the vtpm device to be disconnected and reconnected so that a
    bootloader (like pv-grub) can submit measurements and return the vtpm
    device to its initial state before booting the target kernel.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/tpmback.c  |   23 ++++++++++++++++++++++-
 extras/mini-os/tpmfront.c |   14 ++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index d68ad2b..9917765 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -645,6 +645,24 @@ error_post_map:
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateInitWait);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -671,8 +689,11 @@ static int frontend_changed(tpmif_t* tpmif)
 	 tpmif_change_state(tpmif, XenbusStateClosing);
 	 break;
 
-      case XenbusStateUnknown: /* keep it here */
       case XenbusStateClosed:
+         disconnect_fe(tpmif);
+	 break;
+
+      case XenbusStateUnknown: /* keep it here */
 	 free_tpmif(tpmif);
 	 break;
 
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 9f930b5..95d86f6 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -156,6 +156,9 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 	 case XenbusStateClosed:
 	    TPMFRONT_LOG("Backend Closed\n");
 	    return 0;
+	 case XenbusStateInitWait:
+	    TPMFRONT_LOG("Backend Closed (waiting for reconnect)\n");
+	    return 0;
 	 default:
 	    xenbus_wait_for_watch(events);
       }
@@ -339,10 +342,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    TPMFRONT_LOG("Shutting down tpmfront\n");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
-      dev->state = XenbusStateClosing;
-      //FIXME: Transaction for this?
       /* Tell backend we are closing */
+      dev->state = XenbusStateClosing;
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
 	 free(err);
       }
 
@@ -366,6 +369,13 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
+      /* Prepare for a later reopen (possibly by a kexec'd kernel) */
+      dev->state = XenbusStateInitialising;
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
+	 free(err);
+      }
+
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgl-00062S-HO; Sat, 13 Apr 2013 01:55:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgk-00062F-AA
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:34 +0000
Received: from [85.158.137.99:6128] by server-11.bemta-3.messagelabs.com id
	D0/AE-01263-51BB8615; Sat, 13 Apr 2013 01:55:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-217.messagelabs.com!1365818131!17186521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2261 invoked from network); 13 Apr 2013 01:55:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgg-0006DQ-N3
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgg-0002gZ-FC
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:30 +0000
Date: Sat, 13 Apr 2013 01:55:30 +0000
Message-Id: <E1UQpgg-0002gZ-FC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpm{back,
	front}: Allow device repoens
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e66cb3294f3aa815ae6741b7030dfeb2ea801284
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:19 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpm{back, front}: Allow device repoens
    
    Allow the vtpm device to be disconnected and reconnected so that a
    bootloader (like pv-grub) can submit measurements and return the vtpm
    device to its initial state before booting the target kernel.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/tpmback.c  |   23 ++++++++++++++++++++++-
 extras/mini-os/tpmfront.c |   14 ++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index d68ad2b..9917765 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -645,6 +645,24 @@ error_post_map:
    return -1;
 }
 
+static void disconnect_fe(tpmif_t* tpmif)
+{
+   if (tpmif->status == CONNECTED) {
+      tpmif->status = DISCONNECTING;
+      mask_evtchn(tpmif->evtchn);
+
+      if(gntmap_munmap(&gtpmdev.map, (unsigned long)tpmif->page, 1)) {
+	 TPMBACK_ERR("%u/%u Error occured while trying to unmap shared page\n", (unsigned int) tpmif->domid, tpmif->handle);
+      }
+
+      unbind_evtchn(tpmif->evtchn);
+   }
+   tpmif->status = DISCONNECTED;
+   tpmif_change_state(tpmif, XenbusStateInitWait);
+
+   TPMBACK_LOG("Frontend %u/%u disconnected\n", (unsigned int) tpmif->domid, tpmif->handle);
+}
+
 static int frontend_changed(tpmif_t* tpmif)
 {
    int state = xenbus_read_integer(tpmif->fe_state_path);
@@ -671,8 +689,11 @@ static int frontend_changed(tpmif_t* tpmif)
 	 tpmif_change_state(tpmif, XenbusStateClosing);
 	 break;
 
-      case XenbusStateUnknown: /* keep it here */
       case XenbusStateClosed:
+         disconnect_fe(tpmif);
+	 break;
+
+      case XenbusStateUnknown: /* keep it here */
 	 free_tpmif(tpmif);
 	 break;
 
diff --git a/extras/mini-os/tpmfront.c b/extras/mini-os/tpmfront.c
index 9f930b5..95d86f6 100644
--- a/extras/mini-os/tpmfront.c
+++ b/extras/mini-os/tpmfront.c
@@ -156,6 +156,9 @@ static int wait_for_backend_closed(xenbus_event_queue* events, char* path)
 	 case XenbusStateClosed:
 	    TPMFRONT_LOG("Backend Closed\n");
 	    return 0;
+	 case XenbusStateInitWait:
+	    TPMFRONT_LOG("Backend Closed (waiting for reconnect)\n");
+	    return 0;
 	 default:
 	    xenbus_wait_for_watch(events);
       }
@@ -339,10 +342,10 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
    TPMFRONT_LOG("Shutting down tpmfront\n");
    /* disconnect */
    if(dev->state == XenbusStateConnected) {
-      dev->state = XenbusStateClosing;
-      //FIXME: Transaction for this?
       /* Tell backend we are closing */
+      dev->state = XenbusStateClosing;
       if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
 	 free(err);
       }
 
@@ -366,6 +369,13 @@ void shutdown_tpmfront(struct tpmfront_dev* dev)
       /* Wait for the backend to close and unmap shared pages, ignore any errors */
       wait_for_backend_state_changed(dev, XenbusStateClosed);
 
+      /* Prepare for a later reopen (possibly by a kexec'd kernel) */
+      dev->state = XenbusStateInitialising;
+      if((err = xenbus_printf(XBT_NIL, dev->nodename, "state", "%u", (unsigned int) dev->state))) {
+	 TPMFRONT_ERR("Unable to write to %s, error was %s", dev->nodename, err);
+	 free(err);
+      }
+
       /* Close event channel and unmap shared page */
       mask_evtchn(dev->evtchn);
       unbind_evtchn(dev->evtchn);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgv-00063c-KH; Sat, 13 Apr 2013 01:55:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgu-00063Q-DB
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:44 +0000
Received: from [85.158.139.211:28320] by server-2.bemta-5.messagelabs.com id
	CB/D2-23989-F1BB8615; Sat, 13 Apr 2013 01:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1365818141!18662910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30014 invoked from network); 13 Apr 2013 01:55:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgr-0006DW-3C
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgq-0002hU-Su
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:40 +0000
Date: Sat, 13 Apr 2013 01:55:40 +0000
Message-Id: <E1UQpgq-0002hU-Su@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpmback: set up callbacks
	before enumeration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 368fcb52643105d80c4705afa557647c8f7114c5
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:20 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpmback: set up callbacks before enumeration
    
    The open/close callbacks in tpmback cannot be properly initalized in
    order to catch the initial enumeration events because init_tpmback
    clears the callbacks and then asynchronously starts the enumeration of
    existing tpmback devices. Fix this by passing the callbacks to
    init_tpmback so they can be installed before enumeration.
    
    This also removes the unused callbacks for suspend and resume.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h |   12 +-----------
 extras/mini-os/tpmback.c         |   31 +++----------------------------
 stubdom/vtpm/vtpm.c              |    2 +-
 stubdom/vtpmmgr/init.c           |    2 +-
 4 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ec9eda4..3c11c34 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -56,7 +56,7 @@ struct tpmcmd {
 typedef struct tpmcmd tpmcmd_t;
 
 /* Initialize the tpm backend driver */
-void init_tpmback(void);
+void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid_t, unsigned int));
 
 /* Shutdown tpm backend driver */
 void shutdown_tpmback(void);
@@ -94,14 +94,4 @@ int tpmback_num_frontends(void);
  * The return value is internally allocated, so don't free it */
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle);
 
-/* Specify a function to call when a new tpm device connects */
-void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int));
-
-/* Specify a function to call when a tpm device disconnects */
-void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int));
-
-//Not Implemented
-void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int));
-void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int));
-
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 9917765..cff3861 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -114,8 +114,6 @@ struct tpmback_dev {
    /* Callbacks */
    void (*open_callback)(domid_t, unsigned int);
    void (*close_callback)(domid_t, unsigned int);
-   void (*suspend_callback)(domid_t, unsigned int);
-   void (*resume_callback)(domid_t, unsigned int);
 };
 typedef struct tpmback_dev tpmback_dev_t;
 
@@ -131,8 +129,6 @@ static tpmback_dev_t gtpmdev = {
    .events = NULL,
    .open_callback = NULL,
    .close_callback = NULL,
-   .suspend_callback = NULL,
-   .resume_callback = NULL,
 };
 struct wait_queue_head waitq;
 int globalinit = 0;
@@ -809,23 +805,6 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
    return tpmif->uuid;
 }
 
-void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.open_callback = cb;
-}
-void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.close_callback = cb;
-}
-void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.suspend_callback = cb;
-}
-void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.resume_callback = cb;
-}
-
 static void event_listener(void)
 {
    const char* bepath = "backend/vtpm";
@@ -872,7 +851,7 @@ void event_thread(void* p) {
    event_listener();
 }
 
-void init_tpmback(void)
+void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid_t, unsigned int))
 {
    if(!globalinit) {
       init_waitqueue_head(&waitq);
@@ -884,8 +863,8 @@ void init_tpmback(void)
    gtpmdev.num_tpms = 0;
    gtpmdev.flags = 0;
 
-   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
-   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
+   gtpmdev.open_callback = open_cb;
+   gtpmdev.close_callback = close_cb;
 
    eventthread = create_thread("tpmback-listener", event_thread, NULL);
 
@@ -893,10 +872,6 @@ void init_tpmback(void)
 
 void shutdown_tpmback(void)
 {
-   /* Disable callbacks */
-   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
-   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
-
    TPMBACK_LOG("Shutting down tpm backend\n");
    /* Set the quit flag */
    gtpmdev.flags = TPMIF_CLOSED;
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 71aef78..3362ea8 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -367,7 +367,7 @@ int main(int argc, char **argv)
    }
 
    /* Initialize devices */
-   init_tpmback();
+   init_tpmback(NULL, NULL);
    if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
       error("Unable to initialize tpmfront device");
       goto abort_posttpmfront;
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index a158020..00dd9f3 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -462,7 +462,7 @@ TPM_RESULT vtpmmgr_init(int argc, char** argv) {
    }
 
    //Setup tpmback device
-   init_tpmback();
+   init_tpmback(NULL, NULL);
 
    //Setup tpm access
    switch(opts.tpmdriver) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpgv-00063c-KH; Sat, 13 Apr 2013 01:55:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgu-00063Q-DB
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:44 +0000
Received: from [85.158.139.211:28320] by server-2.bemta-5.messagelabs.com id
	CB/D2-23989-F1BB8615; Sat, 13 Apr 2013 01:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1365818141!18662910!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30014 invoked from network); 13 Apr 2013 01:55:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgr-0006DW-3C
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpgq-0002hU-Su
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:40 +0000
Date: Sat, 13 Apr 2013 01:55:40 +0000
Message-Id: <E1UQpgq-0002hU-Su@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpmback: set up callbacks
	before enumeration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 368fcb52643105d80c4705afa557647c8f7114c5
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:20 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpmback: set up callbacks before enumeration
    
    The open/close callbacks in tpmback cannot be properly initalized in
    order to catch the initial enumeration events because init_tpmback
    clears the callbacks and then asynchronously starts the enumeration of
    existing tpmback devices. Fix this by passing the callbacks to
    init_tpmback so they can be installed before enumeration.
    
    This also removes the unused callbacks for suspend and resume.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h |   12 +-----------
 extras/mini-os/tpmback.c         |   31 +++----------------------------
 stubdom/vtpm/vtpm.c              |    2 +-
 stubdom/vtpmmgr/init.c           |    2 +-
 4 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index ec9eda4..3c11c34 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -56,7 +56,7 @@ struct tpmcmd {
 typedef struct tpmcmd tpmcmd_t;
 
 /* Initialize the tpm backend driver */
-void init_tpmback(void);
+void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid_t, unsigned int));
 
 /* Shutdown tpm backend driver */
 void shutdown_tpmback(void);
@@ -94,14 +94,4 @@ int tpmback_num_frontends(void);
  * The return value is internally allocated, so don't free it */
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle);
 
-/* Specify a function to call when a new tpm device connects */
-void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int));
-
-/* Specify a function to call when a tpm device disconnects */
-void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int));
-
-//Not Implemented
-void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int));
-void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int));
-
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 9917765..cff3861 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -114,8 +114,6 @@ struct tpmback_dev {
    /* Callbacks */
    void (*open_callback)(domid_t, unsigned int);
    void (*close_callback)(domid_t, unsigned int);
-   void (*suspend_callback)(domid_t, unsigned int);
-   void (*resume_callback)(domid_t, unsigned int);
 };
 typedef struct tpmback_dev tpmback_dev_t;
 
@@ -131,8 +129,6 @@ static tpmback_dev_t gtpmdev = {
    .events = NULL,
    .open_callback = NULL,
    .close_callback = NULL,
-   .suspend_callback = NULL,
-   .resume_callback = NULL,
 };
 struct wait_queue_head waitq;
 int globalinit = 0;
@@ -809,23 +805,6 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
    return tpmif->uuid;
 }
 
-void tpmback_set_open_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.open_callback = cb;
-}
-void tpmback_set_close_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.close_callback = cb;
-}
-void tpmback_set_suspend_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.suspend_callback = cb;
-}
-void tpmback_set_resume_callback(void (*cb)(domid_t, unsigned int))
-{
-   gtpmdev.resume_callback = cb;
-}
-
 static void event_listener(void)
 {
    const char* bepath = "backend/vtpm";
@@ -872,7 +851,7 @@ void event_thread(void* p) {
    event_listener();
 }
 
-void init_tpmback(void)
+void init_tpmback(void (*open_cb)(domid_t, unsigned int), void (*close_cb)(domid_t, unsigned int))
 {
    if(!globalinit) {
       init_waitqueue_head(&waitq);
@@ -884,8 +863,8 @@ void init_tpmback(void)
    gtpmdev.num_tpms = 0;
    gtpmdev.flags = 0;
 
-   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
-   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
+   gtpmdev.open_callback = open_cb;
+   gtpmdev.close_callback = close_cb;
 
    eventthread = create_thread("tpmback-listener", event_thread, NULL);
 
@@ -893,10 +872,6 @@ void init_tpmback(void)
 
 void shutdown_tpmback(void)
 {
-   /* Disable callbacks */
-   gtpmdev.open_callback = gtpmdev.close_callback = NULL;
-   gtpmdev.suspend_callback = gtpmdev.resume_callback = NULL;
-
    TPMBACK_LOG("Shutting down tpm backend\n");
    /* Set the quit flag */
    gtpmdev.flags = TPMIF_CLOSED;
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 71aef78..3362ea8 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -367,7 +367,7 @@ int main(int argc, char **argv)
    }
 
    /* Initialize devices */
-   init_tpmback();
+   init_tpmback(NULL, NULL);
    if((tpmfront_dev = init_tpmfront(NULL)) == NULL) {
       error("Unable to initialize tpmfront device");
       goto abort_posttpmfront;
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index a158020..00dd9f3 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -462,7 +462,7 @@ TPM_RESULT vtpmmgr_init(int argc, char** argv) {
    }
 
    //Setup tpmback device
-   init_tpmback();
+   init_tpmback(NULL, NULL);
 
    //Setup tpm access
    switch(opts.tpmdriver) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQph6-00065d-NF; Sat, 13 Apr 2013 01:55:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQph4-000652-EF
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:54 +0000
Received: from [85.158.137.99:49295] by server-1.bemta-3.messagelabs.com id
	2D/1D-13706-92BB8615; Sat, 13 Apr 2013 01:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1365818151!11820054!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11837 invoked from network); 13 Apr 2013 01:55:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQph1-0006Dc-Ad
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQph1-0002hq-8M
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:51 +0000
Date: Sat, 13 Apr 2013 01:55:51 +0000
Message-Id: <E1UQph1-0002hq-8M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpmback: Replace UUID field
	with opaque pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b05cb51b0605fb7c614e8a78ef03b79eeb06c85a
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:21 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpmback: Replace UUID field with opaque pointer
    
    Instead of only recording the UUID field, which may not be of interest
    to all tpmback implementations, provide a user-settable opaque pointer
    associated with the tpmback instance.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h |    9 +++++++--
 extras/mini-os/tpmback.c         |   31 ++++++++++++++++++++++++++++---
 stubdom/vtpmmgr/init.c           |    8 +++++++-
 stubdom/vtpmmgr/vtpmmgr.c        |    2 +-
 4 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index 3c11c34..a6cbbf1 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -45,10 +45,10 @@ struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
    uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
-   unsigned char uuid[16];			/* uuid of the tpm interface */
+   void *opaque;        /* Opaque pointer taken from the tpmback instance */
 
-   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
    uint8_t* req;			/* tpm command bits, allocated by driver, DON'T FREE IT */
+   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
    unsigned int resp_len;	/* Size of the outgoing command,
 				   you set this before passing the cmd object to tpmback_resp */
    uint8_t* resp;		/* Buffer for response - YOU MUST ALLOCATE IT, YOU MUST ALSO FREE IT */
@@ -94,4 +94,9 @@ int tpmback_num_frontends(void);
  * The return value is internally allocated, so don't free it */
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle);
 
+/* Get and set the opaque pointer for a tpmback instance */
+void* tpmback_get_opaque(domid_t domid, unsigned int handle);
+/* Returns zero if successful, nonzero on failure (no such frontend) */
+int tpmback_set_opaque(domid_t domid, unsigned int handle, void* opaque);
+
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index cff3861..21dd206 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -92,6 +92,7 @@ struct tpmif {
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
 
    unsigned char uuid[16];
+   void* opaque;
 
    /* state flags */
    int flags;
@@ -391,6 +392,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->status = DISCONNECTED;
    tpmif->page = NULL;
    tpmif->flags = 0;
+   tpmif->opaque = NULL;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
 }
@@ -794,6 +796,29 @@ static void generate_backend_events(const char* path)
    return;
 }
 
+void* tpmback_get_opaque(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("get_opaque() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return NULL;
+   }
+
+   return tpmif->opaque;
+}
+
+int tpmback_set_opaque(domid_t domid, unsigned int handle, void *opaque)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("set_opaque() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return -1;
+   }
+
+   tpmif->opaque = opaque;
+   return 0;
+}
+
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
 {
    tpmif_t* tpmif;
@@ -890,12 +915,12 @@ void shutdown_tpmback(void)
    schedule();
 }
 
-inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
+static void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, void *opaque)
 {
    tpmcmd->domid = domid;
    tpmcmd->locality = -1;
    tpmcmd->handle = handle;
-   memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
+   tpmcmd->opaque = opaque;
    tpmcmd->req = NULL;
    tpmcmd->req_len = 0;
    tpmcmd->resp = NULL;
@@ -917,7 +942,7 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    if((cmd = malloc(sizeof(*cmd))) == NULL) {
       goto error;
    }
-   init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
+   init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->opaque);
 
    shr = tpmif->page;
    cmd->req_len = shr->length;
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index 00dd9f3..33ac152 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -436,6 +436,12 @@ egress:
    return status;
 }
 
+/* Set up the opaque field to contain a pointer to the UUID */
+static void set_opaque_to_uuid(domid_t domid, unsigned int handle)
+{
+   tpmback_set_opaque(domid, handle, tpmback_get_uuid(domid, handle));
+}
+
 TPM_RESULT vtpmmgr_init(int argc, char** argv) {
    TPM_RESULT status = TPM_SUCCESS;
 
@@ -462,7 +468,7 @@ TPM_RESULT vtpmmgr_init(int argc, char** argv) {
    }
 
    //Setup tpmback device
-   init_tpmback(NULL, NULL);
+   init_tpmback(set_opaque_to_uuid, NULL);
 
    //Setup tpm access
    switch(opts.tpmdriver) {
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
index 563f4e8..270ca8a 100644
--- a/stubdom/vtpmmgr/vtpmmgr.c
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -61,7 +61,7 @@ void main_loop(void) {
       tpmcmd->resp = respbuf;
 
       /* Process the command */
-      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+      vtpmmgr_handle_cmd(tpmcmd->opaque, tpmcmd);
 
       /* Send response */
       tpmback_resp(tpmcmd);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQph6-00065d-NF; Sat, 13 Apr 2013 01:55:56 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQph4-000652-EF
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:54 +0000
Received: from [85.158.137.99:49295] by server-1.bemta-3.messagelabs.com id
	2D/1D-13706-92BB8615; Sat, 13 Apr 2013 01:55:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1365818151!11820054!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11837 invoked from network); 13 Apr 2013 01:55:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:55:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQph1-0006Dc-Ad
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQph1-0002hq-8M
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:55:51 +0000
Date: Sat, 13 Apr 2013 01:55:51 +0000
Message-Id: <E1UQph1-0002hq-8M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpmback: Replace UUID field
	with opaque pointer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b05cb51b0605fb7c614e8a78ef03b79eeb06c85a
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:21 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpmback: Replace UUID field with opaque pointer
    
    Instead of only recording the UUID field, which may not be of interest
    to all tpmback implementations, provide a user-settable opaque pointer
    associated with the tpmback instance.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 extras/mini-os/include/tpmback.h |    9 +++++++--
 extras/mini-os/tpmback.c         |   31 ++++++++++++++++++++++++++++---
 stubdom/vtpmmgr/init.c           |    8 +++++++-
 stubdom/vtpmmgr/vtpmmgr.c        |    2 +-
 4 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index 3c11c34..a6cbbf1 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -45,10 +45,10 @@ struct tpmcmd {
    domid_t domid;		/* Domid of the frontend */
    uint8_t locality;    /* Locality requested by the frontend */
    unsigned int handle;	/* Handle of the frontend */
-   unsigned char uuid[16];			/* uuid of the tpm interface */
+   void *opaque;        /* Opaque pointer taken from the tpmback instance */
 
-   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
    uint8_t* req;			/* tpm command bits, allocated by driver, DON'T FREE IT */
+   unsigned int req_len;		/* Size of the command in buf - set by tpmback driver */
    unsigned int resp_len;	/* Size of the outgoing command,
 				   you set this before passing the cmd object to tpmback_resp */
    uint8_t* resp;		/* Buffer for response - YOU MUST ALLOCATE IT, YOU MUST ALSO FREE IT */
@@ -94,4 +94,9 @@ int tpmback_num_frontends(void);
  * The return value is internally allocated, so don't free it */
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle);
 
+/* Get and set the opaque pointer for a tpmback instance */
+void* tpmback_get_opaque(domid_t domid, unsigned int handle);
+/* Returns zero if successful, nonzero on failure (no such frontend) */
+int tpmback_set_opaque(domid_t domid, unsigned int handle, void* opaque);
+
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index cff3861..21dd206 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -92,6 +92,7 @@ struct tpmif {
    enum { DISCONNECTED, DISCONNECTING, CONNECTED } status;
 
    unsigned char uuid[16];
+   void* opaque;
 
    /* state flags */
    int flags;
@@ -391,6 +392,7 @@ inline tpmif_t* __init_tpmif(domid_t domid, unsigned int handle)
    tpmif->status = DISCONNECTED;
    tpmif->page = NULL;
    tpmif->flags = 0;
+   tpmif->opaque = NULL;
    memset(tpmif->uuid, 0, sizeof(tpmif->uuid));
    return tpmif;
 }
@@ -794,6 +796,29 @@ static void generate_backend_events(const char* path)
    return;
 }
 
+void* tpmback_get_opaque(domid_t domid, unsigned int handle)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("get_opaque() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return NULL;
+   }
+
+   return tpmif->opaque;
+}
+
+int tpmback_set_opaque(domid_t domid, unsigned int handle, void *opaque)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("set_opaque() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return -1;
+   }
+
+   tpmif->opaque = opaque;
+   return 0;
+}
+
 unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
 {
    tpmif_t* tpmif;
@@ -890,12 +915,12 @@ void shutdown_tpmback(void)
    schedule();
 }
 
-inline void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, unsigned char uuid[16])
+static void init_tpmcmd(tpmcmd_t* tpmcmd, domid_t domid, unsigned int handle, void *opaque)
 {
    tpmcmd->domid = domid;
    tpmcmd->locality = -1;
    tpmcmd->handle = handle;
-   memcpy(tpmcmd->uuid, uuid, sizeof(tpmcmd->uuid));
+   tpmcmd->opaque = opaque;
    tpmcmd->req = NULL;
    tpmcmd->req_len = 0;
    tpmcmd->resp = NULL;
@@ -917,7 +942,7 @@ tpmcmd_t* get_request(tpmif_t* tpmif) {
    if((cmd = malloc(sizeof(*cmd))) == NULL) {
       goto error;
    }
-   init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->uuid);
+   init_tpmcmd(cmd, tpmif->domid, tpmif->handle, tpmif->opaque);
 
    shr = tpmif->page;
    cmd->req_len = shr->length;
diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c
index 00dd9f3..33ac152 100644
--- a/stubdom/vtpmmgr/init.c
+++ b/stubdom/vtpmmgr/init.c
@@ -436,6 +436,12 @@ egress:
    return status;
 }
 
+/* Set up the opaque field to contain a pointer to the UUID */
+static void set_opaque_to_uuid(domid_t domid, unsigned int handle)
+{
+   tpmback_set_opaque(domid, handle, tpmback_get_uuid(domid, handle));
+}
+
 TPM_RESULT vtpmmgr_init(int argc, char** argv) {
    TPM_RESULT status = TPM_SUCCESS;
 
@@ -462,7 +468,7 @@ TPM_RESULT vtpmmgr_init(int argc, char** argv) {
    }
 
    //Setup tpmback device
-   init_tpmback(NULL, NULL);
+   init_tpmback(set_opaque_to_uuid, NULL);
 
    //Setup tpm access
    switch(opts.tpmdriver) {
diff --git a/stubdom/vtpmmgr/vtpmmgr.c b/stubdom/vtpmmgr/vtpmmgr.c
index 563f4e8..270ca8a 100644
--- a/stubdom/vtpmmgr/vtpmmgr.c
+++ b/stubdom/vtpmmgr/vtpmmgr.c
@@ -61,7 +61,7 @@ void main_loop(void) {
       tpmcmd->resp = respbuf;
 
       /* Process the command */
-      vtpmmgr_handle_cmd(tpmcmd->uuid, tpmcmd);
+      vtpmmgr_handle_cmd(tpmcmd->opaque, tpmcmd);
 
       /* Send response */
       tpmback_resp(tpmcmd);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphG-00067T-QN; Sat, 13 Apr 2013 01:56:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphE-000674-HK
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:04 +0000
Received: from [85.158.139.83:51275] by server-8.bemta-5.messagelabs.com id
	08/86-05790-33BB8615; Sat, 13 Apr 2013 01:56:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1365818161!24105210!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26474 invoked from network); 13 Apr 2013 01:56:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphB-0006EC-Mm
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphB-0002iD-Dp
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:01 +0000
Date: Sat, 13 Apr 2013 01:56:01 +0000
Message-Id: <E1UQphB-0002iD-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpmback: add
	tpmback_get_peercontext
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f0cf56683a0efcaa3cda67c534144d335f7ad2c
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:22 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpmback: add tpmback_get_peercontext
    
    This allows the XSM label of the TPM's client domain to be retrieved.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/events.c          |   22 ++++++++++++++++++++++
 extras/mini-os/include/events.h  |    1 +
 extras/mini-os/include/tpmback.h |    2 ++
 extras/mini-os/tpmback.c         |   11 +++++++++++
 4 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index 896c365..036b84b 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -21,6 +21,7 @@
 #include <mini-os/hypervisor.h>
 #include <mini-os/events.h>
 #include <mini-os/lib.h>
+#include <xen/xsm/flask_op.h>
 
 #define NR_EVS 1024
 
@@ -258,6 +259,27 @@ int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
     return rc;
 }
 
+int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size)
+{
+    int rc;
+    uint32_t sid;
+    struct xen_flask_op op;
+    op.cmd = FLASK_GET_PEER_SID;
+    op.interface_version = XEN_FLASK_INTERFACE_VERSION;
+    op.u.peersid.evtchn = local_port;
+    rc = _hypercall1(int, xsm_op, &op);
+    if (rc)
+        return rc;
+    sid = op.u.peersid.sid;
+    op.cmd = FLASK_SID_TO_CONTEXT;
+    op.u.sid_context.sid = sid;
+    op.u.sid_context.size = size;
+    set_xen_guest_handle(op.u.sid_context.context, ctx);
+    rc = _hypercall1(int, xsm_op, &op);
+    return rc;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h
index 912e4cf..0e9d3a7 100644
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -37,6 +37,7 @@ int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
 int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
 							evtchn_handler_t handler, void *data,
 							evtchn_port_t *local_port);
+int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size);
 void unbind_all_ports(void);
 
 static inline int notify_remote_via_evtchn(evtchn_port_t port)
diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index a6cbbf1..4408986 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -99,4 +99,6 @@ void* tpmback_get_opaque(domid_t domid, unsigned int handle);
 /* Returns zero if successful, nonzero on failure (no such frontend) */
 int tpmback_set_opaque(domid_t domid, unsigned int handle, void* opaque);
 
+/* Get the XSM context of the given domain (using the tpmback event channel) */
+int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, int buflen);
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 21dd206..43e840d 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -830,6 +830,17 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
    return tpmif->uuid;
 }
 
+int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, int buflen)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("get_uuid() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return -1;
+   }
+
+   return evtchn_get_peercontext(tpmif->evtchn, buffer, buflen);
+}
+
 static void event_listener(void)
 {
    const char* bepath = "backend/vtpm";
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphG-00067T-QN; Sat, 13 Apr 2013 01:56:06 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphE-000674-HK
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:04 +0000
Received: from [85.158.139.83:51275] by server-8.bemta-5.messagelabs.com id
	08/86-05790-33BB8615; Sat, 13 Apr 2013 01:56:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1365818161!24105210!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26474 invoked from network); 13 Apr 2013 01:56:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphB-0006EC-Mm
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphB-0002iD-Dp
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:01 +0000
Date: Sat, 13 Apr 2013 01:56:01 +0000
Message-Id: <E1UQphB-0002iD-Dp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/tpmback: add
	tpmback_get_peercontext
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f0cf56683a0efcaa3cda67c534144d335f7ad2c
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:22 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    mini-os/tpmback: add tpmback_get_peercontext
    
    This allows the XSM label of the TPM's client domain to be retrieved.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/events.c          |   22 ++++++++++++++++++++++
 extras/mini-os/include/events.h  |    1 +
 extras/mini-os/include/tpmback.h |    2 ++
 extras/mini-os/tpmback.c         |   11 +++++++++++
 4 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index 896c365..036b84b 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -21,6 +21,7 @@
 #include <mini-os/hypervisor.h>
 #include <mini-os/events.h>
 #include <mini-os/lib.h>
+#include <xen/xsm/flask_op.h>
 
 #define NR_EVS 1024
 
@@ -258,6 +259,27 @@ int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
     return rc;
 }
 
+int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size)
+{
+    int rc;
+    uint32_t sid;
+    struct xen_flask_op op;
+    op.cmd = FLASK_GET_PEER_SID;
+    op.interface_version = XEN_FLASK_INTERFACE_VERSION;
+    op.u.peersid.evtchn = local_port;
+    rc = _hypercall1(int, xsm_op, &op);
+    if (rc)
+        return rc;
+    sid = op.u.peersid.sid;
+    op.cmd = FLASK_SID_TO_CONTEXT;
+    op.u.sid_context.sid = sid;
+    op.u.sid_context.size = size;
+    set_xen_guest_handle(op.u.sid_context.context, ctx);
+    rc = _hypercall1(int, xsm_op, &op);
+    return rc;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h
index 912e4cf..0e9d3a7 100644
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -37,6 +37,7 @@ int evtchn_alloc_unbound(domid_t pal, evtchn_handler_t handler,
 int evtchn_bind_interdomain(domid_t pal, evtchn_port_t remote_port,
 							evtchn_handler_t handler, void *data,
 							evtchn_port_t *local_port);
+int evtchn_get_peercontext(evtchn_port_t local_port, char *ctx, int size);
 void unbind_all_ports(void);
 
 static inline int notify_remote_via_evtchn(evtchn_port_t port)
diff --git a/extras/mini-os/include/tpmback.h b/extras/mini-os/include/tpmback.h
index a6cbbf1..4408986 100644
--- a/extras/mini-os/include/tpmback.h
+++ b/extras/mini-os/include/tpmback.h
@@ -99,4 +99,6 @@ void* tpmback_get_opaque(domid_t domid, unsigned int handle);
 /* Returns zero if successful, nonzero on failure (no such frontend) */
 int tpmback_set_opaque(domid_t domid, unsigned int handle, void* opaque);
 
+/* Get the XSM context of the given domain (using the tpmback event channel) */
+int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, int buflen);
 #endif
diff --git a/extras/mini-os/tpmback.c b/extras/mini-os/tpmback.c
index 21dd206..43e840d 100644
--- a/extras/mini-os/tpmback.c
+++ b/extras/mini-os/tpmback.c
@@ -830,6 +830,17 @@ unsigned char* tpmback_get_uuid(domid_t domid, unsigned int handle)
    return tpmif->uuid;
 }
 
+int tpmback_get_peercontext(domid_t domid, unsigned int handle, void* buffer, int buflen)
+{
+   tpmif_t* tpmif;
+   if((tpmif = get_tpmif(domid, handle)) == NULL) {
+      TPMBACK_DEBUG("get_uuid() failed, %u/%u is an invalid frontend\n", (unsigned int) domid, handle);
+      return -1;
+   }
+
+   return evtchn_get_peercontext(tpmif->evtchn, buffer, buflen);
+}
+
 static void event_listener(void)
 {
    const char* bepath = "backend/vtpm";
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphT-00069v-Td; Sat, 13 Apr 2013 01:56:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphS-00069Y-Ns
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:18 +0000
Received: from [85.158.139.83:24909] by server-15.bemta-5.messagelabs.com id
	BF/D5-22815-D3BB8615; Sat, 13 Apr 2013 01:56:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1365818172!28052581!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22225 invoked from network); 13 Apr 2013 01:56:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphL-0006EN-Sp
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphL-0002ib-RS
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:11 +0000
Date: Sat, 13 Apr 2013 01:56:11 +0000
Message-Id: <E1UQphL-0002ib-RS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: correct the buffer size
	returned by TPM_CAP_PROP_INPUT_BUFFER
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9e6dcb08b5d6f68d05f658850c72f8888d8c533
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:23 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: correct the buffer size returned by TPM_CAP_PROP_INPUT_BUFFER
    
    The vtpm2 ABI supports packets of up to 4088 bytes by default; expose
    this property though the TPM's interface so clients do not attempt to
    send larger packets.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile           |    1 +
 stubdom/vtpm-bufsize.patch |   13 +++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 674132a..5372715 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -209,6 +209,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	tar xzf $<
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	patch -d $@ -p1 < vtpm-bufsize.patch
 	mkdir $@/build
 	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-bufsize.patch b/stubdom/vtpm-bufsize.patch
new file mode 100644
index 0000000..9c9304c
--- /dev/null
+++ b/stubdom/vtpm-bufsize.patch
@@ -0,0 +1,13 @@
+diff --git a/config.h.in b/config.h.in
+index d16a997..8088a2a 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -27,7 +27,7 @@
+ #define TPM_STORAGE_NAME "${TPM_STORAGE_NAME}"
+ #define TPM_DEVICE_NAME  "${TPM_DEVICE_NAME}"
+ #define TPM_LOG_FILE     "${TPM_LOG_FILE}"
+-#define TPM_CMD_BUF_SIZE 4096
++#define TPM_CMD_BUF_SIZE 4088
+ 
+ #endif /* _CONFIG_H_ */
+ 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphT-00069v-Td; Sat, 13 Apr 2013 01:56:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphS-00069Y-Ns
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:18 +0000
Received: from [85.158.139.83:24909] by server-15.bemta-5.messagelabs.com id
	BF/D5-22815-D3BB8615; Sat, 13 Apr 2013 01:56:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-182.messagelabs.com!1365818172!28052581!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22225 invoked from network); 13 Apr 2013 01:56:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphL-0006EN-Sp
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphL-0002ib-RS
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:11 +0000
Date: Sat, 13 Apr 2013 01:56:11 +0000
Message-Id: <E1UQphL-0002ib-RS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: correct the buffer size
	returned by TPM_CAP_PROP_INPUT_BUFFER
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c9e6dcb08b5d6f68d05f658850c72f8888d8c533
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:23 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: correct the buffer size returned by TPM_CAP_PROP_INPUT_BUFFER
    
    The vtpm2 ABI supports packets of up to 4088 bytes by default; expose
    this property though the TPM's interface so clients do not attempt to
    send larger packets.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/Makefile           |    1 +
 stubdom/vtpm-bufsize.patch |   13 +++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 674132a..5372715 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -209,6 +209,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	tar xzf $<
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
+	patch -d $@ -p1 < vtpm-bufsize.patch
 	mkdir $@/build
 	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-bufsize.patch b/stubdom/vtpm-bufsize.patch
new file mode 100644
index 0000000..9c9304c
--- /dev/null
+++ b/stubdom/vtpm-bufsize.patch
@@ -0,0 +1,13 @@
+diff --git a/config.h.in b/config.h.in
+index d16a997..8088a2a 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -27,7 +27,7 @@
+ #define TPM_STORAGE_NAME "${TPM_STORAGE_NAME}"
+ #define TPM_DEVICE_NAME  "${TPM_DEVICE_NAME}"
+ #define TPM_LOG_FILE     "${TPM_LOG_FILE}"
+-#define TPM_CMD_BUF_SIZE 4096
++#define TPM_CMD_BUF_SIZE 4088
+ 
+ #endif /* _CONFIG_H_ */
+ 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpha-0006BB-2Q; Sat, 13 Apr 2013 01:56:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphY-0006Aw-OZ
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:25 +0000
Received: from [85.158.139.211:27145] by server-6.bemta-5.messagelabs.com id
	D6/A9-21466-74BB8615; Sat, 13 Apr 2013 01:56:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365818182!18603303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4172 invoked from network); 13 Apr 2013 01:56:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphW-0006EQ-0R
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphV-0002iz-VS
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:21 +0000
Date: Sat, 13 Apr 2013 01:56:21 +0000
Message-Id: <E1UQphV-0002iz-VS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: Support locality field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57c265546e7d12d2f44225928c6b5679ad0a14ba
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:24 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: Support locality field
    
    The vTPM protocol now contains a field allowing the locality of a
    command to be specified; pass this to the TPM when processing a packet.
    While the locality is not currently checked for validity, a binding
    between locality and some distinguishing feature of the client domain
    (such as the XSM label) will need to be defined in order to properly
    support a multi-client vTPM.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 stubdom/Makefile            |    1 +
 stubdom/vtpm-locality.patch |   50 +++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.c         |    2 +-
 3 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 5372715..b714343 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -210,6 +210,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
 	patch -d $@ -p1 < vtpm-bufsize.patch
+	patch -d $@ -p1 < vtpm-locality.patch
 	mkdir $@/build
 	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-locality.patch b/stubdom/vtpm-locality.patch
new file mode 100644
index 0000000..8ab7dea
--- /dev/null
+++ b/stubdom/vtpm-locality.patch
@@ -0,0 +1,50 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index 60bbb90..f8f7f0f 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
+                              UINT32 setValueSize, BOOL ownerAuth,
+                              BOOL deactivated, BOOL disabled)
+ {
++  if (tpmData.stany.flags.localityModifier != 8)
++    return TPM_BAD_PARAMETER;
+   /* set the capability area with the specified data, on failure
+      deactivate the TPM */
+   switch (subCap) {
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..9e1cfb4 100644
+--- a/tpm/tpm_cmd_handler.c
++++ b/tpm/tpm_cmd_handler.c
+@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
+   tpm_extern_release();
+ }
+ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
+ {
+   TPM_REQUEST req;
+   TPM_RESPONSE rsp;
+@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
+   UINT32 len;
+   BOOL free_out;
+ 
+-  debug("tpm_handle_command()");
++  debug("tpm_handle_command(%d)", locality);
++  if (locality != -1)
++    tpmData.stany.flags.localityModifier = locality;
+ 
+   /* we need the whole packet at once, otherwise unmarshalling will fail */
+   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
+diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
+index eed749e..4c228bd 100644
+--- a/tpm/tpm_emulator.h
++++ b/tpm/tpm_emulator.h
+@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
+  * its usage. In case of an error, all internally allocated memory
+  * is released and the the state of out and out_size is unspecified.
+  */ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
+ 
+ #endif /* _TPM_EMULATOR_H_ */
+ 
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 3362ea8..10e7477 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -183,7 +183,7 @@ static void main_loop(void) {
          }
          /* If not disabled, do the command */
          else {
-            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
                error("tpm_handle_command() failed");
                create_error_response(tpmcmd, TPM_FAIL);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpha-0006BB-2Q; Sat, 13 Apr 2013 01:56:26 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphY-0006Aw-OZ
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:25 +0000
Received: from [85.158.139.211:27145] by server-6.bemta-5.messagelabs.com id
	D6/A9-21466-74BB8615; Sat, 13 Apr 2013 01:56:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1365818182!18603303!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4172 invoked from network); 13 Apr 2013 01:56:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphW-0006EQ-0R
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphV-0002iz-VS
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:21 +0000
Date: Sat, 13 Apr 2013 01:56:21 +0000
Message-Id: <E1UQphV-0002iz-VS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: Support locality field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 57c265546e7d12d2f44225928c6b5679ad0a14ba
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:24 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: Support locality field
    
    The vTPM protocol now contains a field allowing the locality of a
    command to be specified; pass this to the TPM when processing a packet.
    While the locality is not currently checked for validity, a binding
    between locality and some distinguishing feature of the client domain
    (such as the XSM label) will need to be defined in order to properly
    support a multi-client vTPM.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 stubdom/Makefile            |    1 +
 stubdom/vtpm-locality.patch |   50 +++++++++++++++++++++++++++++++++++++++++++
 stubdom/vtpm/vtpm.c         |    2 +-
 3 files changed, 52 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 5372715..b714343 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -210,6 +210,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	mv tpm_emulator-$(TPMEMU_VERSION) $@
 	patch -d $@ -p1 < tpmemu-$(TPMEMU_VERSION).patch;
 	patch -d $@ -p1 < vtpm-bufsize.patch
+	patch -d $@ -p1 < vtpm-locality.patch
 	mkdir $@/build
 	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm-locality.patch b/stubdom/vtpm-locality.patch
new file mode 100644
index 0000000..8ab7dea
--- /dev/null
+++ b/stubdom/vtpm-locality.patch
@@ -0,0 +1,50 @@
+diff --git a/tpm/tpm_capability.c b/tpm/tpm_capability.c
+index 60bbb90..f8f7f0f 100644
+--- a/tpm/tpm_capability.c
++++ b/tpm/tpm_capability.c
+@@ -949,6 +949,8 @@ static TPM_RESULT set_vendor(UINT32 subCap, BYTE *setValue,
+                              UINT32 setValueSize, BOOL ownerAuth,
+                              BOOL deactivated, BOOL disabled)
+ {
++  if (tpmData.stany.flags.localityModifier != 8)
++    return TPM_BAD_PARAMETER;
+   /* set the capability area with the specified data, on failure
+      deactivate the TPM */
+   switch (subCap) {
+diff --git a/tpm/tpm_cmd_handler.c b/tpm/tpm_cmd_handler.c
+index 288d1ce..9e1cfb4 100644
+--- a/tpm/tpm_cmd_handler.c
++++ b/tpm/tpm_cmd_handler.c
+@@ -4132,7 +4132,7 @@ void tpm_emulator_shutdown()
+   tpm_extern_release();
+ }
+ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size)
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality)
+ {
+   TPM_REQUEST req;
+   TPM_RESPONSE rsp;
+@@ -4140,7 +4140,9 @@ int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint3
+   UINT32 len;
+   BOOL free_out;
+ 
+-  debug("tpm_handle_command()");
++  debug("tpm_handle_command(%d)", locality);
++  if (locality != -1)
++    tpmData.stany.flags.localityModifier = locality;
+ 
+   /* we need the whole packet at once, otherwise unmarshalling will fail */
+   if (tpm_unmarshal_TPM_REQUEST((uint8_t**)&in, &in_size, &req) != 0) {
+diff --git a/tpm/tpm_emulator.h b/tpm/tpm_emulator.h
+index eed749e..4c228bd 100644
+--- a/tpm/tpm_emulator.h
++++ b/tpm/tpm_emulator.h
+@@ -59,7 +59,7 @@ void tpm_emulator_shutdown(void);
+  * its usage. In case of an error, all internally allocated memory
+  * is released and the the state of out and out_size is unspecified.
+  */ 
+-int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size);
++int tpm_handle_command(const uint8_t *in, uint32_t in_size, uint8_t **out, uint32_t *out_size, int locality);
+ 
+ #endif /* _TPM_EMULATOR_H_ */
+ 
diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 3362ea8..10e7477 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -183,7 +183,7 @@ static void main_loop(void) {
          }
          /* If not disabled, do the command */
          else {
-            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len)) != 0) {
+            if((res = tpm_handle_command(tpmcmd->req, tpmcmd->req_len, &tpmcmd->resp, &tpmcmd->resp_len, tpmcmd->locality)) != 0) {
                error("tpm_handle_command() failed");
                create_error_response(tpmcmd, TPM_FAIL);
             }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphl-0006DD-5i; Sat, 13 Apr 2013 01:56:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphj-0006Cp-It
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:35 +0000
Received: from [85.158.137.99:42761] by server-10.bemta-3.messagelabs.com id
	58/54-19664-25BB8615; Sat, 13 Apr 2013 01:56:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1365818192!12052373!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28747 invoked from network); 13 Apr 2013 01:56:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphg-0006EY-8Y
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphg-0002k5-5f
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:32 +0000
Date: Sat, 13 Apr 2013 01:56:32 +0000
Message-Id: <E1UQphg-0002k5-5f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: make state save
	operation atomic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 58c2ab7588c4d27ac569494ae4ec8e81795d0ca3
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:25 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: make state save operation atomic
    
    This changes the save format of the vtpm stubdom to include two copies
    of the saved data: one active, and one inactive. When saving the state,
    data is written to the inactive slot before updating the key and hash
    saved with the TPM Manager, which determines the active slot when the
    vTPM starts up.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpmblk.c |   74 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index b343bd8..fe529ab 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -26,6 +26,7 @@
 
 static struct blkfront_dev* blkdev = NULL;
 static int blkfront_fd = -1;
+static uint64_t slot_size = 0;
 
 int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
 {
@@ -45,6 +46,8 @@ int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
       goto error;
    }
 
+   slot_size = blkinfo.sectors * blkinfo.sector_size / 2;
+
    return 0;
 error:
    shutdown_blkfront(blkdev);
@@ -59,15 +62,20 @@ void shutdown_vtpmblk(void)
    blkdev = NULL;
 }
 
-int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
-   debug("Begin Write data=%p len=%u", data, data_length);
+   debug("Begin Write data=%p len=%u slot=%u ssize=%u", data, data_length, slot, slot_size);
+
+   if (data_length > slot_size - 4) {
+      error("vtpm data cannot fit in data slot (%d/%d).", data_length, slot_size - 4);
+      return -1;
+   }
 
    lenbuf = cpu_to_be32((uint32_t)data_length);
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("write(length) failed! error was %s", strerror(errno));
       return -1;
@@ -82,12 +90,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
    return 0;
 }
 
-int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("read(length) failed! error was %s", strerror(errno));
       return -1;
@@ -97,6 +105,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       error("read 0 data_length for NVM");
       return -1;
    }
+   if(*data_length > slot_size - 4) {
+      error("read invalid data_length for NVM");
+      return -1;
+   }
 
    *data = tpm_malloc(*data_length);
    if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
@@ -104,7 +116,7 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       return -1;
    }
 
-   info("Read %u bytes from NVM persistent storage", *data_length);
+   info("Read %u bytes from NVM persistent storage (slot %d)", *data_length, slot);
    return 0;
 }
 
@@ -221,6 +233,9 @@ egress:
    return rc;
 }
 
+/* Current active state slot, or -1 if no valid saved state exists */
+static int active_slot = -1;
+
 int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
    int rc;
    uint8_t* cipher = NULL;
@@ -228,12 +243,17 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
    uint8_t hashkey[HASHKEYSZ];
    uint8_t* symkey = hashkey + HASHSZ;
 
+   /* Switch to the other slot. Note that in a new vTPM, the read will not
+	* succeed, so active_slot will be -1 and we will write to slot 0.
+	*/
+   active_slot = !active_slot;
+
    /* Encrypt the data */
    if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
       goto abort_egress;
    }
    /* Write to disk */
-   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
       goto abort_egress;
    }
    /* Get sha1 hash of data */
@@ -256,7 +276,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    size_t cipher_len = 0;
    size_t keysize;
    uint8_t* hashkey = NULL;
-   uint8_t hash[HASHSZ];
+   uint8_t hash0[HASHSZ];
+   uint8_t hash1[HASHSZ];
    uint8_t* symkey;
 
    /* Retreive the hash and the key from the manager */
@@ -270,14 +291,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    symkey = hashkey + HASHSZ;
 
-   /* Read from disk now */
-   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+   active_slot = 0;
+   debug("Reading slot 0 from disk\n");
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
       goto abort_egress;
    }
 
    /* Compute the hash of the cipher text and compare */
-   sha1(cipher, cipher_len, hash);
-   if(memcmp(hash, hashkey, HASHSZ)) {
+   sha1(cipher, cipher_len, hash0);
+   if(!memcmp(hash0, hashkey, HASHSZ))
+      goto valid;
+
+   free(cipher);
+   cipher = NULL;
+
+   active_slot = 1;
+   debug("Reading slot 1 from disk (offset=%u)\n", slot_size);
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash1);
+   if(!memcmp(hash1, hashkey, HASHSZ))
+      goto valid;
+
+   {
       int i;
       error("NVM Storage Checksum failed!");
       printf("Expected: ");
@@ -285,14 +324,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
 	 printf("%02hhX ", hashkey[i]);
       }
       printf("\n");
-      printf("Actual:   ");
+      printf("Slot 0:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash0[i]);
+      }
+      printf("\n");
+      printf("Slot 1:   ");
       for(i = 0; i < HASHSZ; ++i) {
-	 printf("%02hhX ", hash[i]);
+	 printf("%02hhX ", hash1[i]);
       }
       printf("\n");
       rc = -1;
       goto abort_egress;
    }
+valid:
 
    /* Decrypt the blob */
    if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
@@ -300,6 +345,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    goto egress;
 abort_egress:
+   active_slot = -1;
 egress:
    free(cipher);
    free(hashkey);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphl-0006DD-5i; Sat, 13 Apr 2013 01:56:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphj-0006Cp-It
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:35 +0000
Received: from [85.158.137.99:42761] by server-10.bemta-3.messagelabs.com id
	58/54-19664-25BB8615; Sat, 13 Apr 2013 01:56:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1365818192!12052373!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28747 invoked from network); 13 Apr 2013 01:56:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphg-0006EY-8Y
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphg-0002k5-5f
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:32 +0000
Date: Sat, 13 Apr 2013 01:56:32 +0000
Message-Id: <E1UQphg-0002k5-5f@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: make state save
	operation atomic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 58c2ab7588c4d27ac569494ae4ec8e81795d0ca3
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:25 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: make state save operation atomic
    
    This changes the save format of the vtpm stubdom to include two copies
    of the saved data: one active, and one inactive. When saving the state,
    data is written to the inactive slot before updating the key and hash
    saved with the TPM Manager, which determines the active slot when the
    vTPM starts up.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpmblk.c |   74 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/stubdom/vtpm/vtpmblk.c b/stubdom/vtpm/vtpmblk.c
index b343bd8..fe529ab 100644
--- a/stubdom/vtpm/vtpmblk.c
+++ b/stubdom/vtpm/vtpmblk.c
@@ -26,6 +26,7 @@
 
 static struct blkfront_dev* blkdev = NULL;
 static int blkfront_fd = -1;
+static uint64_t slot_size = 0;
 
 int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
 {
@@ -45,6 +46,8 @@ int init_vtpmblk(struct tpmfront_dev* tpmfront_dev)
       goto error;
    }
 
+   slot_size = blkinfo.sectors * blkinfo.sector_size / 2;
+
    return 0;
 error:
    shutdown_blkfront(blkdev);
@@ -59,15 +62,20 @@ void shutdown_vtpmblk(void)
    blkdev = NULL;
 }
 
-int write_vtpmblk_raw(uint8_t *data, size_t data_length)
+static int write_vtpmblk_raw(uint8_t *data, size_t data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
-   debug("Begin Write data=%p len=%u", data, data_length);
+   debug("Begin Write data=%p len=%u slot=%u ssize=%u", data, data_length, slot, slot_size);
+
+   if (data_length > slot_size - 4) {
+      error("vtpm data cannot fit in data slot (%d/%d).", data_length, slot_size - 4);
+      return -1;
+   }
 
    lenbuf = cpu_to_be32((uint32_t)data_length);
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if((rc = write(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("write(length) failed! error was %s", strerror(errno));
       return -1;
@@ -82,12 +90,12 @@ int write_vtpmblk_raw(uint8_t *data, size_t data_length)
    return 0;
 }
 
-int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
+static int read_vtpmblk_raw(uint8_t **data, size_t *data_length, int slot)
 {
    int rc;
    uint32_t lenbuf;
 
-   lseek(blkfront_fd, 0, SEEK_SET);
+   lseek(blkfront_fd, slot * slot_size, SEEK_SET);
    if(( rc = read(blkfront_fd, (uint8_t*)&lenbuf, 4)) != 4) {
       error("read(length) failed! error was %s", strerror(errno));
       return -1;
@@ -97,6 +105,10 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       error("read 0 data_length for NVM");
       return -1;
    }
+   if(*data_length > slot_size - 4) {
+      error("read invalid data_length for NVM");
+      return -1;
+   }
 
    *data = tpm_malloc(*data_length);
    if((rc = read(blkfront_fd, *data, *data_length)) != *data_length) {
@@ -104,7 +116,7 @@ int read_vtpmblk_raw(uint8_t **data, size_t *data_length)
       return -1;
    }
 
-   info("Read %u bytes from NVM persistent storage", *data_length);
+   info("Read %u bytes from NVM persistent storage (slot %d)", *data_length, slot);
    return 0;
 }
 
@@ -221,6 +233,9 @@ egress:
    return rc;
 }
 
+/* Current active state slot, or -1 if no valid saved state exists */
+static int active_slot = -1;
+
 int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_length) {
    int rc;
    uint8_t* cipher = NULL;
@@ -228,12 +243,17 @@ int write_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t* data, size_t data_
    uint8_t hashkey[HASHKEYSZ];
    uint8_t* symkey = hashkey + HASHSZ;
 
+   /* Switch to the other slot. Note that in a new vTPM, the read will not
+	* succeed, so active_slot will be -1 and we will write to slot 0.
+	*/
+   active_slot = !active_slot;
+
    /* Encrypt the data */
    if((rc = encrypt_vtpmblk(data, data_length, &cipher, &cipher_len, symkey))) {
       goto abort_egress;
    }
    /* Write to disk */
-   if((rc = write_vtpmblk_raw(cipher, cipher_len))) {
+   if((rc = write_vtpmblk_raw(cipher, cipher_len, active_slot))) {
       goto abort_egress;
    }
    /* Get sha1 hash of data */
@@ -256,7 +276,8 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    size_t cipher_len = 0;
    size_t keysize;
    uint8_t* hashkey = NULL;
-   uint8_t hash[HASHSZ];
+   uint8_t hash0[HASHSZ];
+   uint8_t hash1[HASHSZ];
    uint8_t* symkey;
 
    /* Retreive the hash and the key from the manager */
@@ -270,14 +291,32 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    symkey = hashkey + HASHSZ;
 
-   /* Read from disk now */
-   if((rc = read_vtpmblk_raw(&cipher, &cipher_len))) {
+   active_slot = 0;
+   debug("Reading slot 0 from disk\n");
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 0))) {
       goto abort_egress;
    }
 
    /* Compute the hash of the cipher text and compare */
-   sha1(cipher, cipher_len, hash);
-   if(memcmp(hash, hashkey, HASHSZ)) {
+   sha1(cipher, cipher_len, hash0);
+   if(!memcmp(hash0, hashkey, HASHSZ))
+      goto valid;
+
+   free(cipher);
+   cipher = NULL;
+
+   active_slot = 1;
+   debug("Reading slot 1 from disk (offset=%u)\n", slot_size);
+   if((rc = read_vtpmblk_raw(&cipher, &cipher_len, 1))) {
+      goto abort_egress;
+   }
+
+   /* Compute the hash of the cipher text and compare */
+   sha1(cipher, cipher_len, hash1);
+   if(!memcmp(hash1, hashkey, HASHSZ))
+      goto valid;
+
+   {
       int i;
       error("NVM Storage Checksum failed!");
       printf("Expected: ");
@@ -285,14 +324,20 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
 	 printf("%02hhX ", hashkey[i]);
       }
       printf("\n");
-      printf("Actual:   ");
+      printf("Slot 0:   ");
+      for(i = 0; i < HASHSZ; ++i) {
+	 printf("%02hhX ", hash0[i]);
+      }
+      printf("\n");
+      printf("Slot 1:   ");
       for(i = 0; i < HASHSZ; ++i) {
-	 printf("%02hhX ", hash[i]);
+	 printf("%02hhX ", hash1[i]);
       }
       printf("\n");
       rc = -1;
       goto abort_egress;
    }
+valid:
 
    /* Decrypt the blob */
    if((rc = decrypt_vtpmblk(cipher, cipher_len, data, data_length, symkey))) {
@@ -300,6 +345,7 @@ int read_vtpmblk(struct tpmfront_dev* tpmfront_dev, uint8_t** data, size_t *data
    }
    goto egress;
 abort_egress:
+   active_slot = -1;
 egress:
    free(cipher);
    free(hashkey);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphu-0006F4-8L; Sat, 13 Apr 2013 01:56:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpht-0006Eh-C0
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:45 +0000
Received: from [85.158.139.211:29311] by server-6.bemta-5.messagelabs.com id
	A2/C9-21466-C5BB8615; Sat, 13 Apr 2013 01:56:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1365818202!18666847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31474 invoked from network); 13 Apr 2013 01:56:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphq-0006Ee-F9
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphq-0002kU-DP
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:42 +0000
Date: Sat, 13 Apr 2013 01:56:42 +0000
Message-Id: <E1UQphq-0002kU-DP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: support multiple backends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa00660201c8e8b1079298f0f865e72724d34f67
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:26 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: support multiple backends
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpm.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 10e7477..8f8095f 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
 
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
-   domid_t domid;		/* Domid of frontend */
-   unsigned int handle;	/* handle of frontend */
    int res = -1;
 
    info("VTPM Initializing\n");
@@ -162,15 +160,7 @@ static void main_loop(void) {
       goto abort_postpcrs;
    }
 
-   /* Wait for the frontend domain to connect */
-   info("Waiting for frontend domain to connect..");
-   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
-      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
-   } else {
-      error("Unable to attach to a frontend");
-   }
-
-   tpmcmd = tpmback_req(domid, handle);
+   tpmcmd = tpmback_req_any();
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
@@ -194,7 +184,7 @@ static void main_loop(void) {
       tpmback_resp(tpmcmd);
 
       /* Wait for the next request */
-      tpmcmd = tpmback_req(domid, handle);
+      tpmcmd = tpmback_req_any();
 
    }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:56:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQphu-0006F4-8L; Sat, 13 Apr 2013 01:56:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpht-0006Eh-C0
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:45 +0000
Received: from [85.158.139.211:29311] by server-6.bemta-5.messagelabs.com id
	A2/C9-21466-C5BB8615; Sat, 13 Apr 2013 01:56:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1365818202!18666847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31474 invoked from network); 13 Apr 2013 01:56:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphq-0006Ee-F9
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQphq-0002kU-DP
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:42 +0000
Date: Sat, 13 Apr 2013 01:56:42 +0000
Message-Id: <E1UQphq-0002kU-DP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: support multiple backends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa00660201c8e8b1079298f0f865e72724d34f67
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:26 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: support multiple backends
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpm.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 10e7477..8f8095f 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -141,8 +141,6 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
 
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
-   domid_t domid;		/* Domid of frontend */
-   unsigned int handle;	/* handle of frontend */
    int res = -1;
 
    info("VTPM Initializing\n");
@@ -162,15 +160,7 @@ static void main_loop(void) {
       goto abort_postpcrs;
    }
 
-   /* Wait for the frontend domain to connect */
-   info("Waiting for frontend domain to connect..");
-   if(tpmback_wait_for_frontend_connect(&domid, &handle) == 0) {
-      info("VTPM attached to Frontend %u/%u", (unsigned int) domid, handle);
-   } else {
-      error("Unable to attach to a frontend");
-   }
-
-   tpmcmd = tpmback_req(domid, handle);
+   tpmcmd = tpmback_req_any();
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
@@ -194,7 +184,7 @@ static void main_loop(void) {
       tpmback_resp(tpmcmd);
 
       /* Wait for the next request */
-      tpmcmd = tpmback_req(domid, handle);
+      tpmcmd = tpmback_req_any();
 
    }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:57:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:57:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpi8-0006HM-Bk; Sat, 13 Apr 2013 01:57:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpi6-0006Gd-Io
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:58 +0000
Received: from [85.158.139.211:33494] by server-3.bemta-5.messagelabs.com id
	5A/0A-17256-66BB8615; Sat, 13 Apr 2013 01:56:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1365818212!18646596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28556 invoked from network); 13 Apr 2013 01:56:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpi0-0006Er-MJ
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpi0-0002kq-Je
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:52 +0000
Date: Sat, 13 Apr 2013 01:56:52 +0000
Message-Id: <E1UQpi0-0002kq-Je@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: constrain locality by
	XSM label
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4eea1da06217cf5b8ea83387b79dcc6f332354fb
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:27 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: constrain locality by XSM label
    
    This adds the ability for a vTPM to constrain what localities a given
    client domain can use based on its XSM label. For example:
    
      locality=user_1:vm_r:domU_t=0,1,2 locality=user_1:vm_r:watcher_t=5
    
    An arbitrary prefix can be matched by using a '*'.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpm.c |   76 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 8f8095f..f67de18 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -139,6 +139,35 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
    return true;
 }
 
+struct locality_item {
+	char* lbl;
+	uint8_t mask[32];
+};
+#define MAX_CLIENT_LOCALITIES 16
+static struct locality_item client_locality[MAX_CLIENT_LOCALITIES];
+static int nr_client_localities = 0;
+
+static void *generate_locality_mask(domid_t domid, unsigned int handle)
+{
+   char label[512];
+   int i;
+   if (tpmback_get_peercontext(domid, handle, label, sizeof(label)))
+      BUG();
+   for(i=0; i < nr_client_localities; i++) {
+      if (!strcmp(client_locality[i].lbl, label))
+         goto found;
+      if (client_locality[i].lbl[0] == '*') {
+	 char * f = strstr(label, 1 + client_locality[i].lbl);
+	 if (!strcmp(f, 1 + client_locality[i].lbl))
+	    goto found;
+      }
+   }
+   return NULL;
+ found:
+   tpmback_set_opaque(domid, handle, client_locality[i].mask);
+   return client_locality[i].mask;
+}
+
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
    int res = -1;
@@ -164,11 +193,24 @@ static void main_loop(void) {
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
+	 uint8_t* locality_mask = tpmcmd->opaque;
+	 uint8_t locality_bit = (1 << (tpmcmd->locality & 7));
+	 int locality_byte = tpmcmd->locality >> 3;
 	 tpmcmd->resp = NULL;
 	 tpmcmd->resp_len = 0;
 
-         /* First check for disabled ordinals */
-         if(!check_ordinal(tpmcmd)) {
+	 if (nr_client_localities && !locality_mask)
+	    locality_mask = generate_locality_mask(tpmcmd->domid, tpmcmd->handle);
+	 if (nr_client_localities && !locality_mask) {
+            error("Unknown client label in tpm_handle_command");
+            create_error_response(tpmcmd, TPM_FAIL);
+	 }
+	 else if (nr_client_localities && !(locality_mask[locality_byte] & locality_bit)) {
+            error("Invalid locality (%d) for client in tpm_handle_command", tpmcmd->locality);
+            create_error_response(tpmcmd, TPM_FAIL);
+	 }
+         /* Check for disabled ordinals */
+         else if(!check_ordinal(tpmcmd)) {
             create_error_response(tpmcmd, TPM_BAD_ORDINAL);
          }
          /* If not disabled, do the command */
@@ -273,6 +315,36 @@ int parse_cmd_line(int argc, char** argv)
             pch = strtok(NULL, ",");
          }
       }
+      else if(!strncmp(argv[i], "locality=", 9)) {
+        char *lbl = argv[i] + 9;
+	char *pch = strchr(lbl, '=');
+	uint8_t* locality_mask = client_locality[nr_client_localities].mask;
+	if (pch == NULL) {
+		 error("Invalid locality specification: %s", lbl);
+		 return -1;
+	}
+	if (nr_client_localities == MAX_CLIENT_LOCALITIES) {
+		error("Too many locality specifications");
+		return -1;
+	}
+	client_locality[nr_client_localities].lbl = lbl;
+	memset(locality_mask, 0, 32);
+	nr_client_localities++;
+	*pch = 0;
+	pch = strtok(pch + 1, ",");
+	while (pch != NULL) {
+		unsigned int loc;
+		if (sscanf(pch, "%u", &loc) == 1 && loc < 256) {
+			uint8_t locality_bit = (1 << (loc & 7));
+			int locality_byte = loc >> 3;
+			locality_mask[locality_byte] |= locality_bit;
+		} else {
+			error("Invalid locality item: %s", pch);
+			return -1;
+		}
+		pch = strtok(NULL, ",");
+	}
+      }
       else {
 	 error("Invalid command line option `%s'", argv[i]);
       }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:57:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:57:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpi8-0006HM-Bk; Sat, 13 Apr 2013 01:57:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpi6-0006Gd-Io
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:58 +0000
Received: from [85.158.139.211:33494] by server-3.bemta-5.messagelabs.com id
	5A/0A-17256-66BB8615; Sat, 13 Apr 2013 01:56:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1365818212!18646596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28556 invoked from network); 13 Apr 2013 01:56:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:56:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpi0-0006Er-MJ
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpi0-0002kq-Je
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:56:52 +0000
Date: Sat, 13 Apr 2013 01:56:52 +0000
Message-Id: <E1UQpi0-0002kq-Je@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/vtpm: constrain locality by
	XSM label
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4eea1da06217cf5b8ea83387b79dcc6f332354fb
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:27 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:17 2013 +0100

    stubdom/vtpm: constrain locality by XSM label
    
    This adds the ability for a vTPM to constrain what localities a given
    client domain can use based on its XSM label. For example:
    
      locality=user_1:vm_r:domU_t=0,1,2 locality=user_1:vm_r:watcher_t=5
    
    An arbitrary prefix can be matched by using a '*'.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 stubdom/vtpm/vtpm.c |   76 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpm/vtpm.c b/stubdom/vtpm/vtpm.c
index 8f8095f..f67de18 100644
--- a/stubdom/vtpm/vtpm.c
+++ b/stubdom/vtpm/vtpm.c
@@ -139,6 +139,35 @@ int check_ordinal(tpmcmd_t* tpmcmd) {
    return true;
 }
 
+struct locality_item {
+	char* lbl;
+	uint8_t mask[32];
+};
+#define MAX_CLIENT_LOCALITIES 16
+static struct locality_item client_locality[MAX_CLIENT_LOCALITIES];
+static int nr_client_localities = 0;
+
+static void *generate_locality_mask(domid_t domid, unsigned int handle)
+{
+   char label[512];
+   int i;
+   if (tpmback_get_peercontext(domid, handle, label, sizeof(label)))
+      BUG();
+   for(i=0; i < nr_client_localities; i++) {
+      if (!strcmp(client_locality[i].lbl, label))
+         goto found;
+      if (client_locality[i].lbl[0] == '*') {
+	 char * f = strstr(label, 1 + client_locality[i].lbl);
+	 if (!strcmp(f, 1 + client_locality[i].lbl))
+	    goto found;
+      }
+   }
+   return NULL;
+ found:
+   tpmback_set_opaque(domid, handle, client_locality[i].mask);
+   return client_locality[i].mask;
+}
+
 static void main_loop(void) {
    tpmcmd_t* tpmcmd = NULL;
    int res = -1;
@@ -164,11 +193,24 @@ static void main_loop(void) {
    while(tpmcmd) {
       /* Handle the request */
       if(tpmcmd->req_len) {
+	 uint8_t* locality_mask = tpmcmd->opaque;
+	 uint8_t locality_bit = (1 << (tpmcmd->locality & 7));
+	 int locality_byte = tpmcmd->locality >> 3;
 	 tpmcmd->resp = NULL;
 	 tpmcmd->resp_len = 0;
 
-         /* First check for disabled ordinals */
-         if(!check_ordinal(tpmcmd)) {
+	 if (nr_client_localities && !locality_mask)
+	    locality_mask = generate_locality_mask(tpmcmd->domid, tpmcmd->handle);
+	 if (nr_client_localities && !locality_mask) {
+            error("Unknown client label in tpm_handle_command");
+            create_error_response(tpmcmd, TPM_FAIL);
+	 }
+	 else if (nr_client_localities && !(locality_mask[locality_byte] & locality_bit)) {
+            error("Invalid locality (%d) for client in tpm_handle_command", tpmcmd->locality);
+            create_error_response(tpmcmd, TPM_FAIL);
+	 }
+         /* Check for disabled ordinals */
+         else if(!check_ordinal(tpmcmd)) {
             create_error_response(tpmcmd, TPM_BAD_ORDINAL);
          }
          /* If not disabled, do the command */
@@ -273,6 +315,36 @@ int parse_cmd_line(int argc, char** argv)
             pch = strtok(NULL, ",");
          }
       }
+      else if(!strncmp(argv[i], "locality=", 9)) {
+        char *lbl = argv[i] + 9;
+	char *pch = strchr(lbl, '=');
+	uint8_t* locality_mask = client_locality[nr_client_localities].mask;
+	if (pch == NULL) {
+		 error("Invalid locality specification: %s", lbl);
+		 return -1;
+	}
+	if (nr_client_localities == MAX_CLIENT_LOCALITIES) {
+		error("Too many locality specifications");
+		return -1;
+	}
+	client_locality[nr_client_localities].lbl = lbl;
+	memset(locality_mask, 0, 32);
+	nr_client_localities++;
+	*pch = 0;
+	pch = strtok(pch + 1, ",");
+	while (pch != NULL) {
+		unsigned int loc;
+		if (sscanf(pch, "%u", &loc) == 1 && loc < 256) {
+			uint8_t locality_bit = (1 << (loc & 7));
+			int locality_byte = loc >> 3;
+			locality_mask[locality_byte] |= locality_bit;
+		} else {
+			error("Invalid locality item: %s", pch);
+			return -1;
+		}
+		pch = strtok(NULL, ",");
+	}
+      }
       else {
 	 error("Invalid command line option `%s'", argv[i]);
       }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:57:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpiH-0006Ij-FZ; Sat, 13 Apr 2013 01:57:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpiG-0006IS-4l
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:57:08 +0000
Received: from [85.158.137.99:54855] by server-4.bemta-3.messagelabs.com id
	55/8C-21470-37BB8615; Sat, 13 Apr 2013 01:57:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1365818225!12052402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31253 invoked from network); 13 Apr 2013 01:57:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:57:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpiA-0006FQ-V9
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:57:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpiA-0002lD-Qx
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:57:02 +0000
Date: Sat, 13 Apr 2013 01:57:02 +0000
Message-Id: <E1UQpiA-0002lD-Qx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/grub: send kernel measurements
	to vTPM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d78dab3eca85f9ff14af55583d83829e96a76b76
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:28 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:18 2013 +0100

    stubdom/grub: send kernel measurements to vTPM
    
    This allows a domU with an arbitrary kernel and initrd to take advantage
    of the static root of trust provided by a vTPM.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/misc/vtpm.txt      |   41 +++++++++++++++++++++++++++-------
 stubdom/Makefile        |    2 +-
 stubdom/grub/Makefile   |    1 +
 stubdom/grub/kexec.c    |   54 +++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/grub/minios.cfg |    1 +
 5 files changed, 89 insertions(+), 10 deletions(-)

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index c0a6054..b8979a3 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -1,7 +1,7 @@
 Copyright (c) 2010-2012 United States Government, as represented by
 the Secretary of Defense.  All rights reserved.
 November 12 2012
-Authors: Matthew Fioravante (JHUAPL),
+Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)
 
 This document describes the virtual Trusted Platform Module (vTPM) subsystem
 for Xen. The reader is assumed to have familiarity with building and installing
@@ -15,7 +15,8 @@ operating system (a DomU).  This allows programs to interact with a TPM in a
 virtual system the same way they interact with a TPM on the physical system.
 Each guest gets its own unique, emulated, software TPM.  However, each of the
 vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which
-seals the secrets to the Physical TPM.  Thus, the vTPM subsystem extends the
+seals the secrets to the Physical TPM.  If the process of creating each of these
+domains (manager, vTPM, and guest) is trusted, the vTPM subsystem extends the
 chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
 major component of vTPM is implemented as a separate domain, providing secure
 separation guaranteed by the hypervisor. The vTPM domains are implemented in
@@ -119,14 +120,17 @@ the stubdom tree.
 Compiling the LINUX dom0 kernel:
 --------------------------------
 
-The Linux dom0 kernel has no special prerequisites.
+The Linux dom0 kernel should not try accessing the TPM while the vTPM
+Manager domain is accessing it; the simplest way to accomplish this is
+to ensure the kernel is compiled without a driver for the TPM, or avoid
+loading the driver by blacklisting the module.
 
 Compiling the LINUX domU kernel:
 --------------------------------
 
-The domU kernel used by domains with vtpms must
-include the xen-tpmfront.ko driver. It can be built
-directly into the kernel or as a module.
+The domU kernel used by domains with vtpms must include the xen-tpmfront.ko
+driver. It can be built directly into the kernel or as a module; however, some
+features such as IMA require the TPM to be built in to the kernel.
 
 CONFIG_TCG_TPM=y
 CONFIG_TCG_XEN=y
@@ -160,9 +164,10 @@ disk=["file:/var/vtpmmgr-stubdom.img,hda,w"]
 name="vtpmmgr"
 iomem=["fed40,5"]
 
-The iomem line tells xl to allow access to the TPM
-IO memory pages, which are 5 pages that start at
-0xfed40000.
+The iomem line tells xl to allow access to all of the TPM IO memory
+pages, which are 5 pages (one per locality) that start at 0xfed40000. By
+default, the TPM manager uses locality 0 (so only the page at 0xfed40 is
+needed); this can be changed on the domain's command line.
 
 Starting and stopping the manager:
 ----------------------------------
@@ -285,6 +290,24 @@ On guest:
 You may wish to write a script to start your vtpm and guest together.
 
 ------------------------------
+INTEGRATION WITH PV-GRUB
+------------------------------
+
+The vTPM currently starts up with all PCRs set to their default values (all
+zeros for the lower 16).  This means that any decisions about the
+trustworthiness of the created domain must be made based on the environment that
+created the vTPM and the domU; for example, a system that only constructs images
+using a trusted configuration and guest kernel be able to provide guarantees
+about the guests and any measurements done that kernel (such as the IMA TCB
+log).  Guests wishing to use a custom kernel in such a secure environment are
+often started using the pv-grub bootloader as the kernel, which then can load
+the untrusted kernel without needing to parse an untrusted filesystem and kernel
+in dom0.  If the pv-grub stub domain succeeds in connecting to a vTPM, it will
+extend the hash of the kernel that it boots into PCR #4, and will extend the
+command line and initrd into PCR #5 before booting so that a domU booted in this
+way can attest to its early boot state.
+
+------------------------------
 MORE INFORMATION
 ------------------------------
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index b714343..427e4d6 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -400,7 +400,7 @@ grub-upstream: grub-$(GRUB_VERSION).tar.gz
 	done
 
 .PHONY: grub
-grub: grub-upstream $(CROSS_ROOT)
+grub: cross-polarssl grub-upstream $(CROSS_ROOT)
 	mkdir -p grub-$(XEN_TARGET_ARCH)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d6e3a1e..6bd2c4c 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -60,6 +60,7 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
 
 PV_GRUB_SOURCES = kexec.c mini-os.c
+PV_GRUB_SOURCES += ../polarssl-$(XEN_TARGET_ARCH)/library/sha1.o
 
 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
 
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index b21c91a..cef357e 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -28,7 +28,9 @@
 #include <blkfront.h>
 #include <netfront.h>
 #include <fbfront.h>
+#include <tpmfront.h>
 #include <shared.h>
+#include <byteswap.h>
 
 #include "mini-os.h"
 
@@ -54,6 +56,22 @@ static unsigned long allocated;
 int pin_table(xc_interface *xc_handle, unsigned int type, unsigned long mfn,
               domid_t dom);
 
+#define TPM_TAG_RQU_COMMAND 0xC1
+#define TPM_ORD_Extend 20
+
+struct pcr_extend_cmd {
+	uint16_t tag;
+	uint32_t size;
+	uint32_t ord;
+
+	uint32_t pcr;
+	unsigned char hash[20];
+} __attribute__((packed));
+
+/* Not imported from polarssl's header since the prototype unhelpfully defines
+ * the input as unsigned char, which causes pointer type mismatches */
+void sha1(const void *input, size_t ilen, unsigned char output[20]);
+
 /* We need mfn to appear as target_pfn, so exchange with the MFN there */
 static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_t source_mfn)
 {
@@ -117,6 +135,40 @@ int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
     return 0;
 }
 
+static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
+{
+	struct tpmfront_dev* tpm = init_tpmfront(NULL);
+	uint8_t *resp;
+	size_t resplen = 0;
+	struct pcr_extend_cmd cmd;
+
+	/* If all guests have access to a vTPM, it may be useful to replace this
+	 * with ASSERT(tpm) to prevent configuration errors from allowing a guest
+	 * to boot without a TPM (or with a TPM that has not been sent any
+	 * measurements, which could allow forging the measurements).
+	 */
+	if (!tpm)
+		return;
+
+	cmd.tag = bswap_16(TPM_TAG_RQU_COMMAND);
+	cmd.size = bswap_32(sizeof(cmd));
+	cmd.ord = bswap_32(TPM_ORD_Extend);
+	cmd.pcr = bswap_32(4); // PCR #4 for kernel
+	sha1(dom->kernel_blob, dom->kernel_size, cmd.hash);
+
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for cmdline
+	sha1(cmdline, strlen(cmdline), cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for initrd
+	sha1(dom->ramdisk_blob, dom->ramdisk_size, cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	shutdown_tpmfront(tpm);
+}
+
 void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
 {
     struct xc_dom_image *dom;
@@ -151,6 +203,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->console_evtchn = start_info.console.domU.evtchn;
     dom->xenstore_evtchn = start_info.store_evtchn;
 
+    tpm_hash2pcr(dom, cmdline);
+
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
         grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
index 40cfa68..8df4909 100644
--- a/stubdom/grub/minios.cfg
+++ b/stubdom/grub/minios.cfg
@@ -1,2 +1,3 @@
 CONFIG_START_NETWORK=n
 CONFIG_SPARSE_BSS=n
+CONFIG_TPMFRONT=y
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 01:57:10 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 01:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UQpiH-0006Ij-FZ; Sat, 13 Apr 2013 01:57:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpiG-0006IS-4l
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:57:08 +0000
Received: from [85.158.137.99:54855] by server-4.bemta-3.messagelabs.com id
	55/8C-21470-37BB8615; Sat, 13 Apr 2013 01:57:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1365818225!12052402!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31253 invoked from network); 13 Apr 2013 01:57:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 01:57:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpiA-0006FQ-V9
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:57:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UQpiA-0002lD-Qx
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 01:57:02 +0000
Date: Sat, 13 Apr 2013 01:57:02 +0000
Message-Id: <E1UQpiA-0002lD-Qx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] stubdom/grub: send kernel measurements
	to vTPM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d78dab3eca85f9ff14af55583d83829e96a76b76
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Mar 21 16:11:28 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 12 14:28:18 2013 +0100

    stubdom/grub: send kernel measurements to vTPM
    
    This allows a domU with an arbitrary kernel and initrd to take advantage
    of the static root of trust provided by a vTPM.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    Acked-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
---
 docs/misc/vtpm.txt      |   41 +++++++++++++++++++++++++++-------
 stubdom/Makefile        |    2 +-
 stubdom/grub/Makefile   |    1 +
 stubdom/grub/kexec.c    |   54 +++++++++++++++++++++++++++++++++++++++++++++++
 stubdom/grub/minios.cfg |    1 +
 5 files changed, 89 insertions(+), 10 deletions(-)

diff --git a/docs/misc/vtpm.txt b/docs/misc/vtpm.txt
index c0a6054..b8979a3 100644
--- a/docs/misc/vtpm.txt
+++ b/docs/misc/vtpm.txt
@@ -1,7 +1,7 @@
 Copyright (c) 2010-2012 United States Government, as represented by
 the Secretary of Defense.  All rights reserved.
 November 12 2012
-Authors: Matthew Fioravante (JHUAPL),
+Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)
 
 This document describes the virtual Trusted Platform Module (vTPM) subsystem
 for Xen. The reader is assumed to have familiarity with building and installing
@@ -15,7 +15,8 @@ operating system (a DomU).  This allows programs to interact with a TPM in a
 virtual system the same way they interact with a TPM on the physical system.
 Each guest gets its own unique, emulated, software TPM.  However, each of the
 vTPM's secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which
-seals the secrets to the Physical TPM.  Thus, the vTPM subsystem extends the
+seals the secrets to the Physical TPM.  If the process of creating each of these
+domains (manager, vTPM, and guest) is trusted, the vTPM subsystem extends the
 chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
 major component of vTPM is implemented as a separate domain, providing secure
 separation guaranteed by the hypervisor. The vTPM domains are implemented in
@@ -119,14 +120,17 @@ the stubdom tree.
 Compiling the LINUX dom0 kernel:
 --------------------------------
 
-The Linux dom0 kernel has no special prerequisites.
+The Linux dom0 kernel should not try accessing the TPM while the vTPM
+Manager domain is accessing it; the simplest way to accomplish this is
+to ensure the kernel is compiled without a driver for the TPM, or avoid
+loading the driver by blacklisting the module.
 
 Compiling the LINUX domU kernel:
 --------------------------------
 
-The domU kernel used by domains with vtpms must
-include the xen-tpmfront.ko driver. It can be built
-directly into the kernel or as a module.
+The domU kernel used by domains with vtpms must include the xen-tpmfront.ko
+driver. It can be built directly into the kernel or as a module; however, some
+features such as IMA require the TPM to be built in to the kernel.
 
 CONFIG_TCG_TPM=y
 CONFIG_TCG_XEN=y
@@ -160,9 +164,10 @@ disk=["file:/var/vtpmmgr-stubdom.img,hda,w"]
 name="vtpmmgr"
 iomem=["fed40,5"]
 
-The iomem line tells xl to allow access to the TPM
-IO memory pages, which are 5 pages that start at
-0xfed40000.
+The iomem line tells xl to allow access to all of the TPM IO memory
+pages, which are 5 pages (one per locality) that start at 0xfed40000. By
+default, the TPM manager uses locality 0 (so only the page at 0xfed40 is
+needed); this can be changed on the domain's command line.
 
 Starting and stopping the manager:
 ----------------------------------
@@ -285,6 +290,24 @@ On guest:
 You may wish to write a script to start your vtpm and guest together.
 
 ------------------------------
+INTEGRATION WITH PV-GRUB
+------------------------------
+
+The vTPM currently starts up with all PCRs set to their default values (all
+zeros for the lower 16).  This means that any decisions about the
+trustworthiness of the created domain must be made based on the environment that
+created the vTPM and the domU; for example, a system that only constructs images
+using a trusted configuration and guest kernel be able to provide guarantees
+about the guests and any measurements done that kernel (such as the IMA TCB
+log).  Guests wishing to use a custom kernel in such a secure environment are
+often started using the pv-grub bootloader as the kernel, which then can load
+the untrusted kernel without needing to parse an untrusted filesystem and kernel
+in dom0.  If the pv-grub stub domain succeeds in connecting to a vTPM, it will
+extend the hash of the kernel that it boots into PCR #4, and will extend the
+command line and initrd into PCR #5 before booting so that a domU booted in this
+way can attest to its early boot state.
+
+------------------------------
 MORE INFORMATION
 ------------------------------
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index b714343..427e4d6 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -400,7 +400,7 @@ grub-upstream: grub-$(GRUB_VERSION).tar.gz
 	done
 
 .PHONY: grub
-grub: grub-upstream $(CROSS_ROOT)
+grub: cross-polarssl grub-upstream $(CROSS_ROOT)
 	mkdir -p grub-$(XEN_TARGET_ARCH)
 	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C $@ OBJ_DIR=$(CURDIR)/grub-$(XEN_TARGET_ARCH)
 
diff --git a/stubdom/grub/Makefile b/stubdom/grub/Makefile
index d6e3a1e..6bd2c4c 100644
--- a/stubdom/grub/Makefile
+++ b/stubdom/grub/Makefile
@@ -60,6 +60,7 @@ NETBOOT_SOURCES:=$(addprefix netboot/,$(NETBOOT_SOURCES))
 $(BOOT): DEF_CPPFLAGS+=-D__ASSEMBLY__
 
 PV_GRUB_SOURCES = kexec.c mini-os.c
+PV_GRUB_SOURCES += ../polarssl-$(XEN_TARGET_ARCH)/library/sha1.o
 
 SOURCES = $(NETBOOT_SOURCES) $(STAGE2_SOURCES) $(PV_GRUB_SOURCES)
 
diff --git a/stubdom/grub/kexec.c b/stubdom/grub/kexec.c
index b21c91a..cef357e 100644
--- a/stubdom/grub/kexec.c
+++ b/stubdom/grub/kexec.c
@@ -28,7 +28,9 @@
 #include <blkfront.h>
 #include <netfront.h>
 #include <fbfront.h>
+#include <tpmfront.h>
 #include <shared.h>
+#include <byteswap.h>
 
 #include "mini-os.h"
 
@@ -54,6 +56,22 @@ static unsigned long allocated;
 int pin_table(xc_interface *xc_handle, unsigned int type, unsigned long mfn,
               domid_t dom);
 
+#define TPM_TAG_RQU_COMMAND 0xC1
+#define TPM_ORD_Extend 20
+
+struct pcr_extend_cmd {
+	uint16_t tag;
+	uint32_t size;
+	uint32_t ord;
+
+	uint32_t pcr;
+	unsigned char hash[20];
+} __attribute__((packed));
+
+/* Not imported from polarssl's header since the prototype unhelpfully defines
+ * the input as unsigned char, which causes pointer type mismatches */
+void sha1(const void *input, size_t ilen, unsigned char output[20]);
+
 /* We need mfn to appear as target_pfn, so exchange with the MFN there */
 static void do_exchange(struct xc_dom_image *dom, xen_pfn_t target_pfn, xen_pfn_t source_mfn)
 {
@@ -117,6 +135,40 @@ int kexec_allocate(struct xc_dom_image *dom, xen_vaddr_t up_to)
     return 0;
 }
 
+static void tpm_hash2pcr(struct xc_dom_image *dom, char *cmdline)
+{
+	struct tpmfront_dev* tpm = init_tpmfront(NULL);
+	uint8_t *resp;
+	size_t resplen = 0;
+	struct pcr_extend_cmd cmd;
+
+	/* If all guests have access to a vTPM, it may be useful to replace this
+	 * with ASSERT(tpm) to prevent configuration errors from allowing a guest
+	 * to boot without a TPM (or with a TPM that has not been sent any
+	 * measurements, which could allow forging the measurements).
+	 */
+	if (!tpm)
+		return;
+
+	cmd.tag = bswap_16(TPM_TAG_RQU_COMMAND);
+	cmd.size = bswap_32(sizeof(cmd));
+	cmd.ord = bswap_32(TPM_ORD_Extend);
+	cmd.pcr = bswap_32(4); // PCR #4 for kernel
+	sha1(dom->kernel_blob, dom->kernel_size, cmd.hash);
+
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for cmdline
+	sha1(cmdline, strlen(cmdline), cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	cmd.pcr = bswap_32(5); // PCR #5 for initrd
+	sha1(dom->ramdisk_blob, dom->ramdisk_size, cmd.hash);
+	tpmfront_cmd(tpm, (void*)&cmd, sizeof(cmd), &resp, &resplen);
+
+	shutdown_tpmfront(tpm);
+}
+
 void kexec(void *kernel, long kernel_size, void *module, long module_size, char *cmdline, unsigned long flags)
 {
     struct xc_dom_image *dom;
@@ -151,6 +203,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     dom->console_evtchn = start_info.console.domU.evtchn;
     dom->xenstore_evtchn = start_info.store_evtchn;
 
+    tpm_hash2pcr(dom, cmdline);
+
     if ( (rc = xc_dom_boot_xen_init(dom, xc_handle, domid)) != 0 ) {
         grub_printf("xc_dom_boot_xen_init returned %d\n", rc);
         errnum = ERR_BOOT_FAILURE;
diff --git a/stubdom/grub/minios.cfg b/stubdom/grub/minios.cfg
index 40cfa68..8df4909 100644
--- a/stubdom/grub/minios.cfg
+++ b/stubdom/grub/minios.cfg
@@ -1,2 +1,3 @@
 CONFIG_START_NETWORK=n
 CONFIG_SPARSE_BSS=n
+CONFIG_TPMFRONT=y
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 20:44:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 20:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UR7Iu-0006BR-2m; Sat, 13 Apr 2013 20:44:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR7Is-0006BJ-Ot
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 20:44:06 +0000
Received: from [85.158.143.99:31754] by server-1.bemta-4.messagelabs.com id
	EA/3E-06203-593C9615; Sat, 13 Apr 2013 20:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1365885843!24717810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29907 invoked from network); 13 Apr 2013 20:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 20:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR7Ip-0002ea-Ib
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 20:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR7Ip-0002tx-93
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 20:44:03 +0000
Date: Sat, 13 Apr 2013 20:44:03 +0000
Message-Id: <E1UR7Ip-0002tx-93@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] update Xen version to 4.1.5-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c57664c8ff56c7ec4b156ff09ee337e5cab43e6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 12 13:42:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 12 13:42:25 2013 +0200

    update Xen version to 4.1.5-rc2
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index b49894f..6e0ed76 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .5-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 20:44:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 20:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UR7Iu-0006BR-2m; Sat, 13 Apr 2013 20:44:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR7Is-0006BJ-Ot
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 20:44:06 +0000
Received: from [85.158.143.99:31754] by server-1.bemta-4.messagelabs.com id
	EA/3E-06203-593C9615; Sat, 13 Apr 2013 20:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1365885843!24717810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29907 invoked from network); 13 Apr 2013 20:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 20:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR7Ip-0002ea-Ib
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 20:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR7Ip-0002tx-93
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 20:44:03 +0000
Date: Sat, 13 Apr 2013 20:44:03 +0000
Message-Id: <E1UR7Ip-0002tx-93@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] update Xen version to 4.1.5-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c57664c8ff56c7ec4b156ff09ee337e5cab43e6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 12 13:42:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 12 13:42:25 2013 +0200

    update Xen version to 4.1.5-rc2
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index b49894f..6e0ed76 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .5-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 22:44:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 22:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UR9B2-0006nF-Vu; Sat, 13 Apr 2013 22:44:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR9B1-0006n0-9h
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 22:44:07 +0000
Received: from [85.158.137.99:36411] by server-5.bemta-3.messagelabs.com id
	4A/97-30636-6BFD9615; Sat, 13 Apr 2013 22:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1365893044!16385934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3855 invoked from network); 13 Apr 2013 22:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 22:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR9Aw-0003sM-Ho
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 22:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR9Aw-0005wP-E5
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 22:44:02 +0000
Date: Sat, 13 Apr 2013 22:44:02 +0000
Message-Id: <E1UR9Aw-0005wP-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.2-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 321e742eab7a36ffd18ac64f246f341015a007e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 12 13:41:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 12 13:41:19 2013 +0200

    update Xen version to 4.2.2-rc2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 109e3ea..6aa0c43 100644
--- a/Config.mk
+++ b/Config.mk
@@ -203,7 +203,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2-rc1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2-rc2
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -215,7 +215,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.2-rc1
+QEMU_TAG ?= xen-4.2.2-rc2
 # Thu Jan 17 15:52:16 2013 +0000
 # e1000: fix compile warning introduced by security fix, and debugging
 
diff --git a/xen/Makefile b/xen/Makefile
index 515f731..4ccdcf2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .2-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 13 22:44:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 13 Apr 2013 22:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UR9B2-0006nF-Vu; Sat, 13 Apr 2013 22:44:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR9B1-0006n0-9h
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 22:44:07 +0000
Received: from [85.158.137.99:36411] by server-5.bemta-3.messagelabs.com id
	4A/97-30636-6BFD9615; Sat, 13 Apr 2013 22:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-217.messagelabs.com!1365893044!16385934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3855 invoked from network); 13 Apr 2013 22:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Apr 2013 22:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR9Aw-0003sM-Ho
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 22:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UR9Aw-0005wP-E5
	for xen-changelog@lists.xensource.com; Sat, 13 Apr 2013 22:44:02 +0000
Date: Sat, 13 Apr 2013 22:44:02 +0000
Message-Id: <E1UR9Aw-0005wP-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.2-rc2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 321e742eab7a36ffd18ac64f246f341015a007e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 12 13:41:19 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 12 13:41:19 2013 +0200

    update Xen version to 4.2.2-rc2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 109e3ea..6aa0c43 100644
--- a/Config.mk
+++ b/Config.mk
@@ -203,7 +203,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2-rc1
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2-rc2
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -215,7 +215,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.2-rc1
+QEMU_TAG ?= xen-4.2.2-rc2
 # Thu Jan 17 15:52:16 2013 +0000
 # e1000: fix compile warning introduced by security fix, and debugging
 
diff --git a/xen/Makefile b/xen/Makefile
index 515f731..4ccdcf2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .2-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-rc2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 08:44:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 08:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URf1F-00040t-II; Mon, 15 Apr 2013 08:44:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1URf1E-00040l-Dp
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 08:44:08 +0000
Received: from [193.109.254.147:53654] by server-16.bemta-14.messagelabs.com
	id 90/15-29589-7DDBB615; Mon, 15 Apr 2013 08:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1366015445!8519374!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28071 invoked from network); 15 Apr 2013 08:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 08:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1URf19-0007yb-9h
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 08:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1URf18-0004Kt-Vx
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 08:44:03 +0000
Message-Id: <E1URf18-0004Kt-Vx@xenbits.xen.org>
Date: Mon, 15 Apr 2013 08:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] pcifront/MSI: clean up interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1366015043 -7200
# Node ID 874725c5afa10717a5307f5f1c6bdc4baa655c9d
# Parent  93fcadedde4884ead8b206563eba34b780e61db3
pcifront/MSI: clean up interface

- declare functions in a header included by both producer and
  consumer(s)
- don't define private items in global header
- no need to (re-)declare pci_bus_sem

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 93fcadedde48 -r 874725c5afa1 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Wed Mar 13 10:14:44 2013 +0100
+++ b/drivers/pci/msi-xen.c	Mon Apr 15 10:37:23 2013 +0200
@@ -17,6 +17,7 @@
 
 #include <xen/interface/physdev.h>
 #include <xen/evtchn.h>
+#include <xen/pcifront.h>
 
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -605,7 +606,6 @@ static int msix_capability_init(struct p
  * indicates the successful setup of an entry zero with the new MSI
  * vector or non-zero for otherwise.
  **/
-extern int pci_frontend_enable_msi(struct pci_dev *dev);
 int pci_enable_msi(struct pci_dev* dev)
 {
 	struct pci_bus *bus;
@@ -669,7 +669,6 @@ int pci_enable_msi(struct pci_dev* dev)
 	return status;
 }
 
-extern void pci_frontend_disable_msi(struct pci_dev* dev);
 void pci_disable_msi(struct pci_dev* dev)
 {
 	int pos;
@@ -730,8 +729,6 @@ void pci_disable_msi(struct pci_dev* dev
  * of vectors available. Driver should use the returned value to re-send
  * its request.
  **/
-extern int pci_frontend_enable_msix(struct pci_dev *dev,
-		struct msix_entry *entries, int nvec);
 int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
 {
 	struct pci_bus *bus;
@@ -831,7 +828,6 @@ int pci_enable_msix(struct pci_dev* dev,
 	return status;
 }
 
-extern void pci_frontend_disable_msix(struct pci_dev* dev);
 void pci_disable_msix(struct pci_dev* dev)
 {
 	int pos;
diff -r 93fcadedde48 -r 874725c5afa1 drivers/xen/pcifront/pcifront.h
--- a/drivers/xen/pcifront/pcifront.h	Wed Mar 13 10:14:44 2013 +0100
+++ b/drivers/xen/pcifront/pcifront.h	Mon Apr 15 10:37:23 2013 +0200
@@ -7,7 +7,6 @@
 #define __XEN_PCIFRONT_H__
 
 #include <linux/spinlock.h>
-#include <linux/pci.h>
 #include <xen/xenbus.h>
 #include <xen/interface/io/pciif.h>
 #include <linux/interrupt.h>
@@ -53,4 +52,35 @@ void pcifront_do_aer( void *data);
 
 irqreturn_t pcifront_handler_aer(int irq, void *dev, struct pt_regs *regs);
 
+#ifndef __ia64__
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+	return sd->pdev;
+}
+
+static inline void pcifront_setup_root_resources(struct pci_bus *bus,
+						 struct pcifront_sd *sd)
+{
+}
+
+#else /* __ia64__ */
+
+#define pcifront_sd pci_controller
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+	return (struct pcifront_device *)sd->platform_data;
+}
+
+static inline void pcifront_setup_root_resources(struct pci_bus *bus,
+						 struct pcifront_sd *sd)
+{
+	xen_pcibios_setup_root_windows(bus, sd);
+}
+
+#endif /* __ia64__ */
+
 #endif	/* __XEN_PCIFRONT_H__ */
diff -r 93fcadedde48 -r 874725c5afa1 include/xen/pcifront.h
--- a/include/xen/pcifront.h	Wed Mar 13 10:14:44 2013 +0100
+++ b/include/xen/pcifront.h	Mon Apr 15 10:37:23 2013 +0200
@@ -6,26 +6,22 @@
 #ifndef __XEN_ASM_PCIFRONT_H__
 #define __XEN_ASM_PCIFRONT_H__
 
-#include <linux/spinlock.h>
-
 #ifdef __KERNEL__
 
+#include <linux/pci.h>
+
+int pci_frontend_enable_msi(struct pci_dev *);
+void pci_frontend_disable_msi(struct pci_dev *);
+int pci_frontend_enable_msix(struct pci_dev *, struct msix_entry *, int nvec);
+void pci_frontend_disable_msix(struct pci_dev *);
+
 #ifndef __ia64__
 
-struct pcifront_device;
-struct pci_bus;
-
 struct pcifront_sd {
 	int domain;
 	struct pcifront_device *pdev;
 };
 
-static inline struct pcifront_device *
-pcifront_get_pdev(struct pcifront_sd *sd)
-{
-	return sd->pdev;
-}
-
 #if defined(CONFIG_PCI_DOMAINS)
 static inline int pci_domain_nr(struct pci_bus *bus)
 {
@@ -38,38 +34,17 @@ static inline int pci_proc_domain(struct
 }
 #endif /* CONFIG_PCI_DOMAINS */
 
-static inline void pcifront_setup_root_resources(struct pci_bus *bus,
-						 struct pcifront_sd *sd)
-{
-}
-
 #else /* __ia64__ */
 
 #include <linux/acpi.h>
-#include <asm/pci.h>
-#define pcifront_sd pci_controller
 
 extern void xen_add_resource(struct pci_controller *, unsigned int,
 			     unsigned int, struct acpi_resource *);
 extern void xen_pcibios_setup_root_windows(struct pci_bus *,
 					   struct pci_controller *);
 
-static inline struct pcifront_device *
-pcifront_get_pdev(struct pcifront_sd *sd)
-{
-	return (struct pcifront_device *)sd->platform_data;
-}
-
-static inline void pcifront_setup_root_resources(struct pci_bus *bus,
-						 struct pcifront_sd *sd)
-{
-	xen_pcibios_setup_root_windows(bus, sd);
-}
-
 #endif /* __ia64__ */
 
-extern struct rw_semaphore pci_bus_sem;
-
 #endif /* __KERNEL__ */
 
 #endif /* __XEN_ASM_PCIFRONT_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 08:44:13 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 08:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URf1F-00040t-II; Mon, 15 Apr 2013 08:44:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1URf1E-00040l-Dp
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 08:44:08 +0000
Received: from [193.109.254.147:53654] by server-16.bemta-14.messagelabs.com
	id 90/15-29589-7DDBB615; Mon, 15 Apr 2013 08:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1366015445!8519374!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28071 invoked from network); 15 Apr 2013 08:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 08:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1URf19-0007yb-9h
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 08:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1URf18-0004Kt-Vx
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 08:44:03 +0000
Message-Id: <E1URf18-0004Kt-Vx@xenbits.xen.org>
Date: Mon, 15 Apr 2013 08:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] pcifront/MSI: clean up interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1366015043 -7200
# Node ID 874725c5afa10717a5307f5f1c6bdc4baa655c9d
# Parent  93fcadedde4884ead8b206563eba34b780e61db3
pcifront/MSI: clean up interface

- declare functions in a header included by both producer and
  consumer(s)
- don't define private items in global header
- no need to (re-)declare pci_bus_sem

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 93fcadedde48 -r 874725c5afa1 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c	Wed Mar 13 10:14:44 2013 +0100
+++ b/drivers/pci/msi-xen.c	Mon Apr 15 10:37:23 2013 +0200
@@ -17,6 +17,7 @@
 
 #include <xen/interface/physdev.h>
 #include <xen/evtchn.h>
+#include <xen/pcifront.h>
 
 #include <asm/errno.h>
 #include <asm/io.h>
@@ -605,7 +606,6 @@ static int msix_capability_init(struct p
  * indicates the successful setup of an entry zero with the new MSI
  * vector or non-zero for otherwise.
  **/
-extern int pci_frontend_enable_msi(struct pci_dev *dev);
 int pci_enable_msi(struct pci_dev* dev)
 {
 	struct pci_bus *bus;
@@ -669,7 +669,6 @@ int pci_enable_msi(struct pci_dev* dev)
 	return status;
 }
 
-extern void pci_frontend_disable_msi(struct pci_dev* dev);
 void pci_disable_msi(struct pci_dev* dev)
 {
 	int pos;
@@ -730,8 +729,6 @@ void pci_disable_msi(struct pci_dev* dev
  * of vectors available. Driver should use the returned value to re-send
  * its request.
  **/
-extern int pci_frontend_enable_msix(struct pci_dev *dev,
-		struct msix_entry *entries, int nvec);
 int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
 {
 	struct pci_bus *bus;
@@ -831,7 +828,6 @@ int pci_enable_msix(struct pci_dev* dev,
 	return status;
 }
 
-extern void pci_frontend_disable_msix(struct pci_dev* dev);
 void pci_disable_msix(struct pci_dev* dev)
 {
 	int pos;
diff -r 93fcadedde48 -r 874725c5afa1 drivers/xen/pcifront/pcifront.h
--- a/drivers/xen/pcifront/pcifront.h	Wed Mar 13 10:14:44 2013 +0100
+++ b/drivers/xen/pcifront/pcifront.h	Mon Apr 15 10:37:23 2013 +0200
@@ -7,7 +7,6 @@
 #define __XEN_PCIFRONT_H__
 
 #include <linux/spinlock.h>
-#include <linux/pci.h>
 #include <xen/xenbus.h>
 #include <xen/interface/io/pciif.h>
 #include <linux/interrupt.h>
@@ -53,4 +52,35 @@ void pcifront_do_aer( void *data);
 
 irqreturn_t pcifront_handler_aer(int irq, void *dev, struct pt_regs *regs);
 
+#ifndef __ia64__
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+	return sd->pdev;
+}
+
+static inline void pcifront_setup_root_resources(struct pci_bus *bus,
+						 struct pcifront_sd *sd)
+{
+}
+
+#else /* __ia64__ */
+
+#define pcifront_sd pci_controller
+
+static inline struct pcifront_device *
+pcifront_get_pdev(struct pcifront_sd *sd)
+{
+	return (struct pcifront_device *)sd->platform_data;
+}
+
+static inline void pcifront_setup_root_resources(struct pci_bus *bus,
+						 struct pcifront_sd *sd)
+{
+	xen_pcibios_setup_root_windows(bus, sd);
+}
+
+#endif /* __ia64__ */
+
 #endif	/* __XEN_PCIFRONT_H__ */
diff -r 93fcadedde48 -r 874725c5afa1 include/xen/pcifront.h
--- a/include/xen/pcifront.h	Wed Mar 13 10:14:44 2013 +0100
+++ b/include/xen/pcifront.h	Mon Apr 15 10:37:23 2013 +0200
@@ -6,26 +6,22 @@
 #ifndef __XEN_ASM_PCIFRONT_H__
 #define __XEN_ASM_PCIFRONT_H__
 
-#include <linux/spinlock.h>
-
 #ifdef __KERNEL__
 
+#include <linux/pci.h>
+
+int pci_frontend_enable_msi(struct pci_dev *);
+void pci_frontend_disable_msi(struct pci_dev *);
+int pci_frontend_enable_msix(struct pci_dev *, struct msix_entry *, int nvec);
+void pci_frontend_disable_msix(struct pci_dev *);
+
 #ifndef __ia64__
 
-struct pcifront_device;
-struct pci_bus;
-
 struct pcifront_sd {
 	int domain;
 	struct pcifront_device *pdev;
 };
 
-static inline struct pcifront_device *
-pcifront_get_pdev(struct pcifront_sd *sd)
-{
-	return sd->pdev;
-}
-
 #if defined(CONFIG_PCI_DOMAINS)
 static inline int pci_domain_nr(struct pci_bus *bus)
 {
@@ -38,38 +34,17 @@ static inline int pci_proc_domain(struct
 }
 #endif /* CONFIG_PCI_DOMAINS */
 
-static inline void pcifront_setup_root_resources(struct pci_bus *bus,
-						 struct pcifront_sd *sd)
-{
-}
-
 #else /* __ia64__ */
 
 #include <linux/acpi.h>
-#include <asm/pci.h>
-#define pcifront_sd pci_controller
 
 extern void xen_add_resource(struct pci_controller *, unsigned int,
 			     unsigned int, struct acpi_resource *);
 extern void xen_pcibios_setup_root_windows(struct pci_bus *,
 					   struct pci_controller *);
 
-static inline struct pcifront_device *
-pcifront_get_pdev(struct pcifront_sd *sd)
-{
-	return (struct pcifront_device *)sd->platform_data;
-}
-
-static inline void pcifront_setup_root_resources(struct pci_bus *bus,
-						 struct pcifront_sd *sd)
-{
-	xen_pcibios_setup_root_windows(bus, sd);
-}
-
 #endif /* __ia64__ */
 
-extern struct rw_semaphore pci_bus_sem;
-
 #endif /* __KERNEL__ */
 
 #endif /* __XEN_ASM_PCIFRONT_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrmq-0002D3-HN; Mon, 15 Apr 2013 22:22:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrmo-0002Cq-EH
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:06 +0000
Received: from [85.158.138.51:3682] by server-10.bemta-3.messagelabs.com id
	85/44-19664-D8D7C615; Mon, 15 Apr 2013 22:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366064523!26659021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15502 invoked from network); 15 Apr 2013 22:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrml-00012r-6B
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrml-0000Lb-1m
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:03 +0000
Date: Mon, 15 Apr 2013 22:22:03 +0000
Message-Id: <E1URrml-0000Lb-1m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add myself as XSM
	maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 887885c17ada9c571a7a2cd71410876448d0610a
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Mon Apr 15 10:25:41 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 10:25:41 2013 +0200

    MAINTAINERS: Add myself as XSM maintainer
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c24152..bcde139 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -308,6 +308,14 @@ S:	Supported
 F:	tools/xentrace/
 F:	xen/common/trace.c
 
+XSM/FLASK
+M:  Daniel De Graaf <dgdegra@tycho.nsa.gov>
+S:  Supported
+F:  tools/flask/
+F:  xen/include/xsm/
+F:  xen/xsm/
+F:  docs/misc/xsm-flask.txt
+
 THE REST
 M:	Keir Fraser <keir@xen.org>
 L:	xen-devel@lists.xen.org
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrmq-0002D3-HN; Mon, 15 Apr 2013 22:22:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrmo-0002Cq-EH
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:06 +0000
Received: from [85.158.138.51:3682] by server-10.bemta-3.messagelabs.com id
	85/44-19664-D8D7C615; Mon, 15 Apr 2013 22:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366064523!26659021!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15502 invoked from network); 15 Apr 2013 22:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrml-00012r-6B
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrml-0000Lb-1m
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:03 +0000
Date: Mon, 15 Apr 2013 22:22:03 +0000
Message-Id: <E1URrml-0000Lb-1m@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] MAINTAINERS: Add myself as XSM
	maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 887885c17ada9c571a7a2cd71410876448d0610a
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Mon Apr 15 10:25:41 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 10:25:41 2013 +0200

    MAINTAINERS: Add myself as XSM maintainer
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c24152..bcde139 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -308,6 +308,14 @@ S:	Supported
 F:	tools/xentrace/
 F:	xen/common/trace.c
 
+XSM/FLASK
+M:  Daniel De Graaf <dgdegra@tycho.nsa.gov>
+S:  Supported
+F:  tools/flask/
+F:  xen/include/xsm/
+F:  xen/xsm/
+F:  docs/misc/xsm-flask.txt
+
 THE REST
 M:	Keir Fraser <keir@xen.org>
 L:	xen-devel@lists.xen.org
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrn2-0002E0-KU; Mon, 15 Apr 2013 22:22:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn0-0002Dm-9y
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:18 +0000
Received: from [193.109.254.147:10721] by server-9.bemta-14.messagelabs.com id
	B9/46-04223-99D7C615; Mon, 15 Apr 2013 22:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1366064533!8610809!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27043 invoked from network); 15 Apr 2013 22:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrmv-00012u-DD
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrmv-0000Lz-BM
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:13 +0000
Date: Mon, 15 Apr 2013 22:22:13 +0000
Message-Id: <E1URrmv-0000Lz-BM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: allow MSI message to IRTE
	propagation to fail
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6a727d6be892ea5ff818446d96974bebdf8ac3a2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 15 10:33:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 10:33:48 2013 +0200

    IOMMU: allow MSI message to IRTE propagation to fail
    
    With the need to allocate multiple contiguous IRTEs for multi-vector
    MSI, the chance of failure here increases. While on the AMD side
    there's no allocation of IRTEs at present at all (and hence no way for
    this allocation to fail, which is going to change with a later patch in
    this series), VT-d already ignores an eventual error here, which this
    patch fixes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
---
 xen/arch/x86/hpet.c                           |   20 ++++++++++---
 xen/arch/x86/irq.c                            |   10 +++++-
 xen/arch/x86/msi.c                            |   22 ++++++++-------
 xen/drivers/passthrough/amd/iommu_intr.c      |   35 +++++++++++++++++--------
 xen/drivers/passthrough/iommu.c               |    8 +++--
 xen/drivers/passthrough/vtd/extern.h          |    2 +-
 xen/drivers/passthrough/vtd/intremap.c        |    6 ++--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 +-
 xen/include/asm-x86/msi.h                     |    3 +-
 xen/include/xen/iommu.h                       |    4 +-
 10 files changed, 72 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1404196..946d133 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -254,13 +254,22 @@ static void hpet_msi_mask(struct irq_desc *desc)
     ch->msi.msi_attrib.masked = 1;
 }
 
-static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
+static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
     ch->msi.msg = *msg;
+
     if ( iommu_intremap )
-        iommu_update_ire_from_msi(&ch->msi, msg);
+    {
+        int rc = iommu_update_ire_from_msi(&ch->msi, msg);
+
+        if ( rc )
+            return rc;
+    }
+
     hpet_write32(msg->data, HPET_Tn_ROUTE(ch->idx));
     hpet_write32(msg->address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
+
+    return 0;
 }
 
 static void __maybe_unused
@@ -318,12 +327,12 @@ static hw_irq_controller hpet_msi_type = {
     .set_affinity   = hpet_msi_set_affinity,
 };
 
-static void __hpet_setup_msi_irq(struct irq_desc *desc)
+static int __hpet_setup_msi_irq(struct irq_desc *desc)
 {
     struct msi_msg msg;
 
     msi_compose_msg(desc, &msg);
-    hpet_msi_write(desc->action->dev_id, &msg);
+    return hpet_msi_write(desc->action->dev_id, &msg);
 }
 
 static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
@@ -347,6 +356,8 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
 
     desc->handler = &hpet_msi_type;
     ret = request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);
+    if ( ret >= 0 )
+        ret = __hpet_setup_msi_irq(desc);
     if ( ret < 0 )
     {
         if ( iommu_intremap )
@@ -354,7 +365,6 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
         return ret;
     }
 
-    __hpet_setup_msi_irq(desc);
     desc->msi_desc = &ch->msi;
 
     return 0;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index dffb33a..fa6b9a2 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1938,7 +1938,14 @@ int map_domain_pirq(
         if ( desc->handler != &no_irq_type )
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
-        setup_msi_handler(desc, msi_desc);
+
+        ret = setup_msi_irq(desc, msi_desc);
+        if ( ret )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
+            pci_disable_msi(msi_desc);
+            goto done;
+        }
 
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
              && !desc->arch.used_vectors )
@@ -1954,7 +1961,6 @@ int map_domain_pirq(
         }
 
         set_domain_irq_pirq(d, irq, info);
-        setup_msi_irq(desc);
         spin_unlock_irqrestore(&desc->lock, flags);
     }
     else
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 6cc8f7a..36bed29 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -214,14 +214,18 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         iommu_read_msi_from_ire(entry, msg);
 }
 
-static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
+static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
 
     if ( iommu_intremap )
     {
+        int rc;
+
         ASSERT(msg != &entry->msg);
-        iommu_update_ire_from_msi(entry, msg);
+        rc = iommu_update_ire_from_msi(entry, msg);
+        if ( rc )
+            return rc;
     }
 
     switch ( entry->msi_attrib.type )
@@ -264,6 +268,8 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     default:
         BUG();
     }
+
+    return 0;
 }
 
 void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
@@ -464,19 +470,15 @@ static struct msi_desc* alloc_msi_entry(void)
     return entry;
 }
 
-void setup_msi_handler(struct irq_desc *desc, struct msi_desc *msidesc)
+int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc)
 {
+    struct msi_msg msg;
+
     desc->msi_desc = msidesc;
     desc->handler = msi_maskable_irq(msidesc) ? &pci_msi_maskable
                                               : &pci_msi_nonmaskable;
-}
-
-void setup_msi_irq(struct irq_desc *desc)
-{
-    struct msi_msg msg;
-
     msi_compose_msg(desc, &msg);
-    write_msi_msg(desc->msi_desc, &msg);
+    return write_msi_msg(msidesc, &msg);
 }
 
 int msi_free_irq(struct msi_desc *entry)
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 49ed3a2..7943049 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -17,6 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/hvm/iommu.h>
 #include <asm/amd-iommu.h>
@@ -359,25 +360,35 @@ done:
     }
 }
 
-void amd_iommu_msi_msg_update_ire(
+static struct amd_iommu *_find_iommu_for_device(int seg, int bdf)
+{
+    struct amd_iommu *iommu = find_iommu_for_device(seg, bdf);
+
+    if ( iommu )
+        return iommu;
+
+    list_for_each_entry ( iommu, &amd_iommu_head, list )
+        if ( iommu->seg == seg && iommu->bdf == bdf )
+            return NULL;
+
+    AMD_IOMMU_DEBUG("No IOMMU for MSI dev = %04x:%02x:%02x.%u\n",
+                    seg, PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf));
+    return ERR_PTR(-EINVAL);
+}
+
+int amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     struct pci_dev *pdev = msi_desc->dev;
     int bdf, seg;
     struct amd_iommu *iommu;
 
-    if ( !iommu_intremap )
-        return;
-
     bdf = pdev ? PCI_BDF2(pdev->bus, pdev->devfn) : hpet_sbdf.bdf;
     seg = pdev ? pdev->seg : hpet_sbdf.seg;
 
-    iommu = find_iommu_for_device(seg, bdf);
-    if ( !iommu )
-    {
-        AMD_IOMMU_DEBUG("Fail to find iommu for MSI device id = %#x\n", bdf);
-        return;
-    }
+    iommu = _find_iommu_for_device(seg, bdf);
+    if ( IS_ERR_OR_NULL(iommu) )
+        return PTR_ERR(iommu);
 
     if ( msi_desc->remap_index >= 0 )
     {
@@ -395,7 +406,7 @@ void amd_iommu_msi_msg_update_ire(
     }
 
     if ( !msg )
-        return;
+        return 0;
 
     do {
         update_intremap_entry_from_msi_msg(iommu, bdf, &msi_desc->remap_index,
@@ -404,6 +415,8 @@ void amd_iommu_msi_msg_update_ire(
             break;
         bdf += pdev->phantom_stride;
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
+
+    return 0;
 }
 
 void amd_iommu_read_msi_from_ire(
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 2db2e17..c5906ab 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -548,18 +548,20 @@ void iommu_update_ire_from_apic(
     const struct iommu_ops *ops = iommu_get_ops();
     ops->update_ire_from_apic(apic, reg, value);
 }
-void iommu_update_ire_from_msi(
+
+int iommu_update_ire_from_msi(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     const struct iommu_ops *ops = iommu_get_ops();
-    ops->update_ire_from_msi(msi_desc, msg);
+    return iommu_intremap ? ops->update_ire_from_msi(msi_desc, msg) : 0;
 }
 
 void iommu_read_msi_from_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     const struct iommu_ops *ops = iommu_get_ops();
-    ops->read_msi_from_ire(msi_desc, msg);
+    if ( iommu_intremap )
+        ops->read_msi_from_ire(msi_desc, msg);
 }
 
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg)
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index ec4b8cf..14cd90e 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -90,7 +90,7 @@ void io_apic_write_remap_rte(unsigned int apic,
 struct msi_desc;
 struct msi_msg;
 void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
-void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
+int msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
 
 int intel_setup_hpet_msi(struct msi_desc *);
 
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 0dc1788..880f15e 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -653,7 +653,7 @@ void msi_msg_read_remap_rte(
         remap_entry_to_msi_msg(drhd->iommu, msg);
 }
 
-void msi_msg_write_remap_rte(
+int msi_msg_write_remap_rte(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     struct pci_dev *pdev = msi_desc->dev;
@@ -661,8 +661,8 @@ void msi_msg_write_remap_rte(
 
     drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
                 : hpet_to_drhd(msi_desc->hpet_id);
-    if ( drhd )
-        msi_msg_to_remap_entry(drhd->iommu, pdev, msi_desc, msg);
+    return drhd ? msi_msg_to_remap_entry(drhd->iommu, pdev, msi_desc, msg)
+                : -EINVAL;
 }
 
 int __init intel_setup_hpet_msi(struct msi_desc *msi_desc)
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
index 06789bc..bec2c84 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -93,7 +93,7 @@ void *amd_iommu_alloc_intremap_table(void);
 int amd_iommu_free_intremap_table(u16 seg, struct ivrs_mappings *);
 void amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int reg, unsigned int value);
-void amd_iommu_msi_msg_update_ire(
+int amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg);
 void amd_iommu_read_msi_from_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg);
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index d288cfc..e2a3579 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -78,8 +78,7 @@ extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
 extern void pci_disable_msi(struct msi_desc *desc);
 extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool_t off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
-extern void setup_msi_handler(struct irq_desc *, struct msi_desc *);
-extern void setup_msi_irq(struct irq_desc *);
+extern int setup_msi_irq(struct irq_desc *, struct msi_desc *);
 extern void teardown_msi_irq(int irq);
 extern int msi_free_vector(struct msi_desc *entry);
 extern int pci_restore_msi_state(struct pci_dev *pdev);
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 0e832d5..8f04997 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -106,7 +106,7 @@ struct iommu_ops {
 			   u8 devfn, struct pci_dev *);
     int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
     void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value);
-    void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
+    int (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
     void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
     int (*setup_hpet_msi)(struct msi_desc *);
@@ -120,7 +120,7 @@ struct iommu_ops {
 };
 
 void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
-void iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
+int iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
 void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
 int iommu_setup_hpet_msi(struct msi_desc *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrn2-0002E0-KU; Mon, 15 Apr 2013 22:22:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn0-0002Dm-9y
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:18 +0000
Received: from [193.109.254.147:10721] by server-9.bemta-14.messagelabs.com id
	B9/46-04223-99D7C615; Mon, 15 Apr 2013 22:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1366064533!8610809!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27043 invoked from network); 15 Apr 2013 22:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrmv-00012u-DD
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrmv-0000Lz-BM
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:13 +0000
Date: Mon, 15 Apr 2013 22:22:13 +0000
Message-Id: <E1URrmv-0000Lz-BM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: allow MSI message to IRTE
	propagation to fail
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6a727d6be892ea5ff818446d96974bebdf8ac3a2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 15 10:33:48 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 10:33:48 2013 +0200

    IOMMU: allow MSI message to IRTE propagation to fail
    
    With the need to allocate multiple contiguous IRTEs for multi-vector
    MSI, the chance of failure here increases. While on the AMD side
    there's no allocation of IRTEs at present at all (and hence no way for
    this allocation to fail, which is going to change with a later patch in
    this series), VT-d already ignores an eventual error here, which this
    patch fixes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
---
 xen/arch/x86/hpet.c                           |   20 ++++++++++---
 xen/arch/x86/irq.c                            |   10 +++++-
 xen/arch/x86/msi.c                            |   22 ++++++++-------
 xen/drivers/passthrough/amd/iommu_intr.c      |   35 +++++++++++++++++--------
 xen/drivers/passthrough/iommu.c               |    8 +++--
 xen/drivers/passthrough/vtd/extern.h          |    2 +-
 xen/drivers/passthrough/vtd/intremap.c        |    6 ++--
 xen/include/asm-x86/hvm/svm/amd-iommu-proto.h |    2 +-
 xen/include/asm-x86/msi.h                     |    3 +-
 xen/include/xen/iommu.h                       |    4 +-
 10 files changed, 72 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 1404196..946d133 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -254,13 +254,22 @@ static void hpet_msi_mask(struct irq_desc *desc)
     ch->msi.msi_attrib.masked = 1;
 }
 
-static void hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
+static int hpet_msi_write(struct hpet_event_channel *ch, struct msi_msg *msg)
 {
     ch->msi.msg = *msg;
+
     if ( iommu_intremap )
-        iommu_update_ire_from_msi(&ch->msi, msg);
+    {
+        int rc = iommu_update_ire_from_msi(&ch->msi, msg);
+
+        if ( rc )
+            return rc;
+    }
+
     hpet_write32(msg->data, HPET_Tn_ROUTE(ch->idx));
     hpet_write32(msg->address_lo, HPET_Tn_ROUTE(ch->idx) + 4);
+
+    return 0;
 }
 
 static void __maybe_unused
@@ -318,12 +327,12 @@ static hw_irq_controller hpet_msi_type = {
     .set_affinity   = hpet_msi_set_affinity,
 };
 
-static void __hpet_setup_msi_irq(struct irq_desc *desc)
+static int __hpet_setup_msi_irq(struct irq_desc *desc)
 {
     struct msi_msg msg;
 
     msi_compose_msg(desc, &msg);
-    hpet_msi_write(desc->action->dev_id, &msg);
+    return hpet_msi_write(desc->action->dev_id, &msg);
 }
 
 static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
@@ -347,6 +356,8 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
 
     desc->handler = &hpet_msi_type;
     ret = request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);
+    if ( ret >= 0 )
+        ret = __hpet_setup_msi_irq(desc);
     if ( ret < 0 )
     {
         if ( iommu_intremap )
@@ -354,7 +365,6 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
         return ret;
     }
 
-    __hpet_setup_msi_irq(desc);
     desc->msi_desc = &ch->msi;
 
     return 0;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index dffb33a..fa6b9a2 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1938,7 +1938,14 @@ int map_domain_pirq(
         if ( desc->handler != &no_irq_type )
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
-        setup_msi_handler(desc, msi_desc);
+
+        ret = setup_msi_irq(desc, msi_desc);
+        if ( ret )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
+            pci_disable_msi(msi_desc);
+            goto done;
+        }
 
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
              && !desc->arch.used_vectors )
@@ -1954,7 +1961,6 @@ int map_domain_pirq(
         }
 
         set_domain_irq_pirq(d, irq, info);
-        setup_msi_irq(desc);
         spin_unlock_irqrestore(&desc->lock, flags);
     }
     else
diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 6cc8f7a..36bed29 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -214,14 +214,18 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
         iommu_read_msi_from_ire(entry, msg);
 }
 
-static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
+static int write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
     entry->msg = *msg;
 
     if ( iommu_intremap )
     {
+        int rc;
+
         ASSERT(msg != &entry->msg);
-        iommu_update_ire_from_msi(entry, msg);
+        rc = iommu_update_ire_from_msi(entry, msg);
+        if ( rc )
+            return rc;
     }
 
     switch ( entry->msi_attrib.type )
@@ -264,6 +268,8 @@ static void write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
     default:
         BUG();
     }
+
+    return 0;
 }
 
 void set_msi_affinity(struct irq_desc *desc, const cpumask_t *mask)
@@ -464,19 +470,15 @@ static struct msi_desc* alloc_msi_entry(void)
     return entry;
 }
 
-void setup_msi_handler(struct irq_desc *desc, struct msi_desc *msidesc)
+int setup_msi_irq(struct irq_desc *desc, struct msi_desc *msidesc)
 {
+    struct msi_msg msg;
+
     desc->msi_desc = msidesc;
     desc->handler = msi_maskable_irq(msidesc) ? &pci_msi_maskable
                                               : &pci_msi_nonmaskable;
-}
-
-void setup_msi_irq(struct irq_desc *desc)
-{
-    struct msi_msg msg;
-
     msi_compose_msg(desc, &msg);
-    write_msi_msg(desc->msi_desc, &msg);
+    return write_msi_msg(msidesc, &msg);
 }
 
 int msi_free_irq(struct msi_desc *entry)
diff --git a/xen/drivers/passthrough/amd/iommu_intr.c b/xen/drivers/passthrough/amd/iommu_intr.c
index 49ed3a2..7943049 100644
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -17,6 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <xen/err.h>
 #include <xen/sched.h>
 #include <xen/hvm/iommu.h>
 #include <asm/amd-iommu.h>
@@ -359,25 +360,35 @@ done:
     }
 }
 
-void amd_iommu_msi_msg_update_ire(
+static struct amd_iommu *_find_iommu_for_device(int seg, int bdf)
+{
+    struct amd_iommu *iommu = find_iommu_for_device(seg, bdf);
+
+    if ( iommu )
+        return iommu;
+
+    list_for_each_entry ( iommu, &amd_iommu_head, list )
+        if ( iommu->seg == seg && iommu->bdf == bdf )
+            return NULL;
+
+    AMD_IOMMU_DEBUG("No IOMMU for MSI dev = %04x:%02x:%02x.%u\n",
+                    seg, PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf));
+    return ERR_PTR(-EINVAL);
+}
+
+int amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     struct pci_dev *pdev = msi_desc->dev;
     int bdf, seg;
     struct amd_iommu *iommu;
 
-    if ( !iommu_intremap )
-        return;
-
     bdf = pdev ? PCI_BDF2(pdev->bus, pdev->devfn) : hpet_sbdf.bdf;
     seg = pdev ? pdev->seg : hpet_sbdf.seg;
 
-    iommu = find_iommu_for_device(seg, bdf);
-    if ( !iommu )
-    {
-        AMD_IOMMU_DEBUG("Fail to find iommu for MSI device id = %#x\n", bdf);
-        return;
-    }
+    iommu = _find_iommu_for_device(seg, bdf);
+    if ( IS_ERR_OR_NULL(iommu) )
+        return PTR_ERR(iommu);
 
     if ( msi_desc->remap_index >= 0 )
     {
@@ -395,7 +406,7 @@ void amd_iommu_msi_msg_update_ire(
     }
 
     if ( !msg )
-        return;
+        return 0;
 
     do {
         update_intremap_entry_from_msi_msg(iommu, bdf, &msi_desc->remap_index,
@@ -404,6 +415,8 @@ void amd_iommu_msi_msg_update_ire(
             break;
         bdf += pdev->phantom_stride;
     } while ( PCI_SLOT(bdf) == PCI_SLOT(pdev->devfn) );
+
+    return 0;
 }
 
 void amd_iommu_read_msi_from_ire(
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 2db2e17..c5906ab 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -548,18 +548,20 @@ void iommu_update_ire_from_apic(
     const struct iommu_ops *ops = iommu_get_ops();
     ops->update_ire_from_apic(apic, reg, value);
 }
-void iommu_update_ire_from_msi(
+
+int iommu_update_ire_from_msi(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     const struct iommu_ops *ops = iommu_get_ops();
-    ops->update_ire_from_msi(msi_desc, msg);
+    return iommu_intremap ? ops->update_ire_from_msi(msi_desc, msg) : 0;
 }
 
 void iommu_read_msi_from_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     const struct iommu_ops *ops = iommu_get_ops();
-    ops->read_msi_from_ire(msi_desc, msg);
+    if ( iommu_intremap )
+        ops->read_msi_from_ire(msi_desc, msg);
 }
 
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg)
diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index ec4b8cf..14cd90e 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -90,7 +90,7 @@ void io_apic_write_remap_rte(unsigned int apic,
 struct msi_desc;
 struct msi_msg;
 void msi_msg_read_remap_rte(struct msi_desc *, struct msi_msg *);
-void msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
+int msi_msg_write_remap_rte(struct msi_desc *, struct msi_msg *);
 
 int intel_setup_hpet_msi(struct msi_desc *);
 
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 0dc1788..880f15e 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -653,7 +653,7 @@ void msi_msg_read_remap_rte(
         remap_entry_to_msi_msg(drhd->iommu, msg);
 }
 
-void msi_msg_write_remap_rte(
+int msi_msg_write_remap_rte(
     struct msi_desc *msi_desc, struct msi_msg *msg)
 {
     struct pci_dev *pdev = msi_desc->dev;
@@ -661,8 +661,8 @@ void msi_msg_write_remap_rte(
 
     drhd = pdev ? acpi_find_matched_drhd_unit(pdev)
                 : hpet_to_drhd(msi_desc->hpet_id);
-    if ( drhd )
-        msi_msg_to_remap_entry(drhd->iommu, pdev, msi_desc, msg);
+    return drhd ? msi_msg_to_remap_entry(drhd->iommu, pdev, msi_desc, msg)
+                : -EINVAL;
 }
 
 int __init intel_setup_hpet_msi(struct msi_desc *msi_desc)
diff --git a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
index 06789bc..bec2c84 100644
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
@@ -93,7 +93,7 @@ void *amd_iommu_alloc_intremap_table(void);
 int amd_iommu_free_intremap_table(u16 seg, struct ivrs_mappings *);
 void amd_iommu_ioapic_update_ire(
     unsigned int apic, unsigned int reg, unsigned int value);
-void amd_iommu_msi_msg_update_ire(
+int amd_iommu_msi_msg_update_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg);
 void amd_iommu_read_msi_from_ire(
     struct msi_desc *msi_desc, struct msi_msg *msg);
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index d288cfc..e2a3579 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -78,8 +78,7 @@ extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
 extern void pci_disable_msi(struct msi_desc *desc);
 extern int pci_prepare_msix(u16 seg, u8 bus, u8 devfn, bool_t off);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
-extern void setup_msi_handler(struct irq_desc *, struct msi_desc *);
-extern void setup_msi_irq(struct irq_desc *);
+extern int setup_msi_irq(struct irq_desc *, struct msi_desc *);
 extern void teardown_msi_irq(int irq);
 extern int msi_free_vector(struct msi_desc *entry);
 extern int pci_restore_msi_state(struct pci_dev *pdev);
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 0e832d5..8f04997 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -106,7 +106,7 @@ struct iommu_ops {
 			   u8 devfn, struct pci_dev *);
     int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
     void (*update_ire_from_apic)(unsigned int apic, unsigned int reg, unsigned int value);
-    void (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
+    int (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
     void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
     unsigned int (*read_apic_from_ire)(unsigned int apic, unsigned int reg);
     int (*setup_hpet_msi)(struct msi_desc *);
@@ -120,7 +120,7 @@ struct iommu_ops {
 };
 
 void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsigned int value);
-void iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
+int iommu_update_ire_from_msi(struct msi_desc *msi_desc, struct msi_msg *msg);
 void iommu_read_msi_from_ire(struct msi_desc *msi_desc, struct msi_msg *msg);
 unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg);
 int iommu_setup_hpet_msi(struct msi_desc *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrn9-0002Es-NQ; Mon, 15 Apr 2013 22:22:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn8-0002EV-G2
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:26 +0000
Received: from [85.158.139.83:20602] by server-6.bemta-5.messagelabs.com id
	CE/3B-21466-1AD7C615; Mon, 15 Apr 2013 22:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1366064543!28619065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10178 invoked from network); 15 Apr 2013 22:22:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn5-000130-MK
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn5-0000ML-HA
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:23 +0000
Date: Mon, 15 Apr 2013 22:22:23 +0000
Message-Id: <E1URrn5-0000ML-HA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Allow more fine-grained
	control of VMCB MSR Permission Map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f3c6d1ed8d2c8b6cd5d9689159e3647bf428dcd
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:23:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:23:25 2013 +0200

    x86/AMD: Allow more fine-grained control of VMCB MSR Permission Map
    
    Currently VMCB's MSRPM can be updated to either intercept both reads and
    writes to an MSR or not intercept neither. In some cases we may want to
    be more selective and intercept one but not the other.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/svm.c         |   15 +++++++--------
 xen/include/asm-x86/hvm/svm/vmcb.h |    8 ++++++--
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index f170ffb..8ce37c9 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -137,7 +137,7 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr)
     return msr_bit;
 }
 
-void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable)
+void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags)
 {
     unsigned long *msr_bit;
 
@@ -145,16 +145,15 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable)
     BUG_ON(msr_bit == NULL);
     msr &= 0x1fff;
 
-    if ( enable )
-    {
-        __set_bit(msr * 2, msr_bit);
+    if ( flags & MSR_INTERCEPT_READ )
+         __set_bit(msr * 2, msr_bit);
+    else
+         __clear_bit(msr * 2, msr_bit);
+
+    if ( flags & MSR_INTERCEPT_WRITE )
         __set_bit(msr * 2 + 1, msr_bit);
-    }
     else
-    {
-        __clear_bit(msr * 2, msr_bit);
         __clear_bit(msr * 2 + 1, msr_bit);
-    }
 }
 
 static void svm_save_dr(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h
index b7c0404..ade4bb2 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -531,9 +531,13 @@ void svm_destroy_vmcb(struct vcpu *v);
 
 void setup_vmcb_dump(void);
 
+#define MSR_INTERCEPT_NONE    0
+#define MSR_INTERCEPT_READ    1
+#define MSR_INTERCEPT_WRITE   2
+#define MSR_INTERCEPT_RW      (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ)
 void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable);
-#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 0)
-#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 1)
+#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_NONE)
+#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_RW)
 
 /*
  * VMCB accessor functions.
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrn9-0002Es-NQ; Mon, 15 Apr 2013 22:22:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn8-0002EV-G2
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:26 +0000
Received: from [85.158.139.83:20602] by server-6.bemta-5.messagelabs.com id
	CE/3B-21466-1AD7C615; Mon, 15 Apr 2013 22:22:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1366064543!28619065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10178 invoked from network); 15 Apr 2013 22:22:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn5-000130-MK
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrn5-0000ML-HA
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:23 +0000
Date: Mon, 15 Apr 2013 22:22:23 +0000
Message-Id: <E1URrn5-0000ML-HA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Allow more fine-grained
	control of VMCB MSR Permission Map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f3c6d1ed8d2c8b6cd5d9689159e3647bf428dcd
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:23:25 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:23:25 2013 +0200

    x86/AMD: Allow more fine-grained control of VMCB MSR Permission Map
    
    Currently VMCB's MSRPM can be updated to either intercept both reads and
    writes to an MSR or not intercept neither. In some cases we may want to
    be more selective and intercept one but not the other.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/svm.c         |   15 +++++++--------
 xen/include/asm-x86/hvm/svm/vmcb.h |    8 ++++++--
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index f170ffb..8ce37c9 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -137,7 +137,7 @@ svm_msrbit(unsigned long *msr_bitmap, uint32_t msr)
     return msr_bit;
 }
 
-void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable)
+void svm_intercept_msr(struct vcpu *v, uint32_t msr, int flags)
 {
     unsigned long *msr_bit;
 
@@ -145,16 +145,15 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable)
     BUG_ON(msr_bit == NULL);
     msr &= 0x1fff;
 
-    if ( enable )
-    {
-        __set_bit(msr * 2, msr_bit);
+    if ( flags & MSR_INTERCEPT_READ )
+         __set_bit(msr * 2, msr_bit);
+    else
+         __clear_bit(msr * 2, msr_bit);
+
+    if ( flags & MSR_INTERCEPT_WRITE )
         __set_bit(msr * 2 + 1, msr_bit);
-    }
     else
-    {
-        __clear_bit(msr * 2, msr_bit);
         __clear_bit(msr * 2 + 1, msr_bit);
-    }
 }
 
 static void svm_save_dr(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h
index b7c0404..ade4bb2 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -531,9 +531,13 @@ void svm_destroy_vmcb(struct vcpu *v);
 
 void setup_vmcb_dump(void);
 
+#define MSR_INTERCEPT_NONE    0
+#define MSR_INTERCEPT_READ    1
+#define MSR_INTERCEPT_WRITE   2
+#define MSR_INTERCEPT_RW      (MSR_INTERCEPT_WRITE | MSR_INTERCEPT_READ)
 void svm_intercept_msr(struct vcpu *v, uint32_t msr, int enable);
-#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 0)
-#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), 1)
+#define svm_disable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_NONE)
+#define svm_enable_intercept_for_msr(v, msr) svm_intercept_msr((v), (msr), MSR_INTERCEPT_RW)
 
 /*
  * VMCB accessor functions.
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnJ-0002GF-Qg; Mon, 15 Apr 2013 22:22:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnI-0002G4-Vc
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:37 +0000
Received: from [85.158.137.99:12347] by server-12.bemta-3.messagelabs.com id
	0F/AA-01357-CAD7C615; Mon, 15 Apr 2013 22:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1366064554!14361062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8209 invoked from network); 15 Apr 2013 22:22:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnG-000139-11
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnF-0000Mo-Qi
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:33 +0000
Date: Mon, 15 Apr 2013 22:22:33 +0000
Message-Id: <E1URrnF-0000Mo-Qi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Do not intercept access to
	performance counters MSRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45773c5fb6346b1bc2a2ddcc6d19bd7f53ccabff
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:24:27 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:24:27 2013 +0200

    x86/AMD: Do not intercept access to performance counters MSRs
    
    Access to performance counters and reads of event selects don't
    need to always be intercepted.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/svm.c  |    2 +-
 xen/arch/x86/hvm/svm/vpmu.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8ce37c9..89e47b3 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1052,8 +1052,8 @@ static int svm_vcpu_initialise(struct vcpu *v)
 
 static void svm_vcpu_destroy(struct vcpu *v)
 {
-    svm_destroy_vmcb(v);
     vpmu_destroy(v);
+    svm_destroy_vmcb(v);
     passive_domain_destroy(v);
 }
 
diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 16170da..1e54497 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -88,6 +88,7 @@ struct amd_vpmu_context {
     u64 counters[MAX_NUM_COUNTERS];
     u64 ctrls[MAX_NUM_COUNTERS];
     u32 hw_lapic_lvtpc;
+    bool_t msr_bitmap_set;
 };
 
 static inline int get_pmu_reg_type(u32 addr)
@@ -138,6 +139,36 @@ static inline u32 get_fam15h_addr(u32 addr)
     return addr;
 }
 
+static void amd_vpmu_set_msr_bitmap(struct vcpu *v)
+{
+    unsigned int i;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+
+    for ( i = 0; i < num_counters; i++ )
+    {
+        svm_intercept_msr(v, counters[i], MSR_INTERCEPT_NONE);
+        svm_intercept_msr(v, ctrls[i], MSR_INTERCEPT_WRITE);
+    }
+
+    ctxt->msr_bitmap_set = 1;
+}
+
+static void amd_vpmu_unset_msr_bitmap(struct vcpu *v)
+{
+    unsigned int i;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+
+    for ( i = 0; i < num_counters; i++ )
+    {
+        svm_intercept_msr(v, counters[i], MSR_INTERCEPT_RW);
+        svm_intercept_msr(v, ctrls[i], MSR_INTERCEPT_RW);
+    }
+
+    ctxt->msr_bitmap_set = 0;
+}
+
 static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
@@ -219,6 +250,10 @@ static void amd_vpmu_save(struct vcpu *v)
         return;
 
     context_save(v);
+
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
+        amd_vpmu_unset_msr_bitmap(v);
+
     ctx->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
     apic_write(APIC_LVTPC,  ctx->hw_lapic_lvtpc | APIC_LVT_MASKED);
 }
@@ -267,6 +302,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
+
+        if ( !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+            amd_vpmu_set_msr_bitmap(v);
     }
 
     /* stop saving & restore if guest stops first counter */
@@ -275,6 +313,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     {
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
         vpmu_reset(vpmu, VPMU_RUNNING);
+        if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+            amd_vpmu_unset_msr_bitmap(v);
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
@@ -345,6 +385,9 @@ static void amd_vpmu_destroy(struct vcpu *v)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
         return;
 
+    if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+        amd_vpmu_unset_msr_bitmap(v);
+
     xfree(vpmu->context);
     vpmu_reset(vpmu, VPMU_CONTEXT_ALLOCATED);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnJ-0002GF-Qg; Mon, 15 Apr 2013 22:22:37 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnI-0002G4-Vc
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:37 +0000
Received: from [85.158.137.99:12347] by server-12.bemta-3.messagelabs.com id
	0F/AA-01357-CAD7C615; Mon, 15 Apr 2013 22:22:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-217.messagelabs.com!1366064554!14361062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8209 invoked from network); 15 Apr 2013 22:22:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnG-000139-11
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnF-0000Mo-Qi
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:33 +0000
Date: Mon, 15 Apr 2013 22:22:33 +0000
Message-Id: <E1URrnF-0000Mo-Qi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Do not intercept access to
	performance counters MSRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45773c5fb6346b1bc2a2ddcc6d19bd7f53ccabff
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:24:27 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:24:27 2013 +0200

    x86/AMD: Do not intercept access to performance counters MSRs
    
    Access to performance counters and reads of event selects don't
    need to always be intercepted.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/svm.c  |    2 +-
 xen/arch/x86/hvm/svm/vpmu.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8ce37c9..89e47b3 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1052,8 +1052,8 @@ static int svm_vcpu_initialise(struct vcpu *v)
 
 static void svm_vcpu_destroy(struct vcpu *v)
 {
-    svm_destroy_vmcb(v);
     vpmu_destroy(v);
+    svm_destroy_vmcb(v);
     passive_domain_destroy(v);
 }
 
diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 16170da..1e54497 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -88,6 +88,7 @@ struct amd_vpmu_context {
     u64 counters[MAX_NUM_COUNTERS];
     u64 ctrls[MAX_NUM_COUNTERS];
     u32 hw_lapic_lvtpc;
+    bool_t msr_bitmap_set;
 };
 
 static inline int get_pmu_reg_type(u32 addr)
@@ -138,6 +139,36 @@ static inline u32 get_fam15h_addr(u32 addr)
     return addr;
 }
 
+static void amd_vpmu_set_msr_bitmap(struct vcpu *v)
+{
+    unsigned int i;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+
+    for ( i = 0; i < num_counters; i++ )
+    {
+        svm_intercept_msr(v, counters[i], MSR_INTERCEPT_NONE);
+        svm_intercept_msr(v, ctrls[i], MSR_INTERCEPT_WRITE);
+    }
+
+    ctxt->msr_bitmap_set = 1;
+}
+
+static void amd_vpmu_unset_msr_bitmap(struct vcpu *v)
+{
+    unsigned int i;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+
+    for ( i = 0; i < num_counters; i++ )
+    {
+        svm_intercept_msr(v, counters[i], MSR_INTERCEPT_RW);
+        svm_intercept_msr(v, ctrls[i], MSR_INTERCEPT_RW);
+    }
+
+    ctxt->msr_bitmap_set = 0;
+}
+
 static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
@@ -219,6 +250,10 @@ static void amd_vpmu_save(struct vcpu *v)
         return;
 
     context_save(v);
+
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
+        amd_vpmu_unset_msr_bitmap(v);
+
     ctx->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
     apic_write(APIC_LVTPC,  ctx->hw_lapic_lvtpc | APIC_LVT_MASKED);
 }
@@ -267,6 +302,9 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
+
+        if ( !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+            amd_vpmu_set_msr_bitmap(v);
     }
 
     /* stop saving & restore if guest stops first counter */
@@ -275,6 +313,8 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     {
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
         vpmu_reset(vpmu, VPMU_RUNNING);
+        if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+            amd_vpmu_unset_msr_bitmap(v);
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
@@ -345,6 +385,9 @@ static void amd_vpmu_destroy(struct vcpu *v)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
         return;
 
+    if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
+        amd_vpmu_unset_msr_bitmap(v);
+
     xfree(vpmu->context);
     vpmu_reset(vpmu, VPMU_CONTEXT_ALLOCATED);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnT-0002I8-Tg; Mon, 15 Apr 2013 22:22:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnS-0002Hf-Up
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:47 +0000
Received: from [85.158.143.99:48233] by server-1.bemta-4.messagelabs.com id
	7C/31-06203-6BD7C615; Mon, 15 Apr 2013 22:22:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1366064564!18219278!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6281 invoked from network); 15 Apr 2013 22:22:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnQ-00013H-9F
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnQ-0000Nl-5H
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:44 +0000
Date: Mon, 15 Apr 2013 22:22:44 +0000
Message-Id: <E1URrnQ-0000Nl-5H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Load context when attempting
	to read VPMU MSRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 176706746dee6ad72f6bf15d2b6093973c652d6b
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:24:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:24:52 2013 +0200

    x86/AMD: Load context when attempting to read VPMU MSRs
    
    Load context (and mark it as LOADED) on any MSR access. This will allow
    us to always read the most up-to-date value of an MSR: guest may write
    into an MSR without enabling it (thus not marking the context as RUNNING)
    and then be migrated. Without first loading the context reading this MSR
    from HW will not match the pervious write since registers will not be
    loaded into HW in amd_vpmu_load().
    
    In addition, we should be saving the context when it is LOADED, not
    RUNNING --- otherwise we need to save it any time it becomes non-RUNNING,
    which may be a frequent occurrence.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 1e54497..4be5652 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -225,6 +225,8 @@ static void amd_vpmu_restore(struct vcpu *v)
 
     context_restore(v);
     apic_write(APIC_LVTPC, ctxt->hw_lapic_lvtpc);
+
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static inline void context_save(struct vcpu *v)
@@ -246,7 +248,7 @@ static void amd_vpmu_save(struct vcpu *v)
     struct amd_vpmu_context *ctx = vpmu->context;
 
     if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
+           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
         return;
 
     context_save(v);
@@ -256,6 +258,7 @@ static void amd_vpmu_save(struct vcpu *v)
 
     ctx->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
     apic_write(APIC_LVTPC,  ctx->hw_lapic_lvtpc | APIC_LVT_MASKED);
+    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static void context_update(unsigned int msr, u64 msr_content)
@@ -318,6 +321,12 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    {
+        context_restore(v);
+        vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+    }
+
     /* Update vpmu context immediately */
     context_update(msr, msr_content);
 
@@ -328,7 +337,17 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
 
 static int amd_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
 {
+    struct vcpu *v = current;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    {
+        context_restore(v);
+        vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+    }
+
     rdmsrl(msr, *msr_content);
+
     return 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:22:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:22:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnT-0002I8-Tg; Mon, 15 Apr 2013 22:22:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnS-0002Hf-Up
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:47 +0000
Received: from [85.158.143.99:48233] by server-1.bemta-4.messagelabs.com id
	7C/31-06203-6BD7C615; Mon, 15 Apr 2013 22:22:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1366064564!18219278!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6281 invoked from network); 15 Apr 2013 22:22:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnQ-00013H-9F
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnQ-0000Nl-5H
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:44 +0000
Date: Mon, 15 Apr 2013 22:22:44 +0000
Message-Id: <E1URrnQ-0000Nl-5H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Load context when attempting
	to read VPMU MSRs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 176706746dee6ad72f6bf15d2b6093973c652d6b
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:24:52 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:24:52 2013 +0200

    x86/AMD: Load context when attempting to read VPMU MSRs
    
    Load context (and mark it as LOADED) on any MSR access. This will allow
    us to always read the most up-to-date value of an MSR: guest may write
    into an MSR without enabling it (thus not marking the context as RUNNING)
    and then be migrated. Without first loading the context reading this MSR
    from HW will not match the pervious write since registers will not be
    loaded into HW in amd_vpmu_load().
    
    In addition, we should be saving the context when it is LOADED, not
    RUNNING --- otherwise we need to save it any time it becomes non-RUNNING,
    which may be a frequent occurrence.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 1e54497..4be5652 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -225,6 +225,8 @@ static void amd_vpmu_restore(struct vcpu *v)
 
     context_restore(v);
     apic_write(APIC_LVTPC, ctxt->hw_lapic_lvtpc);
+
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static inline void context_save(struct vcpu *v)
@@ -246,7 +248,7 @@ static void amd_vpmu_save(struct vcpu *v)
     struct amd_vpmu_context *ctx = vpmu->context;
 
     if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
+           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
         return;
 
     context_save(v);
@@ -256,6 +258,7 @@ static void amd_vpmu_save(struct vcpu *v)
 
     ctx->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
     apic_write(APIC_LVTPC,  ctx->hw_lapic_lvtpc | APIC_LVT_MASKED);
+    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static void context_update(unsigned int msr, u64 msr_content)
@@ -318,6 +321,12 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    {
+        context_restore(v);
+        vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+    }
+
     /* Update vpmu context immediately */
     context_update(msr, msr_content);
 
@@ -328,7 +337,17 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
 
 static int amd_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
 {
+    struct vcpu *v = current;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    {
+        context_restore(v);
+        vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+    }
+
     rdmsrl(msr, *msr_content);
+
     return 1;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnf-0002KN-2z; Mon, 15 Apr 2013 22:22:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnd-0002Jy-II
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:57 +0000
Received: from [85.158.139.83:48306] by server-8.bemta-5.messagelabs.com id
	6C/C0-05790-0CD7C615; Mon, 15 Apr 2013 22:22:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1366064574!28381487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2547 invoked from network); 15 Apr 2013 22:22:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrna-00013Q-I2
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrna-0000O7-Dk
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:54 +0000
Date: Mon, 15 Apr 2013 22:22:54 +0000
Message-Id: <E1URrna-0000O7-Dk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Stop counters on VPMU save
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5fb2decd2d3a821a7e9cff8c53220eaa45557d8f
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:25:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:25:18 2013 +0200

    x86/AMD: Stop counters on VPMU save
    
    Stop the counters during VPMU save operation since they shouldn't be
    running when VPCU that controls them is not. This also makes it
    unnecessary to check for overflow in context_restore()
    
    Set LVTPC vector before loading the context during vpmu_restore().
    Otherwise it is possible to trigger an interrupt without proper vector.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 4be5652..51e5495 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -197,20 +197,9 @@ static inline void context_restore(struct vcpu *v)
     struct amd_vpmu_context *ctxt = vpmu->context;
 
     for ( i = 0; i < num_counters; i++ )
-        wrmsrl(ctrls[i], ctxt->ctrls[i]);
-
-    for ( i = 0; i < num_counters; i++ )
     {
         wrmsrl(counters[i], ctxt->counters[i]);
-
-        /* Force an interrupt to allow guest reset the counter,
-        if the value is positive */
-        if ( is_overflowed(ctxt->counters[i]) && (ctxt->counters[i] > 0) )
-        {
-            gdprintk(XENLOG_WARNING, "VPMU: Force a performance counter "
-                "overflow interrupt!\n");
-            amd_vpmu_do_interrupt(0);
-        }
+        wrmsrl(ctrls[i], ctxt->ctrls[i]);
     }
 }
 
@@ -223,8 +212,8 @@ static void amd_vpmu_restore(struct vcpu *v)
            vpmu_is_set(vpmu, VPMU_RUNNING)) )
         return;
 
-    context_restore(v);
     apic_write(APIC_LVTPC, ctxt->hw_lapic_lvtpc);
+    context_restore(v);
 
     vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
@@ -236,10 +225,11 @@ static inline void context_save(struct vcpu *v)
     struct amd_vpmu_context *ctxt = vpmu->context;
 
     for ( i = 0; i < num_counters; i++ )
-        rdmsrl(counters[i], ctxt->counters[i]);
-
-    for ( i = 0; i < num_counters; i++ )
+    {
         rdmsrl(ctrls[i], ctxt->ctrls[i]);
+        wrmsrl(ctrls[i], 0);
+        rdmsrl(counters[i], ctxt->counters[i]);
+    }
 }
 
 static void amd_vpmu_save(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnf-0002KN-2z; Mon, 15 Apr 2013 22:22:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnd-0002Jy-II
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:57 +0000
Received: from [85.158.139.83:48306] by server-8.bemta-5.messagelabs.com id
	6C/C0-05790-0CD7C615; Mon, 15 Apr 2013 22:22:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1366064574!28381487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2547 invoked from network); 15 Apr 2013 22:22:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:22:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrna-00013Q-I2
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrna-0000O7-Dk
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:22:54 +0000
Date: Mon, 15 Apr 2013 22:22:54 +0000
Message-Id: <E1URrna-0000O7-Dk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Stop counters on VPMU save
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5fb2decd2d3a821a7e9cff8c53220eaa45557d8f
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:25:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:25:18 2013 +0200

    x86/AMD: Stop counters on VPMU save
    
    Stop the counters during VPMU save operation since they shouldn't be
    running when VPCU that controls them is not. This also makes it
    unnecessary to check for overflow in context_restore()
    
    Set LVTPC vector before loading the context during vpmu_restore().
    Otherwise it is possible to trigger an interrupt without proper vector.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 4be5652..51e5495 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -197,20 +197,9 @@ static inline void context_restore(struct vcpu *v)
     struct amd_vpmu_context *ctxt = vpmu->context;
 
     for ( i = 0; i < num_counters; i++ )
-        wrmsrl(ctrls[i], ctxt->ctrls[i]);
-
-    for ( i = 0; i < num_counters; i++ )
     {
         wrmsrl(counters[i], ctxt->counters[i]);
-
-        /* Force an interrupt to allow guest reset the counter,
-        if the value is positive */
-        if ( is_overflowed(ctxt->counters[i]) && (ctxt->counters[i] > 0) )
-        {
-            gdprintk(XENLOG_WARNING, "VPMU: Force a performance counter "
-                "overflow interrupt!\n");
-            amd_vpmu_do_interrupt(0);
-        }
+        wrmsrl(ctrls[i], ctxt->ctrls[i]);
     }
 }
 
@@ -223,8 +212,8 @@ static void amd_vpmu_restore(struct vcpu *v)
            vpmu_is_set(vpmu, VPMU_RUNNING)) )
         return;
 
-    context_restore(v);
     apic_write(APIC_LVTPC, ctxt->hw_lapic_lvtpc);
+    context_restore(v);
 
     vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
@@ -236,10 +225,11 @@ static inline void context_save(struct vcpu *v)
     struct amd_vpmu_context *ctxt = vpmu->context;
 
     for ( i = 0; i < num_counters; i++ )
-        rdmsrl(counters[i], ctxt->counters[i]);
-
-    for ( i = 0; i < num_counters; i++ )
+    {
         rdmsrl(ctrls[i], ctxt->ctrls[i]);
+        wrmsrl(ctrls[i], 0);
+        rdmsrl(counters[i], ctxt->counters[i]);
+    }
 }
 
 static void amd_vpmu_save(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnp-0002MX-5y; Mon, 15 Apr 2013 22:23:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrno-0002M0-7r
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:08 +0000
Received: from [193.109.254.147:15120] by server-4.bemta-14.messagelabs.com id
	E0/41-17387-ACD7C615; Mon, 15 Apr 2013 22:23:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1366064584!8827991!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19419 invoked from network); 15 Apr 2013 22:23:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:23:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnk-00013z-Nh
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnk-0000OU-Le
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:04 +0000
Date: Mon, 15 Apr 2013 22:23:04 +0000
Message-Id: <E1URrnk-0000OU-Le@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Add Haswell support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6037adc5c934b9ab97e532415302e50ece962d5
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:25:57 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:25:57 2013 +0200

    x86/VPMU: Add Haswell support
    
    Initialize VPMU on Haswell CPUs.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 2313e39..7c86a0b 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -893,6 +893,7 @@ int vmx_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 
         case 0x3a: /* IvyBridge */
         case 0x3e: /* IvyBridge EP */
+        case 0x3c: /* Haswell */
             ret = core2_vpmu_initialise(v, vpmu_flags);
             if ( !ret )
                 vpmu->arch_vpmu_ops = &core2_vpmu_ops;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnp-0002MX-5y; Mon, 15 Apr 2013 22:23:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrno-0002M0-7r
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:08 +0000
Received: from [193.109.254.147:15120] by server-4.bemta-14.messagelabs.com id
	E0/41-17387-ACD7C615; Mon, 15 Apr 2013 22:23:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1366064584!8827991!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19419 invoked from network); 15 Apr 2013 22:23:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:23:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnk-00013z-Nh
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnk-0000OU-Le
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:04 +0000
Date: Mon, 15 Apr 2013 22:23:04 +0000
Message-Id: <E1URrnk-0000OU-Le@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Add Haswell support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6037adc5c934b9ab97e532415302e50ece962d5
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:25:57 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:25:57 2013 +0200

    x86/VPMU: Add Haswell support
    
    Initialize VPMU on Haswell CPUs.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 2313e39..7c86a0b 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -893,6 +893,7 @@ int vmx_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 
         case 0x3a: /* IvyBridge */
         case 0x3e: /* IvyBridge EP */
+        case 0x3c: /* Haswell */
             ret = core2_vpmu_initialise(v, vpmu_flags);
             if ( !ret )
                 vpmu->arch_vpmu_ops = &core2_vpmu_ops;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnz-0002OU-8z; Mon, 15 Apr 2013 22:23:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnx-0002OB-QR
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:18 +0000
Received: from [85.158.143.99:48872] by server-3.bemta-4.messagelabs.com id
	44/A2-02186-5DD7C615; Mon, 15 Apr 2013 22:23:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1366064595!21955621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19545 invoked from network); 15 Apr 2013 22:23:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:23:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnu-000146-TS
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnu-0000Os-RZ
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:14 +0000
Date: Mon, 15 Apr 2013 22:23:14 +0000
Message-Id: <E1URrnu-0000Os-RZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Factor out VPMU common code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 426368be82b0184df1b537bb659680026b747a50
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:26:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:26:44 2013 +0200

    x86/VPMU: Factor out VPMU common code
    
    Factor out common code from SVM amd VMX into VPMU.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/svm/vpmu.c              |   37 ----------------------
 xen/arch/x86/hvm/vmx/vpmu_core2.c        |   30 +-----------------
 xen/arch/x86/hvm/vpmu.c                  |   50 +++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vmx/vpmu_core2.h |    1 -
 xen/include/asm-x86/hvm/vpmu.h           |    1 +
 5 files changed, 47 insertions(+), 72 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 51e5495..f2f2d12 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -87,7 +87,6 @@ static const u32 AMD_F15H_CTRLS[] = {
 struct amd_vpmu_context {
     u64 counters[MAX_NUM_COUNTERS];
     u64 ctrls[MAX_NUM_COUNTERS];
-    u32 hw_lapic_lvtpc;
     bool_t msr_bitmap_set;
 };
 
@@ -171,22 +170,6 @@ static void amd_vpmu_unset_msr_bitmap(struct vcpu *v)
 
 static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
-    struct vcpu *v = current;
-    struct vlapic *vlapic = vcpu_vlapic(v);
-    u32 vlapic_lvtpc;
-    unsigned char int_vec;
-
-    if ( !is_vlapic_lvtpc_enabled(vlapic) )
-        return 0;
-
-    vlapic_lvtpc = vlapic_get_reg(vlapic, APIC_LVTPC);
-    int_vec = vlapic_lvtpc & APIC_VECTOR_MASK;
-
-    if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
-        vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
-    else
-        v->nmi_pending = 1;
-
     return 1;
 }
 
@@ -205,17 +188,7 @@ static inline void context_restore(struct vcpu *v)
 
 static void amd_vpmu_restore(struct vcpu *v)
 {
-    struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    struct amd_vpmu_context *ctxt = vpmu->context;
-
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
-        return;
-
-    apic_write(APIC_LVTPC, ctxt->hw_lapic_lvtpc);
     context_restore(v);
-
-    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static inline void context_save(struct vcpu *v)
@@ -237,18 +210,10 @@ static void amd_vpmu_save(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctx = vpmu->context;
 
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
-        return;
-
     context_save(v);
 
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
-
-    ctx->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
-    apic_write(APIC_LVTPC,  ctx->hw_lapic_lvtpc | APIC_LVT_MASKED);
-    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static void context_update(unsigned int msr, u64 msr_content)
@@ -271,8 +236,6 @@ static void context_update(unsigned int msr, u64 msr_content)
     for ( i = 0; i < num_counters; i++ )
         if ( msr == ctrls[i] )
             ctxt->ctrls[i] = msr_content;
-
-    ctxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
 }
 
 static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 7c86a0b..6195bfc 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -305,25 +305,18 @@ static inline void __core2_vpmu_save(struct vcpu *v)
         rdmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
-    core2_vpmu_cxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
-    apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
 }
 
 static void core2_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
-        return;
-
     __core2_vpmu_save(v);
 
     /* Unset PMU MSR bitmap to trap lazy load. */
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
 
-    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
     return;
 }
 
@@ -341,20 +334,11 @@ static inline void __core2_vpmu_load(struct vcpu *v)
         wrmsrl(core2_ctrls.msr[i], core2_vpmu_cxt->ctrls[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         wrmsrl(MSR_P6_EVNTSEL0+i, core2_vpmu_cxt->arch_msr_pair[i].control);
-
-    apic_write_around(APIC_LVTPC, core2_vpmu_cxt->hw_lapic_lvtpc);
 }
 
 static void core2_vpmu_load(struct vcpu *v)
 {
-    struct vpmu_struct *vpmu = vcpu_vpmu(v);
-
-    /* Only when PMU is counting, we load PMU context immediately. */
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
-        return;
     __core2_vpmu_load(v);
-    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static int core2_vpmu_alloc_resource(struct vcpu *v)
@@ -705,11 +689,8 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     u64 msr_content;
-    u32 vlapic_lvtpc;
-    unsigned char int_vec;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
-    struct vlapic *vlapic = vcpu_vlapic(v);
 
     rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, msr_content);
     if ( msr_content )
@@ -728,18 +709,9 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
+    /* HW sets the MASK bit when performance counter interrupt occurs*/
     apic_write_around(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
 
-    if ( !is_vlapic_lvtpc_enabled(vlapic) )
-        return 1;
-
-    vlapic_lvtpc = vlapic_get_reg(vlapic, APIC_LVTPC);
-    int_vec = vlapic_lvtpc & APIC_VECTOR_MASK;
-    vlapic_set_reg(vlapic, APIC_LVTPC, vlapic_lvtpc | APIC_LVT_MASKED);
-    if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
-        vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
-    else
-        v->nmi_pending = 1;
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 3b69580..ff5f065 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -31,7 +31,7 @@
 #include <asm/hvm/vpmu.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/vmcb.h>
-
+#include <asm/apic.h>
 
 /*
  * "vpmu" :     vpmu generally enabled
@@ -83,10 +83,31 @@ int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
 
 int vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
-    struct vpmu_struct *vpmu = vcpu_vpmu(current);
+    struct vcpu *v = current;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( vpmu->arch_vpmu_ops )
+    {
+        struct vlapic *vlapic = vcpu_vlapic(v);
+        u32 vlapic_lvtpc;
+        unsigned char int_vec;
+
+        if ( !vpmu->arch_vpmu_ops->do_interrupt(regs) )
+            return 0;
+
+        if ( !is_vlapic_lvtpc_enabled(vlapic) )
+            return 1;
+
+        vlapic_lvtpc = vlapic_get_reg(vlapic, APIC_LVTPC);
+        int_vec = vlapic_lvtpc & APIC_VECTOR_MASK;
+
+        if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
+            vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
+        else
+            v->nmi_pending = 1;
+        return 1;
+    }
 
-    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_interrupt )
-        return vpmu->arch_vpmu_ops->do_interrupt(regs);
     return 0;
 }
 
@@ -104,16 +125,35 @@ void vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_save )
+    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
+           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
+       return;
+
+    if ( vpmu->arch_vpmu_ops )
         vpmu->arch_vpmu_ops->arch_vpmu_save(v);
+
+    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
+    apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+
+    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_load(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    /* Only when PMU is counting, we load PMU context immediately. */
+    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
+           vpmu_is_set(vpmu, VPMU_RUNNING)) )
+        return;
+
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_load )
+    {
+        apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
         vpmu->arch_vpmu_ops->arch_vpmu_load(v);
+    }
+
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_initialise(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
index 4128f2a..60b05fd 100644
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
@@ -44,7 +44,6 @@ struct core2_vpmu_context {
     u64 fix_counters[VPMU_CORE2_NUM_FIXED];
     u64 ctrls[VPMU_CORE2_NUM_CTRLS];
     u64 global_ovf_status;
-    u32 hw_lapic_lvtpc;
     struct arch_msr_pair arch_msr_pair[1];
 };
 
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index cd31f5e..01be976 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -62,6 +62,7 @@ int svm_vpmu_initialise(struct vcpu *, unsigned int flags);
 
 struct vpmu_struct {
     u32 flags;
+    u32 hw_lapic_lvtpc;
     void *context;
     struct arch_vpmu_ops *arch_vpmu_ops;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrnz-0002OU-8z; Mon, 15 Apr 2013 22:23:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnx-0002OB-QR
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:18 +0000
Received: from [85.158.143.99:48872] by server-3.bemta-4.messagelabs.com id
	44/A2-02186-5DD7C615; Mon, 15 Apr 2013 22:23:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1366064595!21955621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19545 invoked from network); 15 Apr 2013 22:23:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:23:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnu-000146-TS
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrnu-0000Os-RZ
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:14 +0000
Date: Mon, 15 Apr 2013 22:23:14 +0000
Message-Id: <E1URrnu-0000Os-RZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Factor out VPMU common code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 426368be82b0184df1b537bb659680026b747a50
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:26:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:26:44 2013 +0200

    x86/VPMU: Factor out VPMU common code
    
    Factor out common code from SVM amd VMX into VPMU.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
 xen/arch/x86/hvm/svm/vpmu.c              |   37 ----------------------
 xen/arch/x86/hvm/vmx/vpmu_core2.c        |   30 +-----------------
 xen/arch/x86/hvm/vpmu.c                  |   50 +++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vmx/vpmu_core2.h |    1 -
 xen/include/asm-x86/hvm/vpmu.h           |    1 +
 5 files changed, 47 insertions(+), 72 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 51e5495..f2f2d12 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -87,7 +87,6 @@ static const u32 AMD_F15H_CTRLS[] = {
 struct amd_vpmu_context {
     u64 counters[MAX_NUM_COUNTERS];
     u64 ctrls[MAX_NUM_COUNTERS];
-    u32 hw_lapic_lvtpc;
     bool_t msr_bitmap_set;
 };
 
@@ -171,22 +170,6 @@ static void amd_vpmu_unset_msr_bitmap(struct vcpu *v)
 
 static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
-    struct vcpu *v = current;
-    struct vlapic *vlapic = vcpu_vlapic(v);
-    u32 vlapic_lvtpc;
-    unsigned char int_vec;
-
-    if ( !is_vlapic_lvtpc_enabled(vlapic) )
-        return 0;
-
-    vlapic_lvtpc = vlapic_get_reg(vlapic, APIC_LVTPC);
-    int_vec = vlapic_lvtpc & APIC_VECTOR_MASK;
-
-    if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
-        vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
-    else
-        v->nmi_pending = 1;
-
     return 1;
 }
 
@@ -205,17 +188,7 @@ static inline void context_restore(struct vcpu *v)
 
 static void amd_vpmu_restore(struct vcpu *v)
 {
-    struct vpmu_struct *vpmu = vcpu_vpmu(v);
-    struct amd_vpmu_context *ctxt = vpmu->context;
-
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
-        return;
-
-    apic_write(APIC_LVTPC, ctxt->hw_lapic_lvtpc);
     context_restore(v);
-
-    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static inline void context_save(struct vcpu *v)
@@ -237,18 +210,10 @@ static void amd_vpmu_save(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctx = vpmu->context;
 
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
-        return;
-
     context_save(v);
 
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
-
-    ctx->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
-    apic_write(APIC_LVTPC,  ctx->hw_lapic_lvtpc | APIC_LVT_MASKED);
-    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static void context_update(unsigned int msr, u64 msr_content)
@@ -271,8 +236,6 @@ static void context_update(unsigned int msr, u64 msr_content)
     for ( i = 0; i < num_counters; i++ )
         if ( msr == ctrls[i] )
             ctxt->ctrls[i] = msr_content;
-
-    ctxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
 }
 
 static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 7c86a0b..6195bfc 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -305,25 +305,18 @@ static inline void __core2_vpmu_save(struct vcpu *v)
         rdmsrl(core2_fix_counters.msr[i], core2_vpmu_cxt->fix_counters[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
-    core2_vpmu_cxt->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
-    apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
 }
 
 static void core2_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
-        return;
-
     __core2_vpmu_save(v);
 
     /* Unset PMU MSR bitmap to trap lazy load. */
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
 
-    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
     return;
 }
 
@@ -341,20 +334,11 @@ static inline void __core2_vpmu_load(struct vcpu *v)
         wrmsrl(core2_ctrls.msr[i], core2_vpmu_cxt->ctrls[i]);
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         wrmsrl(MSR_P6_EVNTSEL0+i, core2_vpmu_cxt->arch_msr_pair[i].control);
-
-    apic_write_around(APIC_LVTPC, core2_vpmu_cxt->hw_lapic_lvtpc);
 }
 
 static void core2_vpmu_load(struct vcpu *v)
 {
-    struct vpmu_struct *vpmu = vcpu_vpmu(v);
-
-    /* Only when PMU is counting, we load PMU context immediately. */
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
-        return;
     __core2_vpmu_load(v);
-    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 static int core2_vpmu_alloc_resource(struct vcpu *v)
@@ -705,11 +689,8 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     u64 msr_content;
-    u32 vlapic_lvtpc;
-    unsigned char int_vec;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = vpmu->context;
-    struct vlapic *vlapic = vcpu_vlapic(v);
 
     rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, msr_content);
     if ( msr_content )
@@ -728,18 +709,9 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
             return 0;
     }
 
+    /* HW sets the MASK bit when performance counter interrupt occurs*/
     apic_write_around(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
 
-    if ( !is_vlapic_lvtpc_enabled(vlapic) )
-        return 1;
-
-    vlapic_lvtpc = vlapic_get_reg(vlapic, APIC_LVTPC);
-    int_vec = vlapic_lvtpc & APIC_VECTOR_MASK;
-    vlapic_set_reg(vlapic, APIC_LVTPC, vlapic_lvtpc | APIC_LVT_MASKED);
-    if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
-        vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
-    else
-        v->nmi_pending = 1;
     return 1;
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 3b69580..ff5f065 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -31,7 +31,7 @@
 #include <asm/hvm/vpmu.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/vmcb.h>
-
+#include <asm/apic.h>
 
 /*
  * "vpmu" :     vpmu generally enabled
@@ -83,10 +83,31 @@ int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
 
 int vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
-    struct vpmu_struct *vpmu = vcpu_vpmu(current);
+    struct vcpu *v = current;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( vpmu->arch_vpmu_ops )
+    {
+        struct vlapic *vlapic = vcpu_vlapic(v);
+        u32 vlapic_lvtpc;
+        unsigned char int_vec;
+
+        if ( !vpmu->arch_vpmu_ops->do_interrupt(regs) )
+            return 0;
+
+        if ( !is_vlapic_lvtpc_enabled(vlapic) )
+            return 1;
+
+        vlapic_lvtpc = vlapic_get_reg(vlapic, APIC_LVTPC);
+        int_vec = vlapic_lvtpc & APIC_VECTOR_MASK;
+
+        if ( GET_APIC_DELIVERY_MODE(vlapic_lvtpc) == APIC_MODE_FIXED )
+            vlapic_set_irq(vcpu_vlapic(v), int_vec, 0);
+        else
+            v->nmi_pending = 1;
+        return 1;
+    }
 
-    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_interrupt )
-        return vpmu->arch_vpmu_ops->do_interrupt(regs);
     return 0;
 }
 
@@ -104,16 +125,35 @@ void vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_save )
+    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
+           vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
+       return;
+
+    if ( vpmu->arch_vpmu_ops )
         vpmu->arch_vpmu_ops->arch_vpmu_save(v);
+
+    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
+    apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+
+    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_load(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    /* Only when PMU is counting, we load PMU context immediately. */
+    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
+           vpmu_is_set(vpmu, VPMU_RUNNING)) )
+        return;
+
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_load )
+    {
+        apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
         vpmu->arch_vpmu_ops->arch_vpmu_load(v);
+    }
+
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_initialise(struct vcpu *v)
diff --git a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
index 4128f2a..60b05fd 100644
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h
@@ -44,7 +44,6 @@ struct core2_vpmu_context {
     u64 fix_counters[VPMU_CORE2_NUM_FIXED];
     u64 ctrls[VPMU_CORE2_NUM_CTRLS];
     u64 global_ovf_status;
-    u32 hw_lapic_lvtpc;
     struct arch_msr_pair arch_msr_pair[1];
 };
 
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index cd31f5e..01be976 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -62,6 +62,7 @@ int svm_vpmu_initialise(struct vcpu *, unsigned int flags);
 
 struct vpmu_struct {
     u32 flags;
+    u32 hw_lapic_lvtpc;
     void *context;
     struct arch_vpmu_ops *arch_vpmu_ops;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URroA-0002QH-Ct; Mon, 15 Apr 2013 22:23:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URro8-0002Q0-WB
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:29 +0000
Received: from [85.158.139.211:57138] by server-12.bemta-5.messagelabs.com id
	CD/31-11486-0ED7C615; Mon, 15 Apr 2013 22:23:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1366064605!14952401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3348 invoked from network); 15 Apr 2013 22:23:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:23:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URro5-00014B-6c
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URro5-0000PE-2D
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:25 +0000
Date: Mon, 15 Apr 2013 22:23:25 +0000
Message-Id: <E1URro5-0000PE-2D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Save/restore VPMU only when
	necessary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 055898c9c61d462888941eaede436db4d335890e
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:27:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:27:32 2013 +0200

    x86/VPMU: Save/restore VPMU only when necessary
    
    VPMU doesn't need to always be saved during context switch. If we are
    comming back to the same processor and no other VPCU has run here we can
    simply continue running. This is especailly useful on Intel processors
    where Global Control MSR is stored in VMCS, thus not requiring us to stop
    the counters during save operation. On AMD we need to explicitly stop the
    counters but we don't need to save them.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/domain.c             |   14 ++++++-
 xen/arch/x86/hvm/svm/svm.c        |    2 -
 xen/arch/x86/hvm/svm/vpmu.c       |   52 ++++++++++++++++++++++---
 xen/arch/x86/hvm/vmx/vmx.c        |    2 -
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   25 +++++++++++-
 xen/arch/x86/hvm/vpmu.c           |   75 +++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vpmu.h    |   14 +++++--
 7 files changed, 157 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0d7a40c..6f9cbed 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1535,8 +1535,14 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     if (prev != next)
         update_runstate_area(prev);
 
-    if ( is_hvm_vcpu(prev) && !list_empty(&prev->arch.hvm_vcpu.tm_list) )
-        pt_save_timer(prev);
+    if ( is_hvm_vcpu(prev) )
+    {
+        if (prev != next)
+            vpmu_save(prev);
+
+        if ( !list_empty(&prev->arch.hvm_vcpu.tm_list) )
+            pt_save_timer(prev);
+    }
 
     local_irq_disable();
 
@@ -1574,6 +1580,10 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
                            (next->domain->domain_id != 0));
     }
 
+    if (is_hvm_vcpu(next) && (prev != next) )
+        /* Must be done with interrupts enabled */
+        vpmu_load(next);
+
     context_saved(prev);
 
     if (prev != next)
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 89e47b3..8123f37 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -860,7 +860,6 @@ static void svm_ctxt_switch_from(struct vcpu *v)
     svm_fpu_leave(v);
 
     svm_save_dr(v);
-    vpmu_save(v);
     svm_lwp_save(v);
     svm_tsc_ratio_save(v);
 
@@ -901,7 +900,6 @@ static void svm_ctxt_switch_to(struct vcpu *v)
     svm_vmsave(per_cpu(root_vmcb, cpu));
     svm_vmload(vmcb);
     vmcb->cleanbits.bytes = 0;
-    vpmu_load(v);
     svm_lwp_load(v);
     svm_tsc_ratio_load(v);
 
diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index f2f2d12..efe2b7c 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -188,6 +188,21 @@ static inline void context_restore(struct vcpu *v)
 
 static void amd_vpmu_restore(struct vcpu *v)
 {
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+
+    vpmu_reset(vpmu, VPMU_FROZEN);
+
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    {
+        unsigned int i;
+
+        for ( i = 0; i < num_counters; i++ )
+            wrmsrl(ctrls[i], ctxt->ctrls[i]);
+
+        return;
+    }
+
     context_restore(v);
 }
 
@@ -197,23 +212,40 @@ static inline void context_save(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
 
+    /* No need to save controls -- they are saved in amd_vpmu_do_wrmsr */
     for ( i = 0; i < num_counters; i++ )
-    {
-        rdmsrl(ctrls[i], ctxt->ctrls[i]);
-        wrmsrl(ctrls[i], 0);
         rdmsrl(counters[i], ctxt->counters[i]);
-    }
 }
 
-static void amd_vpmu_save(struct vcpu *v)
+static int amd_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctx = vpmu->context;
+    unsigned int i;
+
+    /*
+     * Stop the counters. If we came here via vpmu_save_force (i.e.
+     * when VPMU_CONTEXT_SAVE is set) counters are already stopped.
+     */
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
+    {
+        vpmu_set(vpmu, VPMU_FROZEN);
+
+        for ( i = 0; i < num_counters; i++ )
+            wrmsrl(ctrls[i], 0);
+
+        return 0;
+    }
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        return 0;
 
     context_save(v);
 
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
+
+    return 1;
 }
 
 static void context_update(unsigned int msr, u64 msr_content)
@@ -258,6 +290,7 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
             amd_vpmu_set_msr_bitmap(v);
@@ -268,16 +301,19 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
             amd_vpmu_unset_msr_bitmap(v);
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
+        || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
         context_restore(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+        vpmu_reset(vpmu, VPMU_FROZEN);
     }
 
     /* Update vpmu context immediately */
@@ -293,10 +329,12 @@ static int amd_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
     struct vcpu *v = current;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
+        || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
         context_restore(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+        vpmu_reset(vpmu, VPMU_FROZEN);
     }
 
     rdmsrl(msr, *msr_content);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a869ed4..e36dbcb 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -615,7 +615,6 @@ static void vmx_ctxt_switch_from(struct vcpu *v)
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
     vmx_save_dr(v);
-    vpmu_save(v);
 }
 
 static void vmx_ctxt_switch_to(struct vcpu *v)
@@ -640,7 +639,6 @@ static void vmx_ctxt_switch_to(struct vcpu *v)
 
     vmx_restore_guest_msrs(v);
     vmx_restore_dr(v);
-    vpmu_load(v);
 }
 
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 6195bfc..9f152b4 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -307,17 +307,23 @@ static inline void __core2_vpmu_save(struct vcpu *v)
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
 }
 
-static void core2_vpmu_save(struct vcpu *v)
+static int core2_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
+        return 0;
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) 
+        return 0;
+
     __core2_vpmu_save(v);
 
     /* Unset PMU MSR bitmap to trap lazy load. */
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
 
-    return;
+    return 1;
 }
 
 static inline void __core2_vpmu_load(struct vcpu *v)
@@ -338,6 +344,11 @@ static inline void __core2_vpmu_load(struct vcpu *v)
 
 static void core2_vpmu_load(struct vcpu *v)
 {
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        return;
+
     __core2_vpmu_load(v);
 }
 
@@ -539,9 +550,15 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     /* Setup LVTPC in local apic */
     if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
          is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
+    {
         apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
+    }
     else
+    {
         apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+    }
 
     core2_vpmu_save_msr_context(v, type, index, msr_content);
     if ( type != MSR_TYPE_GLOBAL )
@@ -616,6 +633,7 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
         else
             return 0;
     }
+
     return 1;
 }
 
@@ -710,7 +728,8 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
     }
 
     /* HW sets the MASK bit when performance counter interrupt occurs*/
-    apic_write_around(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
+    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
+    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
 
     return 1;
 }
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index ff5f065..21fbaba 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -18,7 +18,6 @@
  *
  * Author: Haitao Shan <haitao.shan@intel.com>
  */
-
 #include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/xenoprof.h>
@@ -42,6 +41,8 @@ static unsigned int __read_mostly opt_vpmu_enabled;
 static void parse_vpmu_param(char *s);
 custom_param("vpmu", parse_vpmu_param);
 
+static DEFINE_PER_CPU(struct vcpu *, last_vcpu);
+
 static void __init parse_vpmu_param(char *s)
 {
     switch ( parse_bool(s) )
@@ -121,30 +122,90 @@ void vpmu_do_cpuid(unsigned int input,
         vpmu->arch_vpmu_ops->do_cpuid(input, eax, ebx, ecx, edx);
 }
 
+static void vpmu_save_force(void *arg)
+{
+    struct vcpu *v = (struct vcpu *)arg;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        return;
+
+    if ( vpmu->arch_vpmu_ops )
+        (void)vpmu->arch_vpmu_ops->arch_vpmu_save(v);
+
+    vpmu_reset(vpmu, VPMU_CONTEXT_SAVE);
+
+    per_cpu(last_vcpu, smp_processor_id()) = NULL;
+}
+
 void vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    int pcpu = smp_processor_id();
 
     if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
            vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
        return;
 
+    vpmu->last_pcpu = pcpu;
+    per_cpu(last_vcpu, pcpu) = v;
+
     if ( vpmu->arch_vpmu_ops )
-        vpmu->arch_vpmu_ops->arch_vpmu_save(v);
+        if ( vpmu->arch_vpmu_ops->arch_vpmu_save(v) )
+            vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 
-    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
     apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-
-    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_load(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    int pcpu = smp_processor_id();
+    struct vcpu *prev = NULL;
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+        return;
+
+    /* First time this VCPU is running here */
+    if ( vpmu->last_pcpu != pcpu )
+    {
+        /*
+         * Get the context from last pcpu that we ran on. Note that if another
+         * VCPU is running there it must have saved this VPCU's context before
+         * startig to run (see below).
+         * There should be no race since remote pcpu will disable interrupts
+         * before saving the context.
+         */
+        if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        {
+            vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
+            on_selected_cpus(cpumask_of(vpmu->last_pcpu),
+                             vpmu_save_force, (void *)v, 1);
+            vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
+        }
+    } 
+
+    /* Prevent forced context save from remote CPU */
+    local_irq_disable();
+
+    prev = per_cpu(last_vcpu, pcpu);
+
+    if ( prev != v && prev )
+    {
+        vpmu = vcpu_vpmu(prev);
+
+        /* Someone ran here before us */
+        vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
+        vpmu_save_force(prev);
+        vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
+
+        vpmu = vcpu_vpmu(v);
+    }
+
+    local_irq_enable();
 
     /* Only when PMU is counting, we load PMU context immediately. */
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) )
         return;
 
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_load )
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 01be976..03b9462 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -52,7 +52,7 @@ struct arch_vpmu_ops {
                      unsigned int *eax, unsigned int *ebx,
                      unsigned int *ecx, unsigned int *edx);
     void (*arch_vpmu_destroy)(struct vcpu *v);
-    void (*arch_vpmu_save)(struct vcpu *v);
+    int (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);
     void (*arch_vpmu_dump)(struct vcpu *v);
 };
@@ -62,17 +62,23 @@ int svm_vpmu_initialise(struct vcpu *, unsigned int flags);
 
 struct vpmu_struct {
     u32 flags;
+    u32 last_pcpu;
     u32 hw_lapic_lvtpc;
     void *context;
     struct arch_vpmu_ops *arch_vpmu_ops;
 };
 
+/* VPMU states */
 #define VPMU_CONTEXT_ALLOCATED              0x1
 #define VPMU_CONTEXT_LOADED                 0x2
 #define VPMU_RUNNING                        0x4
-#define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x8
-#define VPMU_CPU_HAS_DS                     0x10 /* Has Debug Store */
-#define VPMU_CPU_HAS_BTS                    0x20 /* Has Branch Trace Store */
+#define VPMU_CONTEXT_SAVE                   0x8   /* Force context save */
+#define VPMU_FROZEN                         0x10  /* Stop counters while VCPU is not running */
+#define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x20
+
+/* VPMU features */
+#define VPMU_CPU_HAS_DS                     0x100 /* Has Debug Store */
+#define VPMU_CPU_HAS_BTS                    0x200 /* Has Branch Trace Store */
 
 
 #define vpmu_set(_vpmu, _x)    ((_vpmu)->flags |= (_x))
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:23:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:23:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URroA-0002QH-Ct; Mon, 15 Apr 2013 22:23:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URro8-0002Q0-WB
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:29 +0000
Received: from [85.158.139.211:57138] by server-12.bemta-5.messagelabs.com id
	CD/31-11486-0ED7C615; Mon, 15 Apr 2013 22:23:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1366064605!14952401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3348 invoked from network); 15 Apr 2013 22:23:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:23:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URro5-00014B-6c
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URro5-0000PE-2D
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:25 +0000
Date: Mon, 15 Apr 2013 22:23:25 +0000
Message-Id: <E1URro5-0000PE-2D@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: Save/restore VPMU only when
	necessary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 055898c9c61d462888941eaede436db4d335890e
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:27:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:27:32 2013 +0200

    x86/VPMU: Save/restore VPMU only when necessary
    
    VPMU doesn't need to always be saved during context switch. If we are
    comming back to the same processor and no other VPCU has run here we can
    simply continue running. This is especailly useful on Intel processors
    where Global Control MSR is stored in VMCS, thus not requiring us to stop
    the counters during save operation. On AMD we need to explicitly stop the
    counters but we don't need to save them.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/domain.c             |   14 ++++++-
 xen/arch/x86/hvm/svm/svm.c        |    2 -
 xen/arch/x86/hvm/svm/vpmu.c       |   52 ++++++++++++++++++++++---
 xen/arch/x86/hvm/vmx/vmx.c        |    2 -
 xen/arch/x86/hvm/vmx/vpmu_core2.c |   25 +++++++++++-
 xen/arch/x86/hvm/vpmu.c           |   75 +++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/hvm/vpmu.h    |   14 +++++--
 7 files changed, 157 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 0d7a40c..6f9cbed 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1535,8 +1535,14 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     if (prev != next)
         update_runstate_area(prev);
 
-    if ( is_hvm_vcpu(prev) && !list_empty(&prev->arch.hvm_vcpu.tm_list) )
-        pt_save_timer(prev);
+    if ( is_hvm_vcpu(prev) )
+    {
+        if (prev != next)
+            vpmu_save(prev);
+
+        if ( !list_empty(&prev->arch.hvm_vcpu.tm_list) )
+            pt_save_timer(prev);
+    }
 
     local_irq_disable();
 
@@ -1574,6 +1580,10 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
                            (next->domain->domain_id != 0));
     }
 
+    if (is_hvm_vcpu(next) && (prev != next) )
+        /* Must be done with interrupts enabled */
+        vpmu_load(next);
+
     context_saved(prev);
 
     if (prev != next)
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 89e47b3..8123f37 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -860,7 +860,6 @@ static void svm_ctxt_switch_from(struct vcpu *v)
     svm_fpu_leave(v);
 
     svm_save_dr(v);
-    vpmu_save(v);
     svm_lwp_save(v);
     svm_tsc_ratio_save(v);
 
@@ -901,7 +900,6 @@ static void svm_ctxt_switch_to(struct vcpu *v)
     svm_vmsave(per_cpu(root_vmcb, cpu));
     svm_vmload(vmcb);
     vmcb->cleanbits.bytes = 0;
-    vpmu_load(v);
     svm_lwp_load(v);
     svm_tsc_ratio_load(v);
 
diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index f2f2d12..efe2b7c 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -188,6 +188,21 @@ static inline void context_restore(struct vcpu *v)
 
 static void amd_vpmu_restore(struct vcpu *v)
 {
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+
+    vpmu_reset(vpmu, VPMU_FROZEN);
+
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    {
+        unsigned int i;
+
+        for ( i = 0; i < num_counters; i++ )
+            wrmsrl(ctrls[i], ctxt->ctrls[i]);
+
+        return;
+    }
+
     context_restore(v);
 }
 
@@ -197,23 +212,40 @@ static inline void context_save(struct vcpu *v)
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
 
+    /* No need to save controls -- they are saved in amd_vpmu_do_wrmsr */
     for ( i = 0; i < num_counters; i++ )
-    {
-        rdmsrl(ctrls[i], ctxt->ctrls[i]);
-        wrmsrl(ctrls[i], 0);
         rdmsrl(counters[i], ctxt->counters[i]);
-    }
 }
 
-static void amd_vpmu_save(struct vcpu *v)
+static int amd_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctx = vpmu->context;
+    unsigned int i;
+
+    /*
+     * Stop the counters. If we came here via vpmu_save_force (i.e.
+     * when VPMU_CONTEXT_SAVE is set) counters are already stopped.
+     */
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
+    {
+        vpmu_set(vpmu, VPMU_FROZEN);
+
+        for ( i = 0; i < num_counters; i++ )
+            wrmsrl(ctrls[i], 0);
+
+        return 0;
+    }
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        return 0;
 
     context_save(v);
 
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && ctx->msr_bitmap_set )
         amd_vpmu_unset_msr_bitmap(v);
+
+    return 1;
 }
 
 static void context_update(unsigned int msr, u64 msr_content)
@@ -258,6 +290,7 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
             return 1;
         vpmu_set(vpmu, VPMU_RUNNING);
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
 
         if ( !((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
             amd_vpmu_set_msr_bitmap(v);
@@ -268,16 +301,19 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
         (is_pmu_enabled(msr_content) == 0) && vpmu_is_set(vpmu, VPMU_RUNNING) )
     {
         apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( ((struct amd_vpmu_context *)vpmu->context)->msr_bitmap_set )
             amd_vpmu_unset_msr_bitmap(v);
         release_pmu_ownship(PMU_OWNER_HVM);
     }
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
+        || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
         context_restore(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+        vpmu_reset(vpmu, VPMU_FROZEN);
     }
 
     /* Update vpmu context immediately */
@@ -293,10 +329,12 @@ static int amd_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
     struct vcpu *v = current;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
-    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
+        || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
         context_restore(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+        vpmu_reset(vpmu, VPMU_FROZEN);
     }
 
     rdmsrl(msr, *msr_content);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index a869ed4..e36dbcb 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -615,7 +615,6 @@ static void vmx_ctxt_switch_from(struct vcpu *v)
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
     vmx_save_dr(v);
-    vpmu_save(v);
 }
 
 static void vmx_ctxt_switch_to(struct vcpu *v)
@@ -640,7 +639,6 @@ static void vmx_ctxt_switch_to(struct vcpu *v)
 
     vmx_restore_guest_msrs(v);
     vmx_restore_dr(v);
-    vpmu_load(v);
 }
 
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 6195bfc..9f152b4 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -307,17 +307,23 @@ static inline void __core2_vpmu_save(struct vcpu *v)
         rdmsrl(MSR_IA32_PERFCTR0+i, core2_vpmu_cxt->arch_msr_pair[i].counter);
 }
 
-static void core2_vpmu_save(struct vcpu *v)
+static int core2_vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
 
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
+        return 0;
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) ) 
+        return 0;
+
     __core2_vpmu_save(v);
 
     /* Unset PMU MSR bitmap to trap lazy load. */
     if ( !vpmu_is_set(vpmu, VPMU_RUNNING) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
 
-    return;
+    return 1;
 }
 
 static inline void __core2_vpmu_load(struct vcpu *v)
@@ -338,6 +344,11 @@ static inline void __core2_vpmu_load(struct vcpu *v)
 
 static void core2_vpmu_load(struct vcpu *v)
 {
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        return;
+
     __core2_vpmu_load(v);
 }
 
@@ -539,9 +550,15 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     /* Setup LVTPC in local apic */
     if ( vpmu_is_set(vpmu, VPMU_RUNNING) &&
          is_vlapic_lvtpc_enabled(vcpu_vlapic(v)) )
+    {
         apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR;
+    }
     else
+    {
         apic_write_around(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
+        vpmu->hw_lapic_lvtpc = PMU_APIC_VECTOR | APIC_LVT_MASKED;
+    }
 
     core2_vpmu_save_msr_context(v, type, index, msr_content);
     if ( type != MSR_TYPE_GLOBAL )
@@ -616,6 +633,7 @@ static int core2_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
         else
             return 0;
     }
+
     return 1;
 }
 
@@ -710,7 +728,8 @@ static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
     }
 
     /* HW sets the MASK bit when performance counter interrupt occurs*/
-    apic_write_around(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
+    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED;
+    apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
 
     return 1;
 }
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index ff5f065..21fbaba 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -18,7 +18,6 @@
  *
  * Author: Haitao Shan <haitao.shan@intel.com>
  */
-
 #include <xen/config.h>
 #include <xen/sched.h>
 #include <xen/xenoprof.h>
@@ -42,6 +41,8 @@ static unsigned int __read_mostly opt_vpmu_enabled;
 static void parse_vpmu_param(char *s);
 custom_param("vpmu", parse_vpmu_param);
 
+static DEFINE_PER_CPU(struct vcpu *, last_vcpu);
+
 static void __init parse_vpmu_param(char *s)
 {
     switch ( parse_bool(s) )
@@ -121,30 +122,90 @@ void vpmu_do_cpuid(unsigned int input,
         vpmu->arch_vpmu_ops->do_cpuid(input, eax, ebx, ecx, edx);
 }
 
+static void vpmu_save_force(void *arg)
+{
+    struct vcpu *v = (struct vcpu *)arg;
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        return;
+
+    if ( vpmu->arch_vpmu_ops )
+        (void)vpmu->arch_vpmu_ops->arch_vpmu_save(v);
+
+    vpmu_reset(vpmu, VPMU_CONTEXT_SAVE);
+
+    per_cpu(last_vcpu, smp_processor_id()) = NULL;
+}
+
 void vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    int pcpu = smp_processor_id();
 
     if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
            vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)) )
        return;
 
+    vpmu->last_pcpu = pcpu;
+    per_cpu(last_vcpu, pcpu) = v;
+
     if ( vpmu->arch_vpmu_ops )
-        vpmu->arch_vpmu_ops->arch_vpmu_save(v);
+        if ( vpmu->arch_vpmu_ops->arch_vpmu_save(v) )
+            vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 
-    vpmu->hw_lapic_lvtpc = apic_read(APIC_LVTPC);
     apic_write(APIC_LVTPC, PMU_APIC_VECTOR | APIC_LVT_MASKED);
-
-    vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_load(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    int pcpu = smp_processor_id();
+    struct vcpu *prev = NULL;
+
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+        return;
+
+    /* First time this VCPU is running here */
+    if ( vpmu->last_pcpu != pcpu )
+    {
+        /*
+         * Get the context from last pcpu that we ran on. Note that if another
+         * VCPU is running there it must have saved this VPCU's context before
+         * startig to run (see below).
+         * There should be no race since remote pcpu will disable interrupts
+         * before saving the context.
+         */
+        if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        {
+            vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
+            on_selected_cpus(cpumask_of(vpmu->last_pcpu),
+                             vpmu_save_force, (void *)v, 1);
+            vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
+        }
+    } 
+
+    /* Prevent forced context save from remote CPU */
+    local_irq_disable();
+
+    prev = per_cpu(last_vcpu, pcpu);
+
+    if ( prev != v && prev )
+    {
+        vpmu = vcpu_vpmu(prev);
+
+        /* Someone ran here before us */
+        vpmu_set(vpmu, VPMU_CONTEXT_SAVE);
+        vpmu_save_force(prev);
+        vpmu_reset(vpmu, VPMU_CONTEXT_LOADED);
+
+        vpmu = vcpu_vpmu(v);
+    }
+
+    local_irq_enable();
 
     /* Only when PMU is counting, we load PMU context immediately. */
-    if ( !(vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) &&
-           vpmu_is_set(vpmu, VPMU_RUNNING)) )
+    if ( !vpmu_is_set(vpmu, VPMU_RUNNING) )
         return;
 
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_load )
diff --git a/xen/include/asm-x86/hvm/vpmu.h b/xen/include/asm-x86/hvm/vpmu.h
index 01be976..03b9462 100644
--- a/xen/include/asm-x86/hvm/vpmu.h
+++ b/xen/include/asm-x86/hvm/vpmu.h
@@ -52,7 +52,7 @@ struct arch_vpmu_ops {
                      unsigned int *eax, unsigned int *ebx,
                      unsigned int *ecx, unsigned int *edx);
     void (*arch_vpmu_destroy)(struct vcpu *v);
-    void (*arch_vpmu_save)(struct vcpu *v);
+    int (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);
     void (*arch_vpmu_dump)(struct vcpu *v);
 };
@@ -62,17 +62,23 @@ int svm_vpmu_initialise(struct vcpu *, unsigned int flags);
 
 struct vpmu_struct {
     u32 flags;
+    u32 last_pcpu;
     u32 hw_lapic_lvtpc;
     void *context;
     struct arch_vpmu_ops *arch_vpmu_ops;
 };
 
+/* VPMU states */
 #define VPMU_CONTEXT_ALLOCATED              0x1
 #define VPMU_CONTEXT_LOADED                 0x2
 #define VPMU_RUNNING                        0x4
-#define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x8
-#define VPMU_CPU_HAS_DS                     0x10 /* Has Debug Store */
-#define VPMU_CPU_HAS_BTS                    0x20 /* Has Branch Trace Store */
+#define VPMU_CONTEXT_SAVE                   0x8   /* Force context save */
+#define VPMU_FROZEN                         0x10  /* Stop counters while VCPU is not running */
+#define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x20
+
+/* VPMU features */
+#define VPMU_CPU_HAS_DS                     0x100 /* Has Debug Store */
+#define VPMU_CPU_HAS_BTS                    0x200 /* Has Branch Trace Store */
 
 
 #define vpmu_set(_vpmu, _x)    ((_vpmu)->flags |= (_x))
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:24:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrpL-0002Vq-Kl; Mon, 15 Apr 2013 22:24:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrpJ-0002Vf-Nw
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:24:42 +0000
Received: from [85.158.138.51:19176] by server-6.bemta-3.messagelabs.com id
	44/10-11048-42E7C615; Mon, 15 Apr 2013 22:24:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1366064674!28351861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5554 invoked from network); 15 Apr 2013 22:24:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:24:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroF-00014J-C2
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroF-0000Pe-Ar
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:35 +0000
Date: Mon, 15 Apr 2013 22:23:35 +0000
Message-Id: <E1URroF-0000Pe-Ar@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Clean up context_update() in
	AMD VPMU code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1df002bb2f218baee6fa4116fa8a7994a49daa91
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:28:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:28:08 2013 +0200

    x86/AMD: Clean up context_update() in AMD VPMU code
    
    Clean up context_update() in AMD VPMU code.
    
    Rename restore routine to "load" to be consistent with Intel
    code and with arch_vpmu_ops names
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index efe2b7c..b36ab2b 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -173,7 +173,7 @@ static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
     return 1;
 }
 
-static inline void context_restore(struct vcpu *v)
+static inline void context_load(struct vcpu *v)
 {
     unsigned int i;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
@@ -186,7 +186,7 @@ static inline void context_restore(struct vcpu *v)
     }
 }
 
-static void amd_vpmu_restore(struct vcpu *v)
+static void amd_vpmu_load(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
@@ -203,7 +203,7 @@ static void amd_vpmu_restore(struct vcpu *v)
         return;
     }
 
-    context_restore(v);
+    context_load(v);
 }
 
 static inline void context_save(struct vcpu *v)
@@ -262,12 +262,18 @@ static void context_update(unsigned int msr, u64 msr_content)
     }
 
     for ( i = 0; i < num_counters; i++ )
-        if ( msr == counters[i] )
+    {
+       if ( msr == ctrls[i] )
+       {
+           ctxt->ctrls[i] = msr_content;
+           return;
+       }
+        else if (msr == counters[i] )
+        {
             ctxt->counters[i] = msr_content;
-
-    for ( i = 0; i < num_counters; i++ )
-        if ( msr == ctrls[i] )
-            ctxt->ctrls[i] = msr_content;
+            return;
+        }
+    }
 }
 
 static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
@@ -311,7 +317,7 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
         || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
-        context_restore(v);
+        context_load(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
         vpmu_reset(vpmu, VPMU_FROZEN);
     }
@@ -332,7 +338,7 @@ static int amd_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
         || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
-        context_restore(v);
+        context_load(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
         vpmu_reset(vpmu, VPMU_FROZEN);
     }
@@ -414,7 +420,7 @@ struct arch_vpmu_ops amd_vpmu_ops = {
     .do_interrupt = amd_vpmu_do_interrupt,
     .arch_vpmu_destroy = amd_vpmu_destroy,
     .arch_vpmu_save = amd_vpmu_save,
-    .arch_vpmu_load = amd_vpmu_restore
+    .arch_vpmu_load = amd_vpmu_load
 };
 
 int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:24:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:24:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrpL-0002Vq-Kl; Mon, 15 Apr 2013 22:24:43 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrpJ-0002Vf-Nw
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:24:42 +0000
Received: from [85.158.138.51:19176] by server-6.bemta-3.messagelabs.com id
	44/10-11048-42E7C615; Mon, 15 Apr 2013 22:24:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1366064674!28351861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5554 invoked from network); 15 Apr 2013 22:24:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:24:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroF-00014J-C2
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroF-0000Pe-Ar
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:35 +0000
Date: Mon, 15 Apr 2013 22:23:35 +0000
Message-Id: <E1URroF-0000Pe-Ar@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Clean up context_update() in
	AMD VPMU code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1df002bb2f218baee6fa4116fa8a7994a49daa91
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:28:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:28:08 2013 +0200

    x86/AMD: Clean up context_update() in AMD VPMU code
    
    Clean up context_update() in AMD VPMU code.
    
    Rename restore routine to "load" to be consistent with Intel
    code and with arch_vpmu_ops names
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index efe2b7c..b36ab2b 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -173,7 +173,7 @@ static int amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
     return 1;
 }
 
-static inline void context_restore(struct vcpu *v)
+static inline void context_load(struct vcpu *v)
 {
     unsigned int i;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
@@ -186,7 +186,7 @@ static inline void context_restore(struct vcpu *v)
     }
 }
 
-static void amd_vpmu_restore(struct vcpu *v)
+static void amd_vpmu_load(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct amd_vpmu_context *ctxt = vpmu->context;
@@ -203,7 +203,7 @@ static void amd_vpmu_restore(struct vcpu *v)
         return;
     }
 
-    context_restore(v);
+    context_load(v);
 }
 
 static inline void context_save(struct vcpu *v)
@@ -262,12 +262,18 @@ static void context_update(unsigned int msr, u64 msr_content)
     }
 
     for ( i = 0; i < num_counters; i++ )
-        if ( msr == counters[i] )
+    {
+       if ( msr == ctrls[i] )
+       {
+           ctxt->ctrls[i] = msr_content;
+           return;
+       }
+        else if (msr == counters[i] )
+        {
             ctxt->counters[i] = msr_content;
-
-    for ( i = 0; i < num_counters; i++ )
-        if ( msr == ctrls[i] )
-            ctxt->ctrls[i] = msr_content;
+            return;
+        }
+    }
 }
 
 static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
@@ -311,7 +317,7 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
         || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
-        context_restore(v);
+        context_load(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
         vpmu_reset(vpmu, VPMU_FROZEN);
     }
@@ -332,7 +338,7 @@ static int amd_vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
         || vpmu_is_set(vpmu, VPMU_FROZEN) )
     {
-        context_restore(v);
+        context_load(v);
         vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
         vpmu_reset(vpmu, VPMU_FROZEN);
     }
@@ -414,7 +420,7 @@ struct arch_vpmu_ops amd_vpmu_ops = {
     .do_interrupt = amd_vpmu_do_interrupt,
     .arch_vpmu_destroy = amd_vpmu_destroy,
     .arch_vpmu_save = amd_vpmu_save,
-    .arch_vpmu_load = amd_vpmu_restore
+    .arch_vpmu_load = amd_vpmu_load
 };
 
 int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:25:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:25:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrpe-0002X3-OP; Mon, 15 Apr 2013 22:25:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrpc-0002Wq-Nm
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:25:01 +0000
Received: from [85.158.138.51:21999] by server-8.bemta-3.messagelabs.com id
	64/59-20604-73E7C615; Mon, 15 Apr 2013 22:24:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1366064684!28362539!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8183 invoked from network); 15 Apr 2013 22:24:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:24:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroP-00014P-JA
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroP-0000Qk-Gb
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:45 +0000
Date: Mon, 15 Apr 2013 22:23:45 +0000
Message-Id: <E1URroP-0000Qk-Gb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Dump AMD VPMU info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f03b5006f7e6e396746a56f5f563fb0f55cabc44
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:28:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:28:30 2013 +0200

    x86/AMD: Dump AMD VPMU info
    
    Dump VPMU registers on AMD in the 'q' keyhandler.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index b36ab2b..4d1fbc8 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -414,13 +414,53 @@ static void amd_vpmu_destroy(struct vcpu *v)
     }
 }
 
+/* VPMU part of the 'q' keyhandler */
+static void amd_vpmu_dump(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+    unsigned int i;
+
+    printk("    VPMU state: 0x%x ", vpmu->flags);
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+    {
+         printk("\n");
+         return;
+    }
+
+    printk("(");
+    if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
+        printk("PASSIVE_DOMAIN_ALLOCATED, ");
+    if ( vpmu_is_set(vpmu, VPMU_FROZEN) )
+        printk("FROZEN, ");
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
+        printk("SAVE, ");
+    if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
+        printk("RUNNING, ");
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        printk("LOADED, ");
+    printk("ALLOCATED)\n");
+
+    for ( i = 0; i < num_counters; i++ )
+    {
+        uint64_t ctrl, cntr;
+
+        rdmsrl(ctrls[i], ctrl);
+        rdmsrl(counters[i], cntr);
+        printk("      0x%08x: 0x%lx (0x%lx in HW)    0x%08x: 0x%lx (0x%lx in HW)\n",
+            ctrls[i], ctxt->ctrls[i], ctrl,
+            counters[i], ctxt->counters[i], cntr);
+    }
+}
+
 struct arch_vpmu_ops amd_vpmu_ops = {
     .do_wrmsr = amd_vpmu_do_wrmsr,
     .do_rdmsr = amd_vpmu_do_rdmsr,
     .do_interrupt = amd_vpmu_do_interrupt,
     .arch_vpmu_destroy = amd_vpmu_destroy,
     .arch_vpmu_save = amd_vpmu_save,
-    .arch_vpmu_load = amd_vpmu_load
+    .arch_vpmu_load = amd_vpmu_load,
+    .arch_vpmu_dump = amd_vpmu_dump
 };
 
 int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 15 22:25:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 15 Apr 2013 22:25:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URrpe-0002X3-OP; Mon, 15 Apr 2013 22:25:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URrpc-0002Wq-Nm
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:25:01 +0000
Received: from [85.158.138.51:21999] by server-8.bemta-3.messagelabs.com id
	64/59-20604-73E7C615; Mon, 15 Apr 2013 22:24:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1366064684!28362539!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8183 invoked from network); 15 Apr 2013 22:24:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Apr 2013 22:24:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroP-00014P-JA
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URroP-0000Qk-Gb
	for xen-changelog@lists.xensource.com; Mon, 15 Apr 2013 22:23:45 +0000
Date: Mon, 15 Apr 2013 22:23:45 +0000
Message-Id: <E1URroP-0000Qk-Gb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/AMD: Dump AMD VPMU info
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f03b5006f7e6e396746a56f5f563fb0f55cabc44
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Apr 15 11:28:30 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 15 11:28:30 2013 +0200

    x86/AMD: Dump AMD VPMU info
    
    Dump VPMU registers on AMD in the 'q' keyhandler.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/svm/vpmu.c |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index b36ab2b..4d1fbc8 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -414,13 +414,53 @@ static void amd_vpmu_destroy(struct vcpu *v)
     }
 }
 
+/* VPMU part of the 'q' keyhandler */
+static void amd_vpmu_dump(struct vcpu *v)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    struct amd_vpmu_context *ctxt = vpmu->context;
+    unsigned int i;
+
+    printk("    VPMU state: 0x%x ", vpmu->flags);
+    if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
+    {
+         printk("\n");
+         return;
+    }
+
+    printk("(");
+    if ( vpmu_is_set(vpmu, VPMU_PASSIVE_DOMAIN_ALLOCATED) )
+        printk("PASSIVE_DOMAIN_ALLOCATED, ");
+    if ( vpmu_is_set(vpmu, VPMU_FROZEN) )
+        printk("FROZEN, ");
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_SAVE) )
+        printk("SAVE, ");
+    if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
+        printk("RUNNING, ");
+    if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
+        printk("LOADED, ");
+    printk("ALLOCATED)\n");
+
+    for ( i = 0; i < num_counters; i++ )
+    {
+        uint64_t ctrl, cntr;
+
+        rdmsrl(ctrls[i], ctrl);
+        rdmsrl(counters[i], cntr);
+        printk("      0x%08x: 0x%lx (0x%lx in HW)    0x%08x: 0x%lx (0x%lx in HW)\n",
+            ctrls[i], ctxt->ctrls[i], ctrl,
+            counters[i], ctxt->counters[i], cntr);
+    }
+}
+
 struct arch_vpmu_ops amd_vpmu_ops = {
     .do_wrmsr = amd_vpmu_do_wrmsr,
     .do_rdmsr = amd_vpmu_do_rdmsr,
     .do_interrupt = amd_vpmu_do_interrupt,
     .arch_vpmu_destroy = amd_vpmu_destroy,
     .arch_vpmu_save = amd_vpmu_save,
-    .arch_vpmu_load = amd_vpmu_load
+    .arch_vpmu_load = amd_vpmu_load,
+    .arch_vpmu_dump = amd_vpmu_dump
 };
 
 int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 16 00:44:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Apr 2013 00:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URu0J-0004Uk-01; Tue, 16 Apr 2013 00:44:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0H-0004UZ-KN
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:09 +0000
Received: from [85.158.139.211:53798] by server-8.bemta-5.messagelabs.com id
	7B/B3-05790-5DE9C615; Tue, 16 Apr 2013 00:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1366073043!18438560!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7164 invoked from network); 16 Apr 2013 00:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Apr 2013 00:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0B-000303-3l
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0A-0004Eq-VC
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:03 +0000
Date: Tue, 16 Apr 2013 00:44:02 +0000
Message-Id: <E1URu0A-0004Eq-VC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: don't launch more than one
	tapdisk process for each disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a438e0e124523fa62628620c7e6f877a9e4ed11
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Apr 15 18:04:35 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 15 18:07:43 2013 +0100

    libxl: don't launch more than one tapdisk process for each disk
    
    When adding a disk don't launch multiple tapdisk instances for the
    same disk, if transaction fails in device_disk_add reuse the same
    tapdisk for further tries instead of creating a new instance each
    time a transaction fails.
    
    Reported-by: Darren Shepherd <darren.s.shepherd@gmail.com>
    Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
    Tested-by: Darren Shepherd <darren.s.shepherd@gmail.com>
    
    Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
    (cherry picked from commit ec398660e89ca18bb8d061d5047d682bd383778a)
    Conflicts:
    	tools/libxl/libxl.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 5783cd2..3a58ef4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1783,7 +1783,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
     STATE_AO_GC(aodev->ao);
     flexarray_t *front = NULL;
     flexarray_t *back = NULL;
-    char *dev, *script;
+    char *dev = NULL, *script;
     libxl__device *device;
     int rc;
     libxl_ctx *ctx = gc->owner;
@@ -1858,12 +1858,15 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                 break;
 
             case LIBXL_DISK_BACKEND_TAP:
-                dev = libxl__blktap_devpath(gc, disk->pdev_path, disk->format);
-                if (!dev) {
-                    LOG(ERROR, "failed to get blktap devpath for %p\n",
-                        disk->pdev_path);
-                    rc = ERROR_FAIL;
-                    goto out_free;
+                if (dev == NULL) {
+                    dev = libxl__blktap_devpath(gc, disk->pdev_path,
+                                                disk->format);
+                    if (!dev) {
+                        LOG(ERROR, "failed to get blktap devpath for %p\n",
+                            disk->pdev_path);
+                        rc = ERROR_FAIL;
+                        goto out_free;
+                    }
                 }
                 flexarray_append(back, "tapdisk-params");
                 flexarray_append(back, libxl__sprintf(gc, "%s:%s",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 16 00:44:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Apr 2013 00:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URu0J-0004Uk-01; Tue, 16 Apr 2013 00:44:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0H-0004UZ-KN
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:09 +0000
Received: from [85.158.139.211:53798] by server-8.bemta-5.messagelabs.com id
	7B/B3-05790-5DE9C615; Tue, 16 Apr 2013 00:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1366073043!18438560!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7164 invoked from network); 16 Apr 2013 00:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Apr 2013 00:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0B-000303-3l
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0A-0004Eq-VC
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:03 +0000
Date: Tue, 16 Apr 2013 00:44:02 +0000
Message-Id: <E1URu0A-0004Eq-VC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: don't launch more than one
	tapdisk process for each disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1a438e0e124523fa62628620c7e6f877a9e4ed11
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Mon Apr 15 18:04:35 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 15 18:07:43 2013 +0100

    libxl: don't launch more than one tapdisk process for each disk
    
    When adding a disk don't launch multiple tapdisk instances for the
    same disk, if transaction fails in device_disk_add reuse the same
    tapdisk for further tries instead of creating a new instance each
    time a transaction fails.
    
    Reported-by: Darren Shepherd <darren.s.shepherd@gmail.com>
    Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
    Tested-by: Darren Shepherd <darren.s.shepherd@gmail.com>
    
    Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
    (cherry picked from commit ec398660e89ca18bb8d061d5047d682bd383778a)
    Conflicts:
    	tools/libxl/libxl.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 5783cd2..3a58ef4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1783,7 +1783,7 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
     STATE_AO_GC(aodev->ao);
     flexarray_t *front = NULL;
     flexarray_t *back = NULL;
-    char *dev, *script;
+    char *dev = NULL, *script;
     libxl__device *device;
     int rc;
     libxl_ctx *ctx = gc->owner;
@@ -1858,12 +1858,15 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
                 break;
 
             case LIBXL_DISK_BACKEND_TAP:
-                dev = libxl__blktap_devpath(gc, disk->pdev_path, disk->format);
-                if (!dev) {
-                    LOG(ERROR, "failed to get blktap devpath for %p\n",
-                        disk->pdev_path);
-                    rc = ERROR_FAIL;
-                    goto out_free;
+                if (dev == NULL) {
+                    dev = libxl__blktap_devpath(gc, disk->pdev_path,
+                                                disk->format);
+                    if (!dev) {
+                        LOG(ERROR, "failed to get blktap devpath for %p\n",
+                            disk->pdev_path);
+                        rc = ERROR_FAIL;
+                        goto out_free;
+                    }
                 }
                 flexarray_append(back, "tapdisk-params");
                 flexarray_append(back, libxl__sprintf(gc, "%s:%s",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 16 00:44:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Apr 2013 00:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URu0Q-0004VD-2k; Tue, 16 Apr 2013 00:44:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0P-0004V5-4P
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:17 +0000
Received: from [85.158.143.99:2426] by server-2.bemta-4.messagelabs.com id
	44/B9-12656-0EE9C615; Tue, 16 Apr 2013 00:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1366073053!23097613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32221 invoked from network); 16 Apr 2013 00:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Apr 2013 00:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0L-000306-J6
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0L-0004FE-9n
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:13 +0000
Date: Tue, 16 Apr 2013 00:44:13 +0000
Message-Id: <E1URu0L-0004FE-9n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/blktap2: Handle read/write
	interrupts in blktap2 control plane.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2065070a0fe4fdf6580b2f31ba069184136e924
Author:     Dr. Greg Wettstein <greg@wind.enjellic.com>
AuthorDate: Thu Mar 28 07:50:34 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 15 18:08:37 2013 +0100

    tools/blktap2: Handle read/write interrupts in blktap2 control plane.
    
    The following patch:
    
    tools: Retry blktap2 tapdisk message on interrupt.
    
    Addressed a long standing regression with the blktap2 control
    plane.  An interruption of the select system call would
    prematurely terminate the message sequence needed to properly
    shutdown a blktap2 tapdisk instance.
    
    Ian Jackson correctly noted that the read and write systems calls
    responsible for receiving and sending the control messages could
    also return EINTR resulting in similar effects.  While this
    regression was not noted in field testing this patch adds support
    to re-start the calls to provide a technically complete
    implementation of control plane management in the presence of
    signals.
    
    Signed-off-by: Dr. Greg Wettstein <xen@wind.enjellic.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a5c800142cfc82159fcb85b47116cf296caebcc5)
---
 tools/blktap2/control/tap-ctl-ipc.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap2/control/tap-ctl-ipc.c
index c8aad1c..c7e42d9 100644
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap2/control/tap-ctl-ipc.c
@@ -71,8 +71,11 @@ tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
 		}
 		else if (FD_ISSET(fd, &readfds)) {
 			ret = read(fd, message + offset, len - offset);
-			if (ret <= 0)
+			if (ret <= 0) {
+				if (errno == EINTR)
+					continue;
 				break;
+			}
 			offset += ret;
 		} else
 			break;
@@ -124,8 +127,11 @@ tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
 		}
 		else if (FD_ISSET(fd, &writefds)) {
 			ret = write(fd, message + offset, len - offset);
-			if (ret <= 0)
+			if (ret <= 0) {
+				if (errno == EINTR)
+					continue;
 				break;
+			}
 			offset += ret;
 		} else
 			break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 16 00:44:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 16 Apr 2013 00:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1URu0Q-0004VD-2k; Tue, 16 Apr 2013 00:44:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0P-0004V5-4P
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:17 +0000
Received: from [85.158.143.99:2426] by server-2.bemta-4.messagelabs.com id
	44/B9-12656-0EE9C615; Tue, 16 Apr 2013 00:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1366073053!23097613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32221 invoked from network); 16 Apr 2013 00:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Apr 2013 00:44:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0L-000306-J6
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1URu0L-0004FE-9n
	for xen-changelog@lists.xensource.com; Tue, 16 Apr 2013 00:44:13 +0000
Date: Tue, 16 Apr 2013 00:44:13 +0000
Message-Id: <E1URu0L-0004FE-9n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] tools/blktap2: Handle read/write
	interrupts in blktap2 control plane.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a2065070a0fe4fdf6580b2f31ba069184136e924
Author:     Dr. Greg Wettstein <greg@wind.enjellic.com>
AuthorDate: Thu Mar 28 07:50:34 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Apr 15 18:08:37 2013 +0100

    tools/blktap2: Handle read/write interrupts in blktap2 control plane.
    
    The following patch:
    
    tools: Retry blktap2 tapdisk message on interrupt.
    
    Addressed a long standing regression with the blktap2 control
    plane.  An interruption of the select system call would
    prematurely terminate the message sequence needed to properly
    shutdown a blktap2 tapdisk instance.
    
    Ian Jackson correctly noted that the read and write systems calls
    responsible for receiving and sending the control messages could
    also return EINTR resulting in similar effects.  While this
    regression was not noted in field testing this patch adds support
    to re-start the calls to provide a technically complete
    implementation of control plane management in the presence of
    signals.
    
    Signed-off-by: Dr. Greg Wettstein <xen@wind.enjellic.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit a5c800142cfc82159fcb85b47116cf296caebcc5)
---
 tools/blktap2/control/tap-ctl-ipc.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/blktap2/control/tap-ctl-ipc.c b/tools/blktap2/control/tap-ctl-ipc.c
index c8aad1c..c7e42d9 100644
--- a/tools/blktap2/control/tap-ctl-ipc.c
+++ b/tools/blktap2/control/tap-ctl-ipc.c
@@ -71,8 +71,11 @@ tap_ctl_read_message(int fd, tapdisk_message_t *message, int timeout)
 		}
 		else if (FD_ISSET(fd, &readfds)) {
 			ret = read(fd, message + offset, len - offset);
-			if (ret <= 0)
+			if (ret <= 0) {
+				if (errno == EINTR)
+					continue;
 				break;
+			}
 			offset += ret;
 		} else
 			break;
@@ -124,8 +127,11 @@ tap_ctl_write_message(int fd, tapdisk_message_t *message, int timeout)
 		}
 		else if (FD_ISSET(fd, &writefds)) {
 			ret = write(fd, message + offset, len - offset);
-			if (ret <= 0)
+			if (ret <= 0) {
+				if (errno == EINTR)
+					continue;
 				break;
+			}
 			offset += ret;
 		} else
 			break;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH4k-00054D-BW; Wed, 17 Apr 2013 01:22:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4j-000546-7D
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:17 +0000
Received: from [193.109.254.147:48843] by server-9.bemta-14.messagelabs.com id
	FF/14-04223-849FD615; Wed, 17 Apr 2013 01:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1366161731!8563993!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32124 invoked from network); 17 Apr 2013 01:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4V-00028l-Fe
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4V-0006ih-6X
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:03 +0000
Date: Wed, 17 Apr 2013 01:22:03 +0000
Message-Id: <E1USH4V-0006ih-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] iommu/crash: Interrupt remapping is
	also disabled on crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53fd1d8458de01169dfb56feb315f02c2b521a86
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 16 10:34:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 16 10:34:32 2013 +0200

    iommu/crash: Interrupt remapping is also disabled on crash
    
    This fixes a regression side-effect caused by:
      IOMMU: properly check whether interrupt remapping is enabled
        git: fae0372140befb88d890a30704a8ec058c902af8
         hg: 26742:e1ec14bad0cb
    
    On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then
    disable the IOAPIC.
    
    On systems which support interrupt remapping, the variable iommu_intremap
    remains set, meaning that disable_IO_APIC() issues interrupt remapping
    invalidate requests.
    
    IOAPIC interrupt remapping used to be conditional on iommu_enabled, but is now
    conditional on iommu_intremap, following the above changeset.
    
    This behaviour can be fixed by also indicating that interrupt remapping is not
    enabled after shutting down the IOMMU.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index c5906ab..93ad122 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -603,7 +603,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = 0;
+    iommu_enabled = iommu_intremap = 0;
 }
 
 int iommu_do_domctl(
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH4k-00054D-BW; Wed, 17 Apr 2013 01:22:18 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4j-000546-7D
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:17 +0000
Received: from [193.109.254.147:48843] by server-9.bemta-14.messagelabs.com id
	FF/14-04223-849FD615; Wed, 17 Apr 2013 01:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1366161731!8563993!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32124 invoked from network); 17 Apr 2013 01:22:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4V-00028l-Fe
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4V-0006ih-6X
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:03 +0000
Date: Wed, 17 Apr 2013 01:22:03 +0000
Message-Id: <E1USH4V-0006ih-6X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] iommu/crash: Interrupt remapping is
	also disabled on crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53fd1d8458de01169dfb56feb315f02c2b521a86
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Apr 16 10:34:32 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 16 10:34:32 2013 +0200

    iommu/crash: Interrupt remapping is also disabled on crash
    
    This fixes a regression side-effect caused by:
      IOMMU: properly check whether interrupt remapping is enabled
        git: fae0372140befb88d890a30704a8ec058c902af8
         hg: 26742:e1ec14bad0cb
    
    On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then
    disable the IOAPIC.
    
    On systems which support interrupt remapping, the variable iommu_intremap
    remains set, meaning that disable_IO_APIC() issues interrupt remapping
    invalidate requests.
    
    IOAPIC interrupt remapping used to be conditional on iommu_enabled, but is now
    conditional on iommu_intremap, following the above changeset.
    
    This behaviour can be fixed by also indicating that interrupt remapping is not
    enabled after shutting down the IOMMU.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index c5906ab..93ad122 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -603,7 +603,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = 0;
+    iommu_enabled = iommu_intremap = 0;
 }
 
 int iommu_do_domctl(
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH4l-00054O-E8; Wed, 17 Apr 2013 01:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4k-00054C-Oc
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:18 +0000
Received: from [85.158.138.51:36467] by server-12.bemta-3.messagelabs.com id
	CE/7A-01357-949FD615; Wed, 17 Apr 2013 01:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366161736!25644724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9366 invoked from network); 17 Apr 2013 01:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4h-00028o-QA
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4h-0006jE-JD
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:15 +0000
Date: Wed, 17 Apr 2013 01:22:15 +0000
Message-Id: <E1USH4h-0006jE-JD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VTD: Remove the check for reserved
	device scope type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 749bc93f7a1ad47640cc7876d27641e98a08bf61
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Tue Apr 16 10:36:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 16 10:36:05 2013 +0200

    VTD: Remove the check for reserved device scope type
    
    Though we only have four valid types now, the new type may be added in future.
    It's better to remove the check and only deal with the type that we can
    recognize.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Signed-off-by: Xiantao Zhang <xiantao.zhang@Intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    Add log message for this case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/vtd/dmar.c |   10 ++++++++--
 xen/include/acpi/actbl2.h          |    1 -
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 370d5d6..c810dbc 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -283,8 +283,7 @@ static int __init scope_device_count(const void *start, const void *end)
     while ( start < end )
     {
         scope = start;
-        if ( (scope->length < MIN_SCOPE_LEN) ||
-             (scope->entry_type >= ACPI_DMAR_SCOPE_TYPE_RESERVED) )
+        if ( scope->length < MIN_SCOPE_LEN )
         {
             dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
             return -EINVAL;
@@ -409,6 +408,13 @@ static int __init acpi_parse_dev_scope(
             }
 
             break;
+
+        default:
+            if ( iommu_verbose )
+                printk(XENLOG_WARNING VTDPREFIX "Unknown scope type %#x\n",
+                       acpi_scope->entry_type);
+            start += acpi_scope->length;
+            continue;
         }
         scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn);
         start += acpi_scope->length;
diff --git a/xen/include/acpi/actbl2.h b/xen/include/acpi/actbl2.h
index a28226a..87bc6b3 100644
--- a/xen/include/acpi/actbl2.h
+++ b/xen/include/acpi/actbl2.h
@@ -303,7 +303,6 @@ enum acpi_dmar_scope_type {
 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
-	ACPI_DMAR_SCOPE_TYPE_RESERVED = 5	/* 5 and greater are reserved */
 };
 
 struct acpi_dmar_pci_path {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH4l-00054O-E8; Wed, 17 Apr 2013 01:22:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4k-00054C-Oc
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:18 +0000
Received: from [85.158.138.51:36467] by server-12.bemta-3.messagelabs.com id
	CE/7A-01357-949FD615; Wed, 17 Apr 2013 01:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366161736!25644724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9366 invoked from network); 17 Apr 2013 01:22:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4h-00028o-QA
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4h-0006jE-JD
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:15 +0000
Date: Wed, 17 Apr 2013 01:22:15 +0000
Message-Id: <E1USH4h-0006jE-JD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VTD: Remove the check for reserved
	device scope type
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 749bc93f7a1ad47640cc7876d27641e98a08bf61
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Tue Apr 16 10:36:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 16 10:36:05 2013 +0200

    VTD: Remove the check for reserved device scope type
    
    Though we only have four valid types now, the new type may be added in future.
    It's better to remove the check and only deal with the type that we can
    recognize.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Signed-off-by: Xiantao Zhang <xiantao.zhang@Intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    
    Add log message for this case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/vtd/dmar.c |   10 ++++++++--
 xen/include/acpi/actbl2.h          |    1 -
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 370d5d6..c810dbc 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -283,8 +283,7 @@ static int __init scope_device_count(const void *start, const void *end)
     while ( start < end )
     {
         scope = start;
-        if ( (scope->length < MIN_SCOPE_LEN) ||
-             (scope->entry_type >= ACPI_DMAR_SCOPE_TYPE_RESERVED) )
+        if ( scope->length < MIN_SCOPE_LEN )
         {
             dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n");
             return -EINVAL;
@@ -409,6 +408,13 @@ static int __init acpi_parse_dev_scope(
             }
 
             break;
+
+        default:
+            if ( iommu_verbose )
+                printk(XENLOG_WARNING VTDPREFIX "Unknown scope type %#x\n",
+                       acpi_scope->entry_type);
+            start += acpi_scope->length;
+            continue;
         }
         scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn);
         start += acpi_scope->length;
diff --git a/xen/include/acpi/actbl2.h b/xen/include/acpi/actbl2.h
index a28226a..87bc6b3 100644
--- a/xen/include/acpi/actbl2.h
+++ b/xen/include/acpi/actbl2.h
@@ -303,7 +303,6 @@ enum acpi_dmar_scope_type {
 	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
 	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
 	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
-	ACPI_DMAR_SCOPE_TYPE_RESERVED = 5	/* 5 and greater are reserved */
 };
 
 struct acpi_dmar_pci_path {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH4w-00055P-Ht; Wed, 17 Apr 2013 01:22:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4v-00055F-CX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:29 +0000
Received: from [85.158.137.99:63919] by server-16.bemta-3.messagelabs.com id
	E2/39-20692-459FD615; Wed, 17 Apr 2013 01:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1366161746!15377504!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23185 invoked from network); 17 Apr 2013 01:22:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4s-00028s-9D
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4r-0006jb-Vp
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:26 +0000
Date: Wed, 17 Apr 2013 01:22:25 +0000
Message-Id: <E1USH4r-0006jb-Vp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xc: use XENMEM_claim_pages hypercall
	during guest creation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc67e9dc0c1fe0cebbc2d77fae5aa721e7089615
Author:     Dan Magenheimer <dan.magenheimer@oracle.com>
AuthorDate: Mon Feb 25 15:19:14 2013 -0500
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xc: use XENMEM_claim_pages hypercall during guest creation.
    
    We add an extra parameter to the structures passed to the
    PV routine (arch_setup_meminit) and HVM routine (setup_guest)
    that determines whether the claim hypercall is to be done.
    
    The contents of the 'claim_enabled' is defined as an 'int'
    in case the hypercall expands in the future with extra
    flags (for example for per-NUMA allocation). For right now
    the proper values are: 0 to disable it or 1 to enable
    it.
    
    If the hypervisor does not support this function, the
    xc_domain_claim_pages and xc_domain_get_outstanding_pages
    will silently return 0 (and set errno to zero).
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    [v2: Updated per Ian's recommendations]
    [v3: Added support for out-of-sync hypervisor]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom.h           |    1 +
 tools/libxc/xc_dom_x86.c       |   12 ++++++++++++
 tools/libxc/xc_domain.c        |   30 ++++++++++++++++++++++++++++++
 tools/libxc/xc_hvm_build_x86.c |   23 +++++++++++++++++++----
 tools/libxc/xenctrl.h          |    6 ++++++
 tools/libxc/xenguest.h         |    2 ++
 6 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 779b9d4..ac36600 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -135,6 +135,7 @@ struct xc_dom_image {
     domid_t guest_domid;
     int8_t vhpt_size_log2; /* for IA64 */
     int8_t superpages;
+    int claim_enabled; /* 0 by default, 1 enables it */
     int shadow_enabled;
 
     int xen_version;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index eb9ac07..d89526d 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -706,6 +706,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     }
     else
     {
+        /* try to claim pages for early warning of insufficient memory avail */
+        if ( dom->claim_enabled ) {
+            rc = xc_domain_claim_pages(dom->xch, dom->guest_domid,
+                                       dom->total_pages);
+            if ( rc )
+                return rc;
+        }
         /* setup initial p2m */
         for ( pfn = 0; pfn < dom->total_pages; pfn++ )
             dom->p2m_host[pfn] = pfn;
@@ -722,6 +729,11 @@ int arch_setup_meminit(struct xc_dom_image *dom)
                 dom->xch, dom->guest_domid, allocsz,
                 0, 0, &dom->p2m_host[i]);
         }
+
+        /* Ensure no unclaimed pages are left unused.
+         * OK to call if hadn't done the earlier claim call. */
+        (void)xc_domain_claim_pages(dom->xch, dom->guest_domid,
+                                    0 /* cancels the claim */);
     }
 
     return rc;
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 480ce91..299c907 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -775,6 +775,36 @@ int xc_domain_add_to_physmap(xc_interface *xch,
     return do_memory_op(xch, XENMEM_add_to_physmap, &xatp, sizeof(xatp));
 }
 
+int xc_domain_claim_pages(xc_interface *xch,
+                               uint32_t domid,
+                               unsigned long nr_pages)
+{
+    int err;
+    struct xen_memory_reservation reservation = {
+        .nr_extents   = nr_pages,
+        .extent_order = 0,
+        .mem_flags    = 0, /* no flags */
+        .domid        = domid
+    };
+
+    set_xen_guest_handle(reservation.extent_start, HYPERCALL_BUFFER_NULL);
+
+    err = do_memory_op(xch, XENMEM_claim_pages, &reservation, sizeof(reservation));
+    /* Ignore it if the hypervisor does not support the call. */
+    if (err == -1 && errno == ENOSYS)
+        err = errno = 0;
+    return err;
+}
+unsigned long xc_domain_get_outstanding_pages(xc_interface *xch)
+{
+    long ret = do_memory_op(xch, XENMEM_get_outstanding_pages, NULL, 0);
+
+    /* Ignore it if the hypervisor does not support the call. */
+    if (ret == -1 && errno == ENOSYS)
+        ret = errno = 0;
+    return ret;
+}
+
 int xc_domain_populate_physmap(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_extents,
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 3b5d777..ab33a7f 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -252,6 +252,7 @@ static int setup_guest(xc_interface *xch,
     unsigned long stat_normal_pages = 0, stat_2mb_pages = 0, 
         stat_1gb_pages = 0;
     int pod_mode = 0;
+    int claim_enabled = args->claim_enabled;
 
     if ( nr_pages > target_pages )
         pod_mode = XENMEMF_populate_on_demand;
@@ -329,6 +330,16 @@ static int setup_guest(xc_interface *xch,
         xch, dom, 0xa0, 0, pod_mode, &page_array[0x00]);
     cur_pages = 0xc0;
     stat_normal_pages = 0xc0;
+
+    /* try to claim pages for early warning of insufficient memory available */
+    if ( claim_enabled ) {
+        rc = xc_domain_claim_pages(xch, dom, nr_pages - cur_pages);
+        if ( rc != 0 )
+        {
+            PERROR("Could not allocate memory for HVM guest as we cannot claim memory!");
+            goto error_out;
+        }
+    }
     while ( (rc == 0) && (nr_pages > cur_pages) )
     {
         /* Clip count to maximum 1GB extent. */
@@ -506,12 +517,16 @@ static int setup_guest(xc_interface *xch,
         munmap(page0, PAGE_SIZE);
     }
 
-    free(page_array);
-    return 0;
-
+    rc = 0;
+    goto out;
  error_out:
+    rc = -1;
+ out:
+    /* ensure no unclaimed pages are left unused */
+    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
+
     free(page_array);
-    return -1;
+    return rc;
 }
 
 /* xc_hvm_build:
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 50853af..19e34b2 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1133,6 +1133,12 @@ int xc_domain_populate_physmap_exact(xc_interface *xch,
                                      unsigned int mem_flags,
                                      xen_pfn_t *extent_start);
 
+int xc_domain_claim_pages(xc_interface *xch,
+                               uint32_t domid,
+                               unsigned long nr_pages);
+
+unsigned long xc_domain_get_outstanding_pages(xc_interface *xch);
+
 int xc_domain_memory_exchange_pages(xc_interface *xch,
                                     int domid,
                                     unsigned long nr_in_extents,
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index 7d4ac33..4714bd2 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -231,6 +231,8 @@ struct xc_hvm_build_args {
 
     /* Extra SMBIOS structures passed to HVMLOADER */
     struct xc_hvm_firmware_module smbios_module;
+    /* Whether to use claim hypercall (1 - enable, 0 - disable). */
+    int claim_enabled;
 };
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH4w-00055P-Ht; Wed, 17 Apr 2013 01:22:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4v-00055F-CX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:29 +0000
Received: from [85.158.137.99:63919] by server-16.bemta-3.messagelabs.com id
	E2/39-20692-459FD615; Wed, 17 Apr 2013 01:22:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1366161746!15377504!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23185 invoked from network); 17 Apr 2013 01:22:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4s-00028s-9D
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH4r-0006jb-Vp
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:26 +0000
Date: Wed, 17 Apr 2013 01:22:25 +0000
Message-Id: <E1USH4r-0006jb-Vp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xc: use XENMEM_claim_pages hypercall
	during guest creation.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fc67e9dc0c1fe0cebbc2d77fae5aa721e7089615
Author:     Dan Magenheimer <dan.magenheimer@oracle.com>
AuthorDate: Mon Feb 25 15:19:14 2013 -0500
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xc: use XENMEM_claim_pages hypercall during guest creation.
    
    We add an extra parameter to the structures passed to the
    PV routine (arch_setup_meminit) and HVM routine (setup_guest)
    that determines whether the claim hypercall is to be done.
    
    The contents of the 'claim_enabled' is defined as an 'int'
    in case the hypercall expands in the future with extra
    flags (for example for per-NUMA allocation). For right now
    the proper values are: 0 to disable it or 1 to enable
    it.
    
    If the hypervisor does not support this function, the
    xc_domain_claim_pages and xc_domain_get_outstanding_pages
    will silently return 0 (and set errno to zero).
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    [v2: Updated per Ian's recommendations]
    [v3: Added support for out-of-sync hypervisor]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom.h           |    1 +
 tools/libxc/xc_dom_x86.c       |   12 ++++++++++++
 tools/libxc/xc_domain.c        |   30 ++++++++++++++++++++++++++++++
 tools/libxc/xc_hvm_build_x86.c |   23 +++++++++++++++++++----
 tools/libxc/xenctrl.h          |    6 ++++++
 tools/libxc/xenguest.h         |    2 ++
 6 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index 779b9d4..ac36600 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -135,6 +135,7 @@ struct xc_dom_image {
     domid_t guest_domid;
     int8_t vhpt_size_log2; /* for IA64 */
     int8_t superpages;
+    int claim_enabled; /* 0 by default, 1 enables it */
     int shadow_enabled;
 
     int xen_version;
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index eb9ac07..d89526d 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -706,6 +706,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     }
     else
     {
+        /* try to claim pages for early warning of insufficient memory avail */
+        if ( dom->claim_enabled ) {
+            rc = xc_domain_claim_pages(dom->xch, dom->guest_domid,
+                                       dom->total_pages);
+            if ( rc )
+                return rc;
+        }
         /* setup initial p2m */
         for ( pfn = 0; pfn < dom->total_pages; pfn++ )
             dom->p2m_host[pfn] = pfn;
@@ -722,6 +729,11 @@ int arch_setup_meminit(struct xc_dom_image *dom)
                 dom->xch, dom->guest_domid, allocsz,
                 0, 0, &dom->p2m_host[i]);
         }
+
+        /* Ensure no unclaimed pages are left unused.
+         * OK to call if hadn't done the earlier claim call. */
+        (void)xc_domain_claim_pages(dom->xch, dom->guest_domid,
+                                    0 /* cancels the claim */);
     }
 
     return rc;
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 480ce91..299c907 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -775,6 +775,36 @@ int xc_domain_add_to_physmap(xc_interface *xch,
     return do_memory_op(xch, XENMEM_add_to_physmap, &xatp, sizeof(xatp));
 }
 
+int xc_domain_claim_pages(xc_interface *xch,
+                               uint32_t domid,
+                               unsigned long nr_pages)
+{
+    int err;
+    struct xen_memory_reservation reservation = {
+        .nr_extents   = nr_pages,
+        .extent_order = 0,
+        .mem_flags    = 0, /* no flags */
+        .domid        = domid
+    };
+
+    set_xen_guest_handle(reservation.extent_start, HYPERCALL_BUFFER_NULL);
+
+    err = do_memory_op(xch, XENMEM_claim_pages, &reservation, sizeof(reservation));
+    /* Ignore it if the hypervisor does not support the call. */
+    if (err == -1 && errno == ENOSYS)
+        err = errno = 0;
+    return err;
+}
+unsigned long xc_domain_get_outstanding_pages(xc_interface *xch)
+{
+    long ret = do_memory_op(xch, XENMEM_get_outstanding_pages, NULL, 0);
+
+    /* Ignore it if the hypervisor does not support the call. */
+    if (ret == -1 && errno == ENOSYS)
+        ret = errno = 0;
+    return ret;
+}
+
 int xc_domain_populate_physmap(xc_interface *xch,
                                uint32_t domid,
                                unsigned long nr_extents,
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 3b5d777..ab33a7f 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -252,6 +252,7 @@ static int setup_guest(xc_interface *xch,
     unsigned long stat_normal_pages = 0, stat_2mb_pages = 0, 
         stat_1gb_pages = 0;
     int pod_mode = 0;
+    int claim_enabled = args->claim_enabled;
 
     if ( nr_pages > target_pages )
         pod_mode = XENMEMF_populate_on_demand;
@@ -329,6 +330,16 @@ static int setup_guest(xc_interface *xch,
         xch, dom, 0xa0, 0, pod_mode, &page_array[0x00]);
     cur_pages = 0xc0;
     stat_normal_pages = 0xc0;
+
+    /* try to claim pages for early warning of insufficient memory available */
+    if ( claim_enabled ) {
+        rc = xc_domain_claim_pages(xch, dom, nr_pages - cur_pages);
+        if ( rc != 0 )
+        {
+            PERROR("Could not allocate memory for HVM guest as we cannot claim memory!");
+            goto error_out;
+        }
+    }
     while ( (rc == 0) && (nr_pages > cur_pages) )
     {
         /* Clip count to maximum 1GB extent. */
@@ -506,12 +517,16 @@ static int setup_guest(xc_interface *xch,
         munmap(page0, PAGE_SIZE);
     }
 
-    free(page_array);
-    return 0;
-
+    rc = 0;
+    goto out;
  error_out:
+    rc = -1;
+ out:
+    /* ensure no unclaimed pages are left unused */
+    xc_domain_claim_pages(xch, dom, 0 /* cancels the claim */);
+
     free(page_array);
-    return -1;
+    return rc;
 }
 
 /* xc_hvm_build:
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 50853af..19e34b2 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1133,6 +1133,12 @@ int xc_domain_populate_physmap_exact(xc_interface *xch,
                                      unsigned int mem_flags,
                                      xen_pfn_t *extent_start);
 
+int xc_domain_claim_pages(xc_interface *xch,
+                               uint32_t domid,
+                               unsigned long nr_pages);
+
+unsigned long xc_domain_get_outstanding_pages(xc_interface *xch);
+
 int xc_domain_memory_exchange_pages(xc_interface *xch,
                                     int domid,
                                     unsigned long nr_in_extents,
diff --git a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
index 7d4ac33..4714bd2 100644
--- a/tools/libxc/xenguest.h
+++ b/tools/libxc/xenguest.h
@@ -231,6 +231,8 @@ struct xc_hvm_build_args {
 
     /* Extra SMBIOS structures passed to HVMLOADER */
     struct xc_hvm_firmware_module smbios_module;
+    /* Whether to use claim hypercall (1 - enable, 0 - disable). */
+    int claim_enabled;
 };
 
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH57-00056w-LO; Wed, 17 Apr 2013 01:22:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH56-00056f-4Q
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:40 +0000
Received: from [85.158.139.83:21987] by server-5.bemta-5.messagelabs.com id
	D0/81-02762-F59FD615; Wed, 17 Apr 2013 01:22:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1366161756!25382289!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17458 invoked from network); 17 Apr 2013 01:22:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH52-000293-KK
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH52-0006k7-EJ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:36 +0000
Date: Wed, 17 Apr 2013 01:22:36 +0000
Message-Id: <E1USH52-0006k7-EJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Implement XENMEM_claim_pages
	support via 'claim_mode' global config
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ad0fcc9fe5cac8cc79b3ec9508aa655220f1a314
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon Mar 18 16:23:39 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: Implement XENMEM_claim_pages support via 'claim_mode' global config
    
    The XENMEM_claim_pages hypercall operates per domain and it should be
    used system wide. As such this patch introduces a global configuration
    option 'claim_mode' that by default is disabled.
    
    If this option is enabled then when a guest is created there will be an
    guarantee that there is memory available for the guest. This is an
    particularly acute problem on hosts with memory over-provisioned guests
    that use tmem and have self-balloon enabled (which is the default option
    for them). The self-balloon mechanism can deflate/inflate the balloon
    quickly and the amount of free memory (which 'xl info' can show) is stale
    the moment it is printed. When claim is enabled a reservation for the
    amount of memory ('memory' in guest config) is set, which is then reduced
    as the domain's memory is populated and eventually reaches zero.
    
    If the reservation cannot be meet the guest creation fails immediately
    instead of taking seconds/minutes (depending on the size of the guest)
    while the guest is populated.
    
    Note that to enable tmem type guests, one needs to provide 'tmem' on the
    Xen hypervisor argument and as well on the Linux kernel command line.
    
    There are two boolean options:
    
    (0) No claim is made. Memory population during guest creation will be
    attempted as normal and may fail due to memory exhaustion.
    
    (1) Normal memory and freeable pool of ephemeral pages (tmem) is used when
    calculating whether there is enough memory free to launch a guest.
    This guarantees immediate feedback whether the guest can be launched due
    to memory exhaustion (which can take a long time to find out if launching
    massively huge guests) and in parallel.
    
    [v1: Removed own claim_mode type, using just bool, improved docs, all per
    Ian's suggestion]
    [v2: Updated the comments]
    [v3: Rebase on top 733b9c524dbc2bec318bfc3588ed1652455d30ec (xl: add vif.default.script)]
    [v4: Fixed up comments]
    [v5: s/global_claim_mode/claim_mode/]
    [v6: Ian Jackson's feedback: use libxl_defbool, better comments, etc]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.conf.pod.5      |   41 +++++++++++++++++++++++++++++++++++++++++
 tools/examples/xl.conf      |    6 ++++++
 tools/libxl/libxl.h         |    1 -
 tools/libxl/libxl_create.c  |    2 ++
 tools/libxl/libxl_dom.c     |    3 ++-
 tools/libxl/libxl_types.idl |    2 +-
 tools/libxl/xl.c            |    5 +++++
 tools/libxl/xl.h            |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 9 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index aaf8da1..c4072aa 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -115,6 +115,47 @@ Configures the name of the first block device to be used for temporary
 block device allocations by the toolstack.
 The default choice is "xvda".
 
+=item B<claim_mode=BOOLEAN>
+
+If this option is enabled then when a guest is created there will be an
+guarantee that there is memory available for the guest. This is an
+particularly acute problem on hosts with memory over-provisioned guests
+that use tmem and have self-balloon enabled (which is the default
+option). The self-balloon mechanism can deflate/inflate the balloon
+quickly and the amount of free memory (which C<xl info> can show) is
+stale the moment it is printed. When claim is enabled a reservation for
+the amount of memory (see 'memory' in xl.conf(5)) is set, which is then
+reduced as the domain's memory is populated and eventually reaches zero.
+
+If the reservation cannot be meet the guest creation fails immediately
+instead of taking seconds/minutes (depending on the size of the guest)
+while the guest is populated.
+
+Note that to enable tmem type guests, one needs to provide C<tmem> on the
+Xen hypervisor argument and as well on the Linux kernel command line.
+
+Note that the claim call is not attempted if C<superpages> option is
+used in the guest config (see xl.cfg(5)).
+
+Default: C<0>
+
+=over 4
+
+=item C<0>
+
+No claim is made. Memory population during guest creation will be
+attempted as normal and may fail due to memory exhaustion.
+
+=item C<1>
+
+Normal memory and freeable pool of ephemeral pages (tmem) is used when
+calculating whether there is enough memory free to launch a guest.
+This guarantees immediate feedback whether the guest can be launched due
+to memory exhaustion (which can take a long time to find out if launching
+massively huge guests).
+
+=back
+
 =back
 
 =head1 SEE ALSO
diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index 50cba2b..9402c3f 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -27,3 +27,9 @@
 
 # default bridge device to use with vif-bridge hotplug scripts
 #vif.default.bridge="xenbr0"
+
+# Reserve a claim of memory when launching a guest. This guarantees immediate
+# feedback whether the guest can be launched due to memory exhaustion
+# (which can take a long time to find out if launching huge guests).
+# see xl.conf(5) for details.
+#claim_mode=0
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index d18d22c..e4a4ab2 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -595,7 +595,6 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k
 /* wait for the memory target of a domain to be reached */
 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
 
-
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
 /* libxl_primary_console_exec finds the domid and console number
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 30a4507..ae72f21 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -196,6 +196,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
         b_info->target_memkb = b_info->max_memkb;
 
+    libxl_defbool_setdefault(&b_info->claim_mode, false);
+
     libxl_defbool_setdefault(&b_info->localtime, false);
 
     libxl_defbool_setdefault(&b_info->disable_migrate, false);
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 2dd429f..92a6628 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -371,6 +371,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     dom->console_domid = state->console_domid;
     dom->xenstore_evtchn = state->store_port;
     dom->xenstore_domid = state->store_domid;
+    dom->claim_enabled = libxl_defbool_val(info->claim_mode);
 
     if ( (ret = xc_dom_boot_xen_init(dom, ctx->xch, domid)) != 0 ) {
         LOGE(ERROR, "xc_dom_boot_xen_init failed");
@@ -605,7 +606,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
      */
     args.mem_size = (uint64_t)(info->max_memkb - info->video_memkb) << 10;
     args.mem_target = (uint64_t)(info->target_memkb - info->video_memkb) << 10;
-
+    args.claim_enabled = libxl_defbool_val(info->claim_mode);
     if (libxl__domain_firmware(gc, info, &args)) {
         LOG(ERROR, "initializing domain firmware failed");
         goto out;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 6cb6de6..4d8f7cd 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -293,7 +293,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("ioports",          Array(libxl_ioport_range, "num_ioports")),
     ("irqs",             Array(uint32, "num_irqs")),
     ("iomem",            Array(libxl_iomem_range, "num_iomem")),
-
+    ("claim_mode",	     libxl_defbool),
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 16cd3f3..3c141bf 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -46,6 +46,7 @@ char *default_vifscript = NULL;
 char *default_bridge = NULL;
 char *default_gatewaydev = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
+libxl_defbool claim_mode;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
@@ -168,6 +169,10 @@ static void parse_global_config(const char *configfile,
     }
     if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
         blkdev_start = strdup(buf);
+
+    libxl_defbool_setdefault(&claim_mode, false);
+    (void)xlu_cfg_get_defbool (config, "claim_mode", &claim_mode, 0);
+
     xlu_cfg_destroy(config);
 }
 
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index b881f92..4c5e5d1 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -145,6 +145,7 @@ int xl_child_pid(xlchildnum); /* returns 0 if child struct is not in use */
 extern int autoballoon;
 extern int run_hotplug_scripts;
 extern int dryrun_only;
+extern libxl_defbool claim_mode;
 extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 61f7b96..5a0506f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -757,6 +757,8 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
         b_info->max_memkb = l * 1024;
 
+    b_info->claim_mode = claim_mode;
+
     if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_poweroff)) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:46 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH57-00056w-LO; Wed, 17 Apr 2013 01:22:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH56-00056f-4Q
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:40 +0000
Received: from [85.158.139.83:21987] by server-5.bemta-5.messagelabs.com id
	D0/81-02762-F59FD615; Wed, 17 Apr 2013 01:22:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1366161756!25382289!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17458 invoked from network); 17 Apr 2013 01:22:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH52-000293-KK
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH52-0006k7-EJ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:36 +0000
Date: Wed, 17 Apr 2013 01:22:36 +0000
Message-Id: <E1USH52-0006k7-EJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Implement XENMEM_claim_pages
	support via 'claim_mode' global config
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ad0fcc9fe5cac8cc79b3ec9508aa655220f1a314
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon Mar 18 16:23:39 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: Implement XENMEM_claim_pages support via 'claim_mode' global config
    
    The XENMEM_claim_pages hypercall operates per domain and it should be
    used system wide. As such this patch introduces a global configuration
    option 'claim_mode' that by default is disabled.
    
    If this option is enabled then when a guest is created there will be an
    guarantee that there is memory available for the guest. This is an
    particularly acute problem on hosts with memory over-provisioned guests
    that use tmem and have self-balloon enabled (which is the default option
    for them). The self-balloon mechanism can deflate/inflate the balloon
    quickly and the amount of free memory (which 'xl info' can show) is stale
    the moment it is printed. When claim is enabled a reservation for the
    amount of memory ('memory' in guest config) is set, which is then reduced
    as the domain's memory is populated and eventually reaches zero.
    
    If the reservation cannot be meet the guest creation fails immediately
    instead of taking seconds/minutes (depending on the size of the guest)
    while the guest is populated.
    
    Note that to enable tmem type guests, one needs to provide 'tmem' on the
    Xen hypervisor argument and as well on the Linux kernel command line.
    
    There are two boolean options:
    
    (0) No claim is made. Memory population during guest creation will be
    attempted as normal and may fail due to memory exhaustion.
    
    (1) Normal memory and freeable pool of ephemeral pages (tmem) is used when
    calculating whether there is enough memory free to launch a guest.
    This guarantees immediate feedback whether the guest can be launched due
    to memory exhaustion (which can take a long time to find out if launching
    massively huge guests) and in parallel.
    
    [v1: Removed own claim_mode type, using just bool, improved docs, all per
    Ian's suggestion]
    [v2: Updated the comments]
    [v3: Rebase on top 733b9c524dbc2bec318bfc3588ed1652455d30ec (xl: add vif.default.script)]
    [v4: Fixed up comments]
    [v5: s/global_claim_mode/claim_mode/]
    [v6: Ian Jackson's feedback: use libxl_defbool, better comments, etc]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.conf.pod.5      |   41 +++++++++++++++++++++++++++++++++++++++++
 tools/examples/xl.conf      |    6 ++++++
 tools/libxl/libxl.h         |    1 -
 tools/libxl/libxl_create.c  |    2 ++
 tools/libxl/libxl_dom.c     |    3 ++-
 tools/libxl/libxl_types.idl |    2 +-
 tools/libxl/xl.c            |    5 +++++
 tools/libxl/xl.h            |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 9 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index aaf8da1..c4072aa 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -115,6 +115,47 @@ Configures the name of the first block device to be used for temporary
 block device allocations by the toolstack.
 The default choice is "xvda".
 
+=item B<claim_mode=BOOLEAN>
+
+If this option is enabled then when a guest is created there will be an
+guarantee that there is memory available for the guest. This is an
+particularly acute problem on hosts with memory over-provisioned guests
+that use tmem and have self-balloon enabled (which is the default
+option). The self-balloon mechanism can deflate/inflate the balloon
+quickly and the amount of free memory (which C<xl info> can show) is
+stale the moment it is printed. When claim is enabled a reservation for
+the amount of memory (see 'memory' in xl.conf(5)) is set, which is then
+reduced as the domain's memory is populated and eventually reaches zero.
+
+If the reservation cannot be meet the guest creation fails immediately
+instead of taking seconds/minutes (depending on the size of the guest)
+while the guest is populated.
+
+Note that to enable tmem type guests, one needs to provide C<tmem> on the
+Xen hypervisor argument and as well on the Linux kernel command line.
+
+Note that the claim call is not attempted if C<superpages> option is
+used in the guest config (see xl.cfg(5)).
+
+Default: C<0>
+
+=over 4
+
+=item C<0>
+
+No claim is made. Memory population during guest creation will be
+attempted as normal and may fail due to memory exhaustion.
+
+=item C<1>
+
+Normal memory and freeable pool of ephemeral pages (tmem) is used when
+calculating whether there is enough memory free to launch a guest.
+This guarantees immediate feedback whether the guest can be launched due
+to memory exhaustion (which can take a long time to find out if launching
+massively huge guests).
+
+=back
+
 =back
 
 =head1 SEE ALSO
diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index 50cba2b..9402c3f 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -27,3 +27,9 @@
 
 # default bridge device to use with vif-bridge hotplug scripts
 #vif.default.bridge="xenbr0"
+
+# Reserve a claim of memory when launching a guest. This guarantees immediate
+# feedback whether the guest can be launched due to memory exhaustion
+# (which can take a long time to find out if launching huge guests).
+# see xl.conf(5) for details.
+#claim_mode=0
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index d18d22c..e4a4ab2 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -595,7 +595,6 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k
 /* wait for the memory target of a domain to be reached */
 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
 
-
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
 /* libxl_primary_console_exec finds the domid and console number
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 30a4507..ae72f21 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -196,6 +196,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
     if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
         b_info->target_memkb = b_info->max_memkb;
 
+    libxl_defbool_setdefault(&b_info->claim_mode, false);
+
     libxl_defbool_setdefault(&b_info->localtime, false);
 
     libxl_defbool_setdefault(&b_info->disable_migrate, false);
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 2dd429f..92a6628 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -371,6 +371,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     dom->console_domid = state->console_domid;
     dom->xenstore_evtchn = state->store_port;
     dom->xenstore_domid = state->store_domid;
+    dom->claim_enabled = libxl_defbool_val(info->claim_mode);
 
     if ( (ret = xc_dom_boot_xen_init(dom, ctx->xch, domid)) != 0 ) {
         LOGE(ERROR, "xc_dom_boot_xen_init failed");
@@ -605,7 +606,7 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
      */
     args.mem_size = (uint64_t)(info->max_memkb - info->video_memkb) << 10;
     args.mem_target = (uint64_t)(info->target_memkb - info->video_memkb) << 10;
-
+    args.claim_enabled = libxl_defbool_val(info->claim_mode);
     if (libxl__domain_firmware(gc, info, &args)) {
         LOG(ERROR, "initializing domain firmware failed");
         goto out;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 6cb6de6..4d8f7cd 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -293,7 +293,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("ioports",          Array(libxl_ioport_range, "num_ioports")),
     ("irqs",             Array(uint32, "num_irqs")),
     ("iomem",            Array(libxl_iomem_range, "num_iomem")),
-
+    ("claim_mode",	     libxl_defbool),
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 16cd3f3..3c141bf 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -46,6 +46,7 @@ char *default_vifscript = NULL;
 char *default_bridge = NULL;
 char *default_gatewaydev = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
+libxl_defbool claim_mode;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
@@ -168,6 +169,10 @@ static void parse_global_config(const char *configfile,
     }
     if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
         blkdev_start = strdup(buf);
+
+    libxl_defbool_setdefault(&claim_mode, false);
+    (void)xlu_cfg_get_defbool (config, "claim_mode", &claim_mode, 0);
+
     xlu_cfg_destroy(config);
 }
 
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index b881f92..4c5e5d1 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -145,6 +145,7 @@ int xl_child_pid(xlchildnum); /* returns 0 if child struct is not in use */
 extern int autoballoon;
 extern int run_hotplug_scripts;
 extern int dryrun_only;
+extern libxl_defbool claim_mode;
 extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 61f7b96..5a0506f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -757,6 +757,8 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long (config, "maxmem", &l, 0))
         b_info->max_memkb = l * 1024;
 
+    b_info->claim_mode = claim_mode;
+
     if (xlu_cfg_get_string (config, "on_poweroff", &buf, 0))
         buf = "destroy";
     if (!parse_action_on_shutdown(buf, &d_config->on_poweroff)) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5H-00058P-Oo; Wed, 17 Apr 2013 01:22:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5F-000584-Ti
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:50 +0000
Received: from [85.158.138.51:37446] by server-12.bemta-3.messagelabs.com id
	87/DA-01357-969FD615; Wed, 17 Apr 2013 01:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1366161767!20305357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21192 invoked from network); 17 Apr 2013 01:22:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5C-000299-RT
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5C-0006lB-Pr
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:46 +0000
Date: Wed, 17 Apr 2013 01:22:46 +0000
Message-Id: <E1USH5C-0006lB-Pr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: 'xl info' print outstanding claims
	if enabled (claim_mode=1 in xl.conf)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f28de1ec060318d74fa6ad853e814d6a1bf0ba2
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Mar 15 12:33:30 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)
    
    This patch provides the value of the currently outstanding pages
    claimed for all domains. This is a total global value that influences
    the hypervisors' MM system.
    
    When a claim call is done, a reservation for a specific amount of pages
    is set and also a global value is incremented. This global value is then
    reduced as the domain's memory is populated and eventually reaches zero.
    The toolstack (libxc) also sets the domain's claim to zero when the population
    of memory has completed as an extra step. Any call to destroy the domain
    will also set the domain's claim to zero.
    
    If the reservation cannot be meet the guest creation fails immediately
    instead of taking seconds or minutes (depending on the size of the guest)
    while the toolstack populates memory.
    
    See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode'
    global config" for details on how it is implemented.
    
    The value fluctuates quite often so the value is stale once it is provided
    to the user-space.  However it is useful for diagnostic purposes.
    
    It is only printed when the global "claim_mode" option in xl.conf(5)
    is set to enabled (1). The 'man xl' shows the details of this item.
    
    [v1: s/unclaimed/outstanding/]
    [v2: Made libxl_get_claiminfo return just MemKB suggested by Ian Campbell]
    [v3: Made libxl_get_claininfo return MemMB to conform to the other values printed]
    [v4: Improvements suggested by Ian Jackson, also added docs to xl.pod.1]
    [v5: Clarify how claims are cancelled, split >72 characters - Ian Jackson]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.pod.1        |   10 ++++++++++
 tools/libxl/libxl.c      |   14 ++++++++++++++
 tools/libxl/libxl.h      |    1 +
 tools/libxl/xl_cmdimpl.c |   24 ++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index a0e298e..d8783e8 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -704,6 +704,7 @@ Sample output looks as follows:
  total_memory           : 6141
  free_memory            : 4274
  free_cpus              : 0
+ outstanding_claims     : 0
  xen_major              : 4
  xen_minor              : 2
  xen_extra              : -unstable
@@ -738,6 +739,15 @@ the feature bits returned by the cpuid command on x86 platforms.
 
 Available memory (in MB) not allocated to Xen, or any other domains.
 
+=item B<outstanding_claims>
+
+When a claim call is done (see L<xl.conf>) a reservation for a specific
+amount of pages is set and also a global value is incremented. This
+global value (outstanding_claims) is then reduced as the domain's memory
+is populated and eventually reaches zero. Most of the time the value will
+be zero, but if you are launching multiple guests, and B<claim_mode> is
+enabled, this value can increase/decrease.
+
 =item B<xen_caps>
 
 The Xen version and architecture.  Architecture values can be one of:
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 572c2c6..230b954 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4057,6 +4057,20 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
     return ret;
 }
 
+uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
+{
+    long l;
+
+    l = xc_domain_get_outstanding_pages(ctx->xch);
+    if (l < 0) {
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_WARNING, l,
+                            "xc_domain_get_outstanding_pages failed.");
+        return ERROR_FAIL;
+    }
+    /* In MB */
+    return (l >> 8);
+}
+
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 {
     union {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index e4a4ab2..4922313 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -595,6 +595,7 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k
 /* wait for the memory target of a domain to be reached */
 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
 
+uint64_t libxl_get_claiminfo(libxl_ctx *ctx);
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
 /* libxl_primary_console_exec finds the domid and console number
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5a0506f..c9b71e6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4666,6 +4666,29 @@ static void output_topologyinfo(void)
     return;
 }
 
+static void output_claim(void)
+{
+    long l;
+
+    /*
+     * Note that the xl.c (which calls us) has already read from the
+     * global configuration the 'claim_mode' value.
+     */
+    if (!libxl_defbool_val(claim_mode))
+        return;
+
+    l = libxl_get_claiminfo(ctx);
+    if (l < 0) {
+        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
+                errno, strerror(errno));
+        return;
+    }
+
+    printf("outstanding_claims     : %ld\n", l);
+
+    return;
+}
+
 static void print_info(int numa)
 {
     output_nodeinfo();
@@ -4676,6 +4699,7 @@ static void print_info(int numa)
         output_topologyinfo();
         output_numainfo();
     }
+    output_claim();
 
     output_xeninfo();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:22:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5H-00058P-Oo; Wed, 17 Apr 2013 01:22:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5F-000584-Ti
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:50 +0000
Received: from [85.158.138.51:37446] by server-12.bemta-3.messagelabs.com id
	87/DA-01357-969FD615; Wed, 17 Apr 2013 01:22:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1366161767!20305357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21192 invoked from network); 17 Apr 2013 01:22:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5C-000299-RT
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5C-0006lB-Pr
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:46 +0000
Date: Wed, 17 Apr 2013 01:22:46 +0000
Message-Id: <E1USH5C-0006lB-Pr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: 'xl info' print outstanding claims
	if enabled (claim_mode=1 in xl.conf)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8f28de1ec060318d74fa6ad853e814d6a1bf0ba2
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Mar 15 12:33:30 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)
    
    This patch provides the value of the currently outstanding pages
    claimed for all domains. This is a total global value that influences
    the hypervisors' MM system.
    
    When a claim call is done, a reservation for a specific amount of pages
    is set and also a global value is incremented. This global value is then
    reduced as the domain's memory is populated and eventually reaches zero.
    The toolstack (libxc) also sets the domain's claim to zero when the population
    of memory has completed as an extra step. Any call to destroy the domain
    will also set the domain's claim to zero.
    
    If the reservation cannot be meet the guest creation fails immediately
    instead of taking seconds or minutes (depending on the size of the guest)
    while the toolstack populates memory.
    
    See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode'
    global config" for details on how it is implemented.
    
    The value fluctuates quite often so the value is stale once it is provided
    to the user-space.  However it is useful for diagnostic purposes.
    
    It is only printed when the global "claim_mode" option in xl.conf(5)
    is set to enabled (1). The 'man xl' shows the details of this item.
    
    [v1: s/unclaimed/outstanding/]
    [v2: Made libxl_get_claiminfo return just MemKB suggested by Ian Campbell]
    [v3: Made libxl_get_claininfo return MemMB to conform to the other values printed]
    [v4: Improvements suggested by Ian Jackson, also added docs to xl.pod.1]
    [v5: Clarify how claims are cancelled, split >72 characters - Ian Jackson]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/man/xl.pod.1        |   10 ++++++++++
 tools/libxl/libxl.c      |   14 ++++++++++++++
 tools/libxl/libxl.h      |    1 +
 tools/libxl/xl_cmdimpl.c |   24 ++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index a0e298e..d8783e8 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -704,6 +704,7 @@ Sample output looks as follows:
  total_memory           : 6141
  free_memory            : 4274
  free_cpus              : 0
+ outstanding_claims     : 0
  xen_major              : 4
  xen_minor              : 2
  xen_extra              : -unstable
@@ -738,6 +739,15 @@ the feature bits returned by the cpuid command on x86 platforms.
 
 Available memory (in MB) not allocated to Xen, or any other domains.
 
+=item B<outstanding_claims>
+
+When a claim call is done (see L<xl.conf>) a reservation for a specific
+amount of pages is set and also a global value is incremented. This
+global value (outstanding_claims) is then reduced as the domain's memory
+is populated and eventually reaches zero. Most of the time the value will
+be zero, but if you are launching multiple guests, and B<claim_mode> is
+enabled, this value can increase/decrease.
+
 =item B<xen_caps>
 
 The Xen version and architecture.  Architecture values can be one of:
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 572c2c6..230b954 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4057,6 +4057,20 @@ libxl_numainfo *libxl_get_numainfo(libxl_ctx *ctx, int *nr)
     return ret;
 }
 
+uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
+{
+    long l;
+
+    l = xc_domain_get_outstanding_pages(ctx->xch);
+    if (l < 0) {
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_WARNING, l,
+                            "xc_domain_get_outstanding_pages failed.");
+        return ERROR_FAIL;
+    }
+    /* In MB */
+    return (l >> 8);
+}
+
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
 {
     union {
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index e4a4ab2..4922313 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -595,6 +595,7 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k
 /* wait for the memory target of a domain to be reached */
 int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs);
 
+uint64_t libxl_get_claiminfo(libxl_ctx *ctx);
 int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass);
 int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type);
 /* libxl_primary_console_exec finds the domid and console number
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5a0506f..c9b71e6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4666,6 +4666,29 @@ static void output_topologyinfo(void)
     return;
 }
 
+static void output_claim(void)
+{
+    long l;
+
+    /*
+     * Note that the xl.c (which calls us) has already read from the
+     * global configuration the 'claim_mode' value.
+     */
+    if (!libxl_defbool_val(claim_mode))
+        return;
+
+    l = libxl_get_claiminfo(ctx);
+    if (l < 0) {
+        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
+                errno, strerror(errno));
+        return;
+    }
+
+    printf("outstanding_claims     : %ld\n", l);
+
+    return;
+}
+
 static void print_info(int numa)
 {
     output_nodeinfo();
@@ -4676,6 +4699,7 @@ static void print_info(int numa)
         output_topologyinfo();
         output_numainfo();
     }
+    output_claim();
 
     output_xeninfo();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5Q-0005An-U8; Wed, 17 Apr 2013 01:23:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5P-0005AF-GH
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:59 +0000
Received: from [85.158.139.83:22563] by server-16.bemta-5.messagelabs.com id
	4B/58-02543-279FD615; Wed, 17 Apr 2013 01:22:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1366161777!28650594!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6128 invoked from network); 17 Apr 2013 01:22:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5N-00029J-1n
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5M-0006lX-W5
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:57 +0000
Date: Wed, 17 Apr 2013 01:22:56 +0000
Message-Id: <E1USH5M-0006lX-W5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xc: export outstanding_pages value in
	xc_dominfo structure.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0af09eebf475d1511fae90aa30a920cd1f29302b
Author:     Dan Magenheimer <dan.magenheimer@oracle.com>
AuthorDate: Mon Feb 25 15:10:08 2013 -0500
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xc: export outstanding_pages value in xc_dominfo structure.
    
    This patch provides the value of the currently outstanding pages
    claimed for a specific domain. This is a value that influences
    the global outstanding claims value (See patch: "xl: 'xl info'
    print outstanding claims if enabled") returned via
    xc_domain_get_outstanding_pages hypercall. This domain value
    decrements as the memory is populated for the guest and
    eventually reaches zero.
    
    This patch is neccessary for "xl: export 'outstanding_pages' value
    from xcinfo" patch.
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    [v2: s/unclaimed_pages/outstanding_pages/ per Tim's suggestion]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_domain.c |    1 +
 tools/libxc/xenctrl.h   |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 299c907..1676bd7 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
 
         info->ssidref  = domctl.u.getdomaininfo.ssidref;
         info->nr_pages = domctl.u.getdomaininfo.tot_pages;
+        info->nr_outstanding_pages = domctl.u.getdomaininfo.outstanding_pages;
         info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
         info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 19e34b2..9676a9f 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -368,6 +368,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_outstanding_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5Q-0005An-U8; Wed, 17 Apr 2013 01:23:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5P-0005AF-GH
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:59 +0000
Received: from [85.158.139.83:22563] by server-16.bemta-5.messagelabs.com id
	4B/58-02543-279FD615; Wed, 17 Apr 2013 01:22:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1366161777!28650594!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6128 invoked from network); 17 Apr 2013 01:22:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:22:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5N-00029J-1n
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5M-0006lX-W5
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:22:57 +0000
Date: Wed, 17 Apr 2013 01:22:56 +0000
Message-Id: <E1USH5M-0006lX-W5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xc: export outstanding_pages value in
	xc_dominfo structure.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0af09eebf475d1511fae90aa30a920cd1f29302b
Author:     Dan Magenheimer <dan.magenheimer@oracle.com>
AuthorDate: Mon Feb 25 15:10:08 2013 -0500
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xc: export outstanding_pages value in xc_dominfo structure.
    
    This patch provides the value of the currently outstanding pages
    claimed for a specific domain. This is a value that influences
    the global outstanding claims value (See patch: "xl: 'xl info'
    print outstanding claims if enabled") returned via
    xc_domain_get_outstanding_pages hypercall. This domain value
    decrements as the memory is populated for the guest and
    eventually reaches zero.
    
    This patch is neccessary for "xl: export 'outstanding_pages' value
    from xcinfo" patch.
    
    Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
    [v2: s/unclaimed_pages/outstanding_pages/ per Tim's suggestion]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_domain.c |    1 +
 tools/libxc/xenctrl.h   |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 299c907..1676bd7 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -234,6 +234,7 @@ int xc_domain_getinfo(xc_interface *xch,
 
         info->ssidref  = domctl.u.getdomaininfo.ssidref;
         info->nr_pages = domctl.u.getdomaininfo.tot_pages;
+        info->nr_outstanding_pages = domctl.u.getdomaininfo.outstanding_pages;
         info->nr_shared_pages = domctl.u.getdomaininfo.shr_pages;
         info->nr_paged_pages = domctl.u.getdomaininfo.paged_pages;
         info->max_memkb = domctl.u.getdomaininfo.max_pages << (PAGE_SHIFT-10);
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 19e34b2..9676a9f 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -368,6 +368,7 @@ typedef struct xc_dominfo {
                   hvm:1, debugged:1;
     unsigned int  shutdown_reason; /* only meaningful if shutdown==1 */
     unsigned long nr_pages; /* current number, not maximum */
+    unsigned long nr_outstanding_pages;
     unsigned long nr_shared_pages;
     unsigned long nr_paged_pages;
     unsigned long shared_info_frame;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5d-0005DL-1G; Wed, 17 Apr 2013 01:23:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5b-0005Cq-58
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:11 +0000
Received: from [193.109.254.147:15596] by server-3.bemta-14.messagelabs.com id
	E6/2A-17488-E79FD615; Wed, 17 Apr 2013 01:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1366161787!8630930!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12592 invoked from network); 17 Apr 2013 01:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:23:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5X-00029t-AV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5X-0006lu-7v
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:07 +0000
Date: Wed, 17 Apr 2013 01:23:07 +0000
Message-Id: <E1USH5X-0006lu-7v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: export 'outstanding_pages' value
	from xcinfo
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d07824810dbc4195ce7473e899baabf4d2c8b3d9
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Mar 1 16:49:42 2013 -0500
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: export 'outstanding_pages' value from xcinfo
    
    This patch provides the value of the currently outstanding pages
    claimed for a specific domain. This is a value that influences
    the global outstanding claims value (See patch: "xl: 'xl info'
    print outstanding claims if enabled") returned via
    xc_domain_get_outstanding_pages hypercall. This domain value
    decrements as the memory is populated for the guest and
    eventually reaches zero.
    
    With this patch it is possible to utilize this field.
    
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [v2: s/unclaimed/outstanding/ per Tim's suggestion]
    [v3: Don't use SXP printout file per Ian's suggestion]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c         |    1 +
 tools/libxl/libxl_types.idl |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 230b954..8b0e415 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -528,6 +528,7 @@ static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
     else
         xlinfo->shutdown_reason  = ~0;
 
+    xlinfo->outstanding_memkb = PAGE_TO_MEMKB(xcinfo->outstanding_pages);
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
     xlinfo->paged_memkb = PAGE_TO_MEMKB(xcinfo->paged_pages);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 4d8f7cd..fcb1ecd 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -196,6 +196,7 @@ libxl_dominfo = Struct("dominfo",[
     # Otherwise set to a value guaranteed not to clash with any valid
     # LIBXL_SHUTDOWN_REASON_* constant.
     ("shutdown_reason", libxl_shutdown_reason),
+    ("outstanding_memkb",  MemKB),
     ("current_memkb",   MemKB),
     ("shared_memkb", MemKB),
     ("paged_memkb", MemKB),
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5d-0005DL-1G; Wed, 17 Apr 2013 01:23:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5b-0005Cq-58
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:11 +0000
Received: from [193.109.254.147:15596] by server-3.bemta-14.messagelabs.com id
	E6/2A-17488-E79FD615; Wed, 17 Apr 2013 01:23:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1366161787!8630930!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12592 invoked from network); 17 Apr 2013 01:23:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:23:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5X-00029t-AV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5X-0006lu-7v
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:07 +0000
Date: Wed, 17 Apr 2013 01:23:07 +0000
Message-Id: <E1USH5X-0006lu-7v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: export 'outstanding_pages' value
	from xcinfo
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d07824810dbc4195ce7473e899baabf4d2c8b3d9
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Mar 1 16:49:42 2013 -0500
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: export 'outstanding_pages' value from xcinfo
    
    This patch provides the value of the currently outstanding pages
    claimed for a specific domain. This is a value that influences
    the global outstanding claims value (See patch: "xl: 'xl info'
    print outstanding claims if enabled") returned via
    xc_domain_get_outstanding_pages hypercall. This domain value
    decrements as the memory is populated for the guest and
    eventually reaches zero.
    
    With this patch it is possible to utilize this field.
    
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [v2: s/unclaimed/outstanding/ per Tim's suggestion]
    [v3: Don't use SXP printout file per Ian's suggestion]
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c         |    1 +
 tools/libxl/libxl_types.idl |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 230b954..8b0e415 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -528,6 +528,7 @@ static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
     else
         xlinfo->shutdown_reason  = ~0;
 
+    xlinfo->outstanding_memkb = PAGE_TO_MEMKB(xcinfo->outstanding_pages);
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
     xlinfo->paged_memkb = PAGE_TO_MEMKB(xcinfo->paged_pages);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 4d8f7cd..fcb1ecd 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -196,6 +196,7 @@ libxl_dominfo = Struct("dominfo",[
     # Otherwise set to a value guaranteed not to clash with any valid
     # LIBXL_SHUTDOWN_REASON_* constant.
     ("shutdown_reason", libxl_shutdown_reason),
+    ("outstanding_memkb",  MemKB),
     ("current_memkb",   MemKB),
     ("shared_memkb", MemKB),
     ("paged_memkb", MemKB),
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5m-0005F9-4j; Wed, 17 Apr 2013 01:23:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5k-0005En-PD
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:21 +0000
Received: from [85.158.143.99:25605] by server-3.bemta-4.messagelabs.com id
	BD/69-02186-889FD615; Wed, 17 Apr 2013 01:23:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1366161797!22157368!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10703 invoked from network); 17 Apr 2013 01:23:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:23:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5h-00029x-Kw
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5h-0006mI-GQ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:17 +0000
Date: Wed, 17 Apr 2013 01:23:17 +0000
Message-Id: <E1USH5h-0006mI-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: 'xl claims' print outstanding per
	domain claims
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb42f98a20fd0315e9b50ffbaca822aef46214ab
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Apr 10 14:28:05 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: 'xl claims' print outstanding per domain claims
    
    This is similar to "xl: 'xl info' print outstanding claims if enabled
    (claim_mode=1 in xl.conf)" which exposes the global claim value.
    
    This patch provides the value of the currently outstanding pages
    claimed for each domains. This is per domain value which is added
    to the global claim value which influences the hypervisors' MM system.
    
    When a claim call is done, a reservation for a specific amount of pages
    is set (and this patch lists said number) and also a global value is
    incremented. This global value is then reduced as the domain's memory
    is populated and eventually reaches zero.
    
    The toolstack (libxc) also sets the domain's claim to zero when the population
    of memory has completed as an extra step. Any call to destroy the domain
    will also set the domain's claim to zero.
    
    If the reservation cannot be meet the guest creation fails immediately
    instead of taking seconds or minutes (depending on the size of the guest)
    while the toolstack populates memory.
    
    See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode'
    global config" for details on how it is implemented.
    
    The value fluctuates quite often so the value is stale once it is provided
    to the user-space.  However it is useful for diagnostic purposes.
    
    It is printed irregardless of global "claim_mode" option in xl.conf(5).
    That is b/c the user might have enabled, launched a guest, and then
    disabled the option - and we should still report the correct outstanding
    claim value.  The 'man xl' shows the details of this argument.
    The output is close to what 'xl list' looks like:
    
    Name                                        ID   Mem VCPUs      State   Time(s)  Claimed
    Domain-0                                     0  2047     4     r-----      19.7     0
    OL5                                          2  2048     1     --p---       0.0   847
    OL6                                          3  1024     4     r-----       5.9     0
    Windows_XP                                   4  2047     1     --p---       0.0  1989
    
    [In which it can be seen that the OL5 guest still has 847MB of claimed
    memory (out of the total 2048MB where 1191MB has been allocated to
    the guest).]
    
    Please note that the 'Mem' column has the cumulative value of outstanding
    claims and the total amount of memory that has been allocated to the guest.
    
    [v1: claims, not claim-list]
    [v2: Add outstanding and current memkb in the output list]
    [v3: Clairy docs and relax some checks]
    [v4: Removed comments about guest config memory being the same as 'Mem']
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/man/xl.pod.1         |   23 +++++++++++++++++++++++
 tools/libxl/libxl.c       |    4 ++--
 tools/libxl/xl.h          |    1 +
 tools/libxl/xl_cmdimpl.c  |   40 ++++++++++++++++++++++++++++++++++++----
 tools/libxl/xl_cmdtable.c |    6 ++++++
 5 files changed, 68 insertions(+), 6 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index d8783e8..01ecc83 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -780,6 +780,29 @@ explanatory.
 
 Prints the current uptime of the domains running.
 
+=item B<claims>
+
+Prints information about outstanding claims by the guests. This provides
+the outstanding claims and currently populated memory count for the guests.
+These values added up reflect the global outstanding claim value, which
+is provided via the I<info> argument, B<outstanding_claims> value.
+The B<Mem> column has the cumulative value of outstanding claims and
+the total amount of memory that has been right now allocated to the guest.
+
+B<EXAMPLE>
+
+An example format for the list is as follows:
+
+ Name                                        ID   Mem VCPUs      State   Time(s)  Claimed
+ Domain-0                                     0  2047     4     r-----      19.7     0
+ OL5                                          2  2048     1     --p---       0.0   847
+ OL6                                          3  1024     4     r-----       5.9     0
+ Windows_XP                                   4  2047     1     --p---       0.0  1989
+
+In which it can be seen that the OL5 guest still has 847MB of claimed
+memory (out of the total 2048MB where 1191MB has been allocated to
+the guest).
+
 =back
 
 =head1 SCHEDULER SUBCOMMANDS
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 8b0e415..c9905e3 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3865,9 +3865,9 @@ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs)
         rc = libxl_domain_info(ctx, &info, domid);
         if (rc < 0)
             return rc;
-    } while (wait_secs > 0 && info.current_memkb > target_memkb);
+    } while (wait_secs > 0 && (info.current_memkb + info.outstanding_memkb) > target_memkb);
 
-    if (info.current_memkb <= target_memkb)
+    if ((info.current_memkb + info.outstanding_memkb) <= target_memkb)
         rc = 0;
     else
         rc = ERROR_FAIL;
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 4c5e5d1..771b4af 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -83,6 +83,7 @@ int main_vtpmattach(int argc, char **argv);
 int main_vtpmlist(int argc, char **argv);
 int main_vtpmdetach(int argc, char **argv);
 int main_uptime(int argc, char **argv);
+int main_claims(int argc, char **argv);
 int main_tmem_list(int argc, char **argv);
 int main_tmem_freeze(int argc, char **argv);
 int main_tmem_thaw(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c9b71e6..09b0f41 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3061,7 +3061,8 @@ out:
     }
 }
 
-static void list_domains(int verbose, int context, const libxl_dominfo *info, int nb_domain)
+static void list_domains(int verbose, int context, int claim,
+                         const libxl_dominfo *info, int nb_domain)
 {
     int i;
     static const char shutdown_reason_letters[]= "-rscw";
@@ -3069,6 +3070,7 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
     printf("Name                                        ID   Mem VCPUs\tState\tTime(s)");
     if (verbose) printf("   UUID                            Reason-Code\tSecurity Label");
     if (context && !verbose) printf("   Security Label");
+    if (claim) printf("  Claimed");
     printf("\n");
     for (i = 0; i < nb_domain; i++) {
         char *domname;
@@ -3078,7 +3080,8 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
         printf("%-40s %5d %5lu %5d     %c%c%c%c%c%c  %8.1f",
                 domname,
                 info[i].domid,
-                (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) ((info[i].current_memkb +
+                    info[i].outstanding_memkb)/ 1024),
                 info[i].vcpu_online,
                 info[i].running ? 'r' : '-',
                 info[i].blocked ? 'b' : '-',
@@ -3095,6 +3098,8 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
             if (info[i].shutdown) printf(" %8x", shutdown_reason);
             else printf(" %8s", "-");
         }
+        if (claim)
+            printf(" %5lu", (unsigned long)info[i].outstanding_memkb / 1024);
         if (verbose || context) {
             int rc;
             size_t size;
@@ -4029,7 +4034,7 @@ int main_list(int argc, char **argv)
     if (details)
         list_domains_details(info, nb_domain);
     else
-        list_domains(verbose, context, info, nb_domain);
+        list_domains(verbose, context, 0 /* claim */, info, nb_domain);
 
     if (info_free)
         libxl_dominfo_list_free(info, nb_domain);
@@ -4742,7 +4747,8 @@ static void sharing(const libxl_dominfo *info, int nb_domain)
         printf("%-40s %5d %5lu  %5lu\n",
                 domname,
                 info[i].domid,
-                (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) ((info[i].current_memkb +
+                    info[i].outstanding_memkb) / 1024),
                 (unsigned long) (info[i].shared_memkb / 1024));
         free(domname);
     }
@@ -5927,6 +5933,32 @@ static char *uptime_to_string(unsigned long uptime, int short_mode)
     return time_string;
 }
 
+int main_claims(int argc, char **argv)
+{
+    libxl_dominfo *info;
+    int opt;
+    int nb_domain;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "claims", 0) {
+        /* No options */
+    }
+
+    if (!libxl_defbool_val(claim_mode))
+        fprintf(stderr, "claim_mode not enabled (see man xl.conf).\n");
+
+    info = libxl_list_domain(ctx, &nb_domain);
+    if (!info) {
+        fprintf(stderr, "libxl_domain_infolist failed.\n");
+        return 1;
+    }
+
+    list_domains(0 /* verbose */, 0 /* context */, 1 /* claim */,
+                 info, nb_domain);
+
+    libxl_dominfo_list_free(info, nb_domain);
+    return 0;
+}
+
 static char *current_time_to_string(time_t now)
 {
     char now_str[100];
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index b4a87ca..00899f5 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -362,6 +362,12 @@ struct cmd_spec cmd_table[] = {
       "Print uptime for all/some domains",
       "[-s] [Domain]",
     },
+    { "claims",
+      &main_claims, 0, 0,
+      "List outstanding claim information about all domains",
+      "",
+      "",
+    },
     { "tmem-list",
       &main_tmem_list, 0, 0,
       "List tmem pools",
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH5m-0005F9-4j; Wed, 17 Apr 2013 01:23:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5k-0005En-PD
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:21 +0000
Received: from [85.158.143.99:25605] by server-3.bemta-4.messagelabs.com id
	BD/69-02186-889FD615; Wed, 17 Apr 2013 01:23:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-216.messagelabs.com!1366161797!22157368!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10703 invoked from network); 17 Apr 2013 01:23:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:23:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5h-00029x-Kw
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5h-0006mI-GQ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:17 +0000
Date: Wed, 17 Apr 2013 01:23:17 +0000
Message-Id: <E1USH5h-0006mI-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: 'xl claims' print outstanding per
	domain claims
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eb42f98a20fd0315e9b50ffbaca822aef46214ab
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Apr 10 14:28:05 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: 'xl claims' print outstanding per domain claims
    
    This is similar to "xl: 'xl info' print outstanding claims if enabled
    (claim_mode=1 in xl.conf)" which exposes the global claim value.
    
    This patch provides the value of the currently outstanding pages
    claimed for each domains. This is per domain value which is added
    to the global claim value which influences the hypervisors' MM system.
    
    When a claim call is done, a reservation for a specific amount of pages
    is set (and this patch lists said number) and also a global value is
    incremented. This global value is then reduced as the domain's memory
    is populated and eventually reaches zero.
    
    The toolstack (libxc) also sets the domain's claim to zero when the population
    of memory has completed as an extra step. Any call to destroy the domain
    will also set the domain's claim to zero.
    
    If the reservation cannot be meet the guest creation fails immediately
    instead of taking seconds or minutes (depending on the size of the guest)
    while the toolstack populates memory.
    
    See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode'
    global config" for details on how it is implemented.
    
    The value fluctuates quite often so the value is stale once it is provided
    to the user-space.  However it is useful for diagnostic purposes.
    
    It is printed irregardless of global "claim_mode" option in xl.conf(5).
    That is b/c the user might have enabled, launched a guest, and then
    disabled the option - and we should still report the correct outstanding
    claim value.  The 'man xl' shows the details of this argument.
    The output is close to what 'xl list' looks like:
    
    Name                                        ID   Mem VCPUs      State   Time(s)  Claimed
    Domain-0                                     0  2047     4     r-----      19.7     0
    OL5                                          2  2048     1     --p---       0.0   847
    OL6                                          3  1024     4     r-----       5.9     0
    Windows_XP                                   4  2047     1     --p---       0.0  1989
    
    [In which it can be seen that the OL5 guest still has 847MB of claimed
    memory (out of the total 2048MB where 1191MB has been allocated to
    the guest).]
    
    Please note that the 'Mem' column has the cumulative value of outstanding
    claims and the total amount of memory that has been allocated to the guest.
    
    [v1: claims, not claim-list]
    [v2: Add outstanding and current memkb in the output list]
    [v3: Clairy docs and relax some checks]
    [v4: Removed comments about guest config memory being the same as 'Mem']
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/man/xl.pod.1         |   23 +++++++++++++++++++++++
 tools/libxl/libxl.c       |    4 ++--
 tools/libxl/xl.h          |    1 +
 tools/libxl/xl_cmdimpl.c  |   40 ++++++++++++++++++++++++++++++++++++----
 tools/libxl/xl_cmdtable.c |    6 ++++++
 5 files changed, 68 insertions(+), 6 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index d8783e8..01ecc83 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -780,6 +780,29 @@ explanatory.
 
 Prints the current uptime of the domains running.
 
+=item B<claims>
+
+Prints information about outstanding claims by the guests. This provides
+the outstanding claims and currently populated memory count for the guests.
+These values added up reflect the global outstanding claim value, which
+is provided via the I<info> argument, B<outstanding_claims> value.
+The B<Mem> column has the cumulative value of outstanding claims and
+the total amount of memory that has been right now allocated to the guest.
+
+B<EXAMPLE>
+
+An example format for the list is as follows:
+
+ Name                                        ID   Mem VCPUs      State   Time(s)  Claimed
+ Domain-0                                     0  2047     4     r-----      19.7     0
+ OL5                                          2  2048     1     --p---       0.0   847
+ OL6                                          3  1024     4     r-----       5.9     0
+ Windows_XP                                   4  2047     1     --p---       0.0  1989
+
+In which it can be seen that the OL5 guest still has 847MB of claimed
+memory (out of the total 2048MB where 1191MB has been allocated to
+the guest).
+
 =back
 
 =head1 SCHEDULER SUBCOMMANDS
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 8b0e415..c9905e3 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3865,9 +3865,9 @@ int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs)
         rc = libxl_domain_info(ctx, &info, domid);
         if (rc < 0)
             return rc;
-    } while (wait_secs > 0 && info.current_memkb > target_memkb);
+    } while (wait_secs > 0 && (info.current_memkb + info.outstanding_memkb) > target_memkb);
 
-    if (info.current_memkb <= target_memkb)
+    if ((info.current_memkb + info.outstanding_memkb) <= target_memkb)
         rc = 0;
     else
         rc = ERROR_FAIL;
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 4c5e5d1..771b4af 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -83,6 +83,7 @@ int main_vtpmattach(int argc, char **argv);
 int main_vtpmlist(int argc, char **argv);
 int main_vtpmdetach(int argc, char **argv);
 int main_uptime(int argc, char **argv);
+int main_claims(int argc, char **argv);
 int main_tmem_list(int argc, char **argv);
 int main_tmem_freeze(int argc, char **argv);
 int main_tmem_thaw(int argc, char **argv);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c9b71e6..09b0f41 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3061,7 +3061,8 @@ out:
     }
 }
 
-static void list_domains(int verbose, int context, const libxl_dominfo *info, int nb_domain)
+static void list_domains(int verbose, int context, int claim,
+                         const libxl_dominfo *info, int nb_domain)
 {
     int i;
     static const char shutdown_reason_letters[]= "-rscw";
@@ -3069,6 +3070,7 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
     printf("Name                                        ID   Mem VCPUs\tState\tTime(s)");
     if (verbose) printf("   UUID                            Reason-Code\tSecurity Label");
     if (context && !verbose) printf("   Security Label");
+    if (claim) printf("  Claimed");
     printf("\n");
     for (i = 0; i < nb_domain; i++) {
         char *domname;
@@ -3078,7 +3080,8 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
         printf("%-40s %5d %5lu %5d     %c%c%c%c%c%c  %8.1f",
                 domname,
                 info[i].domid,
-                (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) ((info[i].current_memkb +
+                    info[i].outstanding_memkb)/ 1024),
                 info[i].vcpu_online,
                 info[i].running ? 'r' : '-',
                 info[i].blocked ? 'b' : '-',
@@ -3095,6 +3098,8 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
             if (info[i].shutdown) printf(" %8x", shutdown_reason);
             else printf(" %8s", "-");
         }
+        if (claim)
+            printf(" %5lu", (unsigned long)info[i].outstanding_memkb / 1024);
         if (verbose || context) {
             int rc;
             size_t size;
@@ -4029,7 +4034,7 @@ int main_list(int argc, char **argv)
     if (details)
         list_domains_details(info, nb_domain);
     else
-        list_domains(verbose, context, info, nb_domain);
+        list_domains(verbose, context, 0 /* claim */, info, nb_domain);
 
     if (info_free)
         libxl_dominfo_list_free(info, nb_domain);
@@ -4742,7 +4747,8 @@ static void sharing(const libxl_dominfo *info, int nb_domain)
         printf("%-40s %5d %5lu  %5lu\n",
                 domname,
                 info[i].domid,
-                (unsigned long) (info[i].current_memkb / 1024),
+                (unsigned long) ((info[i].current_memkb +
+                    info[i].outstanding_memkb) / 1024),
                 (unsigned long) (info[i].shared_memkb / 1024));
         free(domname);
     }
@@ -5927,6 +5933,32 @@ static char *uptime_to_string(unsigned long uptime, int short_mode)
     return time_string;
 }
 
+int main_claims(int argc, char **argv)
+{
+    libxl_dominfo *info;
+    int opt;
+    int nb_domain;
+
+    SWITCH_FOREACH_OPT(opt, "", NULL, "claims", 0) {
+        /* No options */
+    }
+
+    if (!libxl_defbool_val(claim_mode))
+        fprintf(stderr, "claim_mode not enabled (see man xl.conf).\n");
+
+    info = libxl_list_domain(ctx, &nb_domain);
+    if (!info) {
+        fprintf(stderr, "libxl_domain_infolist failed.\n");
+        return 1;
+    }
+
+    list_domains(0 /* verbose */, 0 /* context */, 1 /* claim */,
+                 info, nb_domain);
+
+    libxl_dominfo_list_free(info, nb_domain);
+    return 0;
+}
+
 static char *current_time_to_string(time_t now)
 {
     char now_str[100];
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index b4a87ca..00899f5 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -362,6 +362,12 @@ struct cmd_spec cmd_table[] = {
       "Print uptime for all/some domains",
       "[-s] [Domain]",
     },
+    { "claims",
+      &main_claims, 0, 0,
+      "List outstanding claim information about all domains",
+      "",
+      "",
+    },
     { "tmem-list",
       &main_tmem_list, 0, 0,
       "List tmem pools",
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH61-0005Hn-8E; Wed, 17 Apr 2013 01:23:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5z-0005HE-GC
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:35 +0000
Received: from [85.158.139.211:17830] by server-16.bemta-5.messagelabs.com id
	E9/A8-02543-299FD615; Wed, 17 Apr 2013 01:23:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1366161808!17697670!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21365 invoked from network); 17 Apr 2013 01:23:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:23:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5r-0002A2-UV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5r-0006me-R3
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:27 +0000
Date: Wed, 17 Apr 2013 01:23:27 +0000
Message-Id: <E1USH5r-0006me-R3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Fix 'free_memory' to include
	outstanding_claims value.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65a11256f294882d6bd1af4af51e42dbbead650d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Apr 12 12:43:53 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: Fix 'free_memory' to include outstanding_claims value.
    
    Updating to make it clear that free_memory reported by 'xl info'
    is influenced by the outstanding claim value. That is the free
    memory that will be available to the host once all outstanding
    claims have been completed. This modifies the behavior that the
    patch titled "xl: 'xl info' print outstanding claims if enabled
    (claim_mode=1 in xl.conf)" had - which reported the
    outstanding claims and nothing else.
    
    The free_pages as reported by the hypervisor is the currently
    available count of pages on the heap. The outstanding pages is
    the total amount of pages reserved for guests (so not taken from
    the heap yet). As guests are being populated the memory from the
    heap shrinks and the outstanding count of pages decreases.
    The total memory used for guests increases.
    
    As the available count of pages on the heap and outstanding
    claims are intertwined, report the amount of free memory available
    to be a combination of that. That is free heap memory minus the
    outstanding pages.
    
    We also make some odd choices in reporting. By default we will
    only display 'outstanding_claims' if the claim_mode is enabled
    in the global configuration file. However, if there are outstanding
    claims, we will ignore the claim_mode and report these values.
    
    Suggested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/man/xl.conf.pod.5   |    2 ++
 docs/man/xl.pod.1        |    8 ++++++--
 tools/libxl/libxl.c      |    4 ++--
 tools/libxl/xl_cmdimpl.c |   45 +++++++++++++++++----------------------------
 4 files changed, 27 insertions(+), 32 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index c4072aa..1229c8a 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -126,6 +126,8 @@ quickly and the amount of free memory (which C<xl info> can show) is
 stale the moment it is printed. When claim is enabled a reservation for
 the amount of memory (see 'memory' in xl.conf(5)) is set, which is then
 reduced as the domain's memory is populated and eventually reaches zero.
+The free memory in C<xl info> is the combination of the hypervisor's
+free heap memory minus the outstanding claims value.
 
 If the reservation cannot be meet the guest creation fails immediately
 instead of taking seconds/minutes (depending on the size of the guest)
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 01ecc83..57c6a79 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -737,7 +737,8 @@ the feature bits returned by the cpuid command on x86 platforms.
 
 =item B<free_memory>
 
-Available memory (in MB) not allocated to Xen, or any other domains.
+Available memory (in MB) not allocated to Xen, or any other domains, or
+claimed for domains.
 
 =item B<outstanding_claims>
 
@@ -746,7 +747,10 @@ amount of pages is set and also a global value is incremented. This
 global value (outstanding_claims) is then reduced as the domain's memory
 is populated and eventually reaches zero. Most of the time the value will
 be zero, but if you are launching multiple guests, and B<claim_mode> is
-enabled, this value can increase/decrease.
+enabled, this value can increase/decrease. Note that the value also
+affects the B<free_memory>  - as it will reflect the free memory
+in the hypervisor minus the outstanding pages claimed for guests.
+See xl I<info> B<claims> parameter for detailed listing.
 
 =item B<xen_caps>
 
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index c9905e3..03a9782 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4068,8 +4068,8 @@ uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
                             "xc_domain_get_outstanding_pages failed.");
         return ERROR_FAIL;
     }
-    /* In MB */
-    return (l >> 8);
+    /* In pages */
+    return l;
 }
 
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 09b0f41..98ecf67 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4575,12 +4575,21 @@ static void output_physinfo(void)
     unsigned int i;
     libxl_bitmap cpumap;
     int n = 0;
+    long claims = 0;
 
     if (libxl_get_physinfo(ctx, &info) != 0) {
         fprintf(stderr, "libxl_physinfo failed.\n");
         return;
     }
-
+    /*
+     * Don't bother checking "claim_mode" as user might have turned it off
+     * and we have outstanding claims.
+     */
+    if ((claims = libxl_get_claiminfo(ctx)) < 0){
+        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
+                errno, strerror(errno));
+        return;
+    }
     printf("nr_cpus                : %d\n", info.nr_cpus);
     printf("max_cpu_id             : %d\n", info.max_cpu_id);
     printf("nr_nodes               : %d\n", info.nr_nodes);
@@ -4600,10 +4609,16 @@ static void output_physinfo(void)
     if (vinfo) {
         i = (1 << 20) / vinfo->pagesize;
         printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
-        printf("free_memory            : %"PRIu64"\n", info.free_pages / i);
+        printf("free_memory            : %"PRIu64"\n", (info.free_pages - claims) / i);
         printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
         printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
     }
+    /*
+     * Only if enabled (claim_mode=1) or there are outstanding claims.
+     */
+    if (libxl_defbool_val(claim_mode) || claims)
+        printf("outstanding_claims     : %ld\n", claims / i);
+
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_bit(i, cpumap)
             if (libxl_bitmap_test(&cpumap, i))
@@ -4611,7 +4626,6 @@ static void output_physinfo(void)
         printf("free_cpus              : %d\n", n);
         free(cpumap.map);
     }
-
     libxl_physinfo_dispose(&info);
     return;
 }
@@ -4671,29 +4685,6 @@ static void output_topologyinfo(void)
     return;
 }
 
-static void output_claim(void)
-{
-    long l;
-
-    /*
-     * Note that the xl.c (which calls us) has already read from the
-     * global configuration the 'claim_mode' value.
-     */
-    if (!libxl_defbool_val(claim_mode))
-        return;
-
-    l = libxl_get_claiminfo(ctx);
-    if (l < 0) {
-        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
-                errno, strerror(errno));
-        return;
-    }
-
-    printf("outstanding_claims     : %ld\n", l);
-
-    return;
-}
-
 static void print_info(int numa)
 {
     output_nodeinfo();
@@ -4704,8 +4695,6 @@ static void print_info(int numa)
         output_topologyinfo();
         output_numainfo();
     }
-    output_claim();
-
     output_xeninfo();
 
     printf("xend_config_format     : 4\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 01:23:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 01:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USH61-0005Hn-8E; Wed, 17 Apr 2013 01:23:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5z-0005HE-GC
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:35 +0000
Received: from [85.158.139.211:17830] by server-16.bemta-5.messagelabs.com id
	E9/A8-02543-299FD615; Wed, 17 Apr 2013 01:23:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1366161808!17697670!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21365 invoked from network); 17 Apr 2013 01:23:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 01:23:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5r-0002A2-UV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USH5r-0006me-R3
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 01:23:27 +0000
Date: Wed, 17 Apr 2013 01:23:27 +0000
Message-Id: <E1USH5r-0006me-R3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: Fix 'free_memory' to include
	outstanding_claims value.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65a11256f294882d6bd1af4af51e42dbbead650d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Fri Apr 12 12:43:53 2013 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Tue Apr 16 16:21:50 2013 +0100

    xl: Fix 'free_memory' to include outstanding_claims value.
    
    Updating to make it clear that free_memory reported by 'xl info'
    is influenced by the outstanding claim value. That is the free
    memory that will be available to the host once all outstanding
    claims have been completed. This modifies the behavior that the
    patch titled "xl: 'xl info' print outstanding claims if enabled
    (claim_mode=1 in xl.conf)" had - which reported the
    outstanding claims and nothing else.
    
    The free_pages as reported by the hypervisor is the currently
    available count of pages on the heap. The outstanding pages is
    the total amount of pages reserved for guests (so not taken from
    the heap yet). As guests are being populated the memory from the
    heap shrinks and the outstanding count of pages decreases.
    The total memory used for guests increases.
    
    As the available count of pages on the heap and outstanding
    claims are intertwined, report the amount of free memory available
    to be a combination of that. That is free heap memory minus the
    outstanding pages.
    
    We also make some odd choices in reporting. By default we will
    only display 'outstanding_claims' if the claim_mode is enabled
    in the global configuration file. However, if there are outstanding
    claims, we will ignore the claim_mode and report these values.
    
    Suggested-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/man/xl.conf.pod.5   |    2 ++
 docs/man/xl.pod.1        |    8 ++++++--
 tools/libxl/libxl.c      |    4 ++--
 tools/libxl/xl_cmdimpl.c |   45 +++++++++++++++++----------------------------
 4 files changed, 27 insertions(+), 32 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index c4072aa..1229c8a 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -126,6 +126,8 @@ quickly and the amount of free memory (which C<xl info> can show) is
 stale the moment it is printed. When claim is enabled a reservation for
 the amount of memory (see 'memory' in xl.conf(5)) is set, which is then
 reduced as the domain's memory is populated and eventually reaches zero.
+The free memory in C<xl info> is the combination of the hypervisor's
+free heap memory minus the outstanding claims value.
 
 If the reservation cannot be meet the guest creation fails immediately
 instead of taking seconds/minutes (depending on the size of the guest)
diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index 01ecc83..57c6a79 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -737,7 +737,8 @@ the feature bits returned by the cpuid command on x86 platforms.
 
 =item B<free_memory>
 
-Available memory (in MB) not allocated to Xen, or any other domains.
+Available memory (in MB) not allocated to Xen, or any other domains, or
+claimed for domains.
 
 =item B<outstanding_claims>
 
@@ -746,7 +747,10 @@ amount of pages is set and also a global value is incremented. This
 global value (outstanding_claims) is then reduced as the domain's memory
 is populated and eventually reaches zero. Most of the time the value will
 be zero, but if you are launching multiple guests, and B<claim_mode> is
-enabled, this value can increase/decrease.
+enabled, this value can increase/decrease. Note that the value also
+affects the B<free_memory>  - as it will reflect the free memory
+in the hypervisor minus the outstanding pages claimed for guests.
+See xl I<info> B<claims> parameter for detailed listing.
 
 =item B<xen_caps>
 
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index c9905e3..03a9782 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4068,8 +4068,8 @@ uint64_t libxl_get_claiminfo(libxl_ctx *ctx)
                             "xc_domain_get_outstanding_pages failed.");
         return ERROR_FAIL;
     }
-    /* In MB */
-    return (l >> 8);
+    /* In pages */
+    return l;
 }
 
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx)
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 09b0f41..98ecf67 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4575,12 +4575,21 @@ static void output_physinfo(void)
     unsigned int i;
     libxl_bitmap cpumap;
     int n = 0;
+    long claims = 0;
 
     if (libxl_get_physinfo(ctx, &info) != 0) {
         fprintf(stderr, "libxl_physinfo failed.\n");
         return;
     }
-
+    /*
+     * Don't bother checking "claim_mode" as user might have turned it off
+     * and we have outstanding claims.
+     */
+    if ((claims = libxl_get_claiminfo(ctx)) < 0){
+        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
+                errno, strerror(errno));
+        return;
+    }
     printf("nr_cpus                : %d\n", info.nr_cpus);
     printf("max_cpu_id             : %d\n", info.max_cpu_id);
     printf("nr_nodes               : %d\n", info.nr_nodes);
@@ -4600,10 +4609,16 @@ static void output_physinfo(void)
     if (vinfo) {
         i = (1 << 20) / vinfo->pagesize;
         printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
-        printf("free_memory            : %"PRIu64"\n", info.free_pages / i);
+        printf("free_memory            : %"PRIu64"\n", (info.free_pages - claims) / i);
         printf("sharing_freed_memory   : %"PRIu64"\n", info.sharing_freed_pages / i);
         printf("sharing_used_memory    : %"PRIu64"\n", info.sharing_used_frames / i);
     }
+    /*
+     * Only if enabled (claim_mode=1) or there are outstanding claims.
+     */
+    if (libxl_defbool_val(claim_mode) || claims)
+        printf("outstanding_claims     : %ld\n", claims / i);
+
     if (!libxl_get_freecpus(ctx, &cpumap)) {
         libxl_for_each_bit(i, cpumap)
             if (libxl_bitmap_test(&cpumap, i))
@@ -4611,7 +4626,6 @@ static void output_physinfo(void)
         printf("free_cpus              : %d\n", n);
         free(cpumap.map);
     }
-
     libxl_physinfo_dispose(&info);
     return;
 }
@@ -4671,29 +4685,6 @@ static void output_topologyinfo(void)
     return;
 }
 
-static void output_claim(void)
-{
-    long l;
-
-    /*
-     * Note that the xl.c (which calls us) has already read from the
-     * global configuration the 'claim_mode' value.
-     */
-    if (!libxl_defbool_val(claim_mode))
-        return;
-
-    l = libxl_get_claiminfo(ctx);
-    if (l < 0) {
-        fprintf(stderr, "libxl_get_claiminfo failed. errno: %d (%s)\n",
-                errno, strerror(errno));
-        return;
-    }
-
-    printf("outstanding_claims     : %ld\n", l);
-
-    return;
-}
-
 static void print_info(int numa)
 {
     output_nodeinfo();
@@ -4704,8 +4695,6 @@ static void print_info(int numa)
         output_topologyinfo();
         output_numainfo();
     }
-    output_claim();
-
     output_xeninfo();
 
     printf("xend_config_format     : 4\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 17:44:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 17:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USWOt-0003iA-Dh; Wed, 17 Apr 2013 17:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USWOr-0003ho-V9
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 17:44:06 +0000
Received: from [85.158.139.83:23185] by server-10.bemta-5.messagelabs.com id
	6F/A1-23714-56FDE615; Wed, 17 Apr 2013 17:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1366220642!24540555!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10479 invoked from network); 17 Apr 2013 17:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 17:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USWOo-0006RO-9k
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 17:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USWOn-0006zb-VP
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 17:44:02 +0000
Date: Wed, 17 Apr 2013 17:44:01 +0000
Message-Id: <E1USWOn-0006zb-VP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow VCPUOP_register_vcpu_info
	to work again on PVHVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63753b3e0dc56efb1acf94fa46f3fee7bc59281c
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Apr 17 11:35:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 17 11:35:38 2013 +0200

    x86: allow VCPUOP_register_vcpu_info to work again on PVHVM guests
    
    For details on the hypercall please see commit
    c58ae69360ccf2495a19bf4ca107e21cf873c75b (VCPUOP_register_vcpu_info) and
    the c/s 23143 (git commit 6b063a4a6f44245a727aa04ef76408b2e00af9c7)
    (x86: move pv-only members of struct vcpu to struct pv_vcpu)
    that introduced the regression.
    
    The current code allows the PVHVM guest to make this hypercall.
    But for PVHVM guest it always returns -EINVAL (-22) for Xen 4.2
    and above. Xen 4.1 and earlier worked.
    
    The reason is that the check in map_vcpu_info would fail
    at:
    
      if ( v->arch.vcpu_info_mfn != INVALID_MFN )
    
    The reason is that the vcpu_info_mfn for PVHVM guests ends up by
    defualt with the value of zero (introduced by c/s 23143).
    
    The code in vcpu_initialise which initialized vcpu_info_mfn to a
    valid value (INVALID_MFN), would never be called for PVHVM:
    
        if ( is_hvm_domain(d) )
        {
            rc = hvm_vcpu_initialise(v);
            goto done;
        }
    
        v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
    
    while previously it would be:
    
         v->arch.vcpu_info_mfn = INVALID_MFN;
    
    [right at the start of the function in Xen 4.1]
    
    This fixes the problem with Linux advertising this error:
    register_vcpu_info failed: err=-22
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/domain.c        |   13 +++++++------
 xen/include/asm-x86/domain.h |    6 +++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 6f9cbed..14b6d13 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -387,13 +387,14 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
+    v->arch.vcpu_info_mfn = INVALID_MFN;
+
     if ( is_hvm_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
         goto done;
     }
 
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
 
     spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock);
 
@@ -963,14 +964,14 @@ unmap_vcpu_info(struct vcpu *v)
 {
     unsigned long mfn;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn == INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn == INVALID_MFN )
         return;
 
-    mfn = v->arch.pv_vcpu.vcpu_info_mfn;
+    mfn = v->arch.vcpu_info_mfn;
     unmap_domain_page_global(v->vcpu_info);
 
     v->vcpu_info = &dummy_vcpu_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
+    v->arch.vcpu_info_mfn = INVALID_MFN;
 
     put_page_and_type(mfn_to_page(mfn));
 }
@@ -993,7 +994,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn != INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn != INVALID_MFN )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1030,7 +1031,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     }
 
     v->vcpu_info = new_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = page_to_mfn(page);
+    v->arch.vcpu_info_mfn = page_to_mfn(page);
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     wmb();
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 6f9744a..bdaf714 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -374,9 +374,6 @@ struct pv_vcpu
     /* Current LDT details. */
     unsigned long shadow_ldt_mapcnt;
     spinlock_t shadow_ldt_lock;
-
-    /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
 };
 
 struct arch_vcpu
@@ -438,6 +435,9 @@ struct arch_vcpu
 
     struct paging_vcpu paging;
 
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long vcpu_info_mfn;
+
     uint32_t gdbsx_vcpu_event;
 
     /* A secondary copy of the vcpu time info. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 17:44:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 17:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USWOt-0003iA-Dh; Wed, 17 Apr 2013 17:44:07 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USWOr-0003ho-V9
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 17:44:06 +0000
Received: from [85.158.139.83:23185] by server-10.bemta-5.messagelabs.com id
	6F/A1-23714-56FDE615; Wed, 17 Apr 2013 17:44:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1366220642!24540555!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10479 invoked from network); 17 Apr 2013 17:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 17:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USWOo-0006RO-9k
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 17:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USWOn-0006zb-VP
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 17:44:02 +0000
Date: Wed, 17 Apr 2013 17:44:01 +0000
Message-Id: <E1USWOn-0006zb-VP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: allow VCPUOP_register_vcpu_info
	to work again on PVHVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 63753b3e0dc56efb1acf94fa46f3fee7bc59281c
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Apr 17 11:35:38 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 17 11:35:38 2013 +0200

    x86: allow VCPUOP_register_vcpu_info to work again on PVHVM guests
    
    For details on the hypercall please see commit
    c58ae69360ccf2495a19bf4ca107e21cf873c75b (VCPUOP_register_vcpu_info) and
    the c/s 23143 (git commit 6b063a4a6f44245a727aa04ef76408b2e00af9c7)
    (x86: move pv-only members of struct vcpu to struct pv_vcpu)
    that introduced the regression.
    
    The current code allows the PVHVM guest to make this hypercall.
    But for PVHVM guest it always returns -EINVAL (-22) for Xen 4.2
    and above. Xen 4.1 and earlier worked.
    
    The reason is that the check in map_vcpu_info would fail
    at:
    
      if ( v->arch.vcpu_info_mfn != INVALID_MFN )
    
    The reason is that the vcpu_info_mfn for PVHVM guests ends up by
    defualt with the value of zero (introduced by c/s 23143).
    
    The code in vcpu_initialise which initialized vcpu_info_mfn to a
    valid value (INVALID_MFN), would never be called for PVHVM:
    
        if ( is_hvm_domain(d) )
        {
            rc = hvm_vcpu_initialise(v);
            goto done;
        }
    
        v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
    
    while previously it would be:
    
         v->arch.vcpu_info_mfn = INVALID_MFN;
    
    [right at the start of the function in Xen 4.1]
    
    This fixes the problem with Linux advertising this error:
    register_vcpu_info failed: err=-22
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 xen/arch/x86/domain.c        |   13 +++++++------
 xen/include/asm-x86/domain.h |    6 +++---
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 6f9cbed..14b6d13 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -387,13 +387,14 @@ int vcpu_initialise(struct vcpu *v)
 
     vmce_init_vcpu(v);
 
+    v->arch.vcpu_info_mfn = INVALID_MFN;
+
     if ( is_hvm_domain(d) )
     {
         rc = hvm_vcpu_initialise(v);
         goto done;
     }
 
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
 
     spin_lock_init(&v->arch.pv_vcpu.shadow_ldt_lock);
 
@@ -963,14 +964,14 @@ unmap_vcpu_info(struct vcpu *v)
 {
     unsigned long mfn;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn == INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn == INVALID_MFN )
         return;
 
-    mfn = v->arch.pv_vcpu.vcpu_info_mfn;
+    mfn = v->arch.vcpu_info_mfn;
     unmap_domain_page_global(v->vcpu_info);
 
     v->vcpu_info = &dummy_vcpu_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = INVALID_MFN;
+    v->arch.vcpu_info_mfn = INVALID_MFN;
 
     put_page_and_type(mfn_to_page(mfn));
 }
@@ -993,7 +994,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     if ( offset > (PAGE_SIZE - sizeof(vcpu_info_t)) )
         return -EINVAL;
 
-    if ( v->arch.pv_vcpu.vcpu_info_mfn != INVALID_MFN )
+    if ( v->arch.vcpu_info_mfn != INVALID_MFN )
         return -EINVAL;
 
     /* Run this command on yourself or on other offline VCPUS. */
@@ -1030,7 +1031,7 @@ map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset)
     }
 
     v->vcpu_info = new_info;
-    v->arch.pv_vcpu.vcpu_info_mfn = page_to_mfn(page);
+    v->arch.vcpu_info_mfn = page_to_mfn(page);
 
     /* Set new vcpu_info pointer /before/ setting pending flags. */
     wmb();
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 6f9744a..bdaf714 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -374,9 +374,6 @@ struct pv_vcpu
     /* Current LDT details. */
     unsigned long shadow_ldt_mapcnt;
     spinlock_t shadow_ldt_lock;
-
-    /* Guest-specified relocation of vcpu_info. */
-    unsigned long vcpu_info_mfn;
 };
 
 struct arch_vcpu
@@ -438,6 +435,9 @@ struct arch_vcpu
 
     struct paging_vcpu paging;
 
+    /* Guest-specified relocation of vcpu_info. */
+    unsigned long vcpu_info_mfn;
+
     uint32_t gdbsx_vcpu_event;
 
     /* A secondary copy of the vcpu time info. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScC2-0006Dn-CN; Wed, 17 Apr 2013 23:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC0-0006Dc-Mk
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:13 +0000
Received: from [85.158.139.83:33131] by server-4.bemta-5.messagelabs.com id
	ED/DF-01980-0663F615; Wed, 17 Apr 2013 23:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1366242908!27658263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20552 invoked from network); 17 Apr 2013 23:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScBs-000282-PB
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScBs-0007U1-BR
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:04 +0000
Date: Wed, 17 Apr 2013 23:55:04 +0000
Message-Id: <E1UScBs-0007U1-BR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen,
	libxc: rename xenctl_cpumap to xenctl_bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 15299b5bb3e01759b05f59fc2aebbade46dc35cf
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen, libxc: rename xenctl_cpumap to xenctl_bitmap
    
    More specifically:
     1. replaces xenctl_cpumap with xenctl_bitmap
     2. provides bitmap_to_xenctl_bitmap and the reverse;
     3. re-implement cpumask_to_xenctl_bitmap with
        bitmap_to_xenctl_bitmap and the reverse;
    
    Other than #3, no functional changes. Interface only slightly
    afected.
    
    This is in preparation of introducing NUMA node-affinity maps.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/libxc/xc_cpupool.c                |    4 +-
 tools/libxc/xc_domain.c                 |    4 +-
 tools/libxc/xc_tbuf.c                   |    2 +-
 tools/tests/mce-test/tools/xen-mceinj.c |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c           |    3 +-
 xen/arch/x86/platform_hypercall.c       |    8 ++--
 xen/common/cpupool.c                    |    4 +-
 xen/common/domctl.c                     |   71 ++++++++++++++++++++----------
 xen/common/trace.c                      |    2 +-
 xen/include/public/arch-x86/xen-mca.h   |    2 +-
 xen/include/public/domctl.h             |    2 +-
 xen/include/public/sysctl.h             |    4 +-
 xen/include/public/xen.h                |    4 +-
 xen/include/xen/cpumask.h               |    6 +-
 xen/include/xlat.lst                    |    2 +-
 15 files changed, 71 insertions(+), 49 deletions(-)

diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c
index 54c76b4..b5e0c46 100644
--- a/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -90,7 +90,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_interface *xch,
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_INFO;
     sysctl.u.cpupool_op.cpupool_id = poolid;
     set_xen_guest_handle(sysctl.u.cpupool_op.cpumap.bitmap, local);
-    sysctl.u.cpupool_op.cpumap.nr_cpus = local_size * 8;
+    sysctl.u.cpupool_op.cpumap.nr_bits = local_size * 8;
 
     err = do_sysctl_save(xch, &sysctl);
 
@@ -184,7 +184,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch)
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_FREEINFO;
     set_xen_guest_handle(sysctl.u.cpupool_op.cpumap.bitmap, local);
-    sysctl.u.cpupool_op.cpumap.nr_cpus = mapsize * 8;
+    sysctl.u.cpupool_op.cpumap.nr_bits = mapsize * 8;
 
     err = do_sysctl_save(xch, &sysctl);
 
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 1676bd7..7842519 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -142,7 +142,7 @@ int xc_vcpu_setaffinity(xc_interface *xch,
 
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
 
-    domctl.u.vcpuaffinity.cpumap.nr_cpus = cpusize * 8;
+    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
@@ -182,7 +182,7 @@ int xc_vcpu_getaffinity(xc_interface *xch,
     domctl.u.vcpuaffinity.vcpu = vcpu;
 
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
-    domctl.u.vcpuaffinity.cpumap.nr_cpus = cpusize * 8;
+    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index b52fa8f..4fb7bb1 100644
--- a/tools/libxc/xc_tbuf.c
+++ b/tools/libxc/xc_tbuf.c
@@ -134,7 +134,7 @@ int xc_tbuf_set_cpu_mask(xc_interface *xch, uint32_t mask)
     bitmap_64_to_byte(bytemap, &mask64, sizeof (mask64) * 8);
 
     set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, bytemap);
-    sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(bytemap) * 8;
+    sysctl.u.tbuf_op.cpu_mask.nr_bits = sizeof(bytemap) * 8;
 
     ret = do_sysctl(xch, &sysctl);
 
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
index b69c65d..e3e62f7 100644
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -161,7 +161,7 @@ static int inject_cmci(xc_interface *xc_handle, int cpu_nr)
 
     mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_CPU_BROADCAST;
     mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_TYPE_CMCI;
-    mc.u.mc_inject_v2.cpumap.nr_cpus = nr_cpus;
+    mc.u.mc_inject_v2.cpumap.nr_bits = nr_cpus;
 
     return xc_mca_op(xc_handle, &mc);
 }
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index a22ea48..6712db1 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1453,8 +1453,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
             cpumap = &cpu_online_map;
         else
         {
-            ret = xenctl_cpumap_to_cpumask(&cmv,
-                                           &op->u.mc_inject_v2.cpumap);
+            ret = xenctl_bitmap_to_cpumask(&cmv, &op->u.mc_inject_v2.cpumap);
             if ( ret )
                 break;
             cpumap = cmv;
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index c1bc4f8..7175a82 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -336,7 +336,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         uint32_t cpu;
         uint64_t idletime, now = NOW();
-        struct xenctl_cpumap ctlmap;
+        struct xenctl_bitmap ctlmap;
         cpumask_var_t cpumap;
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
@@ -345,11 +345,11 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
 
-        ctlmap.nr_cpus  = op->u.getidletime.cpumap_nr_cpus;
+        ctlmap.nr_bits  = op->u.getidletime.cpumap_nr_cpus;
         guest_from_compat_handle(cpumap_bitmap,
                                  op->u.getidletime.cpumap_bitmap);
         ctlmap.bitmap.p = cpumap_bitmap.p; /* handle -> handle_64 conversion */
-        if ( (ret = xenctl_cpumap_to_cpumask(&cpumap, &ctlmap)) != 0 )
+        if ( (ret = xenctl_bitmap_to_cpumask(&cpumap, &ctlmap)) != 0 )
             goto out;
         guest_from_compat_handle(idletimes, op->u.getidletime.idletime);
 
@@ -368,7 +368,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         op->u.getidletime.now = now;
         if ( ret == 0 )
-            ret = cpumask_to_xenctl_cpumap(&ctlmap, cpumap);
+            ret = cpumask_to_xenctl_bitmap(&ctlmap, cpumap);
         free_cpumask_var(cpumap);
 
         if ( ret == 0 && __copy_field_to_guest(u_xenpf_op, op, u.getidletime) )
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 10b10f8..b3d8f2b 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -493,7 +493,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         op->cpupool_id = c->cpupool_id;
         op->sched_id = c->sched->sched_id;
         op->n_dom = c->n_dom;
-        ret = cpumask_to_xenctl_cpumap(&op->cpumap, c->cpu_valid);
+        ret = cpumask_to_xenctl_bitmap(&op->cpumap, c->cpu_valid);
         cpupool_put(c);
     }
     break;
@@ -588,7 +588,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
 
     case XEN_SYSCTL_CPUPOOL_OP_FREEINFO:
     {
-        ret = cpumask_to_xenctl_cpumap(
+        ret = cpumask_to_xenctl_bitmap(
             &op->cpumap, &cpupool_free_cpus);
     }
     break;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index c98e99c..6769d24 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -32,28 +32,29 @@
 static DEFINE_SPINLOCK(domctl_lock);
 DEFINE_SPINLOCK(vcpu_alloc_lock);
 
-int cpumask_to_xenctl_cpumap(
-    struct xenctl_cpumap *xenctl_cpumap, const cpumask_t *cpumask)
+int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
+                            const unsigned long *bitmap,
+                            unsigned int nbits)
 {
     unsigned int guest_bytes, copy_bytes, i;
     uint8_t zero = 0;
     int err = 0;
-    uint8_t *bytemap = xmalloc_array(uint8_t, (nr_cpu_ids + 7) / 8);
+    uint8_t *bytemap = xmalloc_array(uint8_t, (nbits + 7) / 8);
 
     if ( !bytemap )
         return -ENOMEM;
 
-    guest_bytes = (xenctl_cpumap->nr_cpus + 7) / 8;
-    copy_bytes  = min_t(unsigned int, guest_bytes, (nr_cpu_ids + 7) / 8);
+    guest_bytes = (xenctl_bitmap->nr_bits + 7) / 8;
+    copy_bytes  = min_t(unsigned int, guest_bytes, (nbits + 7) / 8);
 
-    bitmap_long_to_byte(bytemap, cpumask_bits(cpumask), nr_cpu_ids);
+    bitmap_long_to_byte(bytemap, bitmap, nbits);
 
     if ( copy_bytes != 0 )
-        if ( copy_to_guest(xenctl_cpumap->bitmap, bytemap, copy_bytes) )
+        if ( copy_to_guest(xenctl_bitmap->bitmap, bytemap, copy_bytes) )
             err = -EFAULT;
 
     for ( i = copy_bytes; !err && i < guest_bytes; i++ )
-        if ( copy_to_guest_offset(xenctl_cpumap->bitmap, i, &zero, 1) )
+        if ( copy_to_guest_offset(xenctl_bitmap->bitmap, i, &zero, 1) )
             err = -EFAULT;
 
     xfree(bytemap);
@@ -61,39 +62,61 @@ int cpumask_to_xenctl_cpumap(
     return err;
 }
 
-int xenctl_cpumap_to_cpumask(
-    cpumask_var_t *cpumask, const struct xenctl_cpumap *xenctl_cpumap)
+int xenctl_bitmap_to_bitmap(unsigned long *bitmap,
+                            const struct xenctl_bitmap *xenctl_bitmap,
+                            unsigned int nbits)
 {
     unsigned int guest_bytes, copy_bytes;
     int err = 0;
-    uint8_t *bytemap = xzalloc_array(uint8_t, (nr_cpu_ids + 7) / 8);
+    uint8_t *bytemap = xzalloc_array(uint8_t, (nbits + 7) / 8);
 
     if ( !bytemap )
         return -ENOMEM;
 
-    guest_bytes = (xenctl_cpumap->nr_cpus + 7) / 8;
-    copy_bytes  = min_t(unsigned int, guest_bytes, (nr_cpu_ids + 7) / 8);
+    guest_bytes = (xenctl_bitmap->nr_bits + 7) / 8;
+    copy_bytes  = min_t(unsigned int, guest_bytes, (nbits + 7) / 8);
 
     if ( copy_bytes != 0 )
     {
-        if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
+        if ( copy_from_guest(bytemap, xenctl_bitmap->bitmap, copy_bytes) )
             err = -EFAULT;
-        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
-            bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
+        if ( (xenctl_bitmap->nr_bits & 7) && (guest_bytes == copy_bytes) )
+            bytemap[guest_bytes-1] &= ~(0xff << (xenctl_bitmap->nr_bits & 7));
     }
 
-    if ( err )
-        /* nothing */;
-    else if ( alloc_cpumask_var(cpumask) )
-        bitmap_byte_to_long(cpumask_bits(*cpumask), bytemap, nr_cpu_ids);
-    else
-        err = -ENOMEM;
+    if ( !err )
+        bitmap_byte_to_long(bitmap, bytemap, nbits);
 
     xfree(bytemap);
 
     return err;
 }
 
+int cpumask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_cpumap,
+                             const cpumask_t *cpumask)
+{
+    return bitmap_to_xenctl_bitmap(xenctl_cpumap, cpumask_bits(cpumask),
+                                   nr_cpu_ids);
+}
+
+int xenctl_bitmap_to_cpumask(cpumask_var_t *cpumask,
+                             const struct xenctl_bitmap *xenctl_cpumap)
+{
+    int err = 0;
+
+    if ( alloc_cpumask_var(cpumask) ) {
+        err = xenctl_bitmap_to_bitmap(cpumask_bits(*cpumask), xenctl_cpumap,
+                                      nr_cpu_ids);
+        /* In case of error, cleanup is up to us, as the caller won't care! */
+        if ( err )
+            free_cpumask_var(*cpumask);
+    }
+    else
+        err = -ENOMEM;
+
+    return err;
+}
+
 static inline int is_free_domid(domid_t dom)
 {
     struct domain *d;
@@ -540,7 +563,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         {
             cpumask_var_t new_affinity;
 
-            ret = xenctl_cpumap_to_cpumask(
+            ret = xenctl_bitmap_to_cpumask(
                 &new_affinity, &op->u.vcpuaffinity.cpumap);
             if ( !ret )
             {
@@ -550,7 +573,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         }
         else
         {
-            ret = cpumask_to_xenctl_cpumap(
+            ret = cpumask_to_xenctl_bitmap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
     }
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 506c498..fd4ac48 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -384,7 +384,7 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc)
     {
         cpumask_var_t mask;
 
-        rc = xenctl_cpumap_to_cpumask(&mask, &tbc->cpu_mask);
+        rc = xenctl_bitmap_to_cpumask(&mask, &tbc->cpu_mask);
         if ( !rc )
         {
             cpumask_copy(&tb_cpu_mask, mask);
diff --git a/xen/include/public/arch-x86/xen-mca.h b/xen/include/public/arch-x86/xen-mca.h
index dca6b3e..04382ed 100644
--- a/xen/include/public/arch-x86/xen-mca.h
+++ b/xen/include/public/arch-x86/xen-mca.h
@@ -414,7 +414,7 @@ struct xen_mc_mceinject {
 
 struct xen_mc_inject_v2 {
 	uint32_t flags;
-	struct xenctl_cpumap cpumap;
+	struct xenctl_bitmap cpumap;
 };
 #endif
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 113b8dc..9f5ed48 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -285,7 +285,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
 /* XEN_DOMCTL_getvcpuaffinity */
 struct xen_domctl_vcpuaffinity {
     uint32_t  vcpu;              /* IN */
-    struct xenctl_cpumap cpumap; /* IN/OUT */
+    struct xenctl_bitmap cpumap; /* IN/OUT */
 };
 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 3ca51be..03710d8 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -71,7 +71,7 @@ struct xen_sysctl_tbuf_op {
 #define XEN_SYSCTL_TBUFOP_disable      5
     uint32_t cmd;
     /* IN/OUT variables */
-    struct xenctl_cpumap cpu_mask;
+    struct xenctl_bitmap cpu_mask;
     uint32_t             evt_mask;
     /* OUT variables */
     uint64_aligned_t buffer_mfn;
@@ -532,7 +532,7 @@ struct xen_sysctl_cpupool_op {
     uint32_t domid;       /* IN: M              */
     uint32_t cpu;         /* IN: AR             */
     uint32_t n_dom;       /*            OUT: I  */
-    struct xenctl_cpumap cpumap; /*     OUT: IF */
+    struct xenctl_bitmap cpumap; /*     OUT: IF */
 };
 typedef struct xen_sysctl_cpupool_op xen_sysctl_cpupool_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpupool_op_t);
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 4dd9615..3cab74f 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -869,9 +869,9 @@ __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t);
 #endif
 
 #ifndef __ASSEMBLY__
-struct xenctl_cpumap {
+struct xenctl_bitmap {
     XEN_GUEST_HANDLE_64(uint8) bitmap;
-    uint32_t nr_cpus;
+    uint32_t nr_bits;
 };
 #endif
 
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 22abd1f..f931cf2 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -424,8 +424,8 @@ extern cpumask_t cpu_present_map;
 #define for_each_present_cpu(cpu)  for_each_cpu(cpu, &cpu_present_map)
 
 /* Copy to/from cpumap provided by control tools. */
-struct xenctl_cpumap;
-int cpumask_to_xenctl_cpumap(struct xenctl_cpumap *, const cpumask_t *);
-int xenctl_cpumap_to_cpumask(cpumask_var_t *, const struct xenctl_cpumap *);
+struct xenctl_bitmap;
+int cpumask_to_xenctl_bitmap(struct xenctl_bitmap *, const cpumask_t *);
+int xenctl_bitmap_to_cpumask(cpumask_var_t *, const struct xenctl_bitmap *);
 
 #endif /* __XEN_CPUMASK_H */
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 3d4f1e3..d832110 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -2,7 +2,7 @@
 # ! - needs translation
 # ? - needs checking
 ?	dom0_vga_console_info		xen.h
-?	xenctl_cpumap			xen.h
+?	xenctl_bitmap			xen.h
 ?	mmu_update			xen.h
 !	mmuext_op			xen.h
 !	start_info			xen.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScC2-0006Dn-CN; Wed, 17 Apr 2013 23:55:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC0-0006Dc-Mk
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:13 +0000
Received: from [85.158.139.83:33131] by server-4.bemta-5.messagelabs.com id
	ED/DF-01980-0663F615; Wed, 17 Apr 2013 23:55:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1366242908!27658263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20552 invoked from network); 17 Apr 2013 23:55:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScBs-000282-PB
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScBs-0007U1-BR
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:04 +0000
Date: Wed, 17 Apr 2013 23:55:04 +0000
Message-Id: <E1UScBs-0007U1-BR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen,
	libxc: rename xenctl_cpumap to xenctl_bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 15299b5bb3e01759b05f59fc2aebbade46dc35cf
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:28 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen, libxc: rename xenctl_cpumap to xenctl_bitmap
    
    More specifically:
     1. replaces xenctl_cpumap with xenctl_bitmap
     2. provides bitmap_to_xenctl_bitmap and the reverse;
     3. re-implement cpumask_to_xenctl_bitmap with
        bitmap_to_xenctl_bitmap and the reverse;
    
    Other than #3, no functional changes. Interface only slightly
    afected.
    
    This is in preparation of introducing NUMA node-affinity maps.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/libxc/xc_cpupool.c                |    4 +-
 tools/libxc/xc_domain.c                 |    4 +-
 tools/libxc/xc_tbuf.c                   |    2 +-
 tools/tests/mce-test/tools/xen-mceinj.c |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c           |    3 +-
 xen/arch/x86/platform_hypercall.c       |    8 ++--
 xen/common/cpupool.c                    |    4 +-
 xen/common/domctl.c                     |   71 ++++++++++++++++++++----------
 xen/common/trace.c                      |    2 +-
 xen/include/public/arch-x86/xen-mca.h   |    2 +-
 xen/include/public/domctl.h             |    2 +-
 xen/include/public/sysctl.h             |    4 +-
 xen/include/public/xen.h                |    4 +-
 xen/include/xen/cpumask.h               |    6 +-
 xen/include/xlat.lst                    |    2 +-
 15 files changed, 71 insertions(+), 49 deletions(-)

diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c
index 54c76b4..b5e0c46 100644
--- a/tools/libxc/xc_cpupool.c
+++ b/tools/libxc/xc_cpupool.c
@@ -90,7 +90,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_interface *xch,
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_INFO;
     sysctl.u.cpupool_op.cpupool_id = poolid;
     set_xen_guest_handle(sysctl.u.cpupool_op.cpumap.bitmap, local);
-    sysctl.u.cpupool_op.cpumap.nr_cpus = local_size * 8;
+    sysctl.u.cpupool_op.cpumap.nr_bits = local_size * 8;
 
     err = do_sysctl_save(xch, &sysctl);
 
@@ -184,7 +184,7 @@ xc_cpumap_t xc_cpupool_freeinfo(xc_interface *xch)
     sysctl.cmd = XEN_SYSCTL_cpupool_op;
     sysctl.u.cpupool_op.op = XEN_SYSCTL_CPUPOOL_OP_FREEINFO;
     set_xen_guest_handle(sysctl.u.cpupool_op.cpumap.bitmap, local);
-    sysctl.u.cpupool_op.cpumap.nr_cpus = mapsize * 8;
+    sysctl.u.cpupool_op.cpumap.nr_bits = mapsize * 8;
 
     err = do_sysctl_save(xch, &sysctl);
 
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 1676bd7..7842519 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -142,7 +142,7 @@ int xc_vcpu_setaffinity(xc_interface *xch,
 
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
 
-    domctl.u.vcpuaffinity.cpumap.nr_cpus = cpusize * 8;
+    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
@@ -182,7 +182,7 @@ int xc_vcpu_getaffinity(xc_interface *xch,
     domctl.u.vcpuaffinity.vcpu = vcpu;
 
     set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
-    domctl.u.vcpuaffinity.cpumap.nr_cpus = cpusize * 8;
+    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index b52fa8f..4fb7bb1 100644
--- a/tools/libxc/xc_tbuf.c
+++ b/tools/libxc/xc_tbuf.c
@@ -134,7 +134,7 @@ int xc_tbuf_set_cpu_mask(xc_interface *xch, uint32_t mask)
     bitmap_64_to_byte(bytemap, &mask64, sizeof (mask64) * 8);
 
     set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, bytemap);
-    sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(bytemap) * 8;
+    sysctl.u.tbuf_op.cpu_mask.nr_bits = sizeof(bytemap) * 8;
 
     ret = do_sysctl(xch, &sysctl);
 
diff --git a/tools/tests/mce-test/tools/xen-mceinj.c b/tools/tests/mce-test/tools/xen-mceinj.c
index b69c65d..e3e62f7 100644
--- a/tools/tests/mce-test/tools/xen-mceinj.c
+++ b/tools/tests/mce-test/tools/xen-mceinj.c
@@ -161,7 +161,7 @@ static int inject_cmci(xc_interface *xc_handle, int cpu_nr)
 
     mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_CPU_BROADCAST;
     mc.u.mc_inject_v2.flags |= XEN_MC_INJECT_TYPE_CMCI;
-    mc.u.mc_inject_v2.cpumap.nr_cpus = nr_cpus;
+    mc.u.mc_inject_v2.cpumap.nr_bits = nr_cpus;
 
     return xc_mca_op(xc_handle, &mc);
 }
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index a22ea48..6712db1 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1453,8 +1453,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
             cpumap = &cpu_online_map;
         else
         {
-            ret = xenctl_cpumap_to_cpumask(&cmv,
-                                           &op->u.mc_inject_v2.cpumap);
+            ret = xenctl_bitmap_to_cpumask(&cmv, &op->u.mc_inject_v2.cpumap);
             if ( ret )
                 break;
             cpumap = cmv;
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index c1bc4f8..7175a82 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -336,7 +336,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
     {
         uint32_t cpu;
         uint64_t idletime, now = NOW();
-        struct xenctl_cpumap ctlmap;
+        struct xenctl_bitmap ctlmap;
         cpumask_var_t cpumap;
         XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
         XEN_GUEST_HANDLE(uint64) idletimes;
@@ -345,11 +345,11 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
         if ( cpufreq_controller != FREQCTL_dom0_kernel )
             break;
 
-        ctlmap.nr_cpus  = op->u.getidletime.cpumap_nr_cpus;
+        ctlmap.nr_bits  = op->u.getidletime.cpumap_nr_cpus;
         guest_from_compat_handle(cpumap_bitmap,
                                  op->u.getidletime.cpumap_bitmap);
         ctlmap.bitmap.p = cpumap_bitmap.p; /* handle -> handle_64 conversion */
-        if ( (ret = xenctl_cpumap_to_cpumask(&cpumap, &ctlmap)) != 0 )
+        if ( (ret = xenctl_bitmap_to_cpumask(&cpumap, &ctlmap)) != 0 )
             goto out;
         guest_from_compat_handle(idletimes, op->u.getidletime.idletime);
 
@@ -368,7 +368,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
 
         op->u.getidletime.now = now;
         if ( ret == 0 )
-            ret = cpumask_to_xenctl_cpumap(&ctlmap, cpumap);
+            ret = cpumask_to_xenctl_bitmap(&ctlmap, cpumap);
         free_cpumask_var(cpumap);
 
         if ( ret == 0 && __copy_field_to_guest(u_xenpf_op, op, u.getidletime) )
diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 10b10f8..b3d8f2b 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -493,7 +493,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
         op->cpupool_id = c->cpupool_id;
         op->sched_id = c->sched->sched_id;
         op->n_dom = c->n_dom;
-        ret = cpumask_to_xenctl_cpumap(&op->cpumap, c->cpu_valid);
+        ret = cpumask_to_xenctl_bitmap(&op->cpumap, c->cpu_valid);
         cpupool_put(c);
     }
     break;
@@ -588,7 +588,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
 
     case XEN_SYSCTL_CPUPOOL_OP_FREEINFO:
     {
-        ret = cpumask_to_xenctl_cpumap(
+        ret = cpumask_to_xenctl_bitmap(
             &op->cpumap, &cpupool_free_cpus);
     }
     break;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index c98e99c..6769d24 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -32,28 +32,29 @@
 static DEFINE_SPINLOCK(domctl_lock);
 DEFINE_SPINLOCK(vcpu_alloc_lock);
 
-int cpumask_to_xenctl_cpumap(
-    struct xenctl_cpumap *xenctl_cpumap, const cpumask_t *cpumask)
+int bitmap_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_bitmap,
+                            const unsigned long *bitmap,
+                            unsigned int nbits)
 {
     unsigned int guest_bytes, copy_bytes, i;
     uint8_t zero = 0;
     int err = 0;
-    uint8_t *bytemap = xmalloc_array(uint8_t, (nr_cpu_ids + 7) / 8);
+    uint8_t *bytemap = xmalloc_array(uint8_t, (nbits + 7) / 8);
 
     if ( !bytemap )
         return -ENOMEM;
 
-    guest_bytes = (xenctl_cpumap->nr_cpus + 7) / 8;
-    copy_bytes  = min_t(unsigned int, guest_bytes, (nr_cpu_ids + 7) / 8);
+    guest_bytes = (xenctl_bitmap->nr_bits + 7) / 8;
+    copy_bytes  = min_t(unsigned int, guest_bytes, (nbits + 7) / 8);
 
-    bitmap_long_to_byte(bytemap, cpumask_bits(cpumask), nr_cpu_ids);
+    bitmap_long_to_byte(bytemap, bitmap, nbits);
 
     if ( copy_bytes != 0 )
-        if ( copy_to_guest(xenctl_cpumap->bitmap, bytemap, copy_bytes) )
+        if ( copy_to_guest(xenctl_bitmap->bitmap, bytemap, copy_bytes) )
             err = -EFAULT;
 
     for ( i = copy_bytes; !err && i < guest_bytes; i++ )
-        if ( copy_to_guest_offset(xenctl_cpumap->bitmap, i, &zero, 1) )
+        if ( copy_to_guest_offset(xenctl_bitmap->bitmap, i, &zero, 1) )
             err = -EFAULT;
 
     xfree(bytemap);
@@ -61,39 +62,61 @@ int cpumask_to_xenctl_cpumap(
     return err;
 }
 
-int xenctl_cpumap_to_cpumask(
-    cpumask_var_t *cpumask, const struct xenctl_cpumap *xenctl_cpumap)
+int xenctl_bitmap_to_bitmap(unsigned long *bitmap,
+                            const struct xenctl_bitmap *xenctl_bitmap,
+                            unsigned int nbits)
 {
     unsigned int guest_bytes, copy_bytes;
     int err = 0;
-    uint8_t *bytemap = xzalloc_array(uint8_t, (nr_cpu_ids + 7) / 8);
+    uint8_t *bytemap = xzalloc_array(uint8_t, (nbits + 7) / 8);
 
     if ( !bytemap )
         return -ENOMEM;
 
-    guest_bytes = (xenctl_cpumap->nr_cpus + 7) / 8;
-    copy_bytes  = min_t(unsigned int, guest_bytes, (nr_cpu_ids + 7) / 8);
+    guest_bytes = (xenctl_bitmap->nr_bits + 7) / 8;
+    copy_bytes  = min_t(unsigned int, guest_bytes, (nbits + 7) / 8);
 
     if ( copy_bytes != 0 )
     {
-        if ( copy_from_guest(bytemap, xenctl_cpumap->bitmap, copy_bytes) )
+        if ( copy_from_guest(bytemap, xenctl_bitmap->bitmap, copy_bytes) )
             err = -EFAULT;
-        if ( (xenctl_cpumap->nr_cpus & 7) && (guest_bytes == copy_bytes) )
-            bytemap[guest_bytes-1] &= ~(0xff << (xenctl_cpumap->nr_cpus & 7));
+        if ( (xenctl_bitmap->nr_bits & 7) && (guest_bytes == copy_bytes) )
+            bytemap[guest_bytes-1] &= ~(0xff << (xenctl_bitmap->nr_bits & 7));
     }
 
-    if ( err )
-        /* nothing */;
-    else if ( alloc_cpumask_var(cpumask) )
-        bitmap_byte_to_long(cpumask_bits(*cpumask), bytemap, nr_cpu_ids);
-    else
-        err = -ENOMEM;
+    if ( !err )
+        bitmap_byte_to_long(bitmap, bytemap, nbits);
 
     xfree(bytemap);
 
     return err;
 }
 
+int cpumask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_cpumap,
+                             const cpumask_t *cpumask)
+{
+    return bitmap_to_xenctl_bitmap(xenctl_cpumap, cpumask_bits(cpumask),
+                                   nr_cpu_ids);
+}
+
+int xenctl_bitmap_to_cpumask(cpumask_var_t *cpumask,
+                             const struct xenctl_bitmap *xenctl_cpumap)
+{
+    int err = 0;
+
+    if ( alloc_cpumask_var(cpumask) ) {
+        err = xenctl_bitmap_to_bitmap(cpumask_bits(*cpumask), xenctl_cpumap,
+                                      nr_cpu_ids);
+        /* In case of error, cleanup is up to us, as the caller won't care! */
+        if ( err )
+            free_cpumask_var(*cpumask);
+    }
+    else
+        err = -ENOMEM;
+
+    return err;
+}
+
 static inline int is_free_domid(domid_t dom)
 {
     struct domain *d;
@@ -540,7 +563,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         {
             cpumask_var_t new_affinity;
 
-            ret = xenctl_cpumap_to_cpumask(
+            ret = xenctl_bitmap_to_cpumask(
                 &new_affinity, &op->u.vcpuaffinity.cpumap);
             if ( !ret )
             {
@@ -550,7 +573,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         }
         else
         {
-            ret = cpumask_to_xenctl_cpumap(
+            ret = cpumask_to_xenctl_bitmap(
                 &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
         }
     }
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 506c498..fd4ac48 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -384,7 +384,7 @@ int tb_control(xen_sysctl_tbuf_op_t *tbc)
     {
         cpumask_var_t mask;
 
-        rc = xenctl_cpumap_to_cpumask(&mask, &tbc->cpu_mask);
+        rc = xenctl_bitmap_to_cpumask(&mask, &tbc->cpu_mask);
         if ( !rc )
         {
             cpumask_copy(&tb_cpu_mask, mask);
diff --git a/xen/include/public/arch-x86/xen-mca.h b/xen/include/public/arch-x86/xen-mca.h
index dca6b3e..04382ed 100644
--- a/xen/include/public/arch-x86/xen-mca.h
+++ b/xen/include/public/arch-x86/xen-mca.h
@@ -414,7 +414,7 @@ struct xen_mc_mceinject {
 
 struct xen_mc_inject_v2 {
 	uint32_t flags;
-	struct xenctl_cpumap cpumap;
+	struct xenctl_bitmap cpumap;
 };
 #endif
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 113b8dc..9f5ed48 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -285,7 +285,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
 /* XEN_DOMCTL_getvcpuaffinity */
 struct xen_domctl_vcpuaffinity {
     uint32_t  vcpu;              /* IN */
-    struct xenctl_cpumap cpumap; /* IN/OUT */
+    struct xenctl_bitmap cpumap; /* IN/OUT */
 };
 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 3ca51be..03710d8 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -71,7 +71,7 @@ struct xen_sysctl_tbuf_op {
 #define XEN_SYSCTL_TBUFOP_disable      5
     uint32_t cmd;
     /* IN/OUT variables */
-    struct xenctl_cpumap cpu_mask;
+    struct xenctl_bitmap cpu_mask;
     uint32_t             evt_mask;
     /* OUT variables */
     uint64_aligned_t buffer_mfn;
@@ -532,7 +532,7 @@ struct xen_sysctl_cpupool_op {
     uint32_t domid;       /* IN: M              */
     uint32_t cpu;         /* IN: AR             */
     uint32_t n_dom;       /*            OUT: I  */
-    struct xenctl_cpumap cpumap; /*     OUT: IF */
+    struct xenctl_bitmap cpumap; /*     OUT: IF */
 };
 typedef struct xen_sysctl_cpupool_op xen_sysctl_cpupool_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpupool_op_t);
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 4dd9615..3cab74f 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -869,9 +869,9 @@ __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t);
 #endif
 
 #ifndef __ASSEMBLY__
-struct xenctl_cpumap {
+struct xenctl_bitmap {
     XEN_GUEST_HANDLE_64(uint8) bitmap;
-    uint32_t nr_cpus;
+    uint32_t nr_bits;
 };
 #endif
 
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index 22abd1f..f931cf2 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -424,8 +424,8 @@ extern cpumask_t cpu_present_map;
 #define for_each_present_cpu(cpu)  for_each_cpu(cpu, &cpu_present_map)
 
 /* Copy to/from cpumap provided by control tools. */
-struct xenctl_cpumap;
-int cpumask_to_xenctl_cpumap(struct xenctl_cpumap *, const cpumask_t *);
-int xenctl_cpumap_to_cpumask(cpumask_var_t *, const struct xenctl_cpumap *);
+struct xenctl_bitmap;
+int cpumask_to_xenctl_bitmap(struct xenctl_bitmap *, const cpumask_t *);
+int xenctl_bitmap_to_cpumask(cpumask_var_t *, const struct xenctl_bitmap *);
 
 #endif /* __XEN_CPUMASK_H */
diff --git a/xen/include/xlat.lst b/xen/include/xlat.lst
index 3d4f1e3..d832110 100644
--- a/xen/include/xlat.lst
+++ b/xen/include/xlat.lst
@@ -2,7 +2,7 @@
 # ! - needs translation
 # ? - needs checking
 ?	dom0_vga_console_info		xen.h
-?	xenctl_cpumap			xen.h
+?	xenctl_bitmap			xen.h
 ?	mmu_update			xen.h
 !	mmuext_op			xen.h
 !	start_info			xen.h
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCB-0006EP-Ff; Wed, 17 Apr 2013 23:55:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC9-0006E5-Su
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:22 +0000
Received: from [85.158.143.99:10218] by server-3.bemta-4.messagelabs.com id
	FE/12-02186-9663F615; Wed, 17 Apr 2013 23:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1366242918!28166262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24533 invoked from network); 17 Apr 2013 23:55:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC6-000285-EV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC6-0007UP-3h
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:18 +0000
Date: Wed, 17 Apr 2013 23:55:18 +0000
Message-Id: <E1UScC6-0007UP-3h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen, libxc: introduce xc_nodemap_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 225fa55e53efa8b8e3d964d8572c89001d547d4e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen, libxc: introduce xc_nodemap_t
    
    And its handling functions, following suit from xc_cpumap_t.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/libxc/xc_misc.c |   15 +++++++++++++++
 tools/libxc/xenctrl.h |   10 +++++++++-
 xen/common/domctl.c   |   14 ++++++++++++++
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 777727d..56efe6a 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -54,6 +54,11 @@ int xc_get_cpumap_size(xc_interface *xch)
     return (xc_get_max_cpus(xch) + 7) / 8;
 }
 
+int xc_get_nodemap_size(xc_interface *xch)
+{
+    return (xc_get_max_nodes(xch) + 7) / 8;
+}
+
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
 {
     int sz;
@@ -64,6 +69,16 @@ xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
     return calloc(1, sz);
 }
 
+xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
+{
+    int sz;
+
+    sz = xc_get_nodemap_size(xch);
+    if (sz == 0)
+        return NULL;
+    return calloc(1, sz);
+}
+
 int xc_readconsolering(xc_interface *xch,
                        char *buffer,
                        unsigned int *pnr_chars,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 9676a9f..d3185c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -334,12 +334,20 @@ int xc_get_cpumap_size(xc_interface *xch);
 /* allocate a cpumap */
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch);
 
- /*
+/*
  * NODEMAP handling
  */
+typedef uint8_t *xc_nodemap_t;
+
 /* return maximum number of NUMA nodes the hypervisor supports */
 int xc_get_max_nodes(xc_interface *xch);
 
+/* return array size for nodemap */
+int xc_get_nodemap_size(xc_interface *xch);
+
+/* allocate a nodemap */
+xc_nodemap_t xc_nodemap_alloc(xc_interface *xch);
+
 /*
  * DOMAIN DEBUGGING FUNCTIONS
  */
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6769d24..37532c2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -117,6 +117,20 @@ int xenctl_bitmap_to_cpumask(cpumask_var_t *cpumask,
     return err;
 }
 
+int nodemask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_nodemap,
+                              const nodemask_t *nodemask)
+{
+    return bitmap_to_xenctl_bitmap(xenctl_nodemap, nodes_addr(*nodemask),
+                                   MAX_NUMNODES);
+}
+
+int xenctl_bitmap_to_nodemask(nodemask_t *nodemask,
+                              const struct xenctl_bitmap *xenctl_nodemap)
+{
+    return xenctl_bitmap_to_bitmap(nodes_addr(*nodemask), xenctl_nodemap,
+                                   MAX_NUMNODES);
+}
+
 static inline int is_free_domid(domid_t dom)
 {
     struct domain *d;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCB-0006EP-Ff; Wed, 17 Apr 2013 23:55:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC9-0006E5-Su
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:22 +0000
Received: from [85.158.143.99:10218] by server-3.bemta-4.messagelabs.com id
	FE/12-02186-9663F615; Wed, 17 Apr 2013 23:55:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-216.messagelabs.com!1366242918!28166262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24533 invoked from network); 17 Apr 2013 23:55:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC6-000285-EV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScC6-0007UP-3h
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:18 +0000
Date: Wed, 17 Apr 2013 23:55:18 +0000
Message-Id: <E1UScC6-0007UP-3h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen, libxc: introduce xc_nodemap_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 225fa55e53efa8b8e3d964d8572c89001d547d4e
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:29 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen, libxc: introduce xc_nodemap_t
    
    And its handling functions, following suit from xc_cpumap_t.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/libxc/xc_misc.c |   15 +++++++++++++++
 tools/libxc/xenctrl.h |   10 +++++++++-
 xen/common/domctl.c   |   14 ++++++++++++++
 3 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 777727d..56efe6a 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -54,6 +54,11 @@ int xc_get_cpumap_size(xc_interface *xch)
     return (xc_get_max_cpus(xch) + 7) / 8;
 }
 
+int xc_get_nodemap_size(xc_interface *xch)
+{
+    return (xc_get_max_nodes(xch) + 7) / 8;
+}
+
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
 {
     int sz;
@@ -64,6 +69,16 @@ xc_cpumap_t xc_cpumap_alloc(xc_interface *xch)
     return calloc(1, sz);
 }
 
+xc_nodemap_t xc_nodemap_alloc(xc_interface *xch)
+{
+    int sz;
+
+    sz = xc_get_nodemap_size(xch);
+    if (sz == 0)
+        return NULL;
+    return calloc(1, sz);
+}
+
 int xc_readconsolering(xc_interface *xch,
                        char *buffer,
                        unsigned int *pnr_chars,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 9676a9f..d3185c6 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -334,12 +334,20 @@ int xc_get_cpumap_size(xc_interface *xch);
 /* allocate a cpumap */
 xc_cpumap_t xc_cpumap_alloc(xc_interface *xch);
 
- /*
+/*
  * NODEMAP handling
  */
+typedef uint8_t *xc_nodemap_t;
+
 /* return maximum number of NUMA nodes the hypervisor supports */
 int xc_get_max_nodes(xc_interface *xch);
 
+/* return array size for nodemap */
+int xc_get_nodemap_size(xc_interface *xch);
+
+/* allocate a nodemap */
+xc_nodemap_t xc_nodemap_alloc(xc_interface *xch);
+
 /*
  * DOMAIN DEBUGGING FUNCTIONS
  */
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6769d24..37532c2 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -117,6 +117,20 @@ int xenctl_bitmap_to_cpumask(cpumask_var_t *cpumask,
     return err;
 }
 
+int nodemask_to_xenctl_bitmap(struct xenctl_bitmap *xenctl_nodemap,
+                              const nodemask_t *nodemask)
+{
+    return bitmap_to_xenctl_bitmap(xenctl_nodemap, nodes_addr(*nodemask),
+                                   MAX_NUMNODES);
+}
+
+int xenctl_bitmap_to_nodemask(nodemask_t *nodemask,
+                              const struct xenctl_bitmap *xenctl_nodemap)
+{
+    return xenctl_bitmap_to_bitmap(nodes_addr(*nodemask), xenctl_nodemap,
+                                   MAX_NUMNODES);
+}
+
 static inline int is_free_domid(domid_t dom)
 {
     struct domain *d;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCL-0006FO-Iq; Wed, 17 Apr 2013 23:55:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCK-0006FD-Jw
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:32 +0000
Received: from [85.158.137.99:45595] by server-11.bemta-3.messagelabs.com id
	E9/3A-01263-3763F615; Wed, 17 Apr 2013 23:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1366242929!15561847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25146 invoked from network); 17 Apr 2013 23:55:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCH-00028D-1H
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCG-0007VU-Ih
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:28 +0000
Date: Wed, 17 Apr 2013 23:55:28 +0000
Message-Id: <E1UScCG-0007VU-Ih@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: sched_credit: when picking,
	make sure we get an idle one, if any
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebb064aa22715ae473f72468d093e7a05e3c3c58
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen: sched_credit: when picking, make sure we get an idle one, if any
    
    The pcpu picking algorithm treats two threads of a SMT core the same.
    More specifically, if one is idle and the other one is busy, they both
    will be assigned a weight of 1. Therefore, when picking begins, if the
    first target pcpu is the busy thread (and if there are no other idle
    pcpu than its sibling), that will never change.
    
    This change fixes this by ensuring that, before entering the core of
    the picking algorithm, the target pcpu is an idle one (if there is an
    idle pcpu at all, of course).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 9e9ef33..64e76c5 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -532,6 +532,21 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
     if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
         cpumask_set_cpu(cpu, &idlers);
     cpumask_and(&cpus, &cpus, &idlers);
+
+    /*
+     * It is important that cpu points to an idle processor, if a suitable
+     * one exists (and we can use cpus to check and, possibly, choose a new
+     * CPU, as we just &&-ed it with idlers). In fact, if we are on SMT, and
+     * cpu points to a busy thread with an idle sibling, both the threads
+     * will be considered the same, from the "idleness" calculation point
+     * of view", preventing vcpu from being moved to the thread that is
+     * actually idle.
+     *
+     * Notice that cpumask_test_cpu() is quicker than cpumask_empty(), so
+     * we check for it first.
+     */
+    if ( !cpumask_test_cpu(cpu, &cpus) && !cpumask_empty(&cpus) )
+        cpu = cpumask_cycle(cpu, &cpus);
     cpumask_clear_cpu(cpu, &cpus);
 
     while ( !cpumask_empty(&cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCL-0006FO-Iq; Wed, 17 Apr 2013 23:55:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCK-0006FD-Jw
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:32 +0000
Received: from [85.158.137.99:45595] by server-11.bemta-3.messagelabs.com id
	E9/3A-01263-3763F615; Wed, 17 Apr 2013 23:55:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-217.messagelabs.com!1366242929!15561847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25146 invoked from network); 17 Apr 2013 23:55:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCH-00028D-1H
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCG-0007VU-Ih
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:28 +0000
Date: Wed, 17 Apr 2013 23:55:28 +0000
Message-Id: <E1UScCG-0007VU-Ih@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: sched_credit: when picking,
	make sure we get an idle one, if any
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebb064aa22715ae473f72468d093e7a05e3c3c58
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:30 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen: sched_credit: when picking, make sure we get an idle one, if any
    
    The pcpu picking algorithm treats two threads of a SMT core the same.
    More specifically, if one is idle and the other one is busy, they both
    will be assigned a weight of 1. Therefore, when picking begins, if the
    first target pcpu is the busy thread (and if there are no other idle
    pcpu than its sibling), that will never change.
    
    This change fixes this by ensuring that, before entering the core of
    the picking algorithm, the target pcpu is an idle one (if there is an
    idle pcpu at all, of course).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 9e9ef33..64e76c5 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -532,6 +532,21 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
     if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
         cpumask_set_cpu(cpu, &idlers);
     cpumask_and(&cpus, &cpus, &idlers);
+
+    /*
+     * It is important that cpu points to an idle processor, if a suitable
+     * one exists (and we can use cpus to check and, possibly, choose a new
+     * CPU, as we just &&-ed it with idlers). In fact, if we are on SMT, and
+     * cpu points to a busy thread with an idle sibling, both the threads
+     * will be considered the same, from the "idleness" calculation point
+     * of view", preventing vcpu from being moved to the thread that is
+     * actually idle.
+     *
+     * Notice that cpumask_test_cpu() is quicker than cpumask_empty(), so
+     * we check for it first.
+     */
+    if ( !cpumask_test_cpu(cpu, &cpus) && !cpumask_empty(&cpus) )
+        cpu = cpumask_cycle(cpu, &cpus);
     cpumask_clear_cpu(cpu, &cpus);
 
     while ( !cpumask_empty(&cpus) )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCX-0006H3-OK; Wed, 17 Apr 2013 23:55:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCV-0006Gj-UO
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:44 +0000
Received: from [85.158.139.83:37749] by server-8.bemta-5.messagelabs.com id
	69/AB-05790-F763F615; Wed, 17 Apr 2013 23:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1366242939!24934509!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22023 invoked from network); 17 Apr 2013 23:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCR-00028J-Dx
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCR-0007Vu-5P
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:39 +0000
Date: Wed, 17 Apr 2013 23:55:39 +0000
Message-Id: <E1UScCR-0007Vu-5P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: sched_credit: let the scheduler
	know about node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfcc144ff1ce59a9f93a44bbc89d1e20f5011c3d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen: sched_credit: let the scheduler know about node-affinity
    
    As vcpu-affinity tells where VCPUs must run, node-affinity tells
    where they prefer to. While respecting vcpu-affinity remains mandatory,
    node-affinity is not that strict, it only expresses a preference,
    although honouring it will bring significant performance benefits
    (especially as compared to not having any affinity at all).
    
    This change modifies the VCPUs load balancing algorithm (for the
    credit scheduler only), introducing a two steps logic. During the
    first step, we use both the vcpu-affinity and the node-affinity
    masks (by looking at their intersection). The aim is giving precedence
    to the PCPUs where the domain prefers to run, as expressed by its
    node-affinity (with the intersection with the vcpu-afinity being
    necessary in order to avoid running a VCPU where it never should).
    If that fails in finding a valid PCPU, the node-affinity is just
    ignored and, in the second step, we fall back to using cpu-affinity
    only.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit.c  |  460 +++++++++++++++++++++++++++++---------------
 xen/include/xen/nodemask.h |   12 ++
 2 files changed, 319 insertions(+), 153 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 64e76c5..be0b4b0 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -112,6 +112,12 @@
 
 
 /*
+ * Node Balancing
+ */
+#define CSCHED_BALANCE_NODE_AFFINITY    0
+#define CSCHED_BALANCE_CPU_AFFINITY     1
+
+/*
  * Boot parameters
  */
 static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
@@ -126,9 +132,20 @@ struct csched_pcpu {
     struct timer ticker;
     unsigned int tick;
     unsigned int idle_bias;
+    /* Store this here to avoid having too many cpumask_var_t-s on stack */
+    cpumask_var_t balance_mask;
 };
 
 /*
+ * Convenience macro for accessing the per-PCPU cpumask we need for
+ * implementing the two steps (vcpu and node affinity) balancing logic.
+ * It is stored in csched_pcpu so that serialization is not an issue,
+ * as there is a csched_pcpu for each PCPU and we always hold the
+ * runqueue spin-lock when using this.
+ */
+#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+
+/*
  * Virtual CPU
  */
 struct csched_vcpu {
@@ -161,6 +178,9 @@ struct csched_dom {
     struct list_head active_vcpu;
     struct list_head active_sdom_elem;
     struct domain *dom;
+    /* cpumask translated from the domain's node-affinity.
+     * Basically, the CPUs we prefer to be scheduled on. */
+    cpumask_var_t node_affinity_cpumask;
     uint16_t active_vcpu_count;
     uint16_t weight;
     uint16_t cap;
@@ -241,6 +261,35 @@ __runq_remove(struct csched_vcpu *svc)
     list_del_init(&svc->runq_elem);
 }
 
+#define for_each_csched_balance_step(step) \
+    for ( (step) = 0; (step) <= CSCHED_BALANCE_CPU_AFFINITY; (step)++ )
+
+
+/*
+ * vcpu-affinity balancing is always necessary and must never be skipped.
+ * OTOH, if a domain's node-affinity spans all the nodes, we can safely
+ * avoid dealing with node-affinity entirely.
+ */
+#define __vcpu_has_node_affinity(vc) \
+    ( !cpumask_full(CSCHED_DOM(vc->domain)->node_affinity_cpumask) )
+
+/*
+ * Each csched-balance step uses its own cpumask. This function determines
+ * which one (given the step) and copies it in mask. For the node-affinity
+ * balancing step, the pcpus that are not part of vc's vcpu-affinity are
+ * filtered out from the result, to avoid running a vcpu where it would
+ * like, but is not allowed to!
+ */
+static void
+csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
+{
+    if ( step == CSCHED_BALANCE_NODE_AFFINITY )
+        cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
+                    vc->cpu_affinity);
+    else /* step == CSCHED_BALANCE_CPU_AFFINITY */
+        cpumask_copy(mask, vc->cpu_affinity);
+}
+
 static void burn_credits(struct csched_vcpu *svc, s_time_t now)
 {
     s_time_t delta;
@@ -272,13 +321,13 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
     cpumask_t mask, idle_mask;
-    int idlers_empty;
+    int balance_step, idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
-
     idlers_empty = cpumask_empty(prv->idlers);
 
+
     /*
      * If the pcpu is idle, or there are no idlers and the new
      * vcpu is a higher priority than the old vcpu, run it here.
@@ -297,41 +346,70 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     }
     else if ( !idlers_empty )
     {
-        /* Check whether or not there are idlers that can run new */
-        cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
-
         /*
-         * If there are no suitable idlers for new, and it's higher
-         * priority than cur, ask the scheduler to migrate cur away.
-         * We have to act like this (instead of just waking some of
-         * the idlers suitable for cur) because cur is running.
-         *
-         * If there are suitable idlers for new, no matter priorities,
-         * leave cur alone (as it is running and is, likely, cache-hot)
-         * and wake some of them (which is waking up and so is, likely,
-         * cache cold anyway).
+         * Node and vcpu-affinity balancing loop. For vcpus without
+         * a useful node-affinity, consider vcpu-affinity only.
          */
-        if ( cpumask_empty(&idle_mask) && new->pri > cur->pri )
-        {
-            SCHED_STAT_CRANK(tickle_idlers_none);
-            SCHED_VCPU_STAT_CRANK(cur, kicked_away);
-            SCHED_VCPU_STAT_CRANK(cur, migrate_r);
-            SCHED_STAT_CRANK(migrate_kicked_away);
-            set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
-            cpumask_set_cpu(cpu, &mask);
-        }
-        else if ( !cpumask_empty(&idle_mask) )
+        for_each_csched_balance_step( balance_step )
         {
-            /* Which of the idlers suitable for new shall we wake up? */
-            SCHED_STAT_CRANK(tickle_idlers_some);
-            if ( opt_tickle_one_idle )
+            int new_idlers_empty;
+
+            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
+                 && !__vcpu_has_node_affinity(new->vcpu) )
+                continue;
+
+            /* Are there idlers suitable for new (for this balance step)? */
+            csched_balance_cpumask(new->vcpu, balance_step,
+                                   csched_balance_mask);
+            cpumask_and(&idle_mask, prv->idlers, csched_balance_mask);
+            new_idlers_empty = cpumask_empty(&idle_mask);
+
+            /*
+             * Let's not be too harsh! If there aren't idlers suitable
+             * for new in its node-affinity mask, make sure we check its
+             * vcpu-affinity as well, before taking final decisions.
+             */
+            if ( new_idlers_empty
+                 && balance_step == CSCHED_BALANCE_NODE_AFFINITY )
+                continue;
+
+            /*
+             * If there are no suitable idlers for new, and it's higher
+             * priority than cur, ask the scheduler to migrate cur away.
+             * We have to act like this (instead of just waking some of
+             * the idlers suitable for cur) because cur is running.
+             *
+             * If there are suitable idlers for new, no matter priorities,
+             * leave cur alone (as it is running and is, likely, cache-hot)
+             * and wake some of them (which is waking up and so is, likely,
+             * cache cold anyway).
+             */
+            if ( new_idlers_empty && new->pri > cur->pri )
             {
-                this_cpu(last_tickle_cpu) =
-                    cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
-                cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
+                SCHED_STAT_CRANK(tickle_idlers_none);
+                SCHED_VCPU_STAT_CRANK(cur, kicked_away);
+                SCHED_VCPU_STAT_CRANK(cur, migrate_r);
+                SCHED_STAT_CRANK(migrate_kicked_away);
+                set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
+                cpumask_set_cpu(cpu, &mask);
             }
-            else
-                cpumask_or(&mask, &mask, &idle_mask);
+            else if ( !new_idlers_empty )
+            {
+                /* Which of the idlers suitable for new shall we wake up? */
+                SCHED_STAT_CRANK(tickle_idlers_some);
+                if ( opt_tickle_one_idle )
+                {
+                    this_cpu(last_tickle_cpu) =
+                        cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
+                    cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
+                }
+                else
+                    cpumask_or(&mask, &mask, &idle_mask);
+            }
+
+            /* Did we find anyone? */
+            if ( !cpumask_empty(&mask) )
+                break;
         }
     }
 
@@ -376,6 +454,7 @@ csched_free_pdata(const struct scheduler *ops, void *pcpu, int cpu)
 
     spin_unlock_irqrestore(&prv->lock, flags);
 
+    free_cpumask_var(spc->balance_mask);
     xfree(spc);
 }
 
@@ -391,6 +470,12 @@ csched_alloc_pdata(const struct scheduler *ops, int cpu)
     if ( spc == NULL )
         return NULL;
 
+    if ( !alloc_cpumask_var(&spc->balance_mask) )
+    {
+        xfree(spc);
+        return NULL;
+    }
+
     spin_lock_irqsave(&prv->lock, flags);
 
     /* Initialize/update system-wide config */
@@ -481,15 +566,16 @@ __csched_vcpu_is_cache_hot(struct vcpu *v)
 }
 
 static inline int
-__csched_vcpu_is_migrateable(struct vcpu *vc, int dest_cpu)
+__csched_vcpu_is_migrateable(struct vcpu *vc, int dest_cpu, cpumask_t *mask)
 {
     /*
      * Don't pick up work that's in the peer's scheduling tail or hot on
-     * peer PCPU. Only pick up work that's allowed to run on our CPU.
+     * peer PCPU. Only pick up work that prefers and/or is allowed to run
+     * on our CPU.
      */
     return !vc->is_running &&
            !__csched_vcpu_is_cache_hot(vc) &&
-           cpumask_test_cpu(dest_cpu, vc->cpu_affinity);
+           cpumask_test_cpu(dest_cpu, mask);
 }
 
 static int
@@ -499,100 +585,114 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
     cpumask_t idlers;
     cpumask_t *online;
     struct csched_pcpu *spc = NULL;
-    int cpu;
+    int cpu = vc->processor;
+    int balance_step;
 
-    /*
-     * Pick from online CPUs in VCPU's affinity mask, giving a
-     * preference to its current processor if it's in there.
-     */
     online = cpupool_scheduler_cpumask(vc->domain->cpupool);
-    cpumask_and(&cpus, online, vc->cpu_affinity);
-    cpu = cpumask_test_cpu(vc->processor, &cpus)
-            ? vc->processor
-            : cpumask_cycle(vc->processor, &cpus);
-    ASSERT( !cpumask_empty(&cpus) && cpumask_test_cpu(cpu, &cpus) );
+    for_each_csched_balance_step( balance_step )
+    {
+        if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
+             && !__vcpu_has_node_affinity(vc) )
+            continue;
 
-    /*
-     * Try to find an idle processor within the above constraints.
-     *
-     * In multi-core and multi-threaded CPUs, not all idle execution
-     * vehicles are equal!
-     *
-     * We give preference to the idle execution vehicle with the most
-     * idling neighbours in its grouping. This distributes work across
-     * distinct cores first and guarantees we don't do something stupid
-     * like run two VCPUs on co-hyperthreads while there are idle cores
-     * or sockets.
-     *
-     * Notice that, when computing the "idleness" of cpu, we may want to
-     * discount vc. That is, iff vc is the currently running and the only
-     * runnable vcpu on cpu, we add cpu to the idlers.
-     */
-    cpumask_and(&idlers, &cpu_online_map, CSCHED_PRIV(ops)->idlers);
-    if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
-        cpumask_set_cpu(cpu, &idlers);
-    cpumask_and(&cpus, &cpus, &idlers);
+        /* Pick an online CPU from the proper affinity mask */
+        csched_balance_cpumask(vc, balance_step, &cpus);
+        cpumask_and(&cpus, &cpus, online);
 
-    /*
-     * It is important that cpu points to an idle processor, if a suitable
-     * one exists (and we can use cpus to check and, possibly, choose a new
-     * CPU, as we just &&-ed it with idlers). In fact, if we are on SMT, and
-     * cpu points to a busy thread with an idle sibling, both the threads
-     * will be considered the same, from the "idleness" calculation point
-     * of view", preventing vcpu from being moved to the thread that is
-     * actually idle.
-     *
-     * Notice that cpumask_test_cpu() is quicker than cpumask_empty(), so
-     * we check for it first.
-     */
-    if ( !cpumask_test_cpu(cpu, &cpus) && !cpumask_empty(&cpus) )
-        cpu = cpumask_cycle(cpu, &cpus);
-    cpumask_clear_cpu(cpu, &cpus);
+        /* If present, prefer vc's current processor */
+        cpu = cpumask_test_cpu(vc->processor, &cpus)
+                ? vc->processor
+                : cpumask_cycle(vc->processor, &cpus);
+        ASSERT( !cpumask_empty(&cpus) && cpumask_test_cpu(cpu, &cpus) );
 
-    while ( !cpumask_empty(&cpus) )
-    {
-        cpumask_t cpu_idlers;
-        cpumask_t nxt_idlers;
-        int nxt, weight_cpu, weight_nxt;
-        int migrate_factor;
+        /*
+         * Try to find an idle processor within the above constraints.
+         *
+         * In multi-core and multi-threaded CPUs, not all idle execution
+         * vehicles are equal!
+         *
+         * We give preference to the idle execution vehicle with the most
+         * idling neighbours in its grouping. This distributes work across
+         * distinct cores first and guarantees we don't do something stupid
+         * like run two VCPUs on co-hyperthreads while there are idle cores
+         * or sockets.
+         *
+         * Notice that, when computing the "idleness" of cpu, we may want to
+         * discount vc. That is, iff vc is the currently running and the only
+         * runnable vcpu on cpu, we add cpu to the idlers.
+         */
+        cpumask_and(&idlers, &cpu_online_map, CSCHED_PRIV(ops)->idlers);
+        if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
+            cpumask_set_cpu(cpu, &idlers);
+        cpumask_and(&cpus, &cpus, &idlers);
 
-        nxt = cpumask_cycle(cpu, &cpus);
+        /*
+         * It is important that cpu points to an idle processor, if a suitable
+         * one exists (and we can use cpus to check and, possibly, choose a new
+         * CPU, as we just &&-ed it with idlers). In fact, if we are on SMT, and
+         * cpu points to a busy thread with an idle sibling, both the threads
+         * will be considered the same, from the "idleness" calculation point
+         * of view", preventing vcpu from being moved to the thread that is
+         * actually idle.
+         *
+         * Notice that cpumask_test_cpu() is quicker than cpumask_empty(), so
+         * we check for it first.
+         */
+        if ( !cpumask_test_cpu(cpu, &cpus) && !cpumask_empty(&cpus) )
+            cpu = cpumask_cycle(cpu, &cpus);
+        cpumask_clear_cpu(cpu, &cpus);
 
-        if ( cpumask_test_cpu(cpu, per_cpu(cpu_core_mask, nxt)) )
+        while ( !cpumask_empty(&cpus) )
         {
-            /* We're on the same socket, so check the busy-ness of threads.
-             * Migrate if # of idlers is less at all */
-            ASSERT( cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
-            migrate_factor = 1;
-            cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_sibling_mask, cpu));
-            cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_sibling_mask, nxt));
-        }
-        else
-        {
-            /* We're on different sockets, so check the busy-ness of cores.
-             * Migrate only if the other core is twice as idle */
-            ASSERT( !cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
-            migrate_factor = 2;
-            cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_core_mask, cpu));
-            cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_core_mask, nxt));
-        }
+            cpumask_t cpu_idlers;
+            cpumask_t nxt_idlers;
+            int nxt, weight_cpu, weight_nxt;
+            int migrate_factor;
 
-        weight_cpu = cpumask_weight(&cpu_idlers);
-        weight_nxt = cpumask_weight(&nxt_idlers);
-        /* smt_power_savings: consolidate work rather than spreading it */
-        if ( sched_smt_power_savings ?
-             weight_cpu > weight_nxt :
-             weight_cpu * migrate_factor < weight_nxt )
-        {
-            cpumask_and(&nxt_idlers, &cpus, &nxt_idlers);
-            spc = CSCHED_PCPU(nxt);
-            cpu = cpumask_cycle(spc->idle_bias, &nxt_idlers);
-            cpumask_andnot(&cpus, &cpus, per_cpu(cpu_sibling_mask, cpu));
-        }
-        else
-        {
-            cpumask_andnot(&cpus, &cpus, &nxt_idlers);
+            nxt = cpumask_cycle(cpu, &cpus);
+
+            if ( cpumask_test_cpu(cpu, per_cpu(cpu_core_mask, nxt)) )
+            {
+                /* We're on the same socket, so check the busy-ness of threads.
+                 * Migrate if # of idlers is less at all */
+                ASSERT( cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
+                migrate_factor = 1;
+                cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_sibling_mask,
+                            cpu));
+                cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_sibling_mask,
+                            nxt));
+            }
+            else
+            {
+                /* We're on different sockets, so check the busy-ness of cores.
+                 * Migrate only if the other core is twice as idle */
+                ASSERT( !cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
+                migrate_factor = 2;
+                cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_core_mask, cpu));
+                cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_core_mask, nxt));
+            }
+
+            weight_cpu = cpumask_weight(&cpu_idlers);
+            weight_nxt = cpumask_weight(&nxt_idlers);
+            /* smt_power_savings: consolidate work rather than spreading it */
+            if ( sched_smt_power_savings ?
+                 weight_cpu > weight_nxt :
+                 weight_cpu * migrate_factor < weight_nxt )
+            {
+                cpumask_and(&nxt_idlers, &cpus, &nxt_idlers);
+                spc = CSCHED_PCPU(nxt);
+                cpu = cpumask_cycle(spc->idle_bias, &nxt_idlers);
+                cpumask_andnot(&cpus, &cpus, per_cpu(cpu_sibling_mask, cpu));
+            }
+            else
+            {
+                cpumask_andnot(&cpus, &cpus, &nxt_idlers);
+            }
         }
+
+        /* Stop if cpu is idle */
+        if ( cpumask_test_cpu(cpu, &idlers) )
+            break;
     }
 
     if ( commit && spc )
@@ -934,6 +1034,13 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
     if ( sdom == NULL )
         return NULL;
 
+    if ( !alloc_cpumask_var(&sdom->node_affinity_cpumask) )
+    {
+        xfree(sdom);
+        return NULL;
+    }
+    cpumask_setall(sdom->node_affinity_cpumask);
+
     /* Initialize credit and weight */
     INIT_LIST_HEAD(&sdom->active_vcpu);
     sdom->active_vcpu_count = 0;
@@ -965,6 +1072,9 @@ csched_dom_init(const struct scheduler *ops, struct domain *dom)
 static void
 csched_free_domdata(const struct scheduler *ops, void *data)
 {
+    struct csched_dom *sdom = data;
+
+    free_cpumask_var(sdom->node_affinity_cpumask);
     xfree(data);
 }
 
@@ -1259,7 +1369,7 @@ csched_tick(void *_cpu)
 }
 
 static struct csched_vcpu *
-csched_runq_steal(int peer_cpu, int cpu, int pri)
+csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
 {
     const struct csched_pcpu * const peer_pcpu = CSCHED_PCPU(peer_cpu);
     const struct vcpu * const peer_vcpu = curr_on_cpu(peer_cpu);
@@ -1284,11 +1394,28 @@ csched_runq_steal(int peer_cpu, int cpu, int pri)
             if ( speer->pri <= pri )
                 break;
 
-            /* Is this VCPU is runnable on our PCPU? */
+            /* Is this VCPU runnable on our PCPU? */
             vc = speer->vcpu;
             BUG_ON( is_idle_vcpu(vc) );
 
-            if (__csched_vcpu_is_migrateable(vc, cpu))
+            /*
+             * If the vcpu has no useful node-affinity, skip this vcpu.
+             * In fact, what we want is to check if we have any node-affine
+             * work to steal, before starting to look at vcpu-affine work.
+             *
+             * Notice that, if not even one vCPU on this runq has a useful
+             * node-affinity, we could have avoid considering this runq for
+             * a node balancing step in the first place. This, for instance,
+             * can be implemented by taking note of on what runq there are
+             * vCPUs with useful node-affinities in some sort of bitmap
+             * or counter.
+             */
+            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
+                 && !__vcpu_has_node_affinity(vc) )
+                continue;
+
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
+            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
@@ -1314,7 +1441,8 @@ csched_load_balance(struct csched_private *prv, int cpu,
     struct csched_vcpu *speer;
     cpumask_t workers;
     cpumask_t *online;
-    int peer_cpu;
+    int peer_cpu, peer_node, bstep;
+    int node = cpu_to_node(cpu);
 
     BUG_ON( cpu != snext->vcpu->processor );
     online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
@@ -1331,42 +1459,68 @@ csched_load_balance(struct csched_private *prv, int cpu,
         SCHED_STAT_CRANK(load_balance_other);
 
     /*
-     * Peek at non-idling CPUs in the system, starting with our
-     * immediate neighbour.
+     * Let's look around for work to steal, taking both vcpu-affinity
+     * and node-affinity into account. More specifically, we check all
+     * the non-idle CPUs' runq, looking for:
+     *  1. any node-affine work to steal first,
+     *  2. if not finding anything, any vcpu-affine work to steal.
      */
-    cpumask_andnot(&workers, online, prv->idlers);
-    cpumask_clear_cpu(cpu, &workers);
-    peer_cpu = cpu;
-
-    while ( !cpumask_empty(&workers) )
+    for_each_csched_balance_step( bstep )
     {
-        peer_cpu = cpumask_cycle(peer_cpu, &workers);
-        cpumask_clear_cpu(peer_cpu, &workers);
-
         /*
-         * Get ahold of the scheduler lock for this peer CPU.
-         *
-         * Note: We don't spin on this lock but simply try it. Spinning could
-         * cause a deadlock if the peer CPU is also load balancing and trying
-         * to lock this CPU.
+         * We peek at the non-idling CPUs in a node-wise fashion. In fact,
+         * it is more likely that we find some node-affine work on our same
+         * node, not to mention that migrating vcpus within the same node
+         * could well expected to be cheaper than across-nodes (memory
+         * stays local, there might be some node-wide cache[s], etc.).
          */
-        if ( !pcpu_schedule_trylock(peer_cpu) )
+        peer_node = node;
+        do
         {
-            SCHED_STAT_CRANK(steal_trylock_failed);
-            continue;
-        }
+            /* Find out what the !idle are in this node */
+            cpumask_andnot(&workers, online, prv->idlers);
+            cpumask_and(&workers, &workers, &node_to_cpumask(peer_node));
+            cpumask_clear_cpu(cpu, &workers);
 
-        /*
-         * Any work over there to steal?
-         */
-        speer = cpumask_test_cpu(peer_cpu, online) ?
-            csched_runq_steal(peer_cpu, cpu, snext->pri) : NULL;
-        pcpu_schedule_unlock(peer_cpu);
-        if ( speer != NULL )
-        {
-            *stolen = 1;
-            return speer;
-        }
+            if ( cpumask_empty(&workers) )
+                goto next_node;
+
+            peer_cpu = cpumask_first(&workers);
+            do
+            {
+                /*
+                 * Get ahold of the scheduler lock for this peer CPU.
+                 *
+                 * Note: We don't spin on this lock but simply try it. Spinning
+                 * could cause a deadlock if the peer CPU is also load
+                 * balancing and trying to lock this CPU.
+                 */
+                if ( !pcpu_schedule_trylock(peer_cpu) )
+                {
+                    SCHED_STAT_CRANK(steal_trylock_failed);
+                    peer_cpu = cpumask_cycle(peer_cpu, &workers);
+                    continue;
+                }
+
+                /* Any work over there to steal? */
+                speer = cpumask_test_cpu(peer_cpu, online) ?
+                    csched_runq_steal(peer_cpu, cpu, snext->pri, bstep) : NULL;
+                pcpu_schedule_unlock(peer_cpu);
+
+                /* As soon as one vcpu is found, balancing ends */
+                if ( speer != NULL )
+                {
+                    *stolen = 1;
+                    return speer;
+                }
+
+                peer_cpu = cpumask_cycle(peer_cpu, &workers);
+
+            } while( peer_cpu != cpumask_first(&workers) );
+
+ next_node:
+            peer_node = cycle_node(peer_node, node_online_map);
+        } while( peer_node != node );
     }
 
  out:
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 84de045..1b86016 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -41,6 +41,8 @@
  * int last_node(mask)			Number highest set bit, or MAX_NUMNODES
  * int first_unset_node(mask)		First node not set in mask, or 
  *					MAX_NUMNODES.
+ * int cycle_node(node, mask)		Next node cycling from 'node', or
+ *					MAX_NUMNODES
  *
  * nodemask_t nodemask_of_node(node)	Return nodemask with bit 'node' set
  * NODE_MASK_ALL			Initializer - all bits set
@@ -254,6 +256,16 @@ static inline int __first_unset_node(const nodemask_t *maskp)
 			find_first_zero_bit(maskp->bits, MAX_NUMNODES));
 }
 
+#define cycle_node(n, src) __cycle_node((n), &(src), MAX_NUMNODES)
+static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits)
+{
+    int nxt = __next_node(n, maskp, nbits);
+
+    if (nxt == nbits)
+        nxt = __first_node(maskp, nbits);
+    return nxt;
+}
+
 #define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
 
 #if MAX_NUMNODES <= BITS_PER_LONG
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCX-0006H3-OK; Wed, 17 Apr 2013 23:55:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCV-0006Gj-UO
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:44 +0000
Received: from [85.158.139.83:37749] by server-8.bemta-5.messagelabs.com id
	69/AB-05790-F763F615; Wed, 17 Apr 2013 23:55:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-182.messagelabs.com!1366242939!24934509!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22023 invoked from network); 17 Apr 2013 23:55:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCR-00028J-Dx
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCR-0007Vu-5P
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:39 +0000
Date: Wed, 17 Apr 2013 23:55:39 +0000
Message-Id: <E1UScCR-0007Vu-5P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: sched_credit: let the scheduler
	know about node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cfcc144ff1ce59a9f93a44bbc89d1e20f5011c3d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:31 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen: sched_credit: let the scheduler know about node-affinity
    
    As vcpu-affinity tells where VCPUs must run, node-affinity tells
    where they prefer to. While respecting vcpu-affinity remains mandatory,
    node-affinity is not that strict, it only expresses a preference,
    although honouring it will bring significant performance benefits
    (especially as compared to not having any affinity at all).
    
    This change modifies the VCPUs load balancing algorithm (for the
    credit scheduler only), introducing a two steps logic. During the
    first step, we use both the vcpu-affinity and the node-affinity
    masks (by looking at their intersection). The aim is giving precedence
    to the PCPUs where the domain prefers to run, as expressed by its
    node-affinity (with the intersection with the vcpu-afinity being
    necessary in order to avoid running a VCPU where it never should).
    If that fails in finding a valid PCPU, the node-affinity is just
    ignored and, in the second step, we fall back to using cpu-affinity
    only.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/sched_credit.c  |  460 +++++++++++++++++++++++++++++---------------
 xen/include/xen/nodemask.h |   12 ++
 2 files changed, 319 insertions(+), 153 deletions(-)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 64e76c5..be0b4b0 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -112,6 +112,12 @@
 
 
 /*
+ * Node Balancing
+ */
+#define CSCHED_BALANCE_NODE_AFFINITY    0
+#define CSCHED_BALANCE_CPU_AFFINITY     1
+
+/*
  * Boot parameters
  */
 static int __read_mostly sched_credit_tslice_ms = CSCHED_DEFAULT_TSLICE_MS;
@@ -126,9 +132,20 @@ struct csched_pcpu {
     struct timer ticker;
     unsigned int tick;
     unsigned int idle_bias;
+    /* Store this here to avoid having too many cpumask_var_t-s on stack */
+    cpumask_var_t balance_mask;
 };
 
 /*
+ * Convenience macro for accessing the per-PCPU cpumask we need for
+ * implementing the two steps (vcpu and node affinity) balancing logic.
+ * It is stored in csched_pcpu so that serialization is not an issue,
+ * as there is a csched_pcpu for each PCPU and we always hold the
+ * runqueue spin-lock when using this.
+ */
+#define csched_balance_mask (CSCHED_PCPU(smp_processor_id())->balance_mask)
+
+/*
  * Virtual CPU
  */
 struct csched_vcpu {
@@ -161,6 +178,9 @@ struct csched_dom {
     struct list_head active_vcpu;
     struct list_head active_sdom_elem;
     struct domain *dom;
+    /* cpumask translated from the domain's node-affinity.
+     * Basically, the CPUs we prefer to be scheduled on. */
+    cpumask_var_t node_affinity_cpumask;
     uint16_t active_vcpu_count;
     uint16_t weight;
     uint16_t cap;
@@ -241,6 +261,35 @@ __runq_remove(struct csched_vcpu *svc)
     list_del_init(&svc->runq_elem);
 }
 
+#define for_each_csched_balance_step(step) \
+    for ( (step) = 0; (step) <= CSCHED_BALANCE_CPU_AFFINITY; (step)++ )
+
+
+/*
+ * vcpu-affinity balancing is always necessary and must never be skipped.
+ * OTOH, if a domain's node-affinity spans all the nodes, we can safely
+ * avoid dealing with node-affinity entirely.
+ */
+#define __vcpu_has_node_affinity(vc) \
+    ( !cpumask_full(CSCHED_DOM(vc->domain)->node_affinity_cpumask) )
+
+/*
+ * Each csched-balance step uses its own cpumask. This function determines
+ * which one (given the step) and copies it in mask. For the node-affinity
+ * balancing step, the pcpus that are not part of vc's vcpu-affinity are
+ * filtered out from the result, to avoid running a vcpu where it would
+ * like, but is not allowed to!
+ */
+static void
+csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
+{
+    if ( step == CSCHED_BALANCE_NODE_AFFINITY )
+        cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
+                    vc->cpu_affinity);
+    else /* step == CSCHED_BALANCE_CPU_AFFINITY */
+        cpumask_copy(mask, vc->cpu_affinity);
+}
+
 static void burn_credits(struct csched_vcpu *svc, s_time_t now)
 {
     s_time_t delta;
@@ -272,13 +321,13 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     struct csched_vcpu * const cur = CSCHED_VCPU(curr_on_cpu(cpu));
     struct csched_private *prv = CSCHED_PRIV(per_cpu(scheduler, cpu));
     cpumask_t mask, idle_mask;
-    int idlers_empty;
+    int balance_step, idlers_empty;
 
     ASSERT(cur);
     cpumask_clear(&mask);
-
     idlers_empty = cpumask_empty(prv->idlers);
 
+
     /*
      * If the pcpu is idle, or there are no idlers and the new
      * vcpu is a higher priority than the old vcpu, run it here.
@@ -297,41 +346,70 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     }
     else if ( !idlers_empty )
     {
-        /* Check whether or not there are idlers that can run new */
-        cpumask_and(&idle_mask, prv->idlers, new->vcpu->cpu_affinity);
-
         /*
-         * If there are no suitable idlers for new, and it's higher
-         * priority than cur, ask the scheduler to migrate cur away.
-         * We have to act like this (instead of just waking some of
-         * the idlers suitable for cur) because cur is running.
-         *
-         * If there are suitable idlers for new, no matter priorities,
-         * leave cur alone (as it is running and is, likely, cache-hot)
-         * and wake some of them (which is waking up and so is, likely,
-         * cache cold anyway).
+         * Node and vcpu-affinity balancing loop. For vcpus without
+         * a useful node-affinity, consider vcpu-affinity only.
          */
-        if ( cpumask_empty(&idle_mask) && new->pri > cur->pri )
-        {
-            SCHED_STAT_CRANK(tickle_idlers_none);
-            SCHED_VCPU_STAT_CRANK(cur, kicked_away);
-            SCHED_VCPU_STAT_CRANK(cur, migrate_r);
-            SCHED_STAT_CRANK(migrate_kicked_away);
-            set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
-            cpumask_set_cpu(cpu, &mask);
-        }
-        else if ( !cpumask_empty(&idle_mask) )
+        for_each_csched_balance_step( balance_step )
         {
-            /* Which of the idlers suitable for new shall we wake up? */
-            SCHED_STAT_CRANK(tickle_idlers_some);
-            if ( opt_tickle_one_idle )
+            int new_idlers_empty;
+
+            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
+                 && !__vcpu_has_node_affinity(new->vcpu) )
+                continue;
+
+            /* Are there idlers suitable for new (for this balance step)? */
+            csched_balance_cpumask(new->vcpu, balance_step,
+                                   csched_balance_mask);
+            cpumask_and(&idle_mask, prv->idlers, csched_balance_mask);
+            new_idlers_empty = cpumask_empty(&idle_mask);
+
+            /*
+             * Let's not be too harsh! If there aren't idlers suitable
+             * for new in its node-affinity mask, make sure we check its
+             * vcpu-affinity as well, before taking final decisions.
+             */
+            if ( new_idlers_empty
+                 && balance_step == CSCHED_BALANCE_NODE_AFFINITY )
+                continue;
+
+            /*
+             * If there are no suitable idlers for new, and it's higher
+             * priority than cur, ask the scheduler to migrate cur away.
+             * We have to act like this (instead of just waking some of
+             * the idlers suitable for cur) because cur is running.
+             *
+             * If there are suitable idlers for new, no matter priorities,
+             * leave cur alone (as it is running and is, likely, cache-hot)
+             * and wake some of them (which is waking up and so is, likely,
+             * cache cold anyway).
+             */
+            if ( new_idlers_empty && new->pri > cur->pri )
             {
-                this_cpu(last_tickle_cpu) =
-                    cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
-                cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
+                SCHED_STAT_CRANK(tickle_idlers_none);
+                SCHED_VCPU_STAT_CRANK(cur, kicked_away);
+                SCHED_VCPU_STAT_CRANK(cur, migrate_r);
+                SCHED_STAT_CRANK(migrate_kicked_away);
+                set_bit(_VPF_migrating, &cur->vcpu->pause_flags);
+                cpumask_set_cpu(cpu, &mask);
             }
-            else
-                cpumask_or(&mask, &mask, &idle_mask);
+            else if ( !new_idlers_empty )
+            {
+                /* Which of the idlers suitable for new shall we wake up? */
+                SCHED_STAT_CRANK(tickle_idlers_some);
+                if ( opt_tickle_one_idle )
+                {
+                    this_cpu(last_tickle_cpu) =
+                        cpumask_cycle(this_cpu(last_tickle_cpu), &idle_mask);
+                    cpumask_set_cpu(this_cpu(last_tickle_cpu), &mask);
+                }
+                else
+                    cpumask_or(&mask, &mask, &idle_mask);
+            }
+
+            /* Did we find anyone? */
+            if ( !cpumask_empty(&mask) )
+                break;
         }
     }
 
@@ -376,6 +454,7 @@ csched_free_pdata(const struct scheduler *ops, void *pcpu, int cpu)
 
     spin_unlock_irqrestore(&prv->lock, flags);
 
+    free_cpumask_var(spc->balance_mask);
     xfree(spc);
 }
 
@@ -391,6 +470,12 @@ csched_alloc_pdata(const struct scheduler *ops, int cpu)
     if ( spc == NULL )
         return NULL;
 
+    if ( !alloc_cpumask_var(&spc->balance_mask) )
+    {
+        xfree(spc);
+        return NULL;
+    }
+
     spin_lock_irqsave(&prv->lock, flags);
 
     /* Initialize/update system-wide config */
@@ -481,15 +566,16 @@ __csched_vcpu_is_cache_hot(struct vcpu *v)
 }
 
 static inline int
-__csched_vcpu_is_migrateable(struct vcpu *vc, int dest_cpu)
+__csched_vcpu_is_migrateable(struct vcpu *vc, int dest_cpu, cpumask_t *mask)
 {
     /*
      * Don't pick up work that's in the peer's scheduling tail or hot on
-     * peer PCPU. Only pick up work that's allowed to run on our CPU.
+     * peer PCPU. Only pick up work that prefers and/or is allowed to run
+     * on our CPU.
      */
     return !vc->is_running &&
            !__csched_vcpu_is_cache_hot(vc) &&
-           cpumask_test_cpu(dest_cpu, vc->cpu_affinity);
+           cpumask_test_cpu(dest_cpu, mask);
 }
 
 static int
@@ -499,100 +585,114 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
     cpumask_t idlers;
     cpumask_t *online;
     struct csched_pcpu *spc = NULL;
-    int cpu;
+    int cpu = vc->processor;
+    int balance_step;
 
-    /*
-     * Pick from online CPUs in VCPU's affinity mask, giving a
-     * preference to its current processor if it's in there.
-     */
     online = cpupool_scheduler_cpumask(vc->domain->cpupool);
-    cpumask_and(&cpus, online, vc->cpu_affinity);
-    cpu = cpumask_test_cpu(vc->processor, &cpus)
-            ? vc->processor
-            : cpumask_cycle(vc->processor, &cpus);
-    ASSERT( !cpumask_empty(&cpus) && cpumask_test_cpu(cpu, &cpus) );
+    for_each_csched_balance_step( balance_step )
+    {
+        if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
+             && !__vcpu_has_node_affinity(vc) )
+            continue;
 
-    /*
-     * Try to find an idle processor within the above constraints.
-     *
-     * In multi-core and multi-threaded CPUs, not all idle execution
-     * vehicles are equal!
-     *
-     * We give preference to the idle execution vehicle with the most
-     * idling neighbours in its grouping. This distributes work across
-     * distinct cores first and guarantees we don't do something stupid
-     * like run two VCPUs on co-hyperthreads while there are idle cores
-     * or sockets.
-     *
-     * Notice that, when computing the "idleness" of cpu, we may want to
-     * discount vc. That is, iff vc is the currently running and the only
-     * runnable vcpu on cpu, we add cpu to the idlers.
-     */
-    cpumask_and(&idlers, &cpu_online_map, CSCHED_PRIV(ops)->idlers);
-    if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
-        cpumask_set_cpu(cpu, &idlers);
-    cpumask_and(&cpus, &cpus, &idlers);
+        /* Pick an online CPU from the proper affinity mask */
+        csched_balance_cpumask(vc, balance_step, &cpus);
+        cpumask_and(&cpus, &cpus, online);
 
-    /*
-     * It is important that cpu points to an idle processor, if a suitable
-     * one exists (and we can use cpus to check and, possibly, choose a new
-     * CPU, as we just &&-ed it with idlers). In fact, if we are on SMT, and
-     * cpu points to a busy thread with an idle sibling, both the threads
-     * will be considered the same, from the "idleness" calculation point
-     * of view", preventing vcpu from being moved to the thread that is
-     * actually idle.
-     *
-     * Notice that cpumask_test_cpu() is quicker than cpumask_empty(), so
-     * we check for it first.
-     */
-    if ( !cpumask_test_cpu(cpu, &cpus) && !cpumask_empty(&cpus) )
-        cpu = cpumask_cycle(cpu, &cpus);
-    cpumask_clear_cpu(cpu, &cpus);
+        /* If present, prefer vc's current processor */
+        cpu = cpumask_test_cpu(vc->processor, &cpus)
+                ? vc->processor
+                : cpumask_cycle(vc->processor, &cpus);
+        ASSERT( !cpumask_empty(&cpus) && cpumask_test_cpu(cpu, &cpus) );
 
-    while ( !cpumask_empty(&cpus) )
-    {
-        cpumask_t cpu_idlers;
-        cpumask_t nxt_idlers;
-        int nxt, weight_cpu, weight_nxt;
-        int migrate_factor;
+        /*
+         * Try to find an idle processor within the above constraints.
+         *
+         * In multi-core and multi-threaded CPUs, not all idle execution
+         * vehicles are equal!
+         *
+         * We give preference to the idle execution vehicle with the most
+         * idling neighbours in its grouping. This distributes work across
+         * distinct cores first and guarantees we don't do something stupid
+         * like run two VCPUs on co-hyperthreads while there are idle cores
+         * or sockets.
+         *
+         * Notice that, when computing the "idleness" of cpu, we may want to
+         * discount vc. That is, iff vc is the currently running and the only
+         * runnable vcpu on cpu, we add cpu to the idlers.
+         */
+        cpumask_and(&idlers, &cpu_online_map, CSCHED_PRIV(ops)->idlers);
+        if ( vc->processor == cpu && IS_RUNQ_IDLE(cpu) )
+            cpumask_set_cpu(cpu, &idlers);
+        cpumask_and(&cpus, &cpus, &idlers);
 
-        nxt = cpumask_cycle(cpu, &cpus);
+        /*
+         * It is important that cpu points to an idle processor, if a suitable
+         * one exists (and we can use cpus to check and, possibly, choose a new
+         * CPU, as we just &&-ed it with idlers). In fact, if we are on SMT, and
+         * cpu points to a busy thread with an idle sibling, both the threads
+         * will be considered the same, from the "idleness" calculation point
+         * of view", preventing vcpu from being moved to the thread that is
+         * actually idle.
+         *
+         * Notice that cpumask_test_cpu() is quicker than cpumask_empty(), so
+         * we check for it first.
+         */
+        if ( !cpumask_test_cpu(cpu, &cpus) && !cpumask_empty(&cpus) )
+            cpu = cpumask_cycle(cpu, &cpus);
+        cpumask_clear_cpu(cpu, &cpus);
 
-        if ( cpumask_test_cpu(cpu, per_cpu(cpu_core_mask, nxt)) )
+        while ( !cpumask_empty(&cpus) )
         {
-            /* We're on the same socket, so check the busy-ness of threads.
-             * Migrate if # of idlers is less at all */
-            ASSERT( cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
-            migrate_factor = 1;
-            cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_sibling_mask, cpu));
-            cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_sibling_mask, nxt));
-        }
-        else
-        {
-            /* We're on different sockets, so check the busy-ness of cores.
-             * Migrate only if the other core is twice as idle */
-            ASSERT( !cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
-            migrate_factor = 2;
-            cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_core_mask, cpu));
-            cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_core_mask, nxt));
-        }
+            cpumask_t cpu_idlers;
+            cpumask_t nxt_idlers;
+            int nxt, weight_cpu, weight_nxt;
+            int migrate_factor;
 
-        weight_cpu = cpumask_weight(&cpu_idlers);
-        weight_nxt = cpumask_weight(&nxt_idlers);
-        /* smt_power_savings: consolidate work rather than spreading it */
-        if ( sched_smt_power_savings ?
-             weight_cpu > weight_nxt :
-             weight_cpu * migrate_factor < weight_nxt )
-        {
-            cpumask_and(&nxt_idlers, &cpus, &nxt_idlers);
-            spc = CSCHED_PCPU(nxt);
-            cpu = cpumask_cycle(spc->idle_bias, &nxt_idlers);
-            cpumask_andnot(&cpus, &cpus, per_cpu(cpu_sibling_mask, cpu));
-        }
-        else
-        {
-            cpumask_andnot(&cpus, &cpus, &nxt_idlers);
+            nxt = cpumask_cycle(cpu, &cpus);
+
+            if ( cpumask_test_cpu(cpu, per_cpu(cpu_core_mask, nxt)) )
+            {
+                /* We're on the same socket, so check the busy-ness of threads.
+                 * Migrate if # of idlers is less at all */
+                ASSERT( cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
+                migrate_factor = 1;
+                cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_sibling_mask,
+                            cpu));
+                cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_sibling_mask,
+                            nxt));
+            }
+            else
+            {
+                /* We're on different sockets, so check the busy-ness of cores.
+                 * Migrate only if the other core is twice as idle */
+                ASSERT( !cpumask_test_cpu(nxt, per_cpu(cpu_core_mask, cpu)) );
+                migrate_factor = 2;
+                cpumask_and(&cpu_idlers, &idlers, per_cpu(cpu_core_mask, cpu));
+                cpumask_and(&nxt_idlers, &idlers, per_cpu(cpu_core_mask, nxt));
+            }
+
+            weight_cpu = cpumask_weight(&cpu_idlers);
+            weight_nxt = cpumask_weight(&nxt_idlers);
+            /* smt_power_savings: consolidate work rather than spreading it */
+            if ( sched_smt_power_savings ?
+                 weight_cpu > weight_nxt :
+                 weight_cpu * migrate_factor < weight_nxt )
+            {
+                cpumask_and(&nxt_idlers, &cpus, &nxt_idlers);
+                spc = CSCHED_PCPU(nxt);
+                cpu = cpumask_cycle(spc->idle_bias, &nxt_idlers);
+                cpumask_andnot(&cpus, &cpus, per_cpu(cpu_sibling_mask, cpu));
+            }
+            else
+            {
+                cpumask_andnot(&cpus, &cpus, &nxt_idlers);
+            }
         }
+
+        /* Stop if cpu is idle */
+        if ( cpumask_test_cpu(cpu, &idlers) )
+            break;
     }
 
     if ( commit && spc )
@@ -934,6 +1034,13 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
     if ( sdom == NULL )
         return NULL;
 
+    if ( !alloc_cpumask_var(&sdom->node_affinity_cpumask) )
+    {
+        xfree(sdom);
+        return NULL;
+    }
+    cpumask_setall(sdom->node_affinity_cpumask);
+
     /* Initialize credit and weight */
     INIT_LIST_HEAD(&sdom->active_vcpu);
     sdom->active_vcpu_count = 0;
@@ -965,6 +1072,9 @@ csched_dom_init(const struct scheduler *ops, struct domain *dom)
 static void
 csched_free_domdata(const struct scheduler *ops, void *data)
 {
+    struct csched_dom *sdom = data;
+
+    free_cpumask_var(sdom->node_affinity_cpumask);
     xfree(data);
 }
 
@@ -1259,7 +1369,7 @@ csched_tick(void *_cpu)
 }
 
 static struct csched_vcpu *
-csched_runq_steal(int peer_cpu, int cpu, int pri)
+csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
 {
     const struct csched_pcpu * const peer_pcpu = CSCHED_PCPU(peer_cpu);
     const struct vcpu * const peer_vcpu = curr_on_cpu(peer_cpu);
@@ -1284,11 +1394,28 @@ csched_runq_steal(int peer_cpu, int cpu, int pri)
             if ( speer->pri <= pri )
                 break;
 
-            /* Is this VCPU is runnable on our PCPU? */
+            /* Is this VCPU runnable on our PCPU? */
             vc = speer->vcpu;
             BUG_ON( is_idle_vcpu(vc) );
 
-            if (__csched_vcpu_is_migrateable(vc, cpu))
+            /*
+             * If the vcpu has no useful node-affinity, skip this vcpu.
+             * In fact, what we want is to check if we have any node-affine
+             * work to steal, before starting to look at vcpu-affine work.
+             *
+             * Notice that, if not even one vCPU on this runq has a useful
+             * node-affinity, we could have avoid considering this runq for
+             * a node balancing step in the first place. This, for instance,
+             * can be implemented by taking note of on what runq there are
+             * vCPUs with useful node-affinities in some sort of bitmap
+             * or counter.
+             */
+            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
+                 && !__vcpu_has_node_affinity(vc) )
+                continue;
+
+            csched_balance_cpumask(vc, balance_step, csched_balance_mask);
+            if ( __csched_vcpu_is_migrateable(vc, cpu, csched_balance_mask) )
             {
                 /* We got a candidate. Grab it! */
                 TRACE_3D(TRC_CSCHED_STOLEN_VCPU, peer_cpu,
@@ -1314,7 +1441,8 @@ csched_load_balance(struct csched_private *prv, int cpu,
     struct csched_vcpu *speer;
     cpumask_t workers;
     cpumask_t *online;
-    int peer_cpu;
+    int peer_cpu, peer_node, bstep;
+    int node = cpu_to_node(cpu);
 
     BUG_ON( cpu != snext->vcpu->processor );
     online = cpupool_scheduler_cpumask(per_cpu(cpupool, cpu));
@@ -1331,42 +1459,68 @@ csched_load_balance(struct csched_private *prv, int cpu,
         SCHED_STAT_CRANK(load_balance_other);
 
     /*
-     * Peek at non-idling CPUs in the system, starting with our
-     * immediate neighbour.
+     * Let's look around for work to steal, taking both vcpu-affinity
+     * and node-affinity into account. More specifically, we check all
+     * the non-idle CPUs' runq, looking for:
+     *  1. any node-affine work to steal first,
+     *  2. if not finding anything, any vcpu-affine work to steal.
      */
-    cpumask_andnot(&workers, online, prv->idlers);
-    cpumask_clear_cpu(cpu, &workers);
-    peer_cpu = cpu;
-
-    while ( !cpumask_empty(&workers) )
+    for_each_csched_balance_step( bstep )
     {
-        peer_cpu = cpumask_cycle(peer_cpu, &workers);
-        cpumask_clear_cpu(peer_cpu, &workers);
-
         /*
-         * Get ahold of the scheduler lock for this peer CPU.
-         *
-         * Note: We don't spin on this lock but simply try it. Spinning could
-         * cause a deadlock if the peer CPU is also load balancing and trying
-         * to lock this CPU.
+         * We peek at the non-idling CPUs in a node-wise fashion. In fact,
+         * it is more likely that we find some node-affine work on our same
+         * node, not to mention that migrating vcpus within the same node
+         * could well expected to be cheaper than across-nodes (memory
+         * stays local, there might be some node-wide cache[s], etc.).
          */
-        if ( !pcpu_schedule_trylock(peer_cpu) )
+        peer_node = node;
+        do
         {
-            SCHED_STAT_CRANK(steal_trylock_failed);
-            continue;
-        }
+            /* Find out what the !idle are in this node */
+            cpumask_andnot(&workers, online, prv->idlers);
+            cpumask_and(&workers, &workers, &node_to_cpumask(peer_node));
+            cpumask_clear_cpu(cpu, &workers);
 
-        /*
-         * Any work over there to steal?
-         */
-        speer = cpumask_test_cpu(peer_cpu, online) ?
-            csched_runq_steal(peer_cpu, cpu, snext->pri) : NULL;
-        pcpu_schedule_unlock(peer_cpu);
-        if ( speer != NULL )
-        {
-            *stolen = 1;
-            return speer;
-        }
+            if ( cpumask_empty(&workers) )
+                goto next_node;
+
+            peer_cpu = cpumask_first(&workers);
+            do
+            {
+                /*
+                 * Get ahold of the scheduler lock for this peer CPU.
+                 *
+                 * Note: We don't spin on this lock but simply try it. Spinning
+                 * could cause a deadlock if the peer CPU is also load
+                 * balancing and trying to lock this CPU.
+                 */
+                if ( !pcpu_schedule_trylock(peer_cpu) )
+                {
+                    SCHED_STAT_CRANK(steal_trylock_failed);
+                    peer_cpu = cpumask_cycle(peer_cpu, &workers);
+                    continue;
+                }
+
+                /* Any work over there to steal? */
+                speer = cpumask_test_cpu(peer_cpu, online) ?
+                    csched_runq_steal(peer_cpu, cpu, snext->pri, bstep) : NULL;
+                pcpu_schedule_unlock(peer_cpu);
+
+                /* As soon as one vcpu is found, balancing ends */
+                if ( speer != NULL )
+                {
+                    *stolen = 1;
+                    return speer;
+                }
+
+                peer_cpu = cpumask_cycle(peer_cpu, &workers);
+
+            } while( peer_cpu != cpumask_first(&workers) );
+
+ next_node:
+            peer_node = cycle_node(peer_node, node_online_map);
+        } while( peer_node != node );
     }
 
  out:
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 84de045..1b86016 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -41,6 +41,8 @@
  * int last_node(mask)			Number highest set bit, or MAX_NUMNODES
  * int first_unset_node(mask)		First node not set in mask, or 
  *					MAX_NUMNODES.
+ * int cycle_node(node, mask)		Next node cycling from 'node', or
+ *					MAX_NUMNODES
  *
  * nodemask_t nodemask_of_node(node)	Return nodemask with bit 'node' set
  * NODE_MASK_ALL			Initializer - all bits set
@@ -254,6 +256,16 @@ static inline int __first_unset_node(const nodemask_t *maskp)
 			find_first_zero_bit(maskp->bits, MAX_NUMNODES));
 }
 
+#define cycle_node(n, src) __cycle_node((n), &(src), MAX_NUMNODES)
+static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits)
+{
+    int nxt = __next_node(n, maskp, nbits);
+
+    if (nxt == nbits)
+        nxt = __first_node(maskp, nbits);
+    return nxt;
+}
+
 #define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
 
 #if MAX_NUMNODES <= BITS_PER_LONG
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCi-0006JA-Ro; Wed, 17 Apr 2013 23:55:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCg-0006If-OB
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:55 +0000
Received: from [85.158.139.83:6473] by server-2.bemta-5.messagelabs.com id
	64/D3-23989-A863F615; Wed, 17 Apr 2013 23:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1366242949!21392790!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4063 invoked from network); 17 Apr 2013 23:55:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCb-00028P-Kk
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCb-0007WG-Jb
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:49 +0000
Date: Wed, 17 Apr 2013 23:55:49 +0000
Message-Id: <E1UScCb-0007WG-Jb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: allow for explicitly specifying
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b5b79a12c41b5e76af9d47551027b56f210d9029
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen: allow for explicitly specifying node-affinity
    
    Make it possible to pass the node-affinity of a domain to the hypervisor
    from the upper layers, instead of always being computed automatically.
    
    Note that this also required generalizing the Flask hooks for setting
    and getting the affinity, so that they now deal with both vcpu and
    node affinity.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/mls                |    4 +-
 tools/flask/policy/policy/modules/xen/xen.if |    6 +-
 tools/flask/policy/policy/modules/xen/xen.te |    2 +-
 xen/common/domain.c                          |   60 ++++++++++++++++++++++++--
 xen/common/domctl.c                          |   17 +++++++
 xen/common/keyhandler.c                      |   11 +++++
 xen/common/sched_credit.c                    |   48 +++++++++++++++++++--
 xen/common/schedule.c                        |    5 ++
 xen/include/public/domctl.h                  |   13 ++++++
 xen/include/xen/nodemask.h                   |   14 +++++-
 xen/include/xen/sched-if.h                   |    2 +
 xen/include/xen/sched.h                      |    9 +++-
 xen/xsm/flask/hooks.c                        |    6 ++-
 xen/xsm/flask/policy/access_vectors          |    6 ++-
 14 files changed, 182 insertions(+), 21 deletions(-)

diff --git a/tools/flask/policy/policy/mls b/tools/flask/policy/policy/mls
index a3dde70..9290a76 100644
--- a/tools/flask/policy/policy/mls
+++ b/tools/flask/policy/policy/mls
@@ -70,11 +70,11 @@ mlsconstrain domain transition
 	(( h1 dom h2 ) and (( l1 eq l2 ) or (t1 == mls_priv)));
 
 # all the domain "read" ops
-mlsconstrain domain { getvcpuaffinity getdomaininfo getvcpuinfo getvcpucontext getaddrsize getextvcpucontext }
+mlsconstrain domain { getaffinity getdomaininfo getvcpuinfo getvcpucontext getaddrsize getextvcpucontext }
 	((l1 dom l2) or (t1 == mls_priv));
 
 # all the domain "write" ops
-mlsconstrain domain { setvcpucontext pause unpause resume create max_vcpus destroy setvcpuaffinity scheduler setdomainmaxmem setdomainhandle setdebugging hypercall settime set_target shutdown setaddrsize trigger setextvcpucontext }
+mlsconstrain domain { setvcpucontext pause unpause resume create max_vcpus destroy setaffinity scheduler setdomainmaxmem setdomainhandle setdebugging hypercall settime set_target shutdown setaddrsize trigger setextvcpucontext }
 	((l1 eq l2) or (t1 == mls_priv));
 
 # This is incomplete - similar constraints must be written for all classes
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 2ce2212..18647c9 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -48,7 +48,7 @@ define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			getscheduler getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity setvcpuaffinity };
+			getaffinity setaffinity };
 	allow $1 $2:domain2 { set_cpuid settsc setscheduler };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
@@ -77,9 +77,9 @@ define(`create_domain_build_label', `
 # manage_domain(priv, target)
 #   Allow managing a running domain
 define(`manage_domain', `
-	allow $1 $2:domain { getdomaininfo getvcpuinfo getvcpuaffinity
+	allow $1 $2:domain { getdomaininfo getvcpuinfo getaffinity
 			getaddrsize pause unpause trigger shutdown destroy
-			setvcpuaffinity setdomainmaxmem getscheduler };
+			setaffinity setdomainmaxmem getscheduler };
 ')
 
 # migrate_domain_out(priv, target)
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 454e27e..c89ce28 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -69,7 +69,7 @@ allow dom0_t xen_t:mmu memorymap;
 # Allow dom0 to use these domctls on itself. For domctls acting on other
 # domains, see the definitions of create_domain and manage_domain.
 allow dom0_t dom0_t:domain {
-	setvcpucontext max_vcpus setvcpuaffinity getvcpuaffinity getscheduler
+	setvcpucontext max_vcpus setaffinity getaffinity getscheduler
 	getdomaininfo getvcpuinfo getvcpucontext setdomainmaxmem setdomainhandle
 	setdebugging hypercall settime setaddrsize getaddrsize trigger
 	getextvcpucontext setextvcpucontext getvcpuextstate setvcpuextstate
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 590548e..ce45d66 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -224,6 +224,7 @@ struct domain *domain_create(
 
     spin_lock_init(&d->node_affinity_lock);
     d->node_affinity = NODE_MASK_ALL;
+    d->auto_node_affinity = 1;
 
     spin_lock_init(&d->shutdown_lock);
     d->shutdown_code = -1;
@@ -364,11 +365,32 @@ void domain_update_node_affinity(struct domain *d)
         cpumask_or(cpumask, cpumask, online_affinity);
     }
 
-    for_each_online_node ( node )
-        if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
-            node_set(node, nodemask);
+    if ( d->auto_node_affinity )
+    {
+        /* Node-affinity is automaically computed from all vcpu-affinities */
+        for_each_online_node ( node )
+            if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
+                node_set(node, nodemask);
+
+        d->node_affinity = nodemask;
+    }
+    else
+    {
+        /* Node-affinity is provided by someone else, just filter out cpus
+         * that are either offline or not in the affinity of any vcpus. */
+        nodemask = d->node_affinity;
+        for_each_node_mask ( node, d->node_affinity )
+            if ( !cpumask_intersects(&node_to_cpumask(node), cpumask) )
+                node_clear(node, nodemask);//d->node_affinity);
+
+        /* Avoid loosing track of node-affinity because of a bad
+         * vcpu-affinity has been specified. */
+        if ( !nodes_empty(nodemask) )
+            d->node_affinity = nodemask;
+    }
+
+    sched_set_node_affinity(d, &d->node_affinity);
 
-    d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
 
     free_cpumask_var(online_affinity);
@@ -376,6 +398,36 @@ void domain_update_node_affinity(struct domain *d)
 }
 
 
+int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity)
+{
+    /* Being affine with no nodes is just wrong */
+    if ( nodes_empty(*affinity) )
+        return -EINVAL;
+
+    spin_lock(&d->node_affinity_lock);
+
+    /*
+     * Being/becoming explicitly affine to all nodes is not particularly
+     * useful. Let's take it as the `reset node affinity` command.
+     */
+    if ( nodes_full(*affinity) )
+    {
+        d->auto_node_affinity = 1;
+        goto out;
+    }
+
+    d->auto_node_affinity = 0;
+    d->node_affinity = *affinity;
+
+out:
+    spin_unlock(&d->node_affinity_lock);
+
+    domain_update_node_affinity(d);
+
+    return 0;
+}
+
+
 struct domain *get_domain_by_id(domid_t dom)
 {
     struct domain *d;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 37532c2..6bd8efd 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -560,6 +560,23 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
     break;
 
+    case XEN_DOMCTL_setnodeaffinity:
+    {
+        nodemask_t new_affinity;
+
+        ret = xenctl_bitmap_to_nodemask(&new_affinity,
+                                        &op->u.nodeaffinity.nodemap);
+        if ( !ret )
+            ret = domain_set_node_affinity(d, &new_affinity);
+    }
+    break;
+    case XEN_DOMCTL_getnodeaffinity:
+    {
+        ret = nodemask_to_xenctl_bitmap(&op->u.nodeaffinity.nodemap,
+                                        &d->node_affinity);
+    }
+    break;
+
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index e9ef45f..5072133 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -218,6 +218,14 @@ static void cpuset_print(char *set, int size, const cpumask_t *mask)
     *set++ = '\0';
 }
 
+static void nodeset_print(char *set, int size, const nodemask_t *mask)
+{
+    *set++ = '[';
+    set += nodelist_scnprintf(set, size-2, mask);
+    *set++ = ']';
+    *set++ = '\0';
+}
+
 static void periodic_timer_print(char *str, int size, uint64_t period)
 {
     if ( period == 0 )
@@ -273,6 +281,9 @@ static void dump_domains(unsigned char key)
 
         dump_pageframe_info(d);
                
+        nodeset_print(tmpstr, sizeof(tmpstr), &d->node_affinity);
+        printk("NODE affinity for domain %d: %s\n", d->domain_id, tmpstr);
+
         printk("VCPU information and callbacks for domain %u:\n",
                d->domain_id);
         for_each_vcpu ( d, v )
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index be0b4b0..3188310 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -261,17 +261,50 @@ __runq_remove(struct csched_vcpu *svc)
     list_del_init(&svc->runq_elem);
 }
 
+/*
+ * Translates node-affinity mask into a cpumask, so that we can use it during
+ * actual scheduling. That of course will contain all the cpus from all the
+ * set nodes in the original node-affinity mask.
+ *
+ * Note that any serialization needed to access mask safely is complete
+ * responsibility of the caller of this function/hook.
+ */
+static void csched_set_node_affinity(
+    const struct scheduler *ops,
+    struct domain *d,
+    nodemask_t *mask)
+{
+    struct csched_dom *sdom;
+    int node;
+
+    /* Skip idle domain since it doesn't even have a node_affinity_cpumask */
+    if ( unlikely(is_idle_domain(d)) )
+        return;
+
+    sdom = CSCHED_DOM(d);
+    cpumask_clear(sdom->node_affinity_cpumask);
+    for_each_node_mask( node, *mask )
+        cpumask_or(sdom->node_affinity_cpumask, sdom->node_affinity_cpumask,
+                   &node_to_cpumask(node));
+}
+
 #define for_each_csched_balance_step(step) \
     for ( (step) = 0; (step) <= CSCHED_BALANCE_CPU_AFFINITY; (step)++ )
 
 
 /*
  * vcpu-affinity balancing is always necessary and must never be skipped.
- * OTOH, if a domain's node-affinity spans all the nodes, we can safely
- * avoid dealing with node-affinity entirely.
+ * OTOH, if a domain's node-affinity is said to be automatically computed
+ * (or if it just spans all the nodes), we can safely avoid dealing with
+ * node-affinity entirely. Ah, node-affinity is also deemed meaningless
+ * in case it has empty intersection with the vcpu's vcpu-affinity, as it
+ * would mean trying to schedule it on _no_ pcpu!
  */
-#define __vcpu_has_node_affinity(vc) \
-    ( !cpumask_full(CSCHED_DOM(vc->domain)->node_affinity_cpumask) )
+#define __vcpu_has_node_affinity(vc)                                          \
+    ( !(cpumask_full(CSCHED_DOM(vc->domain)->node_affinity_cpumask)           \
+        || !cpumask_intersects(vc->cpu_affinity,                              \
+                               CSCHED_DOM(vc->domain)->node_affinity_cpumask) \
+        || vc->domain->auto_node_affinity == 1) )
 
 /*
  * Each csched-balance step uses its own cpumask. This function determines
@@ -284,8 +317,13 @@ static void
 csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
 {
     if ( step == CSCHED_BALANCE_NODE_AFFINITY )
+    {
         cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
                     vc->cpu_affinity);
+
+        if ( unlikely(cpumask_empty(mask)) )
+            cpumask_copy(mask, vc->cpu_affinity);
+    }
     else /* step == CSCHED_BALANCE_CPU_AFFINITY */
         cpumask_copy(mask, vc->cpu_affinity);
 }
@@ -1898,6 +1936,8 @@ const struct scheduler sched_credit_def = {
     .adjust         = csched_dom_cntl,
     .adjust_global  = csched_sys_cntl,
 
+    .set_node_affinity  = csched_set_node_affinity,
+
     .pick_cpu       = csched_cpu_pick,
     .do_schedule    = csched_schedule,
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 7364ff8..c1cd3d0 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -638,6 +638,11 @@ int cpu_disable_scheduler(unsigned int cpu)
     return ret;
 }
 
+void sched_set_node_affinity(struct domain *d, nodemask_t *mask)
+{
+    SCHED_OP(DOM2OP(d), set_node_affinity, d, mask);
+}
+
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
     cpumask_t online_affinity;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 9f5ed48..4c5b2bb 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -280,6 +280,16 @@ typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
 
 
+/* Get/set the NUMA node(s) with which the guest has affinity with. */
+/* XEN_DOMCTL_setnodeaffinity */
+/* XEN_DOMCTL_getnodeaffinity */
+struct xen_domctl_nodeaffinity {
+    struct xenctl_bitmap nodemap;/* IN */
+};
+typedef struct xen_domctl_nodeaffinity xen_domctl_nodeaffinity_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_nodeaffinity_t);
+
+
 /* Get/set which physical cpus a vcpu can execute on. */
 /* XEN_DOMCTL_setvcpuaffinity */
 /* XEN_DOMCTL_getvcpuaffinity */
@@ -908,6 +918,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
 #define XEN_DOMCTL_set_broken_page_p2m           67
+#define XEN_DOMCTL_setnodeaffinity               68
+#define XEN_DOMCTL_getnodeaffinity               69
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -921,6 +933,7 @@ struct xen_domctl {
         struct xen_domctl_getpageframeinfo  getpageframeinfo;
         struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
         struct xen_domctl_getpageframeinfo3 getpageframeinfo3;
+        struct xen_domctl_nodeaffinity      nodeaffinity;
         struct xen_domctl_vcpuaffinity      vcpuaffinity;
         struct xen_domctl_shadow_op         shadow_op;
         struct xen_domctl_max_mem           max_mem;
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 1b86016..2a90dc1 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -8,8 +8,9 @@
  * See detailed comments in the file linux/bitmap.h describing the
  * data type on which these nodemasks are based.
  *
- * For details of nodemask_scnprintf() and nodemask_parse(),
- * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c.
+ * For details of nodemask_scnprintf(), nodelist_scnpintf() and
+ * nodemask_parse(), see bitmap_scnprintf() and bitmap_parse()
+ * in lib/bitmap.c.
  *
  * The available nodemask operations are:
  *
@@ -50,6 +51,7 @@
  * unsigned long *nodes_addr(mask)	Array of unsigned long's in mask
  *
  * int nodemask_scnprintf(buf, len, mask) Format nodemask for printing
+ * int nodelist_scnprintf(buf, len, mask) Format nodemask as a list for printing
  * int nodemask_parse(ubuf, ulen, mask)	Parse ascii string as nodemask
  *
  * for_each_node_mask(node, mask)	for-loop node over mask
@@ -292,6 +294,14 @@ static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits)
 
 #define nodes_addr(src) ((src).bits)
 
+#define nodelist_scnprintf(buf, len, src) \
+			__nodelist_scnprintf((buf), (len), (src), MAX_NUMNODES)
+static inline int __nodelist_scnprintf(char *buf, int len,
+					const nodemask_t *srcp, int nbits)
+{
+	return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
+}
+
 #if 0
 #define nodemask_scnprintf(buf, len, src) \
 			__nodemask_scnprintf((buf), (len), &(src), MAX_NUMNODES)
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 9ace22c..2023ea3 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -184,6 +184,8 @@ struct scheduler {
                                     struct xen_domctl_scheduler_op *);
     int          (*adjust_global)  (const struct scheduler *,
                                     struct xen_sysctl_scheduler_op *);
+    void         (*set_node_affinity) (const struct scheduler *,
+                                       struct domain *, nodemask_t *);
     void         (*dump_settings)  (const struct scheduler *);
     void         (*dump_cpu_state) (const struct scheduler *, int);
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index d15d567..ad971d2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -288,6 +288,8 @@ struct domain
     /* Does this guest need iommu mappings? */
     bool_t           need_iommu;
 #endif
+    /* is node-affinity automatically computed? */
+    bool_t           auto_node_affinity;
     /* Is this guest fully privileged (aka dom0)? */
     bool_t           is_privileged;
     /* Which guest this guest has privileges on */
@@ -365,7 +367,10 @@ struct domain
     /* Various mem_events */
     struct mem_event_per_domain *mem_event;
 
-    /* Currently computed from union of all vcpu cpu-affinity masks. */
+    /*
+     * Can be specified by the user. If that is not the case, it is
+     * computed from the union of all the vcpu cpu-affinity masks.
+     */
     nodemask_t node_affinity;
     unsigned int last_alloc_node;
     spinlock_t node_affinity_lock;
@@ -435,6 +440,7 @@ static inline void get_knownalive_domain(struct domain *d)
     ASSERT(!(atomic_read(&d->refcnt) & DOMAIN_DESTROYED));
 }
 
+int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity);
 void domain_update_node_affinity(struct domain *d);
 
 struct domain *domain_create(
@@ -555,6 +561,7 @@ void sched_destroy_domain(struct domain *d);
 int sched_move_domain(struct domain *d, struct cpupool *c);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
+void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 29a78dd..247c8a3 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -611,10 +611,12 @@ static int flask_domctl(struct domain *d, int cmd)
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
 
     case XEN_DOMCTL_setvcpuaffinity:
-        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+    case XEN_DOMCTL_setnodeaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETAFFINITY);
 
     case XEN_DOMCTL_getvcpuaffinity:
-        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+    case XEN_DOMCTL_getnodeaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETAFFINITY);
 
     case XEN_DOMCTL_resumedomain:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 36cbacf..fdfc502 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -104,9 +104,11 @@ class domain
 # XEN_DOMCTL_destroydomain
     destroy
 # XEN_DOMCTL_setvcpuaffinity
-    setvcpuaffinity
+# XEN_DOMCTL_setnodeaffinity
+    setaffinity
 # XEN_DOMCTL_getvcpuaffinity
-    getvcpuaffinity
+# XEN_DOMCTL_getnodeaffinity
+    getaffinity
 # XEN_DOMCTL_scheduler_op with XEN_DOMCTL_SCHEDOP_getinfo
     getscheduler
 # XEN_DOMCTL_getdomaininfo, XEN_SYSCTL_getdomaininfolist
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:55:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCi-0006JA-Ro; Wed, 17 Apr 2013 23:55:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCg-0006If-OB
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:55 +0000
Received: from [85.158.139.83:6473] by server-2.bemta-5.messagelabs.com id
	64/D3-23989-A863F615; Wed, 17 Apr 2013 23:55:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1366242949!21392790!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.5 required=7.0 tests=BODY_RANDOM_LONG,LONGWORDS
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4063 invoked from network); 17 Apr 2013 23:55:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:55:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCb-00028P-Kk
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCb-0007WG-Jb
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:49 +0000
Date: Wed, 17 Apr 2013 23:55:49 +0000
Message-Id: <E1UScCb-0007WG-Jb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: allow for explicitly specifying
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b5b79a12c41b5e76af9d47551027b56f210d9029
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:32 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    xen: allow for explicitly specifying node-affinity
    
    Make it possible to pass the node-affinity of a domain to the hypervisor
    from the upper layers, instead of always being computed automatically.
    
    Note that this also required generalizing the Flask hooks for setting
    and getting the affinity, so that they now deal with both vcpu and
    node affinity.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 tools/flask/policy/policy/mls                |    4 +-
 tools/flask/policy/policy/modules/xen/xen.if |    6 +-
 tools/flask/policy/policy/modules/xen/xen.te |    2 +-
 xen/common/domain.c                          |   60 ++++++++++++++++++++++++--
 xen/common/domctl.c                          |   17 +++++++
 xen/common/keyhandler.c                      |   11 +++++
 xen/common/sched_credit.c                    |   48 +++++++++++++++++++--
 xen/common/schedule.c                        |    5 ++
 xen/include/public/domctl.h                  |   13 ++++++
 xen/include/xen/nodemask.h                   |   14 +++++-
 xen/include/xen/sched-if.h                   |    2 +
 xen/include/xen/sched.h                      |    9 +++-
 xen/xsm/flask/hooks.c                        |    6 ++-
 xen/xsm/flask/policy/access_vectors          |    6 ++-
 14 files changed, 182 insertions(+), 21 deletions(-)

diff --git a/tools/flask/policy/policy/mls b/tools/flask/policy/policy/mls
index a3dde70..9290a76 100644
--- a/tools/flask/policy/policy/mls
+++ b/tools/flask/policy/policy/mls
@@ -70,11 +70,11 @@ mlsconstrain domain transition
 	(( h1 dom h2 ) and (( l1 eq l2 ) or (t1 == mls_priv)));
 
 # all the domain "read" ops
-mlsconstrain domain { getvcpuaffinity getdomaininfo getvcpuinfo getvcpucontext getaddrsize getextvcpucontext }
+mlsconstrain domain { getaffinity getdomaininfo getvcpuinfo getvcpucontext getaddrsize getextvcpucontext }
 	((l1 dom l2) or (t1 == mls_priv));
 
 # all the domain "write" ops
-mlsconstrain domain { setvcpucontext pause unpause resume create max_vcpus destroy setvcpuaffinity scheduler setdomainmaxmem setdomainhandle setdebugging hypercall settime set_target shutdown setaddrsize trigger setextvcpucontext }
+mlsconstrain domain { setvcpucontext pause unpause resume create max_vcpus destroy setaffinity scheduler setdomainmaxmem setdomainhandle setdebugging hypercall settime set_target shutdown setaddrsize trigger setextvcpucontext }
 	((l1 eq l2) or (t1 == mls_priv));
 
 # This is incomplete - similar constraints must be written for all classes
diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 2ce2212..18647c9 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -48,7 +48,7 @@ define(`create_domain_common', `
 	allow $1 $2:domain { create max_vcpus setdomainmaxmem setaddrsize
 			getdomaininfo hypercall setvcpucontext setextvcpucontext
 			getscheduler getvcpuinfo getvcpuextstate getaddrsize
-			getvcpuaffinity setvcpuaffinity };
+			getaffinity setaffinity };
 	allow $1 $2:domain2 { set_cpuid settsc setscheduler };
 	allow $1 $2:security check_context;
 	allow $1 $2:shadow enable;
@@ -77,9 +77,9 @@ define(`create_domain_build_label', `
 # manage_domain(priv, target)
 #   Allow managing a running domain
 define(`manage_domain', `
-	allow $1 $2:domain { getdomaininfo getvcpuinfo getvcpuaffinity
+	allow $1 $2:domain { getdomaininfo getvcpuinfo getaffinity
 			getaddrsize pause unpause trigger shutdown destroy
-			setvcpuaffinity setdomainmaxmem getscheduler };
+			setaffinity setdomainmaxmem getscheduler };
 ')
 
 # migrate_domain_out(priv, target)
diff --git a/tools/flask/policy/policy/modules/xen/xen.te b/tools/flask/policy/policy/modules/xen/xen.te
index 454e27e..c89ce28 100644
--- a/tools/flask/policy/policy/modules/xen/xen.te
+++ b/tools/flask/policy/policy/modules/xen/xen.te
@@ -69,7 +69,7 @@ allow dom0_t xen_t:mmu memorymap;
 # Allow dom0 to use these domctls on itself. For domctls acting on other
 # domains, see the definitions of create_domain and manage_domain.
 allow dom0_t dom0_t:domain {
-	setvcpucontext max_vcpus setvcpuaffinity getvcpuaffinity getscheduler
+	setvcpucontext max_vcpus setaffinity getaffinity getscheduler
 	getdomaininfo getvcpuinfo getvcpucontext setdomainmaxmem setdomainhandle
 	setdebugging hypercall settime setaddrsize getaddrsize trigger
 	getextvcpucontext setextvcpucontext getvcpuextstate setvcpuextstate
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 590548e..ce45d66 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -224,6 +224,7 @@ struct domain *domain_create(
 
     spin_lock_init(&d->node_affinity_lock);
     d->node_affinity = NODE_MASK_ALL;
+    d->auto_node_affinity = 1;
 
     spin_lock_init(&d->shutdown_lock);
     d->shutdown_code = -1;
@@ -364,11 +365,32 @@ void domain_update_node_affinity(struct domain *d)
         cpumask_or(cpumask, cpumask, online_affinity);
     }
 
-    for_each_online_node ( node )
-        if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
-            node_set(node, nodemask);
+    if ( d->auto_node_affinity )
+    {
+        /* Node-affinity is automaically computed from all vcpu-affinities */
+        for_each_online_node ( node )
+            if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
+                node_set(node, nodemask);
+
+        d->node_affinity = nodemask;
+    }
+    else
+    {
+        /* Node-affinity is provided by someone else, just filter out cpus
+         * that are either offline or not in the affinity of any vcpus. */
+        nodemask = d->node_affinity;
+        for_each_node_mask ( node, d->node_affinity )
+            if ( !cpumask_intersects(&node_to_cpumask(node), cpumask) )
+                node_clear(node, nodemask);//d->node_affinity);
+
+        /* Avoid loosing track of node-affinity because of a bad
+         * vcpu-affinity has been specified. */
+        if ( !nodes_empty(nodemask) )
+            d->node_affinity = nodemask;
+    }
+
+    sched_set_node_affinity(d, &d->node_affinity);
 
-    d->node_affinity = nodemask;
     spin_unlock(&d->node_affinity_lock);
 
     free_cpumask_var(online_affinity);
@@ -376,6 +398,36 @@ void domain_update_node_affinity(struct domain *d)
 }
 
 
+int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity)
+{
+    /* Being affine with no nodes is just wrong */
+    if ( nodes_empty(*affinity) )
+        return -EINVAL;
+
+    spin_lock(&d->node_affinity_lock);
+
+    /*
+     * Being/becoming explicitly affine to all nodes is not particularly
+     * useful. Let's take it as the `reset node affinity` command.
+     */
+    if ( nodes_full(*affinity) )
+    {
+        d->auto_node_affinity = 1;
+        goto out;
+    }
+
+    d->auto_node_affinity = 0;
+    d->node_affinity = *affinity;
+
+out:
+    spin_unlock(&d->node_affinity_lock);
+
+    domain_update_node_affinity(d);
+
+    return 0;
+}
+
+
 struct domain *get_domain_by_id(domid_t dom)
 {
     struct domain *d;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 37532c2..6bd8efd 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -560,6 +560,23 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     }
     break;
 
+    case XEN_DOMCTL_setnodeaffinity:
+    {
+        nodemask_t new_affinity;
+
+        ret = xenctl_bitmap_to_nodemask(&new_affinity,
+                                        &op->u.nodeaffinity.nodemap);
+        if ( !ret )
+            ret = domain_set_node_affinity(d, &new_affinity);
+    }
+    break;
+    case XEN_DOMCTL_getnodeaffinity:
+    {
+        ret = nodemask_to_xenctl_bitmap(&op->u.nodeaffinity.nodemap,
+                                        &d->node_affinity);
+    }
+    break;
+
     case XEN_DOMCTL_setvcpuaffinity:
     case XEN_DOMCTL_getvcpuaffinity:
     {
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index e9ef45f..5072133 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -218,6 +218,14 @@ static void cpuset_print(char *set, int size, const cpumask_t *mask)
     *set++ = '\0';
 }
 
+static void nodeset_print(char *set, int size, const nodemask_t *mask)
+{
+    *set++ = '[';
+    set += nodelist_scnprintf(set, size-2, mask);
+    *set++ = ']';
+    *set++ = '\0';
+}
+
 static void periodic_timer_print(char *str, int size, uint64_t period)
 {
     if ( period == 0 )
@@ -273,6 +281,9 @@ static void dump_domains(unsigned char key)
 
         dump_pageframe_info(d);
                
+        nodeset_print(tmpstr, sizeof(tmpstr), &d->node_affinity);
+        printk("NODE affinity for domain %d: %s\n", d->domain_id, tmpstr);
+
         printk("VCPU information and callbacks for domain %u:\n",
                d->domain_id);
         for_each_vcpu ( d, v )
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index be0b4b0..3188310 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -261,17 +261,50 @@ __runq_remove(struct csched_vcpu *svc)
     list_del_init(&svc->runq_elem);
 }
 
+/*
+ * Translates node-affinity mask into a cpumask, so that we can use it during
+ * actual scheduling. That of course will contain all the cpus from all the
+ * set nodes in the original node-affinity mask.
+ *
+ * Note that any serialization needed to access mask safely is complete
+ * responsibility of the caller of this function/hook.
+ */
+static void csched_set_node_affinity(
+    const struct scheduler *ops,
+    struct domain *d,
+    nodemask_t *mask)
+{
+    struct csched_dom *sdom;
+    int node;
+
+    /* Skip idle domain since it doesn't even have a node_affinity_cpumask */
+    if ( unlikely(is_idle_domain(d)) )
+        return;
+
+    sdom = CSCHED_DOM(d);
+    cpumask_clear(sdom->node_affinity_cpumask);
+    for_each_node_mask( node, *mask )
+        cpumask_or(sdom->node_affinity_cpumask, sdom->node_affinity_cpumask,
+                   &node_to_cpumask(node));
+}
+
 #define for_each_csched_balance_step(step) \
     for ( (step) = 0; (step) <= CSCHED_BALANCE_CPU_AFFINITY; (step)++ )
 
 
 /*
  * vcpu-affinity balancing is always necessary and must never be skipped.
- * OTOH, if a domain's node-affinity spans all the nodes, we can safely
- * avoid dealing with node-affinity entirely.
+ * OTOH, if a domain's node-affinity is said to be automatically computed
+ * (or if it just spans all the nodes), we can safely avoid dealing with
+ * node-affinity entirely. Ah, node-affinity is also deemed meaningless
+ * in case it has empty intersection with the vcpu's vcpu-affinity, as it
+ * would mean trying to schedule it on _no_ pcpu!
  */
-#define __vcpu_has_node_affinity(vc) \
-    ( !cpumask_full(CSCHED_DOM(vc->domain)->node_affinity_cpumask) )
+#define __vcpu_has_node_affinity(vc)                                          \
+    ( !(cpumask_full(CSCHED_DOM(vc->domain)->node_affinity_cpumask)           \
+        || !cpumask_intersects(vc->cpu_affinity,                              \
+                               CSCHED_DOM(vc->domain)->node_affinity_cpumask) \
+        || vc->domain->auto_node_affinity == 1) )
 
 /*
  * Each csched-balance step uses its own cpumask. This function determines
@@ -284,8 +317,13 @@ static void
 csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
 {
     if ( step == CSCHED_BALANCE_NODE_AFFINITY )
+    {
         cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
                     vc->cpu_affinity);
+
+        if ( unlikely(cpumask_empty(mask)) )
+            cpumask_copy(mask, vc->cpu_affinity);
+    }
     else /* step == CSCHED_BALANCE_CPU_AFFINITY */
         cpumask_copy(mask, vc->cpu_affinity);
 }
@@ -1898,6 +1936,8 @@ const struct scheduler sched_credit_def = {
     .adjust         = csched_dom_cntl,
     .adjust_global  = csched_sys_cntl,
 
+    .set_node_affinity  = csched_set_node_affinity,
+
     .pick_cpu       = csched_cpu_pick,
     .do_schedule    = csched_schedule,
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 7364ff8..c1cd3d0 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -638,6 +638,11 @@ int cpu_disable_scheduler(unsigned int cpu)
     return ret;
 }
 
+void sched_set_node_affinity(struct domain *d, nodemask_t *mask)
+{
+    SCHED_OP(DOM2OP(d), set_node_affinity, d, mask);
+}
+
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
     cpumask_t online_affinity;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 9f5ed48..4c5b2bb 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -280,6 +280,16 @@ typedef struct xen_domctl_getvcpuinfo xen_domctl_getvcpuinfo_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_getvcpuinfo_t);
 
 
+/* Get/set the NUMA node(s) with which the guest has affinity with. */
+/* XEN_DOMCTL_setnodeaffinity */
+/* XEN_DOMCTL_getnodeaffinity */
+struct xen_domctl_nodeaffinity {
+    struct xenctl_bitmap nodemap;/* IN */
+};
+typedef struct xen_domctl_nodeaffinity xen_domctl_nodeaffinity_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_nodeaffinity_t);
+
+
 /* Get/set which physical cpus a vcpu can execute on. */
 /* XEN_DOMCTL_setvcpuaffinity */
 /* XEN_DOMCTL_getvcpuaffinity */
@@ -908,6 +918,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_audit_p2m                     65
 #define XEN_DOMCTL_set_virq_handler              66
 #define XEN_DOMCTL_set_broken_page_p2m           67
+#define XEN_DOMCTL_setnodeaffinity               68
+#define XEN_DOMCTL_getnodeaffinity               69
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -921,6 +933,7 @@ struct xen_domctl {
         struct xen_domctl_getpageframeinfo  getpageframeinfo;
         struct xen_domctl_getpageframeinfo2 getpageframeinfo2;
         struct xen_domctl_getpageframeinfo3 getpageframeinfo3;
+        struct xen_domctl_nodeaffinity      nodeaffinity;
         struct xen_domctl_vcpuaffinity      vcpuaffinity;
         struct xen_domctl_shadow_op         shadow_op;
         struct xen_domctl_max_mem           max_mem;
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index 1b86016..2a90dc1 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -8,8 +8,9 @@
  * See detailed comments in the file linux/bitmap.h describing the
  * data type on which these nodemasks are based.
  *
- * For details of nodemask_scnprintf() and nodemask_parse(),
- * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c.
+ * For details of nodemask_scnprintf(), nodelist_scnpintf() and
+ * nodemask_parse(), see bitmap_scnprintf() and bitmap_parse()
+ * in lib/bitmap.c.
  *
  * The available nodemask operations are:
  *
@@ -50,6 +51,7 @@
  * unsigned long *nodes_addr(mask)	Array of unsigned long's in mask
  *
  * int nodemask_scnprintf(buf, len, mask) Format nodemask for printing
+ * int nodelist_scnprintf(buf, len, mask) Format nodemask as a list for printing
  * int nodemask_parse(ubuf, ulen, mask)	Parse ascii string as nodemask
  *
  * for_each_node_mask(node, mask)	for-loop node over mask
@@ -292,6 +294,14 @@ static inline int __cycle_node(int n, const nodemask_t *maskp, int nbits)
 
 #define nodes_addr(src) ((src).bits)
 
+#define nodelist_scnprintf(buf, len, src) \
+			__nodelist_scnprintf((buf), (len), (src), MAX_NUMNODES)
+static inline int __nodelist_scnprintf(char *buf, int len,
+					const nodemask_t *srcp, int nbits)
+{
+	return bitmap_scnlistprintf(buf, len, srcp->bits, nbits);
+}
+
 #if 0
 #define nodemask_scnprintf(buf, len, src) \
 			__nodemask_scnprintf((buf), (len), &(src), MAX_NUMNODES)
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 9ace22c..2023ea3 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -184,6 +184,8 @@ struct scheduler {
                                     struct xen_domctl_scheduler_op *);
     int          (*adjust_global)  (const struct scheduler *,
                                     struct xen_sysctl_scheduler_op *);
+    void         (*set_node_affinity) (const struct scheduler *,
+                                       struct domain *, nodemask_t *);
     void         (*dump_settings)  (const struct scheduler *);
     void         (*dump_cpu_state) (const struct scheduler *, int);
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index d15d567..ad971d2 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -288,6 +288,8 @@ struct domain
     /* Does this guest need iommu mappings? */
     bool_t           need_iommu;
 #endif
+    /* is node-affinity automatically computed? */
+    bool_t           auto_node_affinity;
     /* Is this guest fully privileged (aka dom0)? */
     bool_t           is_privileged;
     /* Which guest this guest has privileges on */
@@ -365,7 +367,10 @@ struct domain
     /* Various mem_events */
     struct mem_event_per_domain *mem_event;
 
-    /* Currently computed from union of all vcpu cpu-affinity masks. */
+    /*
+     * Can be specified by the user. If that is not the case, it is
+     * computed from the union of all the vcpu cpu-affinity masks.
+     */
     nodemask_t node_affinity;
     unsigned int last_alloc_node;
     spinlock_t node_affinity_lock;
@@ -435,6 +440,7 @@ static inline void get_knownalive_domain(struct domain *d)
     ASSERT(!(atomic_read(&d->refcnt) & DOMAIN_DESTROYED));
 }
 
+int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity);
 void domain_update_node_affinity(struct domain *d);
 
 struct domain *domain_create(
@@ -555,6 +561,7 @@ void sched_destroy_domain(struct domain *d);
 int sched_move_domain(struct domain *d, struct cpupool *c);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
+void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 29a78dd..247c8a3 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -611,10 +611,12 @@ static int flask_domctl(struct domain *d, int cmd)
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__UNPAUSE);
 
     case XEN_DOMCTL_setvcpuaffinity:
-        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETVCPUAFFINITY);
+    case XEN_DOMCTL_setnodeaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETAFFINITY);
 
     case XEN_DOMCTL_getvcpuaffinity:
-        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETVCPUAFFINITY);
+    case XEN_DOMCTL_getnodeaffinity:
+        return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETAFFINITY);
 
     case XEN_DOMCTL_resumedomain:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__RESUME);
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 36cbacf..fdfc502 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -104,9 +104,11 @@ class domain
 # XEN_DOMCTL_destroydomain
     destroy
 # XEN_DOMCTL_setvcpuaffinity
-    setvcpuaffinity
+# XEN_DOMCTL_setnodeaffinity
+    setaffinity
 # XEN_DOMCTL_getvcpuaffinity
-    getvcpuaffinity
+# XEN_DOMCTL_getnodeaffinity
+    getaffinity
 # XEN_DOMCTL_scheduler_op with XEN_DOMCTL_SCHEDOP_getinfo
     getscheduler
 # XEN_DOMCTL_getdomaininfo, XEN_SYSCTL_getdomaininfolist
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCr-0006L4-1X; Wed, 17 Apr 2013 23:56:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCo-0006KL-Uh
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:03 +0000
Received: from [85.158.137.99:57577] by server-6.bemta-3.messagelabs.com id
	FF/1D-11048-2963F615; Wed, 17 Apr 2013 23:56:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1366242959!17899184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28565 invoked from network); 17 Apr 2013 23:56:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCl-00028Y-Q2
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCl-0007Wc-O9
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:59 +0000
Date: Wed, 17 Apr 2013 23:55:59 +0000
Message-Id: <E1UScCl-0007Wc-O9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: allow for explicitly specifying
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 02ec52272f08f9beb44454829046d7761dc0e655
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:33 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    libxc: allow for explicitly specifying node-affinity
    
    By providing the proper get/set interface and wiring them
    to the new domctl-s from the previous commit.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxc/xc_domain.c |   77 +++++++++++++++++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h   |   26 ++++++++++++++++
 2 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 7842519..bb71cca 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -110,6 +110,83 @@ int xc_domain_shutdown(xc_interface *xch,
 }
 
 
+int xc_domain_node_setaffinity(xc_interface *xch,
+                               uint32_t domid,
+                               xc_nodemap_t nodemap)
+{
+    DECLARE_DOMCTL;
+    DECLARE_HYPERCALL_BUFFER(uint8_t, local);
+    int ret = -1;
+    int nodesize;
+
+    nodesize = xc_get_nodemap_size(xch);
+    if (!nodesize)
+    {
+        PERROR("Could not get number of nodes");
+        goto out;
+    }
+
+    local = xc_hypercall_buffer_alloc(xch, local, nodesize);
+    if ( local == NULL )
+    {
+        PERROR("Could not allocate memory for setnodeaffinity domctl hypercall");
+        goto out;
+    }
+
+    domctl.cmd = XEN_DOMCTL_setnodeaffinity;
+    domctl.domain = (domid_t)domid;
+
+    memcpy(local, nodemap, nodesize);
+    set_xen_guest_handle(domctl.u.nodeaffinity.nodemap.bitmap, local);
+    domctl.u.nodeaffinity.nodemap.nr_bits = nodesize * 8;
+
+    ret = do_domctl(xch, &domctl);
+
+    xc_hypercall_buffer_free(xch, local);
+
+ out:
+    return ret;
+}
+
+int xc_domain_node_getaffinity(xc_interface *xch,
+                               uint32_t domid,
+                               xc_nodemap_t nodemap)
+{
+    DECLARE_DOMCTL;
+    DECLARE_HYPERCALL_BUFFER(uint8_t, local);
+    int ret = -1;
+    int nodesize;
+
+    nodesize = xc_get_nodemap_size(xch);
+    if (!nodesize)
+    {
+        PERROR("Could not get number of nodes");
+        goto out;
+    }
+
+    local = xc_hypercall_buffer_alloc(xch, local, nodesize);
+    if ( local == NULL )
+    {
+        PERROR("Could not allocate memory for getnodeaffinity domctl hypercall");
+        goto out;
+    }
+
+    domctl.cmd = XEN_DOMCTL_getnodeaffinity;
+    domctl.domain = (domid_t)domid;
+
+    set_xen_guest_handle(domctl.u.nodeaffinity.nodemap.bitmap, local);
+    domctl.u.nodeaffinity.nodemap.nr_bits = nodesize * 8;
+
+    ret = do_domctl(xch, &domctl);
+
+    memcpy(nodemap, local, nodesize);
+
+    xc_hypercall_buffer_free(xch, local);
+
+ out:
+    return ret;
+}
+
 int xc_vcpu_setaffinity(xc_interface *xch,
                         uint32_t domid,
                         int vcpu,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index d3185c6..54a2d5a 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -526,6 +526,32 @@ int xc_watchdog(xc_interface *xch,
 		uint32_t id,
 		uint32_t timeout);
 
+/**
+ * This function explicitly sets the host NUMA nodes the domain will
+ * have affinity with.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id one wants to set the affinity of.
+ * @parm nodemap the map of the affine nodes.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_domain_node_setaffinity(xc_interface *xch,
+                               uint32_t domind,
+                               xc_nodemap_t nodemap);
+
+/**
+ * This function retrieves the host NUMA nodes the domain has
+ * affinity with.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id one wants to get the node affinity of.
+ * @parm nodemap the map of the affine nodes.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_domain_node_getaffinity(xc_interface *xch,
+                               uint32_t domind,
+                               xc_nodemap_t nodemap);
+
 int xc_vcpu_setaffinity(xc_interface *xch,
                         uint32_t domid,
                         int vcpu,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScCr-0006L4-1X; Wed, 17 Apr 2013 23:56:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCo-0006KL-Uh
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:03 +0000
Received: from [85.158.137.99:57577] by server-6.bemta-3.messagelabs.com id
	FF/1D-11048-2963F615; Wed, 17 Apr 2013 23:56:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1366242959!17899184!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28565 invoked from network); 17 Apr 2013 23:56:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCl-00028Y-Q2
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCl-0007Wc-O9
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:55:59 +0000
Date: Wed, 17 Apr 2013 23:55:59 +0000
Message-Id: <E1UScCl-0007Wc-O9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: allow for explicitly specifying
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 02ec52272f08f9beb44454829046d7761dc0e655
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:33 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:14 2013 +0100

    libxc: allow for explicitly specifying node-affinity
    
    By providing the proper get/set interface and wiring them
    to the new domctl-s from the previous commit.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 tools/libxc/xc_domain.c |   77 +++++++++++++++++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h   |   26 ++++++++++++++++
 2 files changed, 103 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 7842519..bb71cca 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -110,6 +110,83 @@ int xc_domain_shutdown(xc_interface *xch,
 }
 
 
+int xc_domain_node_setaffinity(xc_interface *xch,
+                               uint32_t domid,
+                               xc_nodemap_t nodemap)
+{
+    DECLARE_DOMCTL;
+    DECLARE_HYPERCALL_BUFFER(uint8_t, local);
+    int ret = -1;
+    int nodesize;
+
+    nodesize = xc_get_nodemap_size(xch);
+    if (!nodesize)
+    {
+        PERROR("Could not get number of nodes");
+        goto out;
+    }
+
+    local = xc_hypercall_buffer_alloc(xch, local, nodesize);
+    if ( local == NULL )
+    {
+        PERROR("Could not allocate memory for setnodeaffinity domctl hypercall");
+        goto out;
+    }
+
+    domctl.cmd = XEN_DOMCTL_setnodeaffinity;
+    domctl.domain = (domid_t)domid;
+
+    memcpy(local, nodemap, nodesize);
+    set_xen_guest_handle(domctl.u.nodeaffinity.nodemap.bitmap, local);
+    domctl.u.nodeaffinity.nodemap.nr_bits = nodesize * 8;
+
+    ret = do_domctl(xch, &domctl);
+
+    xc_hypercall_buffer_free(xch, local);
+
+ out:
+    return ret;
+}
+
+int xc_domain_node_getaffinity(xc_interface *xch,
+                               uint32_t domid,
+                               xc_nodemap_t nodemap)
+{
+    DECLARE_DOMCTL;
+    DECLARE_HYPERCALL_BUFFER(uint8_t, local);
+    int ret = -1;
+    int nodesize;
+
+    nodesize = xc_get_nodemap_size(xch);
+    if (!nodesize)
+    {
+        PERROR("Could not get number of nodes");
+        goto out;
+    }
+
+    local = xc_hypercall_buffer_alloc(xch, local, nodesize);
+    if ( local == NULL )
+    {
+        PERROR("Could not allocate memory for getnodeaffinity domctl hypercall");
+        goto out;
+    }
+
+    domctl.cmd = XEN_DOMCTL_getnodeaffinity;
+    domctl.domain = (domid_t)domid;
+
+    set_xen_guest_handle(domctl.u.nodeaffinity.nodemap.bitmap, local);
+    domctl.u.nodeaffinity.nodemap.nr_bits = nodesize * 8;
+
+    ret = do_domctl(xch, &domctl);
+
+    memcpy(nodemap, local, nodesize);
+
+    xc_hypercall_buffer_free(xch, local);
+
+ out:
+    return ret;
+}
+
 int xc_vcpu_setaffinity(xc_interface *xch,
                         uint32_t domid,
                         int vcpu,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index d3185c6..54a2d5a 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -526,6 +526,32 @@ int xc_watchdog(xc_interface *xch,
 		uint32_t id,
 		uint32_t timeout);
 
+/**
+ * This function explicitly sets the host NUMA nodes the domain will
+ * have affinity with.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id one wants to set the affinity of.
+ * @parm nodemap the map of the affine nodes.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_domain_node_setaffinity(xc_interface *xch,
+                               uint32_t domind,
+                               xc_nodemap_t nodemap);
+
+/**
+ * This function retrieves the host NUMA nodes the domain has
+ * affinity with.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id one wants to get the node affinity of.
+ * @parm nodemap the map of the affine nodes.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_domain_node_getaffinity(xc_interface *xch,
+                               uint32_t domind,
+                               xc_nodemap_t nodemap);
+
 int xc_vcpu_setaffinity(xc_interface *xch,
                         uint32_t domid,
                         int vcpu,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScD5-0006Nq-4d; Wed, 17 Apr 2013 23:56:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScD3-0006NN-Mm
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:17 +0000
Received: from [85.158.138.51:59434] by server-4.bemta-3.messagelabs.com id
	CA/A0-21470-C963F615; Wed, 17 Apr 2013 23:56:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1366242970!18922859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25757 invoked from network); 17 Apr 2013 23:56:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCv-000297-VV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCv-0007X4-UM
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:09 +0000
Date: Wed, 17 Apr 2013 23:56:09 +0000
Message-Id: <E1UScCv-0007X4-UM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: allow for explicitly specifying
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5d30c236a41e269313380bc584da9e7ddfa251d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:34 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    libxl: allow for explicitly specifying node-affinity
    
    By introducing a nodemap in libxl_domain_build_info and
    providing the get/set methods to deal with it.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c         |   20 ++++++++++++++++++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_create.c  |    6 ++++++
 tools/libxl/libxl_dom.c     |    1 +
 tools/libxl/libxl_types.idl |    1 +
 5 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 03a9782..3c6d71b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4183,6 +4183,26 @@ int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
+int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap)
+{
+    if (xc_domain_node_setaffinity(ctx->xch, domid, nodemap->map)) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting node affinity");
+        return ERROR_FAIL;
+    }
+    return 0;
+}
+
+int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap)
+{
+    if (xc_domain_node_getaffinity(ctx->xch, domid, nodemap->map)) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting node affinity");
+        return ERROR_FAIL;
+    }
+    return 0;
+}
+
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
 {
     GC_INIT(ctx);
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4922313..92f3f8e 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -75,6 +75,13 @@
 #define LIBXL_HAVE_FIRMWARE_PASSTHROUGH 1
 
 /*
+ * LIBXL_HAVE_DOMAIN_NODEAFFINITY indicates that a 'nodemap' field
+ * (of libxl_bitmap type) is present in libxl_domain_build_info,
+ * containing the node-affinity for the domain.
+ */
+#define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
@@ -884,6 +891,10 @@ int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
                            libxl_bitmap *cpumap);
 int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
                                unsigned int max_vcpus, libxl_bitmap *cpumap);
+int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
+int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap);
 
 libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ae72f21..19a56c0 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -191,6 +191,12 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
     libxl_defbool_setdefault(&b_info->numa_placement, true);
 
+    if (!b_info->nodemap.size) {
+        if (libxl_node_bitmap_alloc(CTX, &b_info->nodemap, 0))
+            return ERROR_FAIL;
+        libxl_bitmap_set_any(&b_info->nodemap);
+    }
+
     if (b_info->max_memkb == LIBXL_MEMKB_DEFAULT)
         b_info->max_memkb = 32 * 1024;
     if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 92a6628..0371bad 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -230,6 +230,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
         if (rc)
             return rc;
     }
+    libxl_domain_set_nodeaffinity(ctx, domid, &info->nodemap);
     libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpumap);
 
     xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index fcb1ecd..2c10772 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -263,6 +263,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("avail_vcpus",     libxl_bitmap),
     ("cpumap",          libxl_bitmap),
+    ("nodemap",         libxl_bitmap),
     ("numa_placement",  libxl_defbool),
     ("tsc_mode",        libxl_tsc_mode),
     ("max_memkb",       MemKB),
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScD5-0006Nq-4d; Wed, 17 Apr 2013 23:56:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScD3-0006NN-Mm
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:17 +0000
Received: from [85.158.138.51:59434] by server-4.bemta-3.messagelabs.com id
	CA/A0-21470-C963F615; Wed, 17 Apr 2013 23:56:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1366242970!18922859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25757 invoked from network); 17 Apr 2013 23:56:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCv-000297-VV
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScCv-0007X4-UM
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:09 +0000
Date: Wed, 17 Apr 2013 23:56:09 +0000
Message-Id: <E1UScCv-0007X4-UM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: allow for explicitly specifying
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5d30c236a41e269313380bc584da9e7ddfa251d
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:34 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    libxl: allow for explicitly specifying node-affinity
    
    By introducing a nodemap in libxl_domain_build_info and
    providing the get/set methods to deal with it.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c         |   20 ++++++++++++++++++++
 tools/libxl/libxl.h         |   11 +++++++++++
 tools/libxl/libxl_create.c  |    6 ++++++
 tools/libxl/libxl_dom.c     |    1 +
 tools/libxl/libxl_types.idl |    1 +
 5 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 03a9782..3c6d71b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4183,6 +4183,26 @@ int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
     return rc;
 }
 
+int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap)
+{
+    if (xc_domain_node_setaffinity(ctx->xch, domid, nodemap->map)) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting node affinity");
+        return ERROR_FAIL;
+    }
+    return 0;
+}
+
+int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap)
+{
+    if (xc_domain_node_getaffinity(ctx->xch, domid, nodemap->map)) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting node affinity");
+        return ERROR_FAIL;
+    }
+    return 0;
+}
+
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
 {
     GC_INIT(ctx);
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4922313..92f3f8e 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -75,6 +75,13 @@
 #define LIBXL_HAVE_FIRMWARE_PASSTHROUGH 1
 
 /*
+ * LIBXL_HAVE_DOMAIN_NODEAFFINITY indicates that a 'nodemap' field
+ * (of libxl_bitmap type) is present in libxl_domain_build_info,
+ * containing the node-affinity for the domain.
+ */
+#define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
@@ -884,6 +891,10 @@ int libxl_set_vcpuaffinity(libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid,
                            libxl_bitmap *cpumap);
 int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid,
                                unsigned int max_vcpus, libxl_bitmap *cpumap);
+int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
+int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid,
+                                  libxl_bitmap *nodemap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap);
 
 libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index ae72f21..19a56c0 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -191,6 +191,12 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
 
     libxl_defbool_setdefault(&b_info->numa_placement, true);
 
+    if (!b_info->nodemap.size) {
+        if (libxl_node_bitmap_alloc(CTX, &b_info->nodemap, 0))
+            return ERROR_FAIL;
+        libxl_bitmap_set_any(&b_info->nodemap);
+    }
+
     if (b_info->max_memkb == LIBXL_MEMKB_DEFAULT)
         b_info->max_memkb = 32 * 1024;
     if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 92a6628..0371bad 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -230,6 +230,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
         if (rc)
             return rc;
     }
+    libxl_domain_set_nodeaffinity(ctx, domid, &info->nodemap);
     libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus, &info->cpumap);
 
     xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index fcb1ecd..2c10772 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -263,6 +263,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("avail_vcpus",     libxl_bitmap),
     ("cpumap",          libxl_bitmap),
+    ("nodemap",         libxl_bitmap),
     ("numa_placement",  libxl_defbool),
     ("tsc_mode",        libxl_tsc_mode),
     ("max_memkb",       MemKB),
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDE-0006PZ-7a; Wed, 17 Apr 2013 23:56:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDC-0006P9-Pe
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:27 +0000
Received: from [85.158.139.211:47346] by server-7.bemta-5.messagelabs.com id
	24/3A-12441-6A63F615; Wed, 17 Apr 2013 23:56:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1366242980!18918602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24398 invoked from network); 17 Apr 2013 23:56:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScD6-00029D-58
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScD6-0007XQ-3E
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:20 +0000
Date: Wed, 17 Apr 2013 23:56:20 +0000
Message-Id: <E1UScD6-0007XQ-3E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: optimize the calculation of how
	many VCPUs can run on a candidate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05ad92287b9f91171d66fd0b3db84bca63025d9c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:35 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    libxl: optimize the calculation of how many VCPUs can run on a candidate
    
    For choosing the best NUMA placement candidate, we need to figure out
    how many VCPUs are runnable on each of them. That requires going through
    all the VCPUs of all the domains and check their affinities.
    
    With this change, instead of doing the above for each candidate, we
    do it once for all, populating an array while counting. This way, when
    we later are evaluating candidates, all we need is summing up the right
    elements of the array itself.
    
    This reduces the complexity of the overall algorithm, as it moves a
    potentially expensive operation (for_each_vcpu_of_each_domain {})
    outside from the core placement loop, so that it is performed only
    once instead of (potentially) tens or hundreds of times. More
    specifically, we go from a worst case computation time complaxity of:
    
     O(2^n_nodes) * O(n_domains*n_domain_vcpus)
    
    To, with this change:
    
     O(n_domains*n_domains_vcpus) + O(2^n_nodes) = O(2^n_nodes)
    
    (with n_nodes<=16, otherwise the algorithm suggests partitioning with
    cpupools and does not even start.)
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_numa.c |   70 +++++++++++++++++++++++++++++++--------------
 1 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c
index 2c8e59f..5a12be1 100644
--- a/tools/libxl/libxl_numa.c
+++ b/tools/libxl/libxl_numa.c
@@ -165,22 +165,34 @@ static uint32_t nodemap_to_free_memkb(libxl_numainfo *ninfo,
     return free_memkb;
 }
 
-/* Retrieve the number of vcpus able to run on the cpus of the nodes
- * that are part of the nodemap. */
-static int nodemap_to_nr_vcpus(libxl__gc *gc, libxl_cputopology *tinfo,
+/* Retrieve the number of vcpus able to run on the nodes in nodemap */
+static int nodemap_to_nr_vcpus(libxl__gc *gc, int vcpus_on_node[],
                                const libxl_bitmap *nodemap)
 {
+    int i, nr_vcpus = 0;
+
+    libxl_for_each_set_bit(i, *nodemap)
+        nr_vcpus += vcpus_on_node[i];
+
+    return nr_vcpus;
+}
+
+/* Number of vcpus able to run on the cpus of the various nodes
+ * (reported by filling the array vcpus_on_node[]). */
+static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
+                             const libxl_bitmap *suitable_cpumap,
+                             int vcpus_on_node[])
+{
     libxl_dominfo *dinfo = NULL;
-    libxl_bitmap vcpu_nodemap;
+    libxl_bitmap nodes_counted;
     int nr_doms, nr_cpus;
-    int nr_vcpus = 0;
     int i, j, k;
 
     dinfo = libxl_list_domain(CTX, &nr_doms);
     if (dinfo == NULL)
         return ERROR_FAIL;
 
-    if (libxl_node_bitmap_alloc(CTX, &vcpu_nodemap, 0) < 0) {
+    if (libxl_node_bitmap_alloc(CTX, &nodes_counted, 0) < 0) {
         libxl_dominfo_list_free(dinfo, nr_doms);
         return ERROR_FAIL;
     }
@@ -193,19 +205,17 @@ static int nodemap_to_nr_vcpus(libxl__gc *gc, libxl_cputopology *tinfo,
         if (vinfo == NULL)
             continue;
 
-        /* For each vcpu of each domain ... */
         for (j = 0; j < nr_dom_vcpus; j++) {
-
-            /* Build up a map telling on which nodes the vcpu is runnable on */
-            libxl_bitmap_set_none(&vcpu_nodemap);
-            libxl_for_each_set_bit(k, vinfo[j].cpumap)
-                libxl_bitmap_set(&vcpu_nodemap, tinfo[k].node);
-
-            /* And check if that map has any intersection with our nodemap */
-            libxl_for_each_set_bit(k, vcpu_nodemap) {
-                if (libxl_bitmap_test(nodemap, k)) {
-                    nr_vcpus++;
-                    break;
+            /* For each vcpu of each domain, increment the elements of
+             * the array corresponding to the nodes where the vcpu runs */
+            libxl_bitmap_set_none(&nodes_counted);
+            libxl_for_each_set_bit(k, vinfo[j].cpumap) {
+                int node = tinfo[k].node;
+
+                if (libxl_bitmap_test(suitable_cpumap, k) &&
+                    !libxl_bitmap_test(&nodes_counted, node)) {
+                    libxl_bitmap_set(&nodes_counted, node);
+                    vcpus_on_node[node]++;
                 }
             }
         }
@@ -213,9 +223,9 @@ static int nodemap_to_nr_vcpus(libxl__gc *gc, libxl_cputopology *tinfo,
         libxl_vcpuinfo_list_free(vinfo, nr_dom_vcpus);
     }
 
-    libxl_bitmap_dispose(&vcpu_nodemap);
+    libxl_bitmap_dispose(&nodes_counted);
     libxl_dominfo_list_free(dinfo, nr_doms);
-    return nr_vcpus;
+    return 0;
 }
 
 /*
@@ -270,7 +280,7 @@ int libxl__get_numa_candidate(libxl__gc *gc,
     libxl_numainfo *ninfo = NULL;
     int nr_nodes = 0, nr_suit_nodes, nr_cpus = 0;
     libxl_bitmap suitable_nodemap, nodemap;
-    int rc = 0;
+    int *vcpus_on_node, rc = 0;
 
     libxl_bitmap_init(&nodemap);
     libxl_bitmap_init(&suitable_nodemap);
@@ -281,6 +291,8 @@ int libxl__get_numa_candidate(libxl__gc *gc,
     if (ninfo == NULL)
         return ERROR_FAIL;
 
+    GCNEW_ARRAY(vcpus_on_node, nr_nodes);
+
     /*
      * The good thing about this solution is that it is based on heuristics
      * (implemented in numa_cmpf() ), but we at least can evaluate it on
@@ -330,6 +342,19 @@ int libxl__get_numa_candidate(libxl__gc *gc,
         goto out;
 
     /*
+     * Later on, we will try to figure out how many vcpus are runnable on
+     * each candidate (as a part of choosing the best one of them). That
+     * requires going through all the vcpus of all the domains and check
+     * their affinities. So, instead of doing that for each candidate,
+     * let's count here the number of vcpus runnable on each node, so that
+     * all we have to do later is summing up the right elements of the
+     * vcpus_on_node array.
+     */
+    rc = nr_vcpus_on_nodes(gc, tinfo, suitable_cpumap, vcpus_on_node);
+    if (rc)
+        goto out;
+
+    /*
      * If the minimum number of NUMA nodes is not explicitly specified
      * (i.e., min_nodes == 0), we try to figure out a sensible number of nodes
      * from where to start generating candidates, if possible (or just start
@@ -414,7 +439,8 @@ int libxl__get_numa_candidate(libxl__gc *gc,
              * current best one (if any).
              */
             libxl__numa_candidate_put_nodemap(gc, &new_cndt, &nodemap);
-            new_cndt.nr_vcpus = nodemap_to_nr_vcpus(gc, tinfo, &nodemap);
+            new_cndt.nr_vcpus = nodemap_to_nr_vcpus(gc, vcpus_on_node,
+                                                    &nodemap);
             new_cndt.free_memkb = nodes_free_memkb;
             new_cndt.nr_nodes = libxl_bitmap_count_set(&nodemap);
             new_cndt.nr_cpus = nodes_cpus;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDE-0006PZ-7a; Wed, 17 Apr 2013 23:56:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDC-0006P9-Pe
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:27 +0000
Received: from [85.158.139.211:47346] by server-7.bemta-5.messagelabs.com id
	24/3A-12441-6A63F615; Wed, 17 Apr 2013 23:56:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1366242980!18918602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24398 invoked from network); 17 Apr 2013 23:56:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScD6-00029D-58
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScD6-0007XQ-3E
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:20 +0000
Date: Wed, 17 Apr 2013 23:56:20 +0000
Message-Id: <E1UScD6-0007XQ-3E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: optimize the calculation of how
	many VCPUs can run on a candidate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 05ad92287b9f91171d66fd0b3db84bca63025d9c
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:35 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    libxl: optimize the calculation of how many VCPUs can run on a candidate
    
    For choosing the best NUMA placement candidate, we need to figure out
    how many VCPUs are runnable on each of them. That requires going through
    all the VCPUs of all the domains and check their affinities.
    
    With this change, instead of doing the above for each candidate, we
    do it once for all, populating an array while counting. This way, when
    we later are evaluating candidates, all we need is summing up the right
    elements of the array itself.
    
    This reduces the complexity of the overall algorithm, as it moves a
    potentially expensive operation (for_each_vcpu_of_each_domain {})
    outside from the core placement loop, so that it is performed only
    once instead of (potentially) tens or hundreds of times. More
    specifically, we go from a worst case computation time complaxity of:
    
     O(2^n_nodes) * O(n_domains*n_domain_vcpus)
    
    To, with this change:
    
     O(n_domains*n_domains_vcpus) + O(2^n_nodes) = O(2^n_nodes)
    
    (with n_nodes<=16, otherwise the algorithm suggests partitioning with
    cpupools and does not even start.)
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_numa.c |   70 +++++++++++++++++++++++++++++++--------------
 1 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c
index 2c8e59f..5a12be1 100644
--- a/tools/libxl/libxl_numa.c
+++ b/tools/libxl/libxl_numa.c
@@ -165,22 +165,34 @@ static uint32_t nodemap_to_free_memkb(libxl_numainfo *ninfo,
     return free_memkb;
 }
 
-/* Retrieve the number of vcpus able to run on the cpus of the nodes
- * that are part of the nodemap. */
-static int nodemap_to_nr_vcpus(libxl__gc *gc, libxl_cputopology *tinfo,
+/* Retrieve the number of vcpus able to run on the nodes in nodemap */
+static int nodemap_to_nr_vcpus(libxl__gc *gc, int vcpus_on_node[],
                                const libxl_bitmap *nodemap)
 {
+    int i, nr_vcpus = 0;
+
+    libxl_for_each_set_bit(i, *nodemap)
+        nr_vcpus += vcpus_on_node[i];
+
+    return nr_vcpus;
+}
+
+/* Number of vcpus able to run on the cpus of the various nodes
+ * (reported by filling the array vcpus_on_node[]). */
+static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
+                             const libxl_bitmap *suitable_cpumap,
+                             int vcpus_on_node[])
+{
     libxl_dominfo *dinfo = NULL;
-    libxl_bitmap vcpu_nodemap;
+    libxl_bitmap nodes_counted;
     int nr_doms, nr_cpus;
-    int nr_vcpus = 0;
     int i, j, k;
 
     dinfo = libxl_list_domain(CTX, &nr_doms);
     if (dinfo == NULL)
         return ERROR_FAIL;
 
-    if (libxl_node_bitmap_alloc(CTX, &vcpu_nodemap, 0) < 0) {
+    if (libxl_node_bitmap_alloc(CTX, &nodes_counted, 0) < 0) {
         libxl_dominfo_list_free(dinfo, nr_doms);
         return ERROR_FAIL;
     }
@@ -193,19 +205,17 @@ static int nodemap_to_nr_vcpus(libxl__gc *gc, libxl_cputopology *tinfo,
         if (vinfo == NULL)
             continue;
 
-        /* For each vcpu of each domain ... */
         for (j = 0; j < nr_dom_vcpus; j++) {
-
-            /* Build up a map telling on which nodes the vcpu is runnable on */
-            libxl_bitmap_set_none(&vcpu_nodemap);
-            libxl_for_each_set_bit(k, vinfo[j].cpumap)
-                libxl_bitmap_set(&vcpu_nodemap, tinfo[k].node);
-
-            /* And check if that map has any intersection with our nodemap */
-            libxl_for_each_set_bit(k, vcpu_nodemap) {
-                if (libxl_bitmap_test(nodemap, k)) {
-                    nr_vcpus++;
-                    break;
+            /* For each vcpu of each domain, increment the elements of
+             * the array corresponding to the nodes where the vcpu runs */
+            libxl_bitmap_set_none(&nodes_counted);
+            libxl_for_each_set_bit(k, vinfo[j].cpumap) {
+                int node = tinfo[k].node;
+
+                if (libxl_bitmap_test(suitable_cpumap, k) &&
+                    !libxl_bitmap_test(&nodes_counted, node)) {
+                    libxl_bitmap_set(&nodes_counted, node);
+                    vcpus_on_node[node]++;
                 }
             }
         }
@@ -213,9 +223,9 @@ static int nodemap_to_nr_vcpus(libxl__gc *gc, libxl_cputopology *tinfo,
         libxl_vcpuinfo_list_free(vinfo, nr_dom_vcpus);
     }
 
-    libxl_bitmap_dispose(&vcpu_nodemap);
+    libxl_bitmap_dispose(&nodes_counted);
     libxl_dominfo_list_free(dinfo, nr_doms);
-    return nr_vcpus;
+    return 0;
 }
 
 /*
@@ -270,7 +280,7 @@ int libxl__get_numa_candidate(libxl__gc *gc,
     libxl_numainfo *ninfo = NULL;
     int nr_nodes = 0, nr_suit_nodes, nr_cpus = 0;
     libxl_bitmap suitable_nodemap, nodemap;
-    int rc = 0;
+    int *vcpus_on_node, rc = 0;
 
     libxl_bitmap_init(&nodemap);
     libxl_bitmap_init(&suitable_nodemap);
@@ -281,6 +291,8 @@ int libxl__get_numa_candidate(libxl__gc *gc,
     if (ninfo == NULL)
         return ERROR_FAIL;
 
+    GCNEW_ARRAY(vcpus_on_node, nr_nodes);
+
     /*
      * The good thing about this solution is that it is based on heuristics
      * (implemented in numa_cmpf() ), but we at least can evaluate it on
@@ -330,6 +342,19 @@ int libxl__get_numa_candidate(libxl__gc *gc,
         goto out;
 
     /*
+     * Later on, we will try to figure out how many vcpus are runnable on
+     * each candidate (as a part of choosing the best one of them). That
+     * requires going through all the vcpus of all the domains and check
+     * their affinities. So, instead of doing that for each candidate,
+     * let's count here the number of vcpus runnable on each node, so that
+     * all we have to do later is summing up the right elements of the
+     * vcpus_on_node array.
+     */
+    rc = nr_vcpus_on_nodes(gc, tinfo, suitable_cpumap, vcpus_on_node);
+    if (rc)
+        goto out;
+
+    /*
      * If the minimum number of NUMA nodes is not explicitly specified
      * (i.e., min_nodes == 0), we try to figure out a sensible number of nodes
      * from where to start generating candidates, if possible (or just start
@@ -414,7 +439,8 @@ int libxl__get_numa_candidate(libxl__gc *gc,
              * current best one (if any).
              */
             libxl__numa_candidate_put_nodemap(gc, &new_cndt, &nodemap);
-            new_cndt.nr_vcpus = nodemap_to_nr_vcpus(gc, tinfo, &nodemap);
+            new_cndt.nr_vcpus = nodemap_to_nr_vcpus(gc, vcpus_on_node,
+                                                    &nodemap);
             new_cndt.free_memkb = nodes_free_memkb;
             new_cndt.nr_nodes = libxl_bitmap_count_set(&nodemap);
             new_cndt.nr_cpus = nodes_cpus;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDL-0006RI-Aa; Wed, 17 Apr 2013 23:56:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDK-0006Qk-IX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:34 +0000
Received: from [85.158.139.83:7501] by server-8.bemta-5.messagelabs.com id
	30/0C-05790-0B63F615; Wed, 17 Apr 2013 23:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1366242990!17348508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9302 invoked from network); 17 Apr 2013 23:56:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDG-00029L-Au
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDG-0007Yl-90
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:30 +0000
Date: Wed, 17 Apr 2013 23:56:30 +0000
Message-Id: <E1UScDG-0007Yl-90@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: automatic placement deals with
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d06b1bf169a01a9c7b0947d7825e58cb455a0ba5
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    libxl: automatic placement deals with node-affinity
    
    Which basically means the following two things:
     1) during domain creation, it is the node-affinity of
        the domain --rather than the vcpu-affinities of its
        VCPUs-- that is affected by automatic placement;
     2) during automatic placement, when counting how many
        VCPUs are already "bound" to a placement candidate
        (as part of the process of choosing the best
        candidate), both vcpu-affinity and node-affinity
        are considered.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 tools/libxl/libxl_dom.c  |   30 ++++++++++++++++--------------
 tools/libxl/libxl_numa.c |   20 +++++++++++++++++---
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0371bad..b38d0a7 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -134,13 +134,13 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 {
     int found;
     libxl__numa_candidate candidate;
-    libxl_bitmap candidate_nodemap;
+    libxl_bitmap cpupool_nodemap;
     libxl_cpupoolinfo cpupool_info;
     int i, cpupool, rc = 0;
     uint32_t memkb;
 
     libxl__numa_candidate_init(&candidate);
-    libxl_bitmap_init(&candidate_nodemap);
+    libxl_bitmap_init(&cpupool_nodemap);
 
     /*
      * Extract the cpumap from the cpupool the domain belong to. In fact,
@@ -157,7 +157,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
     rc = libxl_domain_need_memory(CTX, info, &memkb);
     if (rc)
         goto out;
-    if (libxl_node_bitmap_alloc(CTX, &candidate_nodemap, 0)) {
+    if (libxl_node_bitmap_alloc(CTX, &cpupool_nodemap, 0)) {
         rc = ERROR_FAIL;
         goto out;
     }
@@ -175,17 +175,19 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
     if (found == 0)
         goto out;
 
-    /* Map the candidate's node map to the domain's info->cpumap */
-    libxl__numa_candidate_get_nodemap(gc, &candidate, &candidate_nodemap);
-    rc = libxl_nodemap_to_cpumap(CTX, &candidate_nodemap, &info->cpumap);
+    /* Map the candidate's node map to the domain's info->nodemap */
+    libxl__numa_candidate_get_nodemap(gc, &candidate, &info->nodemap);
+
+    /* Avoid trying to set the affinity to nodes that might be in the
+     * candidate's nodemap but out of our cpupool. */
+    rc = libxl_cpumap_to_nodemap(CTX, &cpupool_info.cpumap,
+                                 &cpupool_nodemap);
     if (rc)
         goto out;
 
-    /* Avoid trying to set the affinity to cpus that might be in the
-     * nodemap but not in our cpupool. */
-    libxl_for_each_set_bit(i, info->cpumap) {
-        if (!libxl_bitmap_test(&cpupool_info.cpumap, i))
-            libxl_bitmap_reset(&info->cpumap, i);
+    libxl_for_each_set_bit(i, info->nodemap) {
+        if (!libxl_bitmap_test(&cpupool_nodemap, i))
+            libxl_bitmap_reset(&info->nodemap, i);
     }
 
     LOG(DETAIL, "NUMA placement candidate with %d nodes, %d cpus and "
@@ -194,7 +196,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 
  out:
     libxl__numa_candidate_dispose(&candidate);
-    libxl_bitmap_dispose(&candidate_nodemap);
+    libxl_bitmap_dispose(&cpupool_nodemap);
     libxl_cpupoolinfo_dispose(&cpupool_info);
     return rc;
 }
@@ -212,10 +214,10 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     /*
      * Check if the domain has any CPU affinity. If not, try to build
      * up one. In case numa_place_domain() find at least a suitable
-     * candidate, it will affect info->cpumap accordingly; if it
+     * candidate, it will affect info->nodemap accordingly; if it
      * does not, it just leaves it as it is. This means (unless
      * some weird error manifests) the subsequent call to
-     * libxl_set_vcpuaffinity_all() will do the actual placement,
+     * libxl_domain_set_nodeaffinity() will do the actual placement,
      * whatever that turns out to be.
      */
     if (libxl_defbool_val(info->numa_placement)) {
diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c
index 5a12be1..20c99ac 100644
--- a/tools/libxl/libxl_numa.c
+++ b/tools/libxl/libxl_numa.c
@@ -184,7 +184,7 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
                              int vcpus_on_node[])
 {
     libxl_dominfo *dinfo = NULL;
-    libxl_bitmap nodes_counted;
+    libxl_bitmap dom_nodemap, nodes_counted;
     int nr_doms, nr_cpus;
     int i, j, k;
 
@@ -197,6 +197,12 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
         return ERROR_FAIL;
     }
 
+    if (libxl_node_bitmap_alloc(CTX, &dom_nodemap, 0) < 0) {
+        libxl_bitmap_dispose(&nodes_counted);
+        libxl_dominfo_list_free(dinfo, nr_doms);
+        return ERROR_FAIL;
+    }
+
     for (i = 0; i < nr_doms; i++) {
         libxl_vcpuinfo *vinfo;
         int nr_dom_vcpus;
@@ -205,14 +211,21 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
         if (vinfo == NULL)
             continue;
 
+        /* Retrieve the domain's node-affinity map */
+        libxl_domain_get_nodeaffinity(CTX, dinfo[i].domid, &dom_nodemap);
+
         for (j = 0; j < nr_dom_vcpus; j++) {
-            /* For each vcpu of each domain, increment the elements of
-             * the array corresponding to the nodes where the vcpu runs */
+            /*
+             * For each vcpu of each domain, it must have both vcpu-affinity
+             * and node-affinity to (a pcpu belonging to) a certain node to
+             * cause an increment in the corresponding element of the array.
+             */
             libxl_bitmap_set_none(&nodes_counted);
             libxl_for_each_set_bit(k, vinfo[j].cpumap) {
                 int node = tinfo[k].node;
 
                 if (libxl_bitmap_test(suitable_cpumap, k) &&
+                    libxl_bitmap_test(&dom_nodemap, node) &&
                     !libxl_bitmap_test(&nodes_counted, node)) {
                     libxl_bitmap_set(&nodes_counted, node);
                     vcpus_on_node[node]++;
@@ -223,6 +236,7 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
         libxl_vcpuinfo_list_free(vinfo, nr_dom_vcpus);
     }
 
+    libxl_bitmap_dispose(&dom_nodemap);
     libxl_bitmap_dispose(&nodes_counted);
     libxl_dominfo_list_free(dinfo, nr_doms);
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDL-0006RI-Aa; Wed, 17 Apr 2013 23:56:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDK-0006Qk-IX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:34 +0000
Received: from [85.158.139.83:7501] by server-8.bemta-5.messagelabs.com id
	30/0C-05790-0B63F615; Wed, 17 Apr 2013 23:56:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1366242990!17348508!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9302 invoked from network); 17 Apr 2013 23:56:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDG-00029L-Au
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDG-0007Yl-90
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:30 +0000
Date: Wed, 17 Apr 2013 23:56:30 +0000
Message-Id: <E1UScDG-0007Yl-90@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: automatic placement deals with
	node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d06b1bf169a01a9c7b0947d7825e58cb455a0ba5
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:36 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    libxl: automatic placement deals with node-affinity
    
    Which basically means the following two things:
     1) during domain creation, it is the node-affinity of
        the domain --rather than the vcpu-affinities of its
        VCPUs-- that is affected by automatic placement;
     2) during automatic placement, when counting how many
        VCPUs are already "bound" to a placement candidate
        (as part of the process of choosing the best
        candidate), both vcpu-affinity and node-affinity
        are considered.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 tools/libxl/libxl_dom.c  |   30 ++++++++++++++++--------------
 tools/libxl/libxl_numa.c |   20 +++++++++++++++++---
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0371bad..b38d0a7 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -134,13 +134,13 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 {
     int found;
     libxl__numa_candidate candidate;
-    libxl_bitmap candidate_nodemap;
+    libxl_bitmap cpupool_nodemap;
     libxl_cpupoolinfo cpupool_info;
     int i, cpupool, rc = 0;
     uint32_t memkb;
 
     libxl__numa_candidate_init(&candidate);
-    libxl_bitmap_init(&candidate_nodemap);
+    libxl_bitmap_init(&cpupool_nodemap);
 
     /*
      * Extract the cpumap from the cpupool the domain belong to. In fact,
@@ -157,7 +157,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
     rc = libxl_domain_need_memory(CTX, info, &memkb);
     if (rc)
         goto out;
-    if (libxl_node_bitmap_alloc(CTX, &candidate_nodemap, 0)) {
+    if (libxl_node_bitmap_alloc(CTX, &cpupool_nodemap, 0)) {
         rc = ERROR_FAIL;
         goto out;
     }
@@ -175,17 +175,19 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
     if (found == 0)
         goto out;
 
-    /* Map the candidate's node map to the domain's info->cpumap */
-    libxl__numa_candidate_get_nodemap(gc, &candidate, &candidate_nodemap);
-    rc = libxl_nodemap_to_cpumap(CTX, &candidate_nodemap, &info->cpumap);
+    /* Map the candidate's node map to the domain's info->nodemap */
+    libxl__numa_candidate_get_nodemap(gc, &candidate, &info->nodemap);
+
+    /* Avoid trying to set the affinity to nodes that might be in the
+     * candidate's nodemap but out of our cpupool. */
+    rc = libxl_cpumap_to_nodemap(CTX, &cpupool_info.cpumap,
+                                 &cpupool_nodemap);
     if (rc)
         goto out;
 
-    /* Avoid trying to set the affinity to cpus that might be in the
-     * nodemap but not in our cpupool. */
-    libxl_for_each_set_bit(i, info->cpumap) {
-        if (!libxl_bitmap_test(&cpupool_info.cpumap, i))
-            libxl_bitmap_reset(&info->cpumap, i);
+    libxl_for_each_set_bit(i, info->nodemap) {
+        if (!libxl_bitmap_test(&cpupool_nodemap, i))
+            libxl_bitmap_reset(&info->nodemap, i);
     }
 
     LOG(DETAIL, "NUMA placement candidate with %d nodes, %d cpus and "
@@ -194,7 +196,7 @@ static int numa_place_domain(libxl__gc *gc, uint32_t domid,
 
  out:
     libxl__numa_candidate_dispose(&candidate);
-    libxl_bitmap_dispose(&candidate_nodemap);
+    libxl_bitmap_dispose(&cpupool_nodemap);
     libxl_cpupoolinfo_dispose(&cpupool_info);
     return rc;
 }
@@ -212,10 +214,10 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     /*
      * Check if the domain has any CPU affinity. If not, try to build
      * up one. In case numa_place_domain() find at least a suitable
-     * candidate, it will affect info->cpumap accordingly; if it
+     * candidate, it will affect info->nodemap accordingly; if it
      * does not, it just leaves it as it is. This means (unless
      * some weird error manifests) the subsequent call to
-     * libxl_set_vcpuaffinity_all() will do the actual placement,
+     * libxl_domain_set_nodeaffinity() will do the actual placement,
      * whatever that turns out to be.
      */
     if (libxl_defbool_val(info->numa_placement)) {
diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c
index 5a12be1..20c99ac 100644
--- a/tools/libxl/libxl_numa.c
+++ b/tools/libxl/libxl_numa.c
@@ -184,7 +184,7 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
                              int vcpus_on_node[])
 {
     libxl_dominfo *dinfo = NULL;
-    libxl_bitmap nodes_counted;
+    libxl_bitmap dom_nodemap, nodes_counted;
     int nr_doms, nr_cpus;
     int i, j, k;
 
@@ -197,6 +197,12 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
         return ERROR_FAIL;
     }
 
+    if (libxl_node_bitmap_alloc(CTX, &dom_nodemap, 0) < 0) {
+        libxl_bitmap_dispose(&nodes_counted);
+        libxl_dominfo_list_free(dinfo, nr_doms);
+        return ERROR_FAIL;
+    }
+
     for (i = 0; i < nr_doms; i++) {
         libxl_vcpuinfo *vinfo;
         int nr_dom_vcpus;
@@ -205,14 +211,21 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
         if (vinfo == NULL)
             continue;
 
+        /* Retrieve the domain's node-affinity map */
+        libxl_domain_get_nodeaffinity(CTX, dinfo[i].domid, &dom_nodemap);
+
         for (j = 0; j < nr_dom_vcpus; j++) {
-            /* For each vcpu of each domain, increment the elements of
-             * the array corresponding to the nodes where the vcpu runs */
+            /*
+             * For each vcpu of each domain, it must have both vcpu-affinity
+             * and node-affinity to (a pcpu belonging to) a certain node to
+             * cause an increment in the corresponding element of the array.
+             */
             libxl_bitmap_set_none(&nodes_counted);
             libxl_for_each_set_bit(k, vinfo[j].cpumap) {
                 int node = tinfo[k].node;
 
                 if (libxl_bitmap_test(suitable_cpumap, k) &&
+                    libxl_bitmap_test(&dom_nodemap, node) &&
                     !libxl_bitmap_test(&nodes_counted, node)) {
                     libxl_bitmap_set(&nodes_counted, node);
                     vcpus_on_node[node]++;
@@ -223,6 +236,7 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
         libxl_vcpuinfo_list_free(vinfo, nr_dom_vcpus);
     }
 
+    libxl_bitmap_dispose(&dom_nodemap);
     libxl_bitmap_dispose(&nodes_counted);
     libxl_dominfo_list_free(dinfo, nr_doms);
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDZ-0006UK-G3; Wed, 17 Apr 2013 23:56:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDY-0006Tx-4L
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:48 +0000
Received: from [85.158.139.83:39105] by server-15.bemta-5.messagelabs.com id
	95/6F-22815-BB63F615; Wed, 17 Apr 2013 23:56:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1366243000!17348521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9702 invoked from network); 17 Apr 2013 23:56:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDQ-00029S-Ne
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDQ-0007ZA-JP
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:40 +0000
Date: Wed, 17 Apr 2013 23:56:40 +0000
Message-Id: <E1UScDQ-0007ZA-JP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add node-affinity to the output of
	`xl list`
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d743a2230526f391cc0bad836082543bf4fedbaf
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:37 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    xl: add node-affinity to the output of `xl list`
    
    Node-affinity is now something that is under (some) control of the
    user, so show it upon request as part of the output of `xl list'
    by the `-n' option.
    
    Re the patch, the print_bitmap() related hunk is _mostly_ code motion,
    although there is a very minor change in the code, basically to allow
    using the function for printing both cpu and node bitmaps (as, in case
    all bits are sets, it used to print "any cpu", which doesn't fit the
    nodemap case).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |  165 ++++++++++++++++++++++++++++-----------------
 tools/libxl/xl_cmdtable.c |    3 +-
 2 files changed, 105 insertions(+), 63 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 98ecf67..87d189d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3061,16 +3061,97 @@ out:
     }
 }
 
-static void list_domains(int verbose, int context, int claim,
+/* If map is not full, prints it and returns 0. Returns 1 otherwise. */
+static int print_bitmap(uint8_t *map, int maplen, FILE *stream)
+{
+    int i;
+    uint8_t pmap = 0, bitmask = 0;
+    int firstset = 0, state = 0;
+
+    for (i = 0; i < maplen; i++) {
+        if (i % 8 == 0) {
+            pmap = *map++;
+            bitmask = 1;
+        } else bitmask <<= 1;
+
+        switch (state) {
+        case 0:
+        case 2:
+            if ((pmap & bitmask) != 0) {
+                firstset = i;
+                state++;
+            }
+            continue;
+        case 1:
+        case 3:
+            if ((pmap & bitmask) == 0) {
+                fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
+                if (i - 1 > firstset)
+                    fprintf(stream, "-%d", i - 1);
+                state = 2;
+            }
+            continue;
+        }
+    }
+    switch (state) {
+        case 0:
+            fprintf(stream, "none");
+            break;
+        case 2:
+            break;
+        case 1:
+            if (firstset == 0)
+                return 1;
+        case 3:
+            fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
+            if (i - 1 > firstset)
+                fprintf(stream, "-%d", i - 1);
+            break;
+    }
+
+    return 0;
+}
+
+static void print_cpumap(uint8_t *map, int maplen, FILE *stream)
+{
+    if (print_bitmap(map, maplen, stream))
+        fprintf(stream, "any cpu");
+}
+
+static void print_nodemap(uint8_t *map, int maplen, FILE *stream)
+{
+    if (print_bitmap(map, maplen, stream))
+        fprintf(stream, "any node");
+}
+
+static void list_domains(int verbose, int context, int claim, int numa,
                          const libxl_dominfo *info, int nb_domain)
 {
     int i;
     static const char shutdown_reason_letters[]= "-rscw";
+    libxl_bitmap nodemap;
+    libxl_physinfo physinfo;
+
+    libxl_bitmap_init(&nodemap);
+    libxl_physinfo_init(&physinfo);
 
     printf("Name                                        ID   Mem VCPUs\tState\tTime(s)");
     if (verbose) printf("   UUID                            Reason-Code\tSecurity Label");
     if (context && !verbose) printf("   Security Label");
     if (claim) printf("  Claimed");
+    if (numa) {
+        if (libxl_node_bitmap_alloc(ctx, &nodemap, 0)) {
+            fprintf(stderr, "libxl_node_bitmap_alloc_failed.\n");
+            exit(1);
+        }
+        if (libxl_get_physinfo(ctx, &physinfo) != 0) {
+            fprintf(stderr, "libxl_physinfo failed.\n");
+            libxl_bitmap_dispose(&nodemap);
+            exit(1);
+        }
+
+        printf(" NODE Affinity");
+    }
     printf("\n");
     for (i = 0; i < nb_domain; i++) {
         char *domname;
@@ -3103,18 +3184,23 @@ static void list_domains(int verbose, int context, int claim,
         if (verbose || context) {
             int rc;
             size_t size;
-            char *buf;
+            char *buf = NULL;
             rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf,
                                             &size);
-            if (rc < 0)
-                printf("  -");
-            else {
-                printf("  %s", buf);
-                free(buf);
-            }
+            printf(" %16s", rc < 0 ? "-" : buf);
+            free(buf);
+        }
+        if (numa) {
+            libxl_domain_get_nodeaffinity(ctx, info[i].domid, &nodemap);
+
+            putchar(' ');
+            print_nodemap(nodemap.map, physinfo.nr_nodes, stdout);
         }
         putchar('\n');
     }
+
+    libxl_bitmap_dispose(&nodemap);
+    libxl_physinfo_dispose(&physinfo);
 }
 
 static void list_vm(void)
@@ -3981,10 +4067,12 @@ int main_list(int argc, char **argv)
     int opt, verbose = 0;
     int context = 0;
     int details = 0;
+    int numa = 0;
     static struct option opts[] = {
         {"long", 0, 0, 'l'},
         {"verbose", 0, 0, 'v'},
         {"context", 0, 0, 'Z'},
+        {"numa", 0, 0, 'n'},
         COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
@@ -3993,7 +4081,7 @@ int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    SWITCH_FOREACH_OPT(opt, "lvhZ", opts, "list", 0) {
+    SWITCH_FOREACH_OPT(opt, "lvhZn", opts, "list", 0) {
     case 'l':
         details = 1;
         break;
@@ -4003,6 +4091,9 @@ int main_list(int argc, char **argv)
     case 'Z':
         context = 1;
         break;
+    case 'n':
+        numa = 1;
+        break;
     }
 
     if (optind >= argc) {
@@ -4034,7 +4125,7 @@ int main_list(int argc, char **argv)
     if (details)
         list_domains_details(info, nb_domain);
     else
-        list_domains(verbose, context, 0 /* claim */, info, nb_domain);
+        list_domains(verbose, context, 0 /* claim */, numa, info, nb_domain);
 
     if (info_free)
         libxl_dominfo_list_free(info, nb_domain);
@@ -4283,56 +4374,6 @@ int main_button_press(int argc, char **argv)
     return 0;
 }
 
-static void print_bitmap(uint8_t *map, int maplen, FILE *stream)
-{
-    int i;
-    uint8_t pmap = 0, bitmask = 0;
-    int firstset = 0, state = 0;
-
-    for (i = 0; i < maplen; i++) {
-        if (i % 8 == 0) {
-            pmap = *map++;
-            bitmask = 1;
-        } else bitmask <<= 1;
-
-        switch (state) {
-        case 0:
-        case 2:
-            if ((pmap & bitmask) != 0) {
-                firstset = i;
-                state++;
-            }
-            continue;
-        case 1:
-        case 3:
-            if ((pmap & bitmask) == 0) {
-                fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
-                if (i - 1 > firstset)
-                    fprintf(stream, "-%d", i - 1);
-                state = 2;
-            }
-            continue;
-        }
-    }
-    switch (state) {
-        case 0:
-            fprintf(stream, "none");
-            break;
-        case 2:
-            break;
-        case 1:
-            if (firstset == 0) {
-                fprintf(stream, "any cpu");
-                break;
-            }
-        case 3:
-            fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
-            if (i - 1 > firstset)
-                fprintf(stream, "-%d", i - 1);
-            break;
-    }
-}
-
 static void print_vcpuinfo(uint32_t tdomid,
                            const libxl_vcpuinfo *vcpuinfo,
                            uint32_t nr_cpus)
@@ -4356,7 +4397,7 @@ static void print_vcpuinfo(uint32_t tdomid,
     /*      TIM */
     printf("%9.1f  ", ((float)vcpuinfo->vcpu_time / 1e9));
     /* CPU AFFINITY */
-    print_bitmap(vcpuinfo->cpumap.map, nr_cpus, stdout);
+    print_cpumap(vcpuinfo->cpumap.map, nr_cpus, stdout);
     printf("\n");
 }
 
@@ -5942,7 +5983,7 @@ int main_claims(int argc, char **argv)
     }
 
     list_domains(0 /* verbose */, 0 /* context */, 1 /* claim */,
-                 info, nb_domain);
+                 0 /* numa */, info, nb_domain);
 
     libxl_dominfo_list_free(info, nb_domain);
     return 0;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 00899f5..347302c 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -50,7 +50,8 @@ struct cmd_spec cmd_table[] = {
       "[options] [Domain]\n",
       "-l, --long              Output all VM details\n"
       "-v, --verbose           Prints out UUIDs and security context\n"
-      "-Z, --context           Prints out security context"
+      "-Z, --context           Prints out security context\n"
+      "-n, --numa              Prints out NUMA node affinity"
     },
     { "destroy",
       &main_destroy, 0, 1,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:56:51 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDZ-0006UK-G3; Wed, 17 Apr 2013 23:56:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDY-0006Tx-4L
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:48 +0000
Received: from [85.158.139.83:39105] by server-15.bemta-5.messagelabs.com id
	95/6F-22815-BB63F615; Wed, 17 Apr 2013 23:56:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1366243000!17348521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9702 invoked from network); 17 Apr 2013 23:56:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDQ-00029S-Ne
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDQ-0007ZA-JP
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:40 +0000
Date: Wed, 17 Apr 2013 23:56:40 +0000
Message-Id: <E1UScDQ-0007ZA-JP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: add node-affinity to the output of
	`xl list`
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d743a2230526f391cc0bad836082543bf4fedbaf
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:37 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    xl: add node-affinity to the output of `xl list`
    
    Node-affinity is now something that is under (some) control of the
    user, so show it upon request as part of the output of `xl list'
    by the `-n' option.
    
    Re the patch, the print_bitmap() related hunk is _mostly_ code motion,
    although there is a very minor change in the code, basically to allow
    using the function for printing both cpu and node bitmaps (as, in case
    all bits are sets, it used to print "any cpu", which doesn't fit the
    nodemap case).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c  |  165 ++++++++++++++++++++++++++++-----------------
 tools/libxl/xl_cmdtable.c |    3 +-
 2 files changed, 105 insertions(+), 63 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 98ecf67..87d189d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3061,16 +3061,97 @@ out:
     }
 }
 
-static void list_domains(int verbose, int context, int claim,
+/* If map is not full, prints it and returns 0. Returns 1 otherwise. */
+static int print_bitmap(uint8_t *map, int maplen, FILE *stream)
+{
+    int i;
+    uint8_t pmap = 0, bitmask = 0;
+    int firstset = 0, state = 0;
+
+    for (i = 0; i < maplen; i++) {
+        if (i % 8 == 0) {
+            pmap = *map++;
+            bitmask = 1;
+        } else bitmask <<= 1;
+
+        switch (state) {
+        case 0:
+        case 2:
+            if ((pmap & bitmask) != 0) {
+                firstset = i;
+                state++;
+            }
+            continue;
+        case 1:
+        case 3:
+            if ((pmap & bitmask) == 0) {
+                fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
+                if (i - 1 > firstset)
+                    fprintf(stream, "-%d", i - 1);
+                state = 2;
+            }
+            continue;
+        }
+    }
+    switch (state) {
+        case 0:
+            fprintf(stream, "none");
+            break;
+        case 2:
+            break;
+        case 1:
+            if (firstset == 0)
+                return 1;
+        case 3:
+            fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
+            if (i - 1 > firstset)
+                fprintf(stream, "-%d", i - 1);
+            break;
+    }
+
+    return 0;
+}
+
+static void print_cpumap(uint8_t *map, int maplen, FILE *stream)
+{
+    if (print_bitmap(map, maplen, stream))
+        fprintf(stream, "any cpu");
+}
+
+static void print_nodemap(uint8_t *map, int maplen, FILE *stream)
+{
+    if (print_bitmap(map, maplen, stream))
+        fprintf(stream, "any node");
+}
+
+static void list_domains(int verbose, int context, int claim, int numa,
                          const libxl_dominfo *info, int nb_domain)
 {
     int i;
     static const char shutdown_reason_letters[]= "-rscw";
+    libxl_bitmap nodemap;
+    libxl_physinfo physinfo;
+
+    libxl_bitmap_init(&nodemap);
+    libxl_physinfo_init(&physinfo);
 
     printf("Name                                        ID   Mem VCPUs\tState\tTime(s)");
     if (verbose) printf("   UUID                            Reason-Code\tSecurity Label");
     if (context && !verbose) printf("   Security Label");
     if (claim) printf("  Claimed");
+    if (numa) {
+        if (libxl_node_bitmap_alloc(ctx, &nodemap, 0)) {
+            fprintf(stderr, "libxl_node_bitmap_alloc_failed.\n");
+            exit(1);
+        }
+        if (libxl_get_physinfo(ctx, &physinfo) != 0) {
+            fprintf(stderr, "libxl_physinfo failed.\n");
+            libxl_bitmap_dispose(&nodemap);
+            exit(1);
+        }
+
+        printf(" NODE Affinity");
+    }
     printf("\n");
     for (i = 0; i < nb_domain; i++) {
         char *domname;
@@ -3103,18 +3184,23 @@ static void list_domains(int verbose, int context, int claim,
         if (verbose || context) {
             int rc;
             size_t size;
-            char *buf;
+            char *buf = NULL;
             rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf,
                                             &size);
-            if (rc < 0)
-                printf("  -");
-            else {
-                printf("  %s", buf);
-                free(buf);
-            }
+            printf(" %16s", rc < 0 ? "-" : buf);
+            free(buf);
+        }
+        if (numa) {
+            libxl_domain_get_nodeaffinity(ctx, info[i].domid, &nodemap);
+
+            putchar(' ');
+            print_nodemap(nodemap.map, physinfo.nr_nodes, stdout);
         }
         putchar('\n');
     }
+
+    libxl_bitmap_dispose(&nodemap);
+    libxl_physinfo_dispose(&physinfo);
 }
 
 static void list_vm(void)
@@ -3981,10 +4067,12 @@ int main_list(int argc, char **argv)
     int opt, verbose = 0;
     int context = 0;
     int details = 0;
+    int numa = 0;
     static struct option opts[] = {
         {"long", 0, 0, 'l'},
         {"verbose", 0, 0, 'v'},
         {"context", 0, 0, 'Z'},
+        {"numa", 0, 0, 'n'},
         COMMON_LONG_OPTS,
         {0, 0, 0, 0}
     };
@@ -3993,7 +4081,7 @@ int main_list(int argc, char **argv)
     libxl_dominfo *info, *info_free=0;
     int nb_domain, rc;
 
-    SWITCH_FOREACH_OPT(opt, "lvhZ", opts, "list", 0) {
+    SWITCH_FOREACH_OPT(opt, "lvhZn", opts, "list", 0) {
     case 'l':
         details = 1;
         break;
@@ -4003,6 +4091,9 @@ int main_list(int argc, char **argv)
     case 'Z':
         context = 1;
         break;
+    case 'n':
+        numa = 1;
+        break;
     }
 
     if (optind >= argc) {
@@ -4034,7 +4125,7 @@ int main_list(int argc, char **argv)
     if (details)
         list_domains_details(info, nb_domain);
     else
-        list_domains(verbose, context, 0 /* claim */, info, nb_domain);
+        list_domains(verbose, context, 0 /* claim */, numa, info, nb_domain);
 
     if (info_free)
         libxl_dominfo_list_free(info, nb_domain);
@@ -4283,56 +4374,6 @@ int main_button_press(int argc, char **argv)
     return 0;
 }
 
-static void print_bitmap(uint8_t *map, int maplen, FILE *stream)
-{
-    int i;
-    uint8_t pmap = 0, bitmask = 0;
-    int firstset = 0, state = 0;
-
-    for (i = 0; i < maplen; i++) {
-        if (i % 8 == 0) {
-            pmap = *map++;
-            bitmask = 1;
-        } else bitmask <<= 1;
-
-        switch (state) {
-        case 0:
-        case 2:
-            if ((pmap & bitmask) != 0) {
-                firstset = i;
-                state++;
-            }
-            continue;
-        case 1:
-        case 3:
-            if ((pmap & bitmask) == 0) {
-                fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
-                if (i - 1 > firstset)
-                    fprintf(stream, "-%d", i - 1);
-                state = 2;
-            }
-            continue;
-        }
-    }
-    switch (state) {
-        case 0:
-            fprintf(stream, "none");
-            break;
-        case 2:
-            break;
-        case 1:
-            if (firstset == 0) {
-                fprintf(stream, "any cpu");
-                break;
-            }
-        case 3:
-            fprintf(stream, "%s%d", state > 1 ? "," : "", firstset);
-            if (i - 1 > firstset)
-                fprintf(stream, "-%d", i - 1);
-            break;
-    }
-}
-
 static void print_vcpuinfo(uint32_t tdomid,
                            const libxl_vcpuinfo *vcpuinfo,
                            uint32_t nr_cpus)
@@ -4356,7 +4397,7 @@ static void print_vcpuinfo(uint32_t tdomid,
     /*      TIM */
     printf("%9.1f  ", ((float)vcpuinfo->vcpu_time / 1e9));
     /* CPU AFFINITY */
-    print_bitmap(vcpuinfo->cpumap.map, nr_cpus, stdout);
+    print_cpumap(vcpuinfo->cpumap.map, nr_cpus, stdout);
     printf("\n");
 }
 
@@ -5942,7 +5983,7 @@ int main_claims(int argc, char **argv)
     }
 
     list_domains(0 /* verbose */, 0 /* context */, 1 /* claim */,
-                 info, nb_domain);
+                 0 /* numa */, info, nb_domain);
 
     libxl_dominfo_list_free(info, nb_domain);
     return 0;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 00899f5..347302c 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -50,7 +50,8 @@ struct cmd_spec cmd_table[] = {
       "[options] [Domain]\n",
       "-l, --long              Output all VM details\n"
       "-v, --verbose           Prints out UUIDs and security context\n"
-      "-Z, --context           Prints out security context"
+      "-Z, --context           Prints out security context\n"
+      "-n, --numa              Prints out NUMA node affinity"
     },
     { "destroy",
       &main_destroy, 0, 1,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDg-0006Vg-Ix; Wed, 17 Apr 2013 23:56:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDf-0006VP-Js
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:55 +0000
Received: from [85.158.139.83:39376] by server-1.bemta-5.messagelabs.com id
	54/41-14063-6C63F615; Wed, 17 Apr 2013 23:56:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1366243011!28865632!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=BODY_RANDOM_LONG,
	GUARANTEED_100_PERCENT
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16417 invoked from network); 17 Apr 2013 23:56:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDb-00029f-6y
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDa-0007ZW-T2
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:51 +0000
Date: Wed, 17 Apr 2013 23:56:50 +0000
Message-Id: <E1UScDa-0007ZW-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: rearrange and update NUMA
	placement documentation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b3fc812715e35b730bdd1fcf7a942fa0380adc64
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:38 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    docs: rearrange and update NUMA placement documentation
    
    To include the new concept of NUMA aware scheduling and
    describe its impact.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 docs/misc/xl-numa-placement.markdown |   94 ++++++++++++++++++++++++++++++----
 1 files changed, 83 insertions(+), 11 deletions(-)

diff --git a/docs/misc/xl-numa-placement.markdown b/docs/misc/xl-numa-placement.markdown
index 802bcfe..caa3fec 100644
--- a/docs/misc/xl-numa-placement.markdown
+++ b/docs/misc/xl-numa-placement.markdown
@@ -14,22 +14,67 @@ the memory directly attached to the set of cores.
 
 The Xen hypervisor deals with NUMA machines by assigning to each domain
 a "node affinity", i.e., a set of NUMA nodes of the host from which they
-get their memory allocated.
+get their memory allocated. Also, even if the node affinity of a domain
+is allowed to change on-line, it is very important to "place" the domain
+correctly when it is fist created, as the most of its memory is allocated
+at that time and can not (for now) be moved easily.
 
 NUMA awareness becomes very important as soon as many domains start
 running memory-intensive workloads on a shared host. In fact, the cost
 of accessing non node-local memory locations is very high, and the
 performance degradation is likely to be noticeable.
 
-## Guest Placement in xl ##
+For more information, have a look at the [Xen NUMA Introduction][numa_intro]
+page on the Wiki.
+
+### Placing via pinning and cpupools ###
+
+The simplest way of placing a domain on a NUMA node is statically pinning
+the domain's vCPUs to the pCPUs of the node. This goes under the name of
+CPU affinity and can be set through the "cpus=" option in the config file
+(more about this below). Another option is to pool together the pCPUs
+spanning the node and put the domain in such a cpupool with the "pool="
+config option (as documented in our [Wiki][cpupools_howto]).
+
+In both the above cases, the domain will not be able to execute outside
+the specified set of pCPUs for any reasons, even if all those pCPUs are
+busy doing something else while there are others, idle, pCPUs.
+
+So, when doing this, local memory accesses are 100% guaranteed, but that
+may come at he cost of some load imbalances.
+
+### NUMA aware scheduling ###
+
+If the credit scheduler is in use, the concept of node affinity defined
+above does not only apply to memory. In fact, starting from Xen 4.3, the
+scheduler always tries to run the domain's vCPUs on one of the nodes in
+its node affinity. Only if that turns out to be impossible, it will just
+pick any free pCPU.
+
+This is, therefore, something more flexible than CPU affinity, as a domain
+can still run everywhere, it just prefers some nodes rather than others.
+Locality of access is less guaranteed than in the pinning case, but that
+comes along with better chances to exploit all the host resources (e.g.,
+the pCPUs).
+
+In fact, if all the pCPUs in a domain's node affinity are busy, it is
+possible for the domain to run outside of there, but it is very likely that
+slower execution (due to remote memory accesses) is still better than no
+execution at all, as it would happen with pinning. For this reason, NUMA
+aware scheduling has the potential of bringing substantial performances
+benefits, although this will depend on the workload.
+
+## Guest placement in xl ##
 
 If using xl for creating and managing guests, it is very easy to ask for
 both manual or automatic placement of them across the host's NUMA nodes.
 
-Note that xm/xend does the very same thing, the only differences residing
-in the details of the heuristics adopted for the placement (see below).
+Note that xm/xend does a very similar thing, the only differences being
+the details of the heuristics adopted for automatic placement (see below),
+and the lack of support (in both xm/xend and the Xen versions where that\
+was the default toolstack) for NUMA aware scheduling.
 
-### Manual Guest Placement with xl ###
+### Placing the guest manually ###
 
 Thanks to the "cpus=" option, it is possible to specify where a domain
 should be created and scheduled on, directly in its config file. This
@@ -41,14 +86,19 @@ This is very simple and effective, but requires the user/system
 administrator to explicitly specify affinities for each and every domain,
 or Xen won't be able to guarantee the locality for their memory accesses.
 
-It is also possible to deal with NUMA by partitioning the system using
-cpupools. Again, this could be "The Right Answer" for many needs and
-occasions, but has to be carefully considered and setup by hand.
+Notice that this also pins the domain's vCPUs to the specified set of
+pCPUs, so it not only sets the domain's node affinity (its memory will
+come from the nodes to which the pCPUs belong), but at the same time
+forces the vCPUs of the domain to be scheduled on those same pCPUs.
 
-### Automatic Guest Placement with xl ###
+### Placing the guest automatically ###
 
 If no "cpus=" option is specified in the config file, libxl tries
 to figure out on its own on which node(s) the domain could fit best.
+If it finds one (some), the domain's node affinity get set to there,
+and both memory allocations and NUMA aware scheduling (for the credit
+scheduler and starting from Xen 4.3) will comply with it.
+
 It is worthwhile noting that optimally fitting a set of VMs on the NUMA
 nodes of an host is an incarnation of the Bin Packing Problem. In fact,
 the various VMs with different memory sizes are the items to be packed,
@@ -81,7 +131,7 @@ largest amounts of free memory helps keeping the memory fragmentation
 small, and maximizes the probability of being able to put more domains
 there.
 
-## Guest Placement within libxl ##
+## Guest placement in libxl ##
 
 xl achieves automatic NUMA placement because that is what libxl does
 by default. No API is provided (yet) for modifying the behaviour of
@@ -93,15 +143,34 @@ any placement from happening:
     libxl_defbool_set(&domain_build_info->numa_placement, false);
 
 Also, if `numa_placement` is set to `true`, the domain must not
-have any cpu affinity (i.e., `domain_build_info->cpumap` must
+have any CPU affinity (i.e., `domain_build_info->cpumap` must
 have all its bits set, as it is by default), or domain creation
 will fail returning `ERROR_INVAL`.
 
+Starting from Xen 4.3, in case automatic placement happens (and is
+successful), it will affect the domain's node affinity and _not_ its
+CPU affinity. Namely, the domain's vCPUs will not be pinned to any
+pCPU on the host, but the memory from the domain will come from the
+selected node(s) and the NUMA aware scheduling (if the credit scheduler
+is in use) will try to keep the domain there as much as possible.
+
 Besides than that, looking and/or tweaking the placement algorithm
 search "Automatic NUMA placement" in libxl\_internal.h.
 
 Note this may change in future versions of Xen/libxl.
 
+## Xen < 4.3 ##
+
+As NUMA aware scheduling is a new feature of Xen 4.3, things are a little
+bit different for earlier version of Xen. If no "cpus=" option is specified
+and Xen 4.2 is in use, the automatic placement algorithm still runs, but
+the results is used to _pin_ the vCPUs of the domain to the output node(s).
+This is consistent with what was happening with xm/xend, which were also
+affecting the domain's CPU affinity.
+
+On a version of Xen earlier than 4.2, there is not automatic placement at
+all in xl or libxl, and hence no node or CPU affinity being affected.
+
 ## Limitations ##
 
 Analyzing various possible placement solutions is what makes the
@@ -109,3 +178,6 @@ algorithm flexible and quite effective. However, that also means
 it won't scale well to systems with arbitrary number of nodes.
 For this reason, automatic placement is disabled (with a warning)
 if it is requested on a host with more than 16 NUMA nodes.
+
+[numa_intro]: http://wiki.xen.org/wiki/Xen_NUMA_Introduction
+[cpupools_howto]: http://wiki.xen.org/wiki/Cpupools_Howto
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScDg-0006Vg-Ix; Wed, 17 Apr 2013 23:56:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDf-0006VP-Js
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:55 +0000
Received: from [85.158.139.83:39376] by server-1.bemta-5.messagelabs.com id
	54/41-14063-6C63F615; Wed, 17 Apr 2013 23:56:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1366243011!28865632!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.3 required=7.0 tests=BODY_RANDOM_LONG,
	GUARANTEED_100_PERCENT
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16417 invoked from network); 17 Apr 2013 23:56:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:56:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDb-00029f-6y
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDa-0007ZW-T2
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:56:51 +0000
Date: Wed, 17 Apr 2013 23:56:50 +0000
Message-Id: <E1UScDa-0007ZW-T2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: rearrange and update NUMA
	placement documentation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b3fc812715e35b730bdd1fcf7a942fa0380adc64
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Wed Apr 17 10:57:38 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:11:15 2013 +0100

    docs: rearrange and update NUMA placement documentation
    
    To include the new concept of NUMA aware scheduling and
    describe its impact.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 docs/misc/xl-numa-placement.markdown |   94 ++++++++++++++++++++++++++++++----
 1 files changed, 83 insertions(+), 11 deletions(-)

diff --git a/docs/misc/xl-numa-placement.markdown b/docs/misc/xl-numa-placement.markdown
index 802bcfe..caa3fec 100644
--- a/docs/misc/xl-numa-placement.markdown
+++ b/docs/misc/xl-numa-placement.markdown
@@ -14,22 +14,67 @@ the memory directly attached to the set of cores.
 
 The Xen hypervisor deals with NUMA machines by assigning to each domain
 a "node affinity", i.e., a set of NUMA nodes of the host from which they
-get their memory allocated.
+get their memory allocated. Also, even if the node affinity of a domain
+is allowed to change on-line, it is very important to "place" the domain
+correctly when it is fist created, as the most of its memory is allocated
+at that time and can not (for now) be moved easily.
 
 NUMA awareness becomes very important as soon as many domains start
 running memory-intensive workloads on a shared host. In fact, the cost
 of accessing non node-local memory locations is very high, and the
 performance degradation is likely to be noticeable.
 
-## Guest Placement in xl ##
+For more information, have a look at the [Xen NUMA Introduction][numa_intro]
+page on the Wiki.
+
+### Placing via pinning and cpupools ###
+
+The simplest way of placing a domain on a NUMA node is statically pinning
+the domain's vCPUs to the pCPUs of the node. This goes under the name of
+CPU affinity and can be set through the "cpus=" option in the config file
+(more about this below). Another option is to pool together the pCPUs
+spanning the node and put the domain in such a cpupool with the "pool="
+config option (as documented in our [Wiki][cpupools_howto]).
+
+In both the above cases, the domain will not be able to execute outside
+the specified set of pCPUs for any reasons, even if all those pCPUs are
+busy doing something else while there are others, idle, pCPUs.
+
+So, when doing this, local memory accesses are 100% guaranteed, but that
+may come at he cost of some load imbalances.
+
+### NUMA aware scheduling ###
+
+If the credit scheduler is in use, the concept of node affinity defined
+above does not only apply to memory. In fact, starting from Xen 4.3, the
+scheduler always tries to run the domain's vCPUs on one of the nodes in
+its node affinity. Only if that turns out to be impossible, it will just
+pick any free pCPU.
+
+This is, therefore, something more flexible than CPU affinity, as a domain
+can still run everywhere, it just prefers some nodes rather than others.
+Locality of access is less guaranteed than in the pinning case, but that
+comes along with better chances to exploit all the host resources (e.g.,
+the pCPUs).
+
+In fact, if all the pCPUs in a domain's node affinity are busy, it is
+possible for the domain to run outside of there, but it is very likely that
+slower execution (due to remote memory accesses) is still better than no
+execution at all, as it would happen with pinning. For this reason, NUMA
+aware scheduling has the potential of bringing substantial performances
+benefits, although this will depend on the workload.
+
+## Guest placement in xl ##
 
 If using xl for creating and managing guests, it is very easy to ask for
 both manual or automatic placement of them across the host's NUMA nodes.
 
-Note that xm/xend does the very same thing, the only differences residing
-in the details of the heuristics adopted for the placement (see below).
+Note that xm/xend does a very similar thing, the only differences being
+the details of the heuristics adopted for automatic placement (see below),
+and the lack of support (in both xm/xend and the Xen versions where that\
+was the default toolstack) for NUMA aware scheduling.
 
-### Manual Guest Placement with xl ###
+### Placing the guest manually ###
 
 Thanks to the "cpus=" option, it is possible to specify where a domain
 should be created and scheduled on, directly in its config file. This
@@ -41,14 +86,19 @@ This is very simple and effective, but requires the user/system
 administrator to explicitly specify affinities for each and every domain,
 or Xen won't be able to guarantee the locality for their memory accesses.
 
-It is also possible to deal with NUMA by partitioning the system using
-cpupools. Again, this could be "The Right Answer" for many needs and
-occasions, but has to be carefully considered and setup by hand.
+Notice that this also pins the domain's vCPUs to the specified set of
+pCPUs, so it not only sets the domain's node affinity (its memory will
+come from the nodes to which the pCPUs belong), but at the same time
+forces the vCPUs of the domain to be scheduled on those same pCPUs.
 
-### Automatic Guest Placement with xl ###
+### Placing the guest automatically ###
 
 If no "cpus=" option is specified in the config file, libxl tries
 to figure out on its own on which node(s) the domain could fit best.
+If it finds one (some), the domain's node affinity get set to there,
+and both memory allocations and NUMA aware scheduling (for the credit
+scheduler and starting from Xen 4.3) will comply with it.
+
 It is worthwhile noting that optimally fitting a set of VMs on the NUMA
 nodes of an host is an incarnation of the Bin Packing Problem. In fact,
 the various VMs with different memory sizes are the items to be packed,
@@ -81,7 +131,7 @@ largest amounts of free memory helps keeping the memory fragmentation
 small, and maximizes the probability of being able to put more domains
 there.
 
-## Guest Placement within libxl ##
+## Guest placement in libxl ##
 
 xl achieves automatic NUMA placement because that is what libxl does
 by default. No API is provided (yet) for modifying the behaviour of
@@ -93,15 +143,34 @@ any placement from happening:
     libxl_defbool_set(&domain_build_info->numa_placement, false);
 
 Also, if `numa_placement` is set to `true`, the domain must not
-have any cpu affinity (i.e., `domain_build_info->cpumap` must
+have any CPU affinity (i.e., `domain_build_info->cpumap` must
 have all its bits set, as it is by default), or domain creation
 will fail returning `ERROR_INVAL`.
 
+Starting from Xen 4.3, in case automatic placement happens (and is
+successful), it will affect the domain's node affinity and _not_ its
+CPU affinity. Namely, the domain's vCPUs will not be pinned to any
+pCPU on the host, but the memory from the domain will come from the
+selected node(s) and the NUMA aware scheduling (if the credit scheduler
+is in use) will try to keep the domain there as much as possible.
+
 Besides than that, looking and/or tweaking the placement algorithm
 search "Automatic NUMA placement" in libxl\_internal.h.
 
 Note this may change in future versions of Xen/libxl.
 
+## Xen < 4.3 ##
+
+As NUMA aware scheduling is a new feature of Xen 4.3, things are a little
+bit different for earlier version of Xen. If no "cpus=" option is specified
+and Xen 4.2 is in use, the automatic placement algorithm still runs, but
+the results is used to _pin_ the vCPUs of the domain to the output node(s).
+This is consistent with what was happening with xm/xend, which were also
+affecting the domain's CPU affinity.
+
+On a version of Xen earlier than 4.2, there is not automatic placement at
+all in xl or libxl, and hence no node or CPU affinity being affected.
+
 ## Limitations ##
 
 Analyzing various possible placement solutions is what makes the
@@ -109,3 +178,6 @@ algorithm flexible and quite effective. However, that also means
 it won't scale well to systems with arbitrary number of nodes.
 For this reason, automatic placement is disabled (with a warning)
 if it is requested on a host with more than 16 NUMA nodes.
+
+[numa_intro]: http://wiki.xen.org/wiki/Xen_NUMA_Introduction
+[cpupools_howto]: http://wiki.xen.org/wiki/Cpupools_Howto
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScE2-0006ZC-MB; Wed, 17 Apr 2013 23:57:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE1-0006Yu-KX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:17 +0000
Received: from [85.158.139.83:10632] by server-7.bemta-5.messagelabs.com id
	16/9A-12441-CD63F615; Wed, 17 Apr 2013 23:57:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1366243035!21392872!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9806 invoked from network); 17 Apr 2013 23:57:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDz-0002AN-40
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDz-0007aL-2d
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:15 +0000
Date: Wed, 17 Apr 2013 23:57:15 +0000
Message-Id: <E1UScDz-0007aL-2d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: clean META files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 717d9e5f764a8ef4e405a37d5e20d0ca50791b0f
Author:     Vincent Bernardoff <vincent.bernardoff@citrix.com>
AuthorDate: Mon Apr 15 17:02:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:23:00 2013 +0100

    tools/ocaml: clean META files
    
    As META files are generated from META.in files, they should be cleaned
    by clean rules.
    
    Signed-off-by: Vincent Bernardoff <vincent.bernardoff@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/Makefile.rules |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index ff19067..5e6d81e 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -45,7 +45,7 @@ ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS))
 	$(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli $o,MLDEP,)
 
 clean: $(CLEAN_HOOKS)
-	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make
+	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META
 
 quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScE2-0006ZC-MB; Wed, 17 Apr 2013 23:57:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE1-0006Yu-KX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:17 +0000
Received: from [85.158.139.83:10632] by server-7.bemta-5.messagelabs.com id
	16/9A-12441-CD63F615; Wed, 17 Apr 2013 23:57:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1366243035!21392872!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9806 invoked from network); 17 Apr 2013 23:57:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDz-0002AN-40
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDz-0007aL-2d
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:15 +0000
Date: Wed, 17 Apr 2013 23:57:15 +0000
Message-Id: <E1UScDz-0007aL-2d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/ocaml: clean META files
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 717d9e5f764a8ef4e405a37d5e20d0ca50791b0f
Author:     Vincent Bernardoff <vincent.bernardoff@citrix.com>
AuthorDate: Mon Apr 15 17:02:40 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:23:00 2013 +0100

    tools/ocaml: clean META files
    
    As META files are generated from META.in files, they should be cleaned
    by clean rules.
    
    Signed-off-by: Vincent Bernardoff <vincent.bernardoff@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/ocaml/Makefile.rules |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index ff19067..5e6d81e 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -45,7 +45,7 @@ ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS))
 	$(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli $o,MLDEP,)
 
 clean: $(CLEAN_HOOKS)
-	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make
+	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META
 
 quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScE2-0006ZH-Oi; Wed, 17 Apr 2013 23:57:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE1-0006Yw-QX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:17 +0000
Received: from [85.158.138.51:60489] by server-12.bemta-3.messagelabs.com id
	82/90-01357-2D63F615; Wed, 17 Apr 2013 23:57:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1366243025!8914123!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 483 invoked from network); 17 Apr 2013 23:57:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDl-0002AH-Dv
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDl-0007Zu-B8
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:01 +0000
Date: Wed, 17 Apr 2013 23:57:01 +0000
Message-Id: <E1UScDl-0007Zu-B8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22bbb58689dbbdbe2e0a9309f8894edf0b2fa9ae
Merge: b3fc812715e35b730bdd1fcf7a942fa0380adc64 63753b3e0dc56efb1acf94fa46f3fee7bc59281c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 12:52:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:52:11 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/domain.c        |   13 +++++++------
 xen/include/asm-x86/domain.h |    6 +++---
 2 files changed, 10 insertions(+), 9 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScE2-0006ZH-Oi; Wed, 17 Apr 2013 23:57:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE1-0006Yw-QX
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:17 +0000
Received: from [85.158.138.51:60489] by server-12.bemta-3.messagelabs.com id
	82/90-01357-2D63F615; Wed, 17 Apr 2013 23:57:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1366243025!8914123!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 483 invoked from network); 17 Apr 2013 23:57:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDl-0002AH-Dv
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScDl-0007Zu-B8
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:01 +0000
Date: Wed, 17 Apr 2013 23:57:01 +0000
Message-Id: <E1UScDl-0007Zu-B8@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22bbb58689dbbdbe2e0a9309f8894edf0b2fa9ae
Merge: b3fc812715e35b730bdd1fcf7a942fa0380adc64 63753b3e0dc56efb1acf94fa46f3fee7bc59281c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 12:52:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 12:52:11 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/domain.c        |   13 +++++++------
 xen/include/asm-x86/domain.h |    6 +++---
 2 files changed, 10 insertions(+), 9 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScED-0006br-Ri; Wed, 17 Apr 2013 23:57:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEC-0006bO-3l
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:28 +0000
Received: from [85.158.137.99:2189] by server-13.bemta-3.messagelabs.com id
	1F/F3-25744-7E63F615; Wed, 17 Apr 2013 23:57:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1366243045!12561590!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29954 invoked from network); 17 Apr 2013 23:57:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE9-0002AW-Bl
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE9-0007bT-8i
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:25 +0000
Date: Wed, 17 Apr 2013 23:57:25 +0000
Message-Id: <E1UScE9-0007bT-8i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] configure: test(1) uses = not == for
	string comparison
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3094202715389632690=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3094202715389632690==
Content-Type: text/plain

commit be4d793faa218b6991ff7fd86eacf2c833284919
Author:     Patrick Welche <prlw1@cam.ac.uk>
AuthorDate: Wed Apr 10 11:34:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:29:17 2013 +0100

    configure: test(1) uses = not == for string comparison
    
    Avoids a bash-ism.
    
    Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 m4/path_or_fail.m4 |    2 +-
 m4/python_devel.m4 |    2 +-
 stubdom/configure  |    4 ++--
 tools/configure    |   22 +++++++++++-----------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/m4/path_or_fail.m4 b/m4/path_or_fail.m4
index ece8cd4..e256918 100644
--- a/m4/path_or_fail.m4
+++ b/m4/path_or_fail.m4
@@ -1,6 +1,6 @@
 AC_DEFUN([AX_PATH_PROG_OR_FAIL],
 [AC_PATH_PROG([$1], [$2], [no])
-if test x"${$1}" == x"no" 
+if test x"${$1}" = x"no"
 then
     AC_MSG_ERROR([Unable to find $2, please install $2])
 fi])
diff --git a/m4/python_devel.m4 b/m4/python_devel.m4
index 0a2202c..659e7d4 100644
--- a/m4/python_devel.m4
+++ b/m4/python_devel.m4
@@ -4,7 +4,7 @@ ac_previous_ldflags=$LDFLAGS
 ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
     print distutils.sysconfig.get_config_var("VERSION")'`
 AC_PATH_PROG([pyconfig], [$PYTHON-config], [no])
-AS_IF([test x"$pyconfig" == x"no"], [
+AS_IF([test x"$pyconfig" = x"no"], [
     dnl For those that don't have python-config
     CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`"
diff --git a/stubdom/configure b/stubdom/configure
index 51ca676..218457f 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -3119,7 +3119,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${WGET}" == x"no"
+if test x"${WGET}" = x"no"
 then
     as_fn_error $? "Unable to find wget, please install wget" "$LINENO" 5
 fi
@@ -3168,7 +3168,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${CMAKE}" == x"no"
+if test x"${CMAKE}" = x"no"
 then
     as_fn_error $? "Unable to find cmake, please install cmake" "$LINENO" 5
 fi
diff --git a/tools/configure b/tools/configure
index 7b8cef8..aac7f87 100755
--- a/tools/configure
+++ b/tools/configure
@@ -4477,7 +4477,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${PERL}" == x"no"
+if test x"${PERL}" = x"no"
 then
     as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
 fi
@@ -4524,7 +4524,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${CURL}" == x"no"
+if test x"${CURL}" = x"no"
 then
     as_fn_error $? "Unable to find curl-config, please install curl-config" "$LINENO" 5
 fi
@@ -4569,7 +4569,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${XML}" == x"no"
+if test x"${XML}" = x"no"
 then
     as_fn_error $? "Unable to find xml2-config, please install xml2-config" "$LINENO" 5
 fi
@@ -5837,7 +5837,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${BASH}" == x"no"
+if test x"${BASH}" = x"no"
 then
     as_fn_error $? "Unable to find bash, please install bash" "$LINENO" 5
 fi
@@ -5892,7 +5892,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${PYTHONPATH}" == x"no"
+if test x"${PYTHONPATH}" = x"no"
 then
     as_fn_error $? "Unable to find $PYTHON, please install $PYTHON" "$LINENO" 5
 fi
@@ -6355,7 +6355,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"$pyconfig" == x"no"; then :
+if test x"$pyconfig" = x"no"; then :
 
         CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`"
@@ -6484,7 +6484,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${XGETTEXT}" == x"no"
+if test x"${XGETTEXT}" = x"no"
 then
     as_fn_error $? "Unable to find xgettext, please install xgettext" "$LINENO" 5
 fi
@@ -6531,7 +6531,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${AS86}" == x"no"
+if test x"${AS86}" = x"no"
 then
     as_fn_error $? "Unable to find as86, please install as86" "$LINENO" 5
 fi
@@ -6576,7 +6576,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${LD86}" == x"no"
+if test x"${LD86}" = x"no"
 then
     as_fn_error $? "Unable to find ld86, please install ld86" "$LINENO" 5
 fi
@@ -6621,7 +6621,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${BCC}" == x"no"
+if test x"${BCC}" = x"no"
 then
     as_fn_error $? "Unable to find bcc, please install bcc" "$LINENO" 5
 fi
@@ -6666,7 +6666,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${IASL}" == x"no"
+if test x"${IASL}" = x"no"
 then
     as_fn_error $? "Unable to find iasl, please install iasl" "$LINENO" 5
 fi
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3094202715389632690==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3094202715389632690==--

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScED-0006br-Ri; Wed, 17 Apr 2013 23:57:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEC-0006bO-3l
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:28 +0000
Received: from [85.158.137.99:2189] by server-13.bemta-3.messagelabs.com id
	1F/F3-25744-7E63F615; Wed, 17 Apr 2013 23:57:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1366243045!12561590!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29954 invoked from network); 17 Apr 2013 23:57:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE9-0002AW-Bl
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScE9-0007bT-8i
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:25 +0000
Date: Wed, 17 Apr 2013 23:57:25 +0000
Message-Id: <E1UScE9-0007bT-8i@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] configure: test(1) uses = not == for
	string comparison
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3094202715389632690=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3094202715389632690==
Content-Type: text/plain

commit be4d793faa218b6991ff7fd86eacf2c833284919
Author:     Patrick Welche <prlw1@cam.ac.uk>
AuthorDate: Wed Apr 10 11:34:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:29:17 2013 +0100

    configure: test(1) uses = not == for string comparison
    
    Avoids a bash-ism.
    
    Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 m4/path_or_fail.m4 |    2 +-
 m4/python_devel.m4 |    2 +-
 stubdom/configure  |    4 ++--
 tools/configure    |   22 +++++++++++-----------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/m4/path_or_fail.m4 b/m4/path_or_fail.m4
index ece8cd4..e256918 100644
--- a/m4/path_or_fail.m4
+++ b/m4/path_or_fail.m4
@@ -1,6 +1,6 @@
 AC_DEFUN([AX_PATH_PROG_OR_FAIL],
 [AC_PATH_PROG([$1], [$2], [no])
-if test x"${$1}" == x"no" 
+if test x"${$1}" = x"no"
 then
     AC_MSG_ERROR([Unable to find $2, please install $2])
 fi])
diff --git a/m4/python_devel.m4 b/m4/python_devel.m4
index 0a2202c..659e7d4 100644
--- a/m4/python_devel.m4
+++ b/m4/python_devel.m4
@@ -4,7 +4,7 @@ ac_previous_ldflags=$LDFLAGS
 ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
     print distutils.sysconfig.get_config_var("VERSION")'`
 AC_PATH_PROG([pyconfig], [$PYTHON-config], [no])
-AS_IF([test x"$pyconfig" == x"no"], [
+AS_IF([test x"$pyconfig" = x"no"], [
     dnl For those that don't have python-config
     CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`"
diff --git a/stubdom/configure b/stubdom/configure
index 51ca676..218457f 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -3119,7 +3119,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${WGET}" == x"no"
+if test x"${WGET}" = x"no"
 then
     as_fn_error $? "Unable to find wget, please install wget" "$LINENO" 5
 fi
@@ -3168,7 +3168,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${CMAKE}" == x"no"
+if test x"${CMAKE}" = x"no"
 then
     as_fn_error $? "Unable to find cmake, please install cmake" "$LINENO" 5
 fi
diff --git a/tools/configure b/tools/configure
index 7b8cef8..aac7f87 100755
--- a/tools/configure
+++ b/tools/configure
@@ -4477,7 +4477,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${PERL}" == x"no"
+if test x"${PERL}" = x"no"
 then
     as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
 fi
@@ -4524,7 +4524,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${CURL}" == x"no"
+if test x"${CURL}" = x"no"
 then
     as_fn_error $? "Unable to find curl-config, please install curl-config" "$LINENO" 5
 fi
@@ -4569,7 +4569,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${XML}" == x"no"
+if test x"${XML}" = x"no"
 then
     as_fn_error $? "Unable to find xml2-config, please install xml2-config" "$LINENO" 5
 fi
@@ -5837,7 +5837,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${BASH}" == x"no"
+if test x"${BASH}" = x"no"
 then
     as_fn_error $? "Unable to find bash, please install bash" "$LINENO" 5
 fi
@@ -5892,7 +5892,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${PYTHONPATH}" == x"no"
+if test x"${PYTHONPATH}" = x"no"
 then
     as_fn_error $? "Unable to find $PYTHON, please install $PYTHON" "$LINENO" 5
 fi
@@ -6355,7 +6355,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"$pyconfig" == x"no"; then :
+if test x"$pyconfig" = x"no"; then :
 
         CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \
         print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`"
@@ -6484,7 +6484,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${XGETTEXT}" == x"no"
+if test x"${XGETTEXT}" = x"no"
 then
     as_fn_error $? "Unable to find xgettext, please install xgettext" "$LINENO" 5
 fi
@@ -6531,7 +6531,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${AS86}" == x"no"
+if test x"${AS86}" = x"no"
 then
     as_fn_error $? "Unable to find as86, please install as86" "$LINENO" 5
 fi
@@ -6576,7 +6576,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${LD86}" == x"no"
+if test x"${LD86}" = x"no"
 then
     as_fn_error $? "Unable to find ld86, please install ld86" "$LINENO" 5
 fi
@@ -6621,7 +6621,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${BCC}" == x"no"
+if test x"${BCC}" = x"no"
 then
     as_fn_error $? "Unable to find bcc, please install bcc" "$LINENO" 5
 fi
@@ -6666,7 +6666,7 @@ $as_echo "no" >&6; }
 fi
 
 
-if test x"${IASL}" == x"no"
+if test x"${IASL}" = x"no"
 then
     as_fn_error $? "Unable to find iasl, please install iasl" "$LINENO" 5
 fi
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3094202715389632690==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3094202715389632690==--

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScEO-0006eE-0Z; Wed, 17 Apr 2013 23:57:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEN-0006dw-0A
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:39 +0000
Received: from [85.158.139.211:49094] by server-10.bemta-5.messagelabs.com id
	24/AF-23714-2F63F615; Wed, 17 Apr 2013 23:57:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1366243055!18946700!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31688 invoked from network); 17 Apr 2013 23:57:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEJ-0002Ah-Hg
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEJ-0007bt-GQ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:35 +0000
Date: Wed, 17 Apr 2013 23:57:35 +0000
Message-Id: <E1UScEJ-0007bt-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Don't use non-portable cp -d
	flag unnecessarily (no links are involved)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b0ec476bb9dca589674745ebffb0f6799774d6e
Author:     Patrick Welche <prlw1@cam.ac.uk>
AuthorDate: Wed Apr 17 09:59:38 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:29:33 2013 +0100

    docs: Don't use non-portable cp -d flag unnecessarily (no links are involved)
    
    cp -d is a GNU extension, and only useful for links, which don't seem
    to exist in the directories being copied, so just remove said flag.
    
    Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index fdebae8..5f319a1 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -84,9 +84,9 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
 
 	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
-	cp -dR man1 $(DESTDIR)$(MANDIR)
-	cp -dR man5 $(DESTDIR)$(MANDIR)
-	[ ! -d html ] || cp -dR html $(DESTDIR)$(DOCDIR)
+	cp -R man1 $(DESTDIR)$(MANDIR)
+	cp -R man5 $(DESTDIR)$(MANDIR)
+	[ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR)
 
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:41 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScEO-0006eE-0Z; Wed, 17 Apr 2013 23:57:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEN-0006dw-0A
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:39 +0000
Received: from [85.158.139.211:49094] by server-10.bemta-5.messagelabs.com id
	24/AF-23714-2F63F615; Wed, 17 Apr 2013 23:57:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1366243055!18946700!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31688 invoked from network); 17 Apr 2013 23:57:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEJ-0002Ah-Hg
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEJ-0007bt-GQ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:35 +0000
Date: Wed, 17 Apr 2013 23:57:35 +0000
Message-Id: <E1UScEJ-0007bt-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Don't use non-portable cp -d
	flag unnecessarily (no links are involved)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b0ec476bb9dca589674745ebffb0f6799774d6e
Author:     Patrick Welche <prlw1@cam.ac.uk>
AuthorDate: Wed Apr 17 09:59:38 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:29:33 2013 +0100

    docs: Don't use non-portable cp -d flag unnecessarily (no links are involved)
    
    cp -d is a GNU extension, and only useful for links, which don't seem
    to exist in the directories being copied, so just remove said flag.
    
    Signed-off-by: Patrick Welche <prlw1@cam.ac.uk>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index fdebae8..5f319a1 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -84,9 +84,9 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(DOCDIR)
 
 	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
-	cp -dR man1 $(DESTDIR)$(MANDIR)
-	cp -dR man5 $(DESTDIR)$(MANDIR)
-	[ ! -d html ] || cp -dR html $(DESTDIR)$(DOCDIR)
+	cp -R man1 $(DESTDIR)$(MANDIR)
+	cp -R man5 $(DESTDIR)$(MANDIR)
+	[ ! -d html ] || cp -R html $(DESTDIR)$(DOCDIR)
 
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	perl -w -- ./gen-html-index -i INDEX html $(DOC_HTML)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScEc-0006ll-41; Wed, 17 Apr 2013 23:57:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEZ-0006ga-Vq
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:52 +0000
Received: from [85.158.139.211:52112] by server-2.bemta-5.messagelabs.com id
	2F/94-23989-FF63F615; Wed, 17 Apr 2013 23:57:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1366243065!18918697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28909 invoked from network); 17 Apr 2013 23:57:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScET-0002An-OQ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScET-0007cF-N6
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:45 +0000
Date: Wed, 17 Apr 2013 23:57:45 +0000
Message-Id: <E1UScET-0007cF-N6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: postpone backend name resolution
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef496b81f0336f09968a318e7f81151dd4f5a0cc
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Mon Apr 15 10:33:25 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:55:36 2013 +0100

    libxl: postpone backend name resolution
    
    This adds a backend_domname field in libxl devices that contain a
    backend_domid field, allowing either a domid or a domain name to be
    specified in the configuration structures.  The domain name is resolved
    into a domain ID in the _setdefault function when adding the device.
    This change allows the backend of the block devices to be specified
    (which previously required passing the libxl_ctx down into the block
    device parser), and will simplify specification of backend domains in
    other users of libxl.
    
    The check on run_hotplug_scripts in parse_config_data is removed because
    it is a duplicate of the one in libxl__device_nic_setdefault, and is
    removed here because it no longer has the resolved domain ID to check.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran flex ]
---
 docs/misc/xl-disk-configuration.txt |   12 +
 tools/libxl/libxl.c                 |   32 ++-
 tools/libxl/libxl.h                 |   12 +
 tools/libxl/libxl_types.idl         |    5 +
 tools/libxl/libxl_utils.c           |   19 ++
 tools/libxl/libxl_utils.h           |    1 +
 tools/libxl/libxlu_disk_l.c         |  525 ++++++++++++++++++-----------------
 tools/libxl/libxlu_disk_l.h         |    2 +-
 tools/libxl/libxlu_disk_l.l         |    1 +
 tools/libxl/xl_cmdimpl.c            |   80 +-----
 10 files changed, 359 insertions(+), 330 deletions(-)

diff --git a/docs/misc/xl-disk-configuration.txt b/docs/misc/xl-disk-configuration.txt
index 86c16be..5bd456d 100644
--- a/docs/misc/xl-disk-configuration.txt
+++ b/docs/misc/xl-disk-configuration.txt
@@ -139,6 +139,18 @@ cdrom
 Convenience alias for "devtype=cdrom".
 
 
+backend=<domain-name>
+---------------------
+
+Description:           Designates a backend domain for the device
+Supported values:      Valid domain names
+Mandatory:             No
+
+Specifies the backend domain which this device should attach to. This
+defaults to domain 0. Specifying another domain requires setting up a
+driver domain which is outside the scope of this document.
+
+
 backendtype=<backend-type>
 --------------------------
 
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3c6d71b..fa6dfed 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1731,13 +1731,23 @@ static int libxl__device_nextid(libxl__gc *gc, uint32_t domid, char *device)
     return nextid;
 }
 
+static int libxl__resolve_domid(libxl__gc *gc, const char *name,
+                                uint32_t *domid)
+{
+    if (!name)
+        return 0;
+    return libxl_domain_qualifier_to_domid(CTX, name, domid);
+}
+
 /******************************************************************************/
 int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
 {
-   if(libxl_uuid_is_nil(&vtpm->uuid)) {
-      libxl_uuid_generate(&vtpm->uuid);
-   }
-   return 0;
+    int rc;
+    if (libxl_uuid_is_nil(&vtpm->uuid)) {
+        libxl_uuid_generate(&vtpm->uuid);
+    }
+    rc = libxl__resolve_domid(gc, vtpm->backend_domname, &vtpm->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_vtpm(libxl__gc *gc, uint32_t domid,
@@ -1969,6 +1979,7 @@ int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
     rc = libxl__device_disk_set_backend(gc, disk);
     if (rc) return rc;
 
+    rc = libxl__resolve_domid(gc, disk->backend_domname, &disk->backend_domid);
     return rc;
 }
 
@@ -2740,6 +2751,7 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
                                  uint32_t domid)
 {
     int run_hotplug_scripts;
+    int rc;
 
     if (!nic->mtu)
         nic->mtu = 1492;
@@ -2800,7 +2812,8 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
         abort();
     }
 
-    return 0;
+    rc = libxl__resolve_domid(gc, nic->backend_domname, &nic->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_nic(libxl__gc *gc, uint32_t domid,
@@ -3157,7 +3170,9 @@ out:
 
 int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
-    return 0;
+    int rc;
+    rc = libxl__resolve_domid(gc, vkb->backend_domname, &vkb->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
@@ -3241,6 +3256,8 @@ out:
 
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
+    int rc;
+
     libxl_defbool_setdefault(&vfb->vnc.enable, true);
     if (libxl_defbool_val(vfb->vnc.enable)) {
         if (!vfb->vnc.listen) {
@@ -3256,7 +3273,8 @@ int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
     libxl_defbool_setdefault(&vfb->sdl.enable, false);
     libxl_defbool_setdefault(&vfb->sdl.opengl, false);
 
-    return 0;
+    rc = libxl__resolve_domid(gc, vfb->backend_domname, &vfb->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_vfb(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 92f3f8e..25efa76 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -296,6 +296,18 @@
  */
 #define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
 
+/*
+ * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+ *
+ * If this is defined, libxl_device_* structures containing a backend_domid
+ * field also contain a backend_domname field.  If backend_domname is set, it is
+ * resolved to a domain ID when the device is used and takes precedence over the
+ * backend_domid field.
+ *
+ * If this is not defined, the backend_domname field does not exist.
+ */
+#define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 2c10772..ecf1f0b 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -351,6 +351,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
 
 libxl_device_vfb = Struct("device_vfb", [
     ("backend_domid", libxl_domid),
+    ("backend_domname",string),
     ("devid",         libxl_devid),
     ("vnc",           libxl_vnc_info),
     ("sdl",           libxl_sdl_info),
@@ -360,11 +361,13 @@ libxl_device_vfb = Struct("device_vfb", [
 
 libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
+    ("backend_domname", string),
     ("devid", libxl_devid),
     ])
 
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
+    ("backend_domname", string),
     ("pdev_path", string),
     ("vdev", string),
     ("backend", libxl_disk_backend),
@@ -377,6 +380,7 @@ libxl_device_disk = Struct("device_disk", [
 
 libxl_device_nic = Struct("device_nic", [
     ("backend_domid", libxl_domid),
+    ("backend_domname", string),
     ("devid", libxl_devid),
     ("mtu", integer),
     ("model", string),
@@ -405,6 +409,7 @@ libxl_device_pci = Struct("device_pci", [
 
 libxl_device_vtpm = Struct("device_vtpm", [
     ("backend_domid",    libxl_domid),
+    ("backend_domname",  string),
     ("devid",            libxl_devid),
     ("uuid",             libxl_uuid),
 ])
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 8f78790..35da71c 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -90,6 +90,25 @@ int libxl_name_to_domid(libxl_ctx *ctx, const char *name,
     return ret;
 }
 
+int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name,
+                                    uint32_t *domid)
+{
+    int i, rv;
+    for (i=0; name[i]; i++) {
+        if (!isdigit(name[i])) {
+            goto nondigit_found;
+        }
+    }
+    *domid = strtoul(name, NULL, 10);
+    return 0;
+
+ nondigit_found:
+    /* this could also check for uuids */
+    rv = libxl_name_to_domid(ctx, name, domid);
+    return rv;
+}
+
+
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
     unsigned int len;
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 40f3f30..a430362 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -21,6 +21,7 @@
 const char *libxl_basename(const char *name); /* returns string from strdup */
 unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned int smp_cpus);
 int libxl_name_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
+int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
index 4c68034..03adfef 100644
--- a/tools/libxl/libxlu_disk_l.c
+++ b/tools/libxl/libxlu_disk_l.c
@@ -361,8 +361,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 25
-#define YY_END_OF_BUFFER 26
+#define YY_NUM_RULES 26
+#define YY_END_OF_BUFFER 27
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -370,60 +370,61 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_acclist[447] =
+static yyconst flex_int16_t yy_acclist[454] =
     {   0,
-       24,   24,   26,   22,   23,   25, 8193,   22,   23,   25,
-    16385, 8193,   22,   25,16385,   22,   23,   25,   23,   25,
-       22,   23,   25,   22,   23,   25,   22,   23,   25,   22,
-       23,   25,   22,   23,   25,   22,   23,   25,   22,   23,
-       25,   22,   23,   25,   22,   23,   25,   22,   23,   25,
-       22,   23,   25,   22,   23,   25,   22,   23,   25,   22,
-       23,   25,   22,   23,   25,   24,   25,   25,   22,   22,
-     8193,   22, 8193,   22,16385, 8193,   22, 8193,   22,   22,
-     8213,   22,16405,   22,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-
-       22,   22,   24, 8193,   22, 8193,   22, 8193, 8213,   22,
-     8213,   22, 8213,   12,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-       22,   22, 8213,   22, 8213,   22, 8213,   12,   22,   17,
-     8213,   22,16405,   22,   22,   22,   22,   22,   22,   22,
-     8206, 8213,   22,16398,16405,   20, 8213,   22,16405,   22,
-     8205, 8213,   22,16397,16405,   22,   22, 8208, 8213,   22,
-    16400,16405,   22,   22,   22,   22,   17, 8213,   22,   17,
-     8213,   22,   17,   22,   17, 8213,   22,    3,   22,   22,
-       19, 8213,   22,16405,   22,   22, 8206, 8213,   22, 8206,
-
-     8213,   22, 8206,   22, 8206, 8213,   20, 8213,   22,   20,
-     8213,   22,   20,   22,   20, 8213, 8205, 8213,   22, 8205,
-     8213,   22, 8205,   22, 8205, 8213,   22, 8208, 8213,   22,
-     8208, 8213,   22, 8208,   22, 8208, 8213,   22,   22,    9,
-       22,   17, 8213,   22,   17, 8213,   22,   17, 8213,   17,
-       22,   17,   22,    3,   22,   22,   19, 8213,   22,   19,
-     8213,   22,   19,   22,   19, 8213,   22,   18, 8213,   22,
-    16405, 8206, 8213,   22, 8206, 8213,   22, 8206, 8213, 8206,
-       22, 8206,   20, 8213,   22,   20, 8213,   22,   20, 8213,
-       20,   22,   20, 8205, 8213,   22, 8205, 8213,   22, 8205,
-
-     8213, 8205,   22, 8205,   22, 8208, 8213,   22, 8208, 8213,
-       22, 8208, 8213, 8208,   22, 8208,   22,   22,    9,   12,
-        9,    7,   22,   22,   19, 8213,   22,   19, 8213,   22,
-       19, 8213,   19,   22,   19,    2,   18, 8213,   22,   18,
-     8213,   22,   18,   22,   18, 8213,   10,   22,   11,    9,
-        9,   12,    7,   12,    7,   22,    6,    2,   12,    2,
-       18, 8213,   22,   18, 8213,   22,   18, 8213,   18,   22,
-       18,   10,   12,   10,   15, 8213,   22,16405,   11,   12,
-       11,    7,    7,   12,   22,    6,   12,    6,    6,   12,
-        6,   12,    2,    2,   12,   10,   10,   12,   15, 8213,
-
-       22,   15, 8213,   22,   15,   22,   15, 8213,   11,   12,
-       22,    6,    6,   12,    6,    6,   15, 8213,   22,   15,
-     8213,   22,   15, 8213,   15,   22,   15,   22,    6,    6,
-        8,    6,    5,    6,    8,   12,    8,    4,    6,    5,
-        6,    8,    8,   12,    4,    6
+       25,   25,   27,   23,   24,   26, 8193,   23,   24,   26,
+    16385, 8193,   23,   26,16385,   23,   24,   26,   24,   26,
+       23,   24,   26,   23,   24,   26,   23,   24,   26,   23,
+       24,   26,   23,   24,   26,   23,   24,   26,   23,   24,
+       26,   23,   24,   26,   23,   24,   26,   23,   24,   26,
+       23,   24,   26,   23,   24,   26,   23,   24,   26,   23,
+       24,   26,   23,   24,   26,   25,   26,   26,   23,   23,
+     8193,   23, 8193,   23,16385, 8193,   23, 8193,   23,   23,
+     8214,   23,16406,   23,   23,   23,   23,   23,   23,   23,
+       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
+
+       23,   23,   25, 8193,   23, 8193,   23, 8193, 8214,   23,
+     8214,   23, 8214,   13,   23,   23,   23,   23,   23,   23,
+       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
+       23,   23, 8214,   23, 8214,   23, 8214,   13,   23,   18,
+     8214,   23,16406,   23,   23,   23,   23,   23,   23,   23,
+     8207, 8214,   23,16399,16406,   21, 8214,   23,16406,   23,
+     8206, 8214,   23,16398,16406,   23,   23, 8209, 8214,   23,
+    16401,16406,   23,   23,   23,   23,   18, 8214,   23,   18,
+     8214,   23,   18,   23,   18, 8214,   23,    3,   23,   23,
+       20, 8214,   23,16406,   23,   23, 8207, 8214,   23, 8207,
+
+     8214,   23, 8207,   23, 8207, 8214,   21, 8214,   23,   21,
+     8214,   23,   21,   23,   21, 8214, 8206, 8214,   23, 8206,
+     8214,   23, 8206,   23, 8206, 8214,   23, 8209, 8214,   23,
+     8209, 8214,   23, 8209,   23, 8209, 8214,   23,   23,   10,
+       23,   18, 8214,   23,   18, 8214,   23,   18, 8214,   18,
+       23,   18,   23,    3,   23,   23,   20, 8214,   23,   20,
+     8214,   23,   20,   23,   20, 8214,   23,   19, 8214,   23,
+    16406, 8207, 8214,   23, 8207, 8214,   23, 8207, 8214, 8207,
+       23, 8207,   21, 8214,   23,   21, 8214,   23,   21, 8214,
+       21,   23,   21, 8206, 8214,   23, 8206, 8214,   23, 8206,
+
+     8214, 8206,   23, 8206,   23, 8209, 8214,   23, 8209, 8214,
+       23, 8209, 8214, 8209,   23, 8209,   23,   23,   10,   13,
+       10,    7,   23,   23,   20, 8214,   23,   20, 8214,   23,
+       20, 8214,   20,   23,   20,    2,   19, 8214,   23,   19,
+     8214,   23,   19,   23,   19, 8214,   11,   23,   12,   10,
+       10,   13,    7,   13,    7,    8,   23,    6,    2,   13,
+        2,   19, 8214,   23,   19, 8214,   23,   19, 8214,   19,
+       23,   19,   11,   13,   11,   16, 8214,   23,16406,   12,
+       13,   12,    7,    7,   13,    8,   13,    8,   23,    6,
+       13,    6,    6,   13,    6,   13,    2,    2,   13,   11,
+
+       11,   13,   16, 8214,   23,   16, 8214,   23,   16,   23,
+       16, 8214,   12,   13,    8,    8,   13,   23,    6,    6,
+       13,    6,    6,   16, 8214,   23,   16, 8214,   23,   16,
+     8214,   16,   23,   16,   23,    6,    6,    9,    6,    5,
+        6,    9,   13,    9,    4,    6,    5,    6,    9,    9,
+       13,    4,    6
     } ;
 
-static yyconst flex_int16_t yy_accept[252] =
+static yyconst flex_int16_t yy_accept[257] =
     {   0,
         1,    1,    1,    2,    3,    4,    7,   12,   16,   19,
        21,   24,   27,   30,   33,   36,   39,   42,   45,   48,
@@ -445,14 +446,14 @@ static yyconst flex_int16_t yy_accept[252] =
       293,  294,  297,  300,  302,  304,  305,  306,  309,  312,
       314,  316,  317,  318,  319,  321,  322,  323,  324,  325,
       328,  331,  333,  335,  336,  337,  340,  343,  345,  347,
-      348,  349,  350,  351,  353,  355,  356,  357,  358,  360,
-
-      361,  364,  367,  369,  371,  372,  374,  375,  379,  381,
-      382,  383,  385,  386,  388,  389,  391,  393,  394,  396,
-      397,  399,  402,  405,  407,  409,  411,  412,  413,  415,
-      416,  417,  420,  423,  425,  427,  428,  429,  430,  431,
-      432,  433,  435,  437,  438,  440,  442,  443,  445,  447,
-      447
+      348,  349,  350,  351,  353,  355,  356,  357,  358,  359,
+
+      361,  362,  365,  368,  370,  372,  373,  375,  376,  380,
+      382,  383,  384,  386,  388,  389,  390,  392,  393,  395,
+      397,  398,  400,  401,  403,  406,  409,  411,  413,  415,
+      416,  418,  419,  420,  422,  423,  424,  427,  430,  432,
+      434,  435,  436,  437,  438,  439,  440,  442,  444,  445,
+      447,  449,  450,  452,  454,  454
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -495,83 +496,85 @@ static yyconst flex_int32_t yy_meta[34] =
         1,    1,    1
     } ;
 
-static yyconst flex_int16_t yy_base[308] =
+static yyconst flex_int16_t yy_base[315] =
     {   0,
-        0,    0,  546,  538,  533,  521,   32,   35,  656,  656,
-       44,   62,   30,   41,   50,   51,  507,   64,   47,   66,
-       67,  499,   68,  487,   72,    0,  656,  465,  656,   87,
-       91,    0,    0,  100,  452,  109,    0,   74,   95,   87,
+        0,    0,  563,  559,  558,  546,   32,   35,  665,  665,
+       44,   62,   30,   41,   50,   51,  532,   64,   47,   66,
+       67,  524,   68,  516,   72,    0,  665,  514,  665,   87,
+       91,    0,    0,  100,  500,  109,    0,   74,   95,   87,
        32,   96,  105,  110,   77,   97,   40,  113,  116,  112,
       118,  120,  121,  122,  123,  125,    0,  137,    0,    0,
-      147,    0,    0,  449,  129,  126,  134,  143,  145,  147,
+      147,    0,    0,  494,  129,  126,  134,  143,  145,  147,
       148,  149,  151,  153,  156,  160,  155,  167,  162,  175,
-      168,  159,  188,    0,    0,  656,  166,  197,  179,  185,
-      176,  200,  435,  186,  193,  216,  225,  205,  234,  221,
+      168,  159,  188,    0,    0,  665,  166,  197,  179,  185,
+      176,  200,  460,  186,  193,  216,  225,  205,  234,  221,
 
       237,  247,  204,  230,  244,  213,  254,    0,  256,    0,
       251,  258,  254,  279,  256,  259,  267,    0,  269,    0,
       286,    0,  288,    0,  290,    0,  297,    0,  267,  299,
-        0,  301,    0,  288,  297,  421,  302,  310,    0,    0,
-        0,    0,  305,  656,  307,  319,    0,  321,    0,  322,
+        0,  301,    0,  288,  297,  459,  302,  310,    0,    0,
+        0,    0,  305,  665,  307,  319,    0,  321,    0,  322,
       332,  335,    0,    0,    0,    0,  339,    0,    0,    0,
         0,  342,    0,    0,    0,    0,  340,  349,    0,    0,
-        0,    0,  337,  345,  420,  656,  419,  346,  350,  358,
-        0,    0,    0,    0,  418,  360,    0,  362,    0,  417,
-      319,  369,  416,  656,  415,  656,  276,  364,  414,  656,
-
-      375,    0,    0,    0,    0,  413,  656,  384,  412,    0,
-      410,  656,  370,  409,  656,  370,  378,  408,  656,  366,
-      656,  394,    0,  396,    0,    0,  380,  316,  656,  377,
-      387,  398,    0,    0,    0,    0,  399,  402,  407,  271,
-      406,  228,  200,  656,  175,  656,   77,  656,  656,  656,
-      428,  432,  435,  439,  443,  447,  451,  455,  459,  463,
-      467,  471,  475,  479,  483,  487,  491,  495,  499,  503,
-      507,  511,  515,  519,  523,  527,  531,  535,  539,  543,
-      547,  551,  555,  559,  563,  567,  571,  575,  579,  583,
-      587,  591,  595,  599,  603,  607,  611,  615,  619,  623,
-
-      627,  631,  635,  639,  643,  647,  651
+        0,    0,  337,  345,  450,  665,  442,  350,  352,  360,
+        0,    0,    0,    0,  424,  362,    0,  364,    0,  420,
+      319,  371,  419,  665,  418,  665,  417,  276,  368,  416,
+
+      665,  373,    0,    0,    0,    0,  415,  665,  382,  414,
+        0,  413,  665,  412,  665,  368,  411,  665,  384,  352,
+      410,  665,  409,  665,  391,    0,  395,    0,    0,  405,
+      665,  382,  316,  665,  385,  397,  399,    0,    0,    0,
+        0,  396,  403,  406,  271,  407,  228,  200,  665,  175,
+      665,   77,  665,  665,  665,  429,  433,  436,  440,  444,
+      448,  452,  456,  460,  464,  468,  472,  476,  480,  484,
+      488,  492,  496,  500,  504,  508,  512,  516,  520,  524,
+      528,  532,  536,  540,  544,  548,  552,  556,  560,  564,
+      568,  572,  576,  580,  584,  588,  592,  596,  600,  604,
+
+      608,  612,  616,  620,  624,  628,  632,  636,  640,  644,
+      648,  652,  656,  660
     } ;
 
-static yyconst flex_int16_t yy_def[308] =
+static yyconst flex_int16_t yy_def[315] =
     {   0,
-      250,    1,  251,  251,  250,  252,  253,  253,  250,  250,
-      254,  254,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,  255,  250,  252,  250,  256,
-      253,  257,  257,  258,   12,  252,  259,   12,   12,   12,
+      255,    1,  256,  256,  255,  257,  258,  258,  255,  255,
+      259,  259,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,  260,  255,  257,  255,  261,
+      258,  262,  262,  263,   12,  257,  264,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,  255,  256,  257,  257,
-      260,  261,  261,  250,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,  260,  261,  262,  262,
+      265,  266,  266,  255,   12,   12,   12,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,  260,  261,  261,  250,   12,  262,   12,   12,
-       12,   12,   12,   12,   12,  263,  264,   12,  265,   12,
-
-       12,  266,   12,   12,   12,   12,  267,  268,  262,  268,
-       12,   12,   12,  269,   12,   12,  270,  271,  263,  271,
-      272,  273,  264,  273,  274,  275,  265,  275,   12,  276,
-      277,  266,  277,   12,   12,  278,   12,  267,  268,  268,
-      279,  279,   12,  250,   12,  280,  281,  269,  281,   12,
-      282,  270,  271,  271,  283,  283,  272,  273,  273,  284,
-      284,  274,  275,  275,  285,  285,   12,  276,  277,  277,
-      286,  286,   12,   12,  287,  250,  288,   12,   12,  280,
-      281,  281,  289,  289,  290,  291,  292,  282,  292,  293,
-       12,  294,  287,  250,  295,  250,   12,  296,  297,  250,
-
-      291,  292,  292,  298,  298,  299,  250,  300,  301,  301,
-      295,  250,   12,  302,  250,  302,  302,  297,  250,  299,
-      250,  303,  304,  300,  304,  301,   12,  302,  250,  302,
-      302,  303,  304,  304,  305,  305,   12,  302,  302,  306,
-      302,  302,  307,  250,  302,  250,  307,  250,  250,    0,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-
-      250,  250,  250,  250,  250,  250,  250
+       12,   12,  265,  266,  266,  255,   12,  267,   12,   12,
+       12,   12,   12,   12,   12,  268,  269,   12,  270,   12,
+
+       12,  271,   12,   12,   12,   12,  272,  273,  267,  273,
+       12,   12,   12,  274,   12,   12,  275,  276,  268,  276,
+      277,  278,  269,  278,  279,  280,  270,  280,   12,  281,
+      282,  271,  282,   12,   12,  283,   12,  272,  273,  273,
+      284,  284,   12,  255,   12,  285,  286,  274,  286,   12,
+      287,  275,  276,  276,  288,  288,  277,  278,  278,  289,
+      289,  279,  280,  280,  290,  290,   12,  281,  282,  282,
+      291,  291,   12,   12,  292,  255,  293,   12,   12,  285,
+      286,  286,  294,  294,  295,  296,  297,  287,  297,  298,
+       12,  299,  292,  255,  300,  255,  301,   12,  302,  303,
+
+      255,  296,  297,  297,  304,  304,  305,  255,  306,  307,
+      307,  300,  255,  308,  255,   12,  309,  255,  309,  309,
+      303,  255,  305,  255,  310,  311,  306,  311,  307,  308,
+      255,   12,  309,  255,  309,  309,  310,  311,  311,  312,
+      312,   12,  309,  309,  313,  309,  309,  314,  255,  309,
+      255,  314,  255,  255,    0,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255
     } ;
 
-static yyconst flex_int16_t yy_nxt[690] =
+static yyconst flex_int16_t yy_nxt[699] =
     {   0,
         6,    7,    8,    9,    6,    6,    6,    6,   10,   11,
        12,   13,   14,   15,   16,   17,   17,   18,   17,   17,
@@ -581,7 +584,7 @@ static yyconst flex_int16_t yy_nxt[690] =
        35,   36,   37,   73,   42,   38,   35,   49,   68,   35,
        35,   39,   28,   28,   28,   29,   34,   43,   45,   36,
        37,   40,   44,   35,   46,   35,   35,   35,   51,   53,
-      244,   35,   50,   35,   55,   65,   35,   47,   56,   28,
+      249,   35,   50,   35,   55,   65,   35,   47,   56,   28,
        59,   48,   31,   31,   32,   60,   35,   71,   67,   33,
 
        28,   28,   28,   29,   35,   35,   35,   28,   37,   61,
@@ -591,66 +594,68 @@ static yyconst flex_int16_t yy_nxt[690] =
        59,   77,   87,   35,   76,   60,   80,   79,   81,   28,
        84,   78,   35,   89,   35,   85,   35,   35,   35,   75,
        35,   92,   35,   96,   35,   35,   90,   97,   35,   35,
-       93,   35,   94,   91,   99,   35,   35,   35,  249,  100,
+       93,   35,   94,   91,   99,   35,   35,   35,  254,  100,
        95,  101,  102,  104,   35,   35,   98,  103,   35,  105,
        28,   84,  111,  106,   35,   35,   85,  107,  107,   61,
 
-      108,  107,   35,  248,  107,  110,  112,  114,  113,   35,
+      108,  107,   35,  253,  107,  110,  112,  114,  113,   35,
        75,   78,   99,   35,   35,  116,  117,  117,   61,  118,
       117,  134,   35,  117,  120,  121,  121,   61,  122,  121,
-       35,  246,  121,  124,  125,  125,   61,  126,  125,   35,
+       35,  251,  121,  124,  125,  125,   61,  126,  125,   35,
       137,  125,  128,  135,  102,  129,   35,  130,  130,   61,
       131,  130,  136,   35,  130,  133,   28,  139,   28,  141,
        35,  144,  140,   35,  142,   35,  151,   35,   35,   28,
-      153,   28,  155,  143,  244,  154,   35,  156,  145,  146,
+      153,   28,  155,  143,  249,  154,   35,  156,  145,  146,
       146,   61,  147,  146,  150,   35,  146,  149,   28,  158,
        28,  160,   28,  163,  159,  167,  161,   35,  164,   28,
 
-      165,   28,  169,   28,  171,  166,   35,  170,  213,  172,
-      177,   35,   28,  139,   35,  173,   35,  178,  140,  215,
-      179,   28,  181,   28,  183,  174,  208,  182,   35,  184,
+      165,   28,  169,   28,  171,  166,   35,  170,  216,  172,
+      177,   35,   28,  139,   35,  173,   35,  178,  140,  218,
+      179,   28,  181,   28,  183,  174,  209,  182,   35,  184,
       185,   35,  186,  186,   61,  187,  186,   28,  153,  186,
       189,   28,  158,  154,   28,  163,   35,  159,  190,   35,
-      164,   28,  169,  192,   35,   35,  191,  170,  198,   35,
-       28,  181,   28,  202,   28,  204,  182,  215,  203,  207,
-      205,   64,  210,  229,  197,  216,  217,   28,  202,   35,
-      215,  229,  230,  203,  222,  222,   61,  223,  222,   35,
-      215,  222,  225,  237,  227,  231,   28,  233,   28,  235,
-
-       28,  233,  234,  238,  236,  215,  234,  240,   35,  215,
-      215,  200,  229,  196,  239,  226,  221,  219,  212,  176,
-      207,  200,  196,  194,  176,  241,  242,  245,   26,   26,
-       26,   26,   28,   28,   28,   30,   30,   30,   30,   35,
-       35,   35,   35,   57,  115,   57,   57,   58,   58,   58,
-       58,   60,   86,   60,   60,   34,   34,   34,   34,   64,
-       64,   35,   64,   83,   83,   83,   83,   85,   29,   85,
-       85,  109,  109,  109,  109,  119,  119,  119,  119,  123,
-      123,  123,  123,  127,  127,  127,  127,  132,  132,  132,
-      132,  138,  138,  138,  138,  140,   54,  140,  140,  148,
-
-      148,  148,  148,  152,  152,  152,  152,  154,   52,  154,
-      154,  157,  157,  157,  157,  159,   35,  159,  159,  162,
-      162,  162,  162,  164,   29,  164,  164,  168,  168,  168,
-      168,  170,  250,  170,  170,  175,  175,  175,  175,  142,
-       27,  142,  142,  180,  180,  180,  180,  182,   27,  182,
-      182,  188,  188,  188,  188,  156,  250,  156,  156,  161,
-      250,  161,  161,  166,  250,  166,  166,  172,  250,  172,
-      172,  193,  193,  193,  193,  195,  195,  195,  195,  184,
-      250,  184,  184,  199,  199,  199,  199,  201,  201,  201,
-      201,  203,  250,  203,  203,  206,  206,  206,  206,  209,
-
-      209,  209,  209,  211,  211,  211,  211,  214,  214,  214,
-      214,  218,  218,  218,  218,  205,  250,  205,  205,  220,
-      220,  220,  220,  224,  224,  224,  224,  210,  250,  210,
-      210,  228,  228,  228,  228,  232,  232,  232,  232,  234,
-      250,  234,  234,  236,  250,  236,  236,  243,  243,  243,
-      243,  247,  247,  247,  247,    5,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250
+      164,   28,  169,  192,   35,  234,  191,  170,  197,   35,
+      199,   35,   28,  181,   28,  203,   28,  205,  182,  236,
+      204,  218,  206,   64,  211,   28,  203,   35,  198,  219,
+      220,  204,  225,  225,   61,  226,  225,  234,  218,  225,
+      228,   35,  232,   28,  238,  242,  235,   28,  240,  239,
+
+      218,   28,  238,  241,  245,   35,  218,  239,  215,  218,
+      218,  243,  208,  201,  234,  231,  196,  229,  224,  222,
+      215,  213,  176,  208,  244,  247,  246,  201,  250,   26,
+       26,   26,   26,   28,   28,   28,   30,   30,   30,   30,
+       35,   35,   35,   35,   57,  196,   57,   57,   58,   58,
+       58,   58,   60,  194,   60,   60,   34,   34,   34,   34,
+       64,   64,  176,   64,   83,   83,   83,   83,   85,  115,
+       85,   85,  109,  109,  109,  109,  119,  119,  119,  119,
+      123,  123,  123,  123,  127,  127,  127,  127,  132,  132,
+      132,  132,  138,  138,  138,  138,  140,   86,  140,  140,
+
+      148,  148,  148,  148,  152,  152,  152,  152,  154,   35,
+      154,  154,  157,  157,  157,  157,  159,   29,  159,  159,
+      162,  162,  162,  162,  164,   54,  164,  164,  168,  168,
+      168,  168,  170,   52,  170,  170,  175,  175,  175,  175,
+      142,   35,  142,  142,  180,  180,  180,  180,  182,   29,
+      182,  182,  188,  188,  188,  188,  156,  255,  156,  156,
+      161,   27,  161,  161,  166,   27,  166,  166,  172,  255,
+      172,  172,  193,  193,  193,  193,  195,  195,  195,  195,
+      184,  255,  184,  184,  200,  200,  200,  200,  202,  202,
+      202,  202,  204,  255,  204,  204,  207,  207,  207,  207,
+
+      210,  210,  210,  210,  212,  212,  212,  212,  214,  214,
+      214,  214,  217,  217,  217,  217,  221,  221,  221,  221,
+      206,  255,  206,  206,  223,  223,  223,  223,  227,  227,
+      227,  227,  211,  255,  211,  211,  230,  230,  230,  230,
+      233,  233,  233,  233,  237,  237,  237,  237,  239,  255,
+      239,  239,  241,  255,  241,  241,  248,  248,  248,  248,
+      252,  252,  252,  252,    5,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255
+
     } ;
 
-static yyconst flex_int16_t yy_chk[690] =
+static yyconst flex_int16_t yy_chk[699] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -660,7 +665,7 @@ static yyconst flex_int16_t yy_chk[690] =
        14,   11,   11,   47,   14,   11,   19,   19,   41,   15,
        16,   11,   12,   12,   12,   12,   12,   14,   16,   12,
        12,   12,   15,   18,   16,   20,   21,   23,   21,   23,
-      247,   25,   20,   38,   25,   38,   45,   18,   25,   30,
+      252,   25,   20,   38,   25,   38,   45,   18,   25,   30,
        30,   18,   31,   31,   31,   30,   40,   45,   40,   31,
 
        34,   34,   34,   34,   39,   42,   46,   34,   34,   36,
@@ -670,63 +675,65 @@ static yyconst flex_int16_t yy_chk[690] =
        58,   51,   65,   67,   50,   58,   54,   53,   54,   61,
        61,   52,   68,   67,   69,   61,   70,   71,   72,   70,
        73,   71,   74,   75,   77,   75,   68,   76,   82,   76,
-       72,   79,   73,   69,   78,   87,   78,   81,  245,   79,
+       72,   79,   73,   69,   78,   87,   78,   81,  250,   79,
        74,   80,   80,   81,   80,   91,   77,   80,   89,   82,
        83,   83,   89,   87,   90,   94,   83,   88,   88,   88,
 
-       88,   88,   95,  243,   88,   88,   90,   92,   91,   92,
+       88,   88,   95,  248,   88,   88,   90,   92,   91,   92,
        95,   98,   98,  103,   98,   94,   96,   96,   96,   96,
        96,  103,  106,   96,   96,   97,   97,   97,   97,   97,
-      100,  242,   97,   97,   99,   99,   99,   99,   99,  104,
+      100,  247,   97,   97,   99,   99,   99,   99,   99,  104,
       106,   99,   99,  104,  101,  100,  101,  102,  102,  102,
       102,  102,  105,  105,  102,  102,  107,  107,  109,  109,
       111,  112,  107,  113,  109,  115,  116,  112,  116,  117,
-      117,  119,  119,  111,  240,  117,  129,  119,  113,  114,
-      114,  114,  114,  114,  115,  197,  114,  114,  121,  121,
+      117,  119,  119,  111,  245,  117,  129,  119,  113,  114,
+      114,  114,  114,  114,  115,  198,  114,  114,  121,  121,
       123,  123,  125,  125,  121,  129,  123,  134,  125,  127,
 
-      127,  130,  130,  132,  132,  127,  135,  130,  197,  132,
-      137,  137,  138,  138,  143,  134,  145,  143,  138,  228,
+      127,  130,  130,  132,  132,  127,  135,  130,  198,  132,
+      137,  137,  138,  138,  143,  134,  145,  143,  138,  233,
       145,  146,  146,  148,  148,  135,  191,  146,  191,  148,
       150,  150,  151,  151,  151,  151,  151,  152,  152,  151,
       151,  157,  157,  152,  162,  162,  173,  157,  167,  167,
-      162,  168,  168,  174,  174,  178,  173,  168,  179,  179,
-      180,  180,  186,  186,  188,  188,  180,  198,  186,  220,
-      188,  192,  192,  216,  178,  198,  198,  201,  201,  213,
-      230,  217,  216,  201,  208,  208,  208,  208,  208,  227,
-      231,  208,  208,  227,  213,  217,  222,  222,  224,  224,
-
-      232,  232,  222,  230,  224,  238,  232,  237,  237,  241,
-      239,  218,  214,  211,  231,  209,  206,  199,  195,  193,
-      190,  185,  177,  175,  136,  238,  239,  241,  251,  251,
-      251,  251,  252,  252,  252,  253,  253,  253,  253,  254,
-      254,  254,  254,  255,   93,  255,  255,  256,  256,  256,
-      256,  257,   64,  257,  257,  258,  258,  258,  258,  259,
-      259,   35,  259,  260,  260,  260,  260,  261,   28,  261,
-      261,  262,  262,  262,  262,  263,  263,  263,  263,  264,
-      264,  264,  264,  265,  265,  265,  265,  266,  266,  266,
-      266,  267,  267,  267,  267,  268,   24,  268,  268,  269,
-
-      269,  269,  269,  270,  270,  270,  270,  271,   22,  271,
-      271,  272,  272,  272,  272,  273,   17,  273,  273,  274,
-      274,  274,  274,  275,    6,  275,  275,  276,  276,  276,
-      276,  277,    5,  277,  277,  278,  278,  278,  278,  279,
-        4,  279,  279,  280,  280,  280,  280,  281,    3,  281,
-      281,  282,  282,  282,  282,  283,    0,  283,  283,  284,
-        0,  284,  284,  285,    0,  285,  285,  286,    0,  286,
-      286,  287,  287,  287,  287,  288,  288,  288,  288,  289,
-        0,  289,  289,  290,  290,  290,  290,  291,  291,  291,
-      291,  292,    0,  292,  292,  293,  293,  293,  293,  294,
-
-      294,  294,  294,  295,  295,  295,  295,  296,  296,  296,
-      296,  297,  297,  297,  297,  298,    0,  298,  298,  299,
-      299,  299,  299,  300,  300,  300,  300,  301,    0,  301,
-      301,  302,  302,  302,  302,  303,  303,  303,  303,  304,
-        0,  304,  304,  305,    0,  305,  305,  306,  306,  306,
-      306,  307,  307,  307,  307,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250
+      162,  168,  168,  174,  174,  220,  173,  168,  178,  178,
+      179,  179,  180,  180,  186,  186,  188,  188,  180,  220,
+      186,  199,  188,  192,  192,  202,  202,  216,  178,  199,
+      199,  202,  209,  209,  209,  209,  209,  219,  235,  209,
+      209,  232,  216,  225,  225,  232,  219,  227,  227,  225,
+
+      236,  237,  237,  227,  242,  242,  243,  237,  230,  244,
+      246,  235,  223,  221,  217,  214,  212,  210,  207,  200,
+      197,  195,  193,  190,  236,  244,  243,  185,  246,  256,
+      256,  256,  256,  257,  257,  257,  258,  258,  258,  258,
+      259,  259,  259,  259,  260,  177,  260,  260,  261,  261,
+      261,  261,  262,  175,  262,  262,  263,  263,  263,  263,
+      264,  264,  136,  264,  265,  265,  265,  265,  266,   93,
+      266,  266,  267,  267,  267,  267,  268,  268,  268,  268,
+      269,  269,  269,  269,  270,  270,  270,  270,  271,  271,
+      271,  271,  272,  272,  272,  272,  273,   64,  273,  273,
+
+      274,  274,  274,  274,  275,  275,  275,  275,  276,   35,
+      276,  276,  277,  277,  277,  277,  278,   28,  278,  278,
+      279,  279,  279,  279,  280,   24,  280,  280,  281,  281,
+      281,  281,  282,   22,  282,  282,  283,  283,  283,  283,
+      284,   17,  284,  284,  285,  285,  285,  285,  286,    6,
+      286,  286,  287,  287,  287,  287,  288,    5,  288,  288,
+      289,    4,  289,  289,  290,    3,  290,  290,  291,    0,
+      291,  291,  292,  292,  292,  292,  293,  293,  293,  293,
+      294,    0,  294,  294,  295,  295,  295,  295,  296,  296,
+      296,  296,  297,    0,  297,  297,  298,  298,  298,  298,
+
+      299,  299,  299,  299,  300,  300,  300,  300,  301,  301,
+      301,  301,  302,  302,  302,  302,  303,  303,  303,  303,
+      304,    0,  304,  304,  305,  305,  305,  305,  306,  306,
+      306,  306,  307,    0,  307,  307,  308,  308,  308,  308,
+      309,  309,  309,  309,  310,  310,  310,  310,  311,    0,
+      311,  311,  312,    0,  312,  312,  313,  313,  313,  313,
+      314,  314,  314,  314,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255
+
     } ;
 
 #define YY_TRAILING_MASK 0x2000
@@ -883,7 +890,7 @@ static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
 #define DPC ((DiskParseContext*)yyextra)
 
 
-#line 887 "libxlu_disk_l.c"
+#line 894 "libxlu_disk_l.c"
 
 #define INITIAL 0
 #define LEXERR 1
@@ -1124,7 +1131,7 @@ YY_DECL
 
  /*----- the scanner rules which do the parsing -----*/
 
-#line 1128 "libxlu_disk_l.c"
+#line 1135 "libxlu_disk_l.c"
 
 	if ( !yyg->yy_init )
 		{
@@ -1188,14 +1195,14 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 251 )
+				if ( yy_current_state >= 256 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			*yyg->yy_state_ptr++ = yy_current_state;
 			++yy_cp;
 			}
-		while ( yy_current_state != 250 );
+		while ( yy_current_state != 255 );
 
 yy_find_action:
 		yy_current_state = *--yyg->yy_state_ptr;
@@ -1286,48 +1293,54 @@ case 8:
 /* rule 8 can match eol */
 YY_RULE_SETUP
 #line 171 "libxlu_disk_l.l"
-{ STRIP(','); setbackendtype(DPC,FROMEQUALS); }
+{ STRIP(','); SAVESTRING("backend", backend_domname, FROMEQUALS); }
 	YY_BREAK
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 173 "libxlu_disk_l.l"
-{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+#line 172 "libxlu_disk_l.l"
+{ STRIP(','); setbackendtype(DPC,FROMEQUALS); }
 	YY_BREAK
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
 #line 174 "libxlu_disk_l.l"
+{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+	YY_BREAK
+case 11:
+/* rule 11 can match eol */
+YY_RULE_SETUP
+#line 175 "libxlu_disk_l.l"
 { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
 	YY_BREAK
 /* the target magic parameter, eats the rest of the string */
-case 11:
+case 12:
 YY_RULE_SETUP
-#line 178 "libxlu_disk_l.l"
+#line 179 "libxlu_disk_l.l"
 { STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
 	YY_BREAK
 /* unknown parameters */
-case 12:
-/* rule 12 can match eol */
+case 13:
+/* rule 13 can match eol */
 YY_RULE_SETUP
-#line 182 "libxlu_disk_l.l"
+#line 183 "libxlu_disk_l.l"
 { xlu__disk_err(DPC,yytext,"unknown parameter"); }
 	YY_BREAK
 /* deprecated prefixes */
 /* the "/.*" in these patterns ensures that they count as if they
    * matched the whole string, so these patterns take precedence */
-case 13:
+case 14:
 YY_RULE_SETUP
-#line 189 "libxlu_disk_l.l"
+#line 190 "libxlu_disk_l.l"
 {
                     STRIP(':');
                     DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
                     setformat(DPC, yytext);
                  }
 	YY_BREAK
-case 14:
+case 15:
 YY_RULE_SETUP
-#line 195 "libxlu_disk_l.l"
+#line 196 "libxlu_disk_l.l"
 {
                     char *newscript;
                     STRIP(':');
@@ -1341,30 +1354,22 @@ YY_RULE_SETUP
                     free(newscript);
                 }
 	YY_BREAK
-case 15:
+case 16:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 8;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 208 "libxlu_disk_l.l"
-{ DPC->had_depr_prefix=1; DEPRECATE(0); }
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
 #line 209 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
 	YY_BREAK
 case 17:
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 210 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
 	YY_BREAK
 case 18:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
+yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 211 "libxlu_disk_l.l"
@@ -1372,7 +1377,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 19:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
+yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 212 "libxlu_disk_l.l"
@@ -1380,26 +1385,34 @@ YY_RULE_SETUP
 	YY_BREAK
 case 20:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
+yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 213 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
 	YY_BREAK
 case 21:
-/* rule 21 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
+YY_RULE_SETUP
+#line 214 "libxlu_disk_l.l"
+{ DPC->had_depr_prefix=1; DEPRECATE(0); }
+	YY_BREAK
+case 22:
+/* rule 22 can match eol */
 YY_RULE_SETUP
-#line 215 "libxlu_disk_l.l"
+#line 216 "libxlu_disk_l.l"
 {
 		  xlu__disk_err(DPC,yytext,"unknown deprecated disk prefix");
 		  return 0;
 		}
 	YY_BREAK
 /* positional parameters */
-case 22:
-/* rule 22 can match eol */
+case 23:
+/* rule 23 can match eol */
 YY_RULE_SETUP
-#line 222 "libxlu_disk_l.l"
+#line 223 "libxlu_disk_l.l"
 {
     STRIP(',');
 
@@ -1426,27 +1439,27 @@ YY_RULE_SETUP
     }
 }
 	YY_BREAK
-case 23:
+case 24:
 YY_RULE_SETUP
-#line 248 "libxlu_disk_l.l"
+#line 249 "libxlu_disk_l.l"
 {
     BEGIN(LEXERR);
     yymore();
 }
 	YY_BREAK
-case 24:
+case 25:
 YY_RULE_SETUP
-#line 252 "libxlu_disk_l.l"
+#line 253 "libxlu_disk_l.l"
 {
     xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
 }
 	YY_BREAK
-case 25:
+case 26:
 YY_RULE_SETUP
-#line 255 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 1450 "libxlu_disk_l.c"
+#line 1463 "libxlu_disk_l.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(LEXERR):
 				yyterminate();
@@ -1710,7 +1723,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 251 )
+			if ( yy_current_state >= 256 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1734,11 +1747,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 251 )
+		if ( yy_current_state >= 256 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 250);
+	yy_is_jam = (yy_current_state == 255);
 	if ( ! yy_is_jam )
 		*yyg->yy_state_ptr++ = yy_current_state;
 
@@ -2538,4 +2551,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 255 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h
index de03908..0176249 100644
--- a/tools/libxl/libxlu_disk_l.h
+++ b/tools/libxl/libxlu_disk_l.h
@@ -344,7 +344,7 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 255 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
 
 #line 350 "libxlu_disk_l.h"
 #undef xlu__disk_yyIN_HEADER
diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l
index bee16a1..7c4e7f1 100644
--- a/tools/libxl/libxlu_disk_l.l
+++ b/tools/libxl/libxlu_disk_l.l
@@ -168,6 +168,7 @@ devtype=disk,?	{ DPC->disk->is_cdrom = 0; }
 devtype=[^,]*,?	{ xlu__disk_err(DPC,yytext,"unknown value for type"); }
 
 access=[^,]*,?	{ STRIP(','); setaccess(DPC, FROMEQUALS); }
+backend=[^,]*,? { STRIP(','); SAVESTRING("backend", backend_domname, FROMEQUALS); }
 backendtype=[^,]*,? { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
 
 vdev=[^,]*,?	{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 87d189d..c1a969b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -162,29 +162,6 @@ static int qualifier_to_id(const char *p, uint32_t *id_r)
     return 1;
 }
 
-static int domain_qualifier_to_domid(const char *p, uint32_t *domid_r,
-                                     int *was_name_r)
-{
-    int was_name, rc;
-
-    was_name = qualifier_to_id(p, domid_r);
-    if (was_name_r)
-        *was_name_r = was_name;
-
-    if (was_name) {
-        rc = libxl_name_to_domid(ctx, p, domid_r);
-        if (rc)
-            return rc;
-    } else {
-        rc = libxl_domain_info(ctx, NULL, *domid_r);
-        /* error only if domain does not exist */
-        if (rc == ERROR_INVAL)
-            return rc;
-    }
-
-    return 0;
-}
-
 static int cpupool_qualifier_to_cpupoolid(const char *p, uint32_t *poolid_r,
                                      int *was_name_r)
 {
@@ -199,14 +176,14 @@ static uint32_t find_domain(const char *p) __attribute__((warn_unused_result));
 static uint32_t find_domain(const char *p)
 {
     uint32_t domid;
-    int rc, was_name;
+    int rc;
 
-    rc = domain_qualifier_to_domid(p, &domid, &was_name);
+    rc = libxl_domain_qualifier_to_domid(ctx, p, &domid);
     if (rc) {
         fprintf(stderr, "%s is an invalid domain identifier (rc=%d)\n", p, rc);
         exit(2);
     }
-    common_domname = was_name ? p : libxl_domid_to_name(ctx, domid);
+    common_domname = libxl_domid_to_name(ctx, domid);
     return domid;
 }
 
@@ -1097,12 +1074,7 @@ static void parse_config_data(const char *config_source,
                      break;
                   *p2 = '\0';
                   if (!strcmp(p, "backend")) {
-                     if(domain_qualifier_to_domid(p2 + 1, &(vtpm->backend_domid), 0))
-                     {
-                        fprintf(stderr,
-                              "Specified vtpm backend domain `%s' does not exist!\n", p2 + 1);
-                        exit(1);
-                     }
+                     vtpm->backend_domname = strdup(p2 + 1);
                      got_backend = true;
                   } else if(!strcmp(p, "uuid")) {
                      if( libxl_uuid_from_string(&vtpm->uuid, p2 + 1) ) {
@@ -1202,17 +1174,7 @@ static void parse_config_data(const char *config_source,
                     free(nic->ifname);
                     nic->ifname = strdup(p2 + 1);
                 } else if (!strcmp(p, "backend")) {
-                    if(libxl_name_to_domid(ctx, (p2 + 1), &(nic->backend_domid))) {
-                        fprintf(stderr, "Specified backend domain does not exist, defaulting to Dom0\n");
-                        nic->backend_domid = 0;
-                    }
-                    if (nic->backend_domid != 0 && run_hotplug_scripts) {
-                        fprintf(stderr, "ERROR: the vif 'backend=' option "
-                                "cannot be used in conjunction with "
-                                "run_hotplug_scripts, please set "
-                                "run_hotplug_scripts to 0 in xl.conf\n");
-                        exit(EXIT_FAILURE);
-                    }
+                    nic->backend_domname = strdup(p2 + 1);
                 } else if (!strcmp(p, "rate")) {
                     parse_vif_rate(&config, (p2 + 1), nic);
                 } else if (!strcmp(p, "accel")) {
@@ -2558,8 +2520,6 @@ static void cd_insert(uint32_t domid, const char *virtdev, char *phys)
 
     parse_disk_config(&config, buf, &disk);
 
-    disk.backend_domid = 0;
-
     libxl_cdrom_insert(ctx, domid, &disk, NULL);
 
     libxl_device_disk_dispose(&disk);
@@ -5596,11 +5556,7 @@ int main_networkattach(int argc, char **argv)
         } else if (MATCH_OPTION("script", *argv, oparg)) {
             replace_string(&nic.script, oparg);
         } else if (MATCH_OPTION("backend", *argv, oparg)) {
-            if(libxl_name_to_domid(ctx, oparg, &val)) {
-                fprintf(stderr, "Specified backend domain does not exist, defaulting to Dom0\n");
-                val = 0;
-            }
-            nic.backend_domid = val;
+            replace_string(&nic.backend_domname, oparg);
         } else if (MATCH_OPTION("vifname", *argv, oparg)) {
             replace_string(&nic.ifname, oparg);
         } else if (MATCH_OPTION("model", *argv, oparg)) {
@@ -5705,15 +5661,15 @@ int main_networkdetach(int argc, char **argv)
 int main_blockattach(int argc, char **argv)
 {
     int opt;
-    uint32_t fe_domid, be_domid = 0;
-    libxl_device_disk disk = { 0 };
+    uint32_t fe_domid;
+    libxl_device_disk disk;
     XLU_Config *config = 0;
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "block-attach", 2) {
         /* No options */
     }
 
-    if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
+    if (libxl_domain_qualifier_to_domid(ctx, argv[optind], &fe_domid) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
@@ -5722,8 +5678,6 @@ int main_blockattach(int argc, char **argv)
     parse_disk_config_multistring
         (&config, argc-optind, (const char* const*)argv + optind, &disk);
 
-    disk.backend_domid = be_domid;
-
     if (dryrun_only) {
         char *json = libxl_device_disk_to_json(ctx, &disk);
         printf("disk: %s\n", json);
@@ -5753,7 +5707,7 @@ int main_blocklist(int argc, char **argv)
            "Vdev", "BE", "handle", "state", "evt-ch", "ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
         uint32_t domid;
-        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
+        if (libxl_domain_qualifier_to_domid(ctx, *argv, &domid) < 0) {
             fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
             continue;
         }
@@ -5805,14 +5759,13 @@ int main_vtpmattach(int argc, char **argv)
     int opt;
     libxl_device_vtpm vtpm;
     char *oparg;
-    unsigned int val;
     uint32_t domid;
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-attach", 1) {
         /* No options */
     }
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
+    if (libxl_domain_qualifier_to_domid(ctx, argv[optind], &domid) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
@@ -5826,12 +5779,7 @@ int main_vtpmattach(int argc, char **argv)
                 return 1;
             }
         } else if (MATCH_OPTION("backend", *argv, oparg)) {
-            if(domain_qualifier_to_domid(oparg, &val, 0)) {
-                fprintf(stderr,
-                      "Specified backend domain does not exist, defaulting to Dom0\n");
-                val = 0;
-            }
-            vtpm.backend_domid = val;
+            replace_string(&vtpm.backend_domname, oparg);
         } else {
             fprintf(stderr, "unrecognized argument `%s'\n", *argv);
             return 1;
@@ -5871,7 +5819,7 @@ int main_vtpmlist(int argc, char **argv)
            "Idx", "BE", "Uuid", "handle", "state", "evt-ch", "ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
         uint32_t domid;
-        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
+        if (libxl_domain_qualifier_to_domid(ctx, *argv, &domid) < 0) {
             fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
             continue;
         }
@@ -6779,7 +6727,7 @@ int main_cpupoolmigrate(int argc, char **argv)
     dom = argv[optind++];
     pool = argv[optind];
 
-    if (domain_qualifier_to_domid(dom, &domid, NULL) ||
+    if (libxl_domain_qualifier_to_domid(ctx, dom, &domid) ||
         !libxl_domid_to_name(ctx, domid)) {
         fprintf(stderr, "unknown domain \'%s\'\n", dom);
         return -ERROR_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:57:54 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:57:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScEc-0006ll-41; Wed, 17 Apr 2013 23:57:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEZ-0006ga-Vq
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:52 +0000
Received: from [85.158.139.211:52112] by server-2.bemta-5.messagelabs.com id
	2F/94-23989-FF63F615; Wed, 17 Apr 2013 23:57:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1366243065!18918697!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28909 invoked from network); 17 Apr 2013 23:57:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScET-0002An-OQ
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScET-0007cF-N6
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:45 +0000
Date: Wed, 17 Apr 2013 23:57:45 +0000
Message-Id: <E1UScET-0007cF-N6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: postpone backend name resolution
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ef496b81f0336f09968a318e7f81151dd4f5a0cc
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Mon Apr 15 10:33:25 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:55:36 2013 +0100

    libxl: postpone backend name resolution
    
    This adds a backend_domname field in libxl devices that contain a
    backend_domid field, allowing either a domid or a domain name to be
    specified in the configuration structures.  The domain name is resolved
    into a domain ID in the _setdefault function when adding the device.
    This change allows the backend of the block devices to be specified
    (which previously required passing the libxl_ctx down into the block
    device parser), and will simplify specification of backend domains in
    other users of libxl.
    
    The check on run_hotplug_scripts in parse_config_data is removed because
    it is a duplicate of the one in libxl__device_nic_setdefault, and is
    removed here because it no longer has the resolved domain ID to check.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran flex ]
---
 docs/misc/xl-disk-configuration.txt |   12 +
 tools/libxl/libxl.c                 |   32 ++-
 tools/libxl/libxl.h                 |   12 +
 tools/libxl/libxl_types.idl         |    5 +
 tools/libxl/libxl_utils.c           |   19 ++
 tools/libxl/libxl_utils.h           |    1 +
 tools/libxl/libxlu_disk_l.c         |  525 ++++++++++++++++++-----------------
 tools/libxl/libxlu_disk_l.h         |    2 +-
 tools/libxl/libxlu_disk_l.l         |    1 +
 tools/libxl/xl_cmdimpl.c            |   80 +-----
 10 files changed, 359 insertions(+), 330 deletions(-)

diff --git a/docs/misc/xl-disk-configuration.txt b/docs/misc/xl-disk-configuration.txt
index 86c16be..5bd456d 100644
--- a/docs/misc/xl-disk-configuration.txt
+++ b/docs/misc/xl-disk-configuration.txt
@@ -139,6 +139,18 @@ cdrom
 Convenience alias for "devtype=cdrom".
 
 
+backend=<domain-name>
+---------------------
+
+Description:           Designates a backend domain for the device
+Supported values:      Valid domain names
+Mandatory:             No
+
+Specifies the backend domain which this device should attach to. This
+defaults to domain 0. Specifying another domain requires setting up a
+driver domain which is outside the scope of this document.
+
+
 backendtype=<backend-type>
 --------------------------
 
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3c6d71b..fa6dfed 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1731,13 +1731,23 @@ static int libxl__device_nextid(libxl__gc *gc, uint32_t domid, char *device)
     return nextid;
 }
 
+static int libxl__resolve_domid(libxl__gc *gc, const char *name,
+                                uint32_t *domid)
+{
+    if (!name)
+        return 0;
+    return libxl_domain_qualifier_to_domid(CTX, name, domid);
+}
+
 /******************************************************************************/
 int libxl__device_vtpm_setdefault(libxl__gc *gc, libxl_device_vtpm *vtpm)
 {
-   if(libxl_uuid_is_nil(&vtpm->uuid)) {
-      libxl_uuid_generate(&vtpm->uuid);
-   }
-   return 0;
+    int rc;
+    if (libxl_uuid_is_nil(&vtpm->uuid)) {
+        libxl_uuid_generate(&vtpm->uuid);
+    }
+    rc = libxl__resolve_domid(gc, vtpm->backend_domname, &vtpm->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_vtpm(libxl__gc *gc, uint32_t domid,
@@ -1969,6 +1979,7 @@ int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
     rc = libxl__device_disk_set_backend(gc, disk);
     if (rc) return rc;
 
+    rc = libxl__resolve_domid(gc, disk->backend_domname, &disk->backend_domid);
     return rc;
 }
 
@@ -2740,6 +2751,7 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
                                  uint32_t domid)
 {
     int run_hotplug_scripts;
+    int rc;
 
     if (!nic->mtu)
         nic->mtu = 1492;
@@ -2800,7 +2812,8 @@ int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic,
         abort();
     }
 
-    return 0;
+    rc = libxl__resolve_domid(gc, nic->backend_domname, &nic->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_nic(libxl__gc *gc, uint32_t domid,
@@ -3157,7 +3170,9 @@ out:
 
 int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
-    return 0;
+    int rc;
+    rc = libxl__resolve_domid(gc, vkb->backend_domname, &vkb->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_vkb(libxl__gc *gc, uint32_t domid,
@@ -3241,6 +3256,8 @@ out:
 
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
+    int rc;
+
     libxl_defbool_setdefault(&vfb->vnc.enable, true);
     if (libxl_defbool_val(vfb->vnc.enable)) {
         if (!vfb->vnc.listen) {
@@ -3256,7 +3273,8 @@ int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
     libxl_defbool_setdefault(&vfb->sdl.enable, false);
     libxl_defbool_setdefault(&vfb->sdl.opengl, false);
 
-    return 0;
+    rc = libxl__resolve_domid(gc, vfb->backend_domname, &vfb->backend_domid);
+    return rc;
 }
 
 static int libxl__device_from_vfb(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 92f3f8e..25efa76 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -296,6 +296,18 @@
  */
 #define LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST 1
 
+/*
+ * LIBXL_HAVE_DEVICE_BACKEND_DOMNAME
+ *
+ * If this is defined, libxl_device_* structures containing a backend_domid
+ * field also contain a backend_domname field.  If backend_domname is set, it is
+ * resolved to a domain ID when the device is used and takes precedence over the
+ * backend_domid field.
+ *
+ * If this is not defined, the backend_domname field does not exist.
+ */
+#define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
+
 /* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
  * called from within libxl itself. Callers outside libxl, who
  * do not #include libxl_internal.h, are fine. */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 2c10772..ecf1f0b 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -351,6 +351,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
 
 libxl_device_vfb = Struct("device_vfb", [
     ("backend_domid", libxl_domid),
+    ("backend_domname",string),
     ("devid",         libxl_devid),
     ("vnc",           libxl_vnc_info),
     ("sdl",           libxl_sdl_info),
@@ -360,11 +361,13 @@ libxl_device_vfb = Struct("device_vfb", [
 
 libxl_device_vkb = Struct("device_vkb", [
     ("backend_domid", libxl_domid),
+    ("backend_domname", string),
     ("devid", libxl_devid),
     ])
 
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
+    ("backend_domname", string),
     ("pdev_path", string),
     ("vdev", string),
     ("backend", libxl_disk_backend),
@@ -377,6 +380,7 @@ libxl_device_disk = Struct("device_disk", [
 
 libxl_device_nic = Struct("device_nic", [
     ("backend_domid", libxl_domid),
+    ("backend_domname", string),
     ("devid", libxl_devid),
     ("mtu", integer),
     ("model", string),
@@ -405,6 +409,7 @@ libxl_device_pci = Struct("device_pci", [
 
 libxl_device_vtpm = Struct("device_vtpm", [
     ("backend_domid",    libxl_domid),
+    ("backend_domname",  string),
     ("devid",            libxl_devid),
     ("uuid",             libxl_uuid),
 ])
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 8f78790..35da71c 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -90,6 +90,25 @@ int libxl_name_to_domid(libxl_ctx *ctx, const char *name,
     return ret;
 }
 
+int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name,
+                                    uint32_t *domid)
+{
+    int i, rv;
+    for (i=0; name[i]; i++) {
+        if (!isdigit(name[i])) {
+            goto nondigit_found;
+        }
+    }
+    *domid = strtoul(name, NULL, 10);
+    return 0;
+
+ nondigit_found:
+    /* this could also check for uuids */
+    rv = libxl_name_to_domid(ctx, name, domid);
+    return rv;
+}
+
+
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
     unsigned int len;
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 40f3f30..a430362 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -21,6 +21,7 @@
 const char *libxl_basename(const char *name); /* returns string from strdup */
 unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned int smp_cpus);
 int libxl_name_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
+int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
index 4c68034..03adfef 100644
--- a/tools/libxl/libxlu_disk_l.c
+++ b/tools/libxl/libxlu_disk_l.c
@@ -361,8 +361,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 25
-#define YY_END_OF_BUFFER 26
+#define YY_NUM_RULES 26
+#define YY_END_OF_BUFFER 27
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -370,60 +370,61 @@ struct yy_trans_info
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_acclist[447] =
+static yyconst flex_int16_t yy_acclist[454] =
     {   0,
-       24,   24,   26,   22,   23,   25, 8193,   22,   23,   25,
-    16385, 8193,   22,   25,16385,   22,   23,   25,   23,   25,
-       22,   23,   25,   22,   23,   25,   22,   23,   25,   22,
-       23,   25,   22,   23,   25,   22,   23,   25,   22,   23,
-       25,   22,   23,   25,   22,   23,   25,   22,   23,   25,
-       22,   23,   25,   22,   23,   25,   22,   23,   25,   22,
-       23,   25,   22,   23,   25,   24,   25,   25,   22,   22,
-     8193,   22, 8193,   22,16385, 8193,   22, 8193,   22,   22,
-     8213,   22,16405,   22,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-
-       22,   22,   24, 8193,   22, 8193,   22, 8193, 8213,   22,
-     8213,   22, 8213,   12,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-       22,   22, 8213,   22, 8213,   22, 8213,   12,   22,   17,
-     8213,   22,16405,   22,   22,   22,   22,   22,   22,   22,
-     8206, 8213,   22,16398,16405,   20, 8213,   22,16405,   22,
-     8205, 8213,   22,16397,16405,   22,   22, 8208, 8213,   22,
-    16400,16405,   22,   22,   22,   22,   17, 8213,   22,   17,
-     8213,   22,   17,   22,   17, 8213,   22,    3,   22,   22,
-       19, 8213,   22,16405,   22,   22, 8206, 8213,   22, 8206,
-
-     8213,   22, 8206,   22, 8206, 8213,   20, 8213,   22,   20,
-     8213,   22,   20,   22,   20, 8213, 8205, 8213,   22, 8205,
-     8213,   22, 8205,   22, 8205, 8213,   22, 8208, 8213,   22,
-     8208, 8213,   22, 8208,   22, 8208, 8213,   22,   22,    9,
-       22,   17, 8213,   22,   17, 8213,   22,   17, 8213,   17,
-       22,   17,   22,    3,   22,   22,   19, 8213,   22,   19,
-     8213,   22,   19,   22,   19, 8213,   22,   18, 8213,   22,
-    16405, 8206, 8213,   22, 8206, 8213,   22, 8206, 8213, 8206,
-       22, 8206,   20, 8213,   22,   20, 8213,   22,   20, 8213,
-       20,   22,   20, 8205, 8213,   22, 8205, 8213,   22, 8205,
-
-     8213, 8205,   22, 8205,   22, 8208, 8213,   22, 8208, 8213,
-       22, 8208, 8213, 8208,   22, 8208,   22,   22,    9,   12,
-        9,    7,   22,   22,   19, 8213,   22,   19, 8213,   22,
-       19, 8213,   19,   22,   19,    2,   18, 8213,   22,   18,
-     8213,   22,   18,   22,   18, 8213,   10,   22,   11,    9,
-        9,   12,    7,   12,    7,   22,    6,    2,   12,    2,
-       18, 8213,   22,   18, 8213,   22,   18, 8213,   18,   22,
-       18,   10,   12,   10,   15, 8213,   22,16405,   11,   12,
-       11,    7,    7,   12,   22,    6,   12,    6,    6,   12,
-        6,   12,    2,    2,   12,   10,   10,   12,   15, 8213,
-
-       22,   15, 8213,   22,   15,   22,   15, 8213,   11,   12,
-       22,    6,    6,   12,    6,    6,   15, 8213,   22,   15,
-     8213,   22,   15, 8213,   15,   22,   15,   22,    6,    6,
-        8,    6,    5,    6,    8,   12,    8,    4,    6,    5,
-        6,    8,    8,   12,    4,    6
+       25,   25,   27,   23,   24,   26, 8193,   23,   24,   26,
+    16385, 8193,   23,   26,16385,   23,   24,   26,   24,   26,
+       23,   24,   26,   23,   24,   26,   23,   24,   26,   23,
+       24,   26,   23,   24,   26,   23,   24,   26,   23,   24,
+       26,   23,   24,   26,   23,   24,   26,   23,   24,   26,
+       23,   24,   26,   23,   24,   26,   23,   24,   26,   23,
+       24,   26,   23,   24,   26,   25,   26,   26,   23,   23,
+     8193,   23, 8193,   23,16385, 8193,   23, 8193,   23,   23,
+     8214,   23,16406,   23,   23,   23,   23,   23,   23,   23,
+       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
+
+       23,   23,   25, 8193,   23, 8193,   23, 8193, 8214,   23,
+     8214,   23, 8214,   13,   23,   23,   23,   23,   23,   23,
+       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
+       23,   23, 8214,   23, 8214,   23, 8214,   13,   23,   18,
+     8214,   23,16406,   23,   23,   23,   23,   23,   23,   23,
+     8207, 8214,   23,16399,16406,   21, 8214,   23,16406,   23,
+     8206, 8214,   23,16398,16406,   23,   23, 8209, 8214,   23,
+    16401,16406,   23,   23,   23,   23,   18, 8214,   23,   18,
+     8214,   23,   18,   23,   18, 8214,   23,    3,   23,   23,
+       20, 8214,   23,16406,   23,   23, 8207, 8214,   23, 8207,
+
+     8214,   23, 8207,   23, 8207, 8214,   21, 8214,   23,   21,
+     8214,   23,   21,   23,   21, 8214, 8206, 8214,   23, 8206,
+     8214,   23, 8206,   23, 8206, 8214,   23, 8209, 8214,   23,
+     8209, 8214,   23, 8209,   23, 8209, 8214,   23,   23,   10,
+       23,   18, 8214,   23,   18, 8214,   23,   18, 8214,   18,
+       23,   18,   23,    3,   23,   23,   20, 8214,   23,   20,
+     8214,   23,   20,   23,   20, 8214,   23,   19, 8214,   23,
+    16406, 8207, 8214,   23, 8207, 8214,   23, 8207, 8214, 8207,
+       23, 8207,   21, 8214,   23,   21, 8214,   23,   21, 8214,
+       21,   23,   21, 8206, 8214,   23, 8206, 8214,   23, 8206,
+
+     8214, 8206,   23, 8206,   23, 8209, 8214,   23, 8209, 8214,
+       23, 8209, 8214, 8209,   23, 8209,   23,   23,   10,   13,
+       10,    7,   23,   23,   20, 8214,   23,   20, 8214,   23,
+       20, 8214,   20,   23,   20,    2,   19, 8214,   23,   19,
+     8214,   23,   19,   23,   19, 8214,   11,   23,   12,   10,
+       10,   13,    7,   13,    7,    8,   23,    6,    2,   13,
+        2,   19, 8214,   23,   19, 8214,   23,   19, 8214,   19,
+       23,   19,   11,   13,   11,   16, 8214,   23,16406,   12,
+       13,   12,    7,    7,   13,    8,   13,    8,   23,    6,
+       13,    6,    6,   13,    6,   13,    2,    2,   13,   11,
+
+       11,   13,   16, 8214,   23,   16, 8214,   23,   16,   23,
+       16, 8214,   12,   13,    8,    8,   13,   23,    6,    6,
+       13,    6,    6,   16, 8214,   23,   16, 8214,   23,   16,
+     8214,   16,   23,   16,   23,    6,    6,    9,    6,    5,
+        6,    9,   13,    9,    4,    6,    5,    6,    9,    9,
+       13,    4,    6
     } ;
 
-static yyconst flex_int16_t yy_accept[252] =
+static yyconst flex_int16_t yy_accept[257] =
     {   0,
         1,    1,    1,    2,    3,    4,    7,   12,   16,   19,
        21,   24,   27,   30,   33,   36,   39,   42,   45,   48,
@@ -445,14 +446,14 @@ static yyconst flex_int16_t yy_accept[252] =
       293,  294,  297,  300,  302,  304,  305,  306,  309,  312,
       314,  316,  317,  318,  319,  321,  322,  323,  324,  325,
       328,  331,  333,  335,  336,  337,  340,  343,  345,  347,
-      348,  349,  350,  351,  353,  355,  356,  357,  358,  360,
-
-      361,  364,  367,  369,  371,  372,  374,  375,  379,  381,
-      382,  383,  385,  386,  388,  389,  391,  393,  394,  396,
-      397,  399,  402,  405,  407,  409,  411,  412,  413,  415,
-      416,  417,  420,  423,  425,  427,  428,  429,  430,  431,
-      432,  433,  435,  437,  438,  440,  442,  443,  445,  447,
-      447
+      348,  349,  350,  351,  353,  355,  356,  357,  358,  359,
+
+      361,  362,  365,  368,  370,  372,  373,  375,  376,  380,
+      382,  383,  384,  386,  388,  389,  390,  392,  393,  395,
+      397,  398,  400,  401,  403,  406,  409,  411,  413,  415,
+      416,  418,  419,  420,  422,  423,  424,  427,  430,  432,
+      434,  435,  436,  437,  438,  439,  440,  442,  444,  445,
+      447,  449,  450,  452,  454,  454
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -495,83 +496,85 @@ static yyconst flex_int32_t yy_meta[34] =
         1,    1,    1
     } ;
 
-static yyconst flex_int16_t yy_base[308] =
+static yyconst flex_int16_t yy_base[315] =
     {   0,
-        0,    0,  546,  538,  533,  521,   32,   35,  656,  656,
-       44,   62,   30,   41,   50,   51,  507,   64,   47,   66,
-       67,  499,   68,  487,   72,    0,  656,  465,  656,   87,
-       91,    0,    0,  100,  452,  109,    0,   74,   95,   87,
+        0,    0,  563,  559,  558,  546,   32,   35,  665,  665,
+       44,   62,   30,   41,   50,   51,  532,   64,   47,   66,
+       67,  524,   68,  516,   72,    0,  665,  514,  665,   87,
+       91,    0,    0,  100,  500,  109,    0,   74,   95,   87,
        32,   96,  105,  110,   77,   97,   40,  113,  116,  112,
       118,  120,  121,  122,  123,  125,    0,  137,    0,    0,
-      147,    0,    0,  449,  129,  126,  134,  143,  145,  147,
+      147,    0,    0,  494,  129,  126,  134,  143,  145,  147,
       148,  149,  151,  153,  156,  160,  155,  167,  162,  175,
-      168,  159,  188,    0,    0,  656,  166,  197,  179,  185,
-      176,  200,  435,  186,  193,  216,  225,  205,  234,  221,
+      168,  159,  188,    0,    0,  665,  166,  197,  179,  185,
+      176,  200,  460,  186,  193,  216,  225,  205,  234,  221,
 
       237,  247,  204,  230,  244,  213,  254,    0,  256,    0,
       251,  258,  254,  279,  256,  259,  267,    0,  269,    0,
       286,    0,  288,    0,  290,    0,  297,    0,  267,  299,
-        0,  301,    0,  288,  297,  421,  302,  310,    0,    0,
-        0,    0,  305,  656,  307,  319,    0,  321,    0,  322,
+        0,  301,    0,  288,  297,  459,  302,  310,    0,    0,
+        0,    0,  305,  665,  307,  319,    0,  321,    0,  322,
       332,  335,    0,    0,    0,    0,  339,    0,    0,    0,
         0,  342,    0,    0,    0,    0,  340,  349,    0,    0,
-        0,    0,  337,  345,  420,  656,  419,  346,  350,  358,
-        0,    0,    0,    0,  418,  360,    0,  362,    0,  417,
-      319,  369,  416,  656,  415,  656,  276,  364,  414,  656,
-
-      375,    0,    0,    0,    0,  413,  656,  384,  412,    0,
-      410,  656,  370,  409,  656,  370,  378,  408,  656,  366,
-      656,  394,    0,  396,    0,    0,  380,  316,  656,  377,
-      387,  398,    0,    0,    0,    0,  399,  402,  407,  271,
-      406,  228,  200,  656,  175,  656,   77,  656,  656,  656,
-      428,  432,  435,  439,  443,  447,  451,  455,  459,  463,
-      467,  471,  475,  479,  483,  487,  491,  495,  499,  503,
-      507,  511,  515,  519,  523,  527,  531,  535,  539,  543,
-      547,  551,  555,  559,  563,  567,  571,  575,  579,  583,
-      587,  591,  595,  599,  603,  607,  611,  615,  619,  623,
-
-      627,  631,  635,  639,  643,  647,  651
+        0,    0,  337,  345,  450,  665,  442,  350,  352,  360,
+        0,    0,    0,    0,  424,  362,    0,  364,    0,  420,
+      319,  371,  419,  665,  418,  665,  417,  276,  368,  416,
+
+      665,  373,    0,    0,    0,    0,  415,  665,  382,  414,
+        0,  413,  665,  412,  665,  368,  411,  665,  384,  352,
+      410,  665,  409,  665,  391,    0,  395,    0,    0,  405,
+      665,  382,  316,  665,  385,  397,  399,    0,    0,    0,
+        0,  396,  403,  406,  271,  407,  228,  200,  665,  175,
+      665,   77,  665,  665,  665,  429,  433,  436,  440,  444,
+      448,  452,  456,  460,  464,  468,  472,  476,  480,  484,
+      488,  492,  496,  500,  504,  508,  512,  516,  520,  524,
+      528,  532,  536,  540,  544,  548,  552,  556,  560,  564,
+      568,  572,  576,  580,  584,  588,  592,  596,  600,  604,
+
+      608,  612,  616,  620,  624,  628,  632,  636,  640,  644,
+      648,  652,  656,  660
     } ;
 
-static yyconst flex_int16_t yy_def[308] =
+static yyconst flex_int16_t yy_def[315] =
     {   0,
-      250,    1,  251,  251,  250,  252,  253,  253,  250,  250,
-      254,  254,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,  255,  250,  252,  250,  256,
-      253,  257,  257,  258,   12,  252,  259,   12,   12,   12,
+      255,    1,  256,  256,  255,  257,  258,  258,  255,  255,
+      259,  259,   12,   12,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,  260,  255,  257,  255,  261,
+      258,  262,  262,  263,   12,  257,  264,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,   12,   12,   12,   12,  255,  256,  257,  257,
-      260,  261,  261,  250,   12,   12,   12,   12,   12,   12,
+       12,   12,   12,   12,   12,   12,  260,  261,  262,  262,
+      265,  266,  266,  255,   12,   12,   12,   12,   12,   12,
        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
-       12,   12,  260,  261,  261,  250,   12,  262,   12,   12,
-       12,   12,   12,   12,   12,  263,  264,   12,  265,   12,
-
-       12,  266,   12,   12,   12,   12,  267,  268,  262,  268,
-       12,   12,   12,  269,   12,   12,  270,  271,  263,  271,
-      272,  273,  264,  273,  274,  275,  265,  275,   12,  276,
-      277,  266,  277,   12,   12,  278,   12,  267,  268,  268,
-      279,  279,   12,  250,   12,  280,  281,  269,  281,   12,
-      282,  270,  271,  271,  283,  283,  272,  273,  273,  284,
-      284,  274,  275,  275,  285,  285,   12,  276,  277,  277,
-      286,  286,   12,   12,  287,  250,  288,   12,   12,  280,
-      281,  281,  289,  289,  290,  291,  292,  282,  292,  293,
-       12,  294,  287,  250,  295,  250,   12,  296,  297,  250,
-
-      291,  292,  292,  298,  298,  299,  250,  300,  301,  301,
-      295,  250,   12,  302,  250,  302,  302,  297,  250,  299,
-      250,  303,  304,  300,  304,  301,   12,  302,  250,  302,
-      302,  303,  304,  304,  305,  305,   12,  302,  302,  306,
-      302,  302,  307,  250,  302,  250,  307,  250,  250,    0,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-
-      250,  250,  250,  250,  250,  250,  250
+       12,   12,  265,  266,  266,  255,   12,  267,   12,   12,
+       12,   12,   12,   12,   12,  268,  269,   12,  270,   12,
+
+       12,  271,   12,   12,   12,   12,  272,  273,  267,  273,
+       12,   12,   12,  274,   12,   12,  275,  276,  268,  276,
+      277,  278,  269,  278,  279,  280,  270,  280,   12,  281,
+      282,  271,  282,   12,   12,  283,   12,  272,  273,  273,
+      284,  284,   12,  255,   12,  285,  286,  274,  286,   12,
+      287,  275,  276,  276,  288,  288,  277,  278,  278,  289,
+      289,  279,  280,  280,  290,  290,   12,  281,  282,  282,
+      291,  291,   12,   12,  292,  255,  293,   12,   12,  285,
+      286,  286,  294,  294,  295,  296,  297,  287,  297,  298,
+       12,  299,  292,  255,  300,  255,  301,   12,  302,  303,
+
+      255,  296,  297,  297,  304,  304,  305,  255,  306,  307,
+      307,  300,  255,  308,  255,   12,  309,  255,  309,  309,
+      303,  255,  305,  255,  310,  311,  306,  311,  307,  308,
+      255,   12,  309,  255,  309,  309,  310,  311,  311,  312,
+      312,   12,  309,  309,  313,  309,  309,  314,  255,  309,
+      255,  314,  255,  255,    0,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255
     } ;
 
-static yyconst flex_int16_t yy_nxt[690] =
+static yyconst flex_int16_t yy_nxt[699] =
     {   0,
         6,    7,    8,    9,    6,    6,    6,    6,   10,   11,
        12,   13,   14,   15,   16,   17,   17,   18,   17,   17,
@@ -581,7 +584,7 @@ static yyconst flex_int16_t yy_nxt[690] =
        35,   36,   37,   73,   42,   38,   35,   49,   68,   35,
        35,   39,   28,   28,   28,   29,   34,   43,   45,   36,
        37,   40,   44,   35,   46,   35,   35,   35,   51,   53,
-      244,   35,   50,   35,   55,   65,   35,   47,   56,   28,
+      249,   35,   50,   35,   55,   65,   35,   47,   56,   28,
        59,   48,   31,   31,   32,   60,   35,   71,   67,   33,
 
        28,   28,   28,   29,   35,   35,   35,   28,   37,   61,
@@ -591,66 +594,68 @@ static yyconst flex_int16_t yy_nxt[690] =
        59,   77,   87,   35,   76,   60,   80,   79,   81,   28,
        84,   78,   35,   89,   35,   85,   35,   35,   35,   75,
        35,   92,   35,   96,   35,   35,   90,   97,   35,   35,
-       93,   35,   94,   91,   99,   35,   35,   35,  249,  100,
+       93,   35,   94,   91,   99,   35,   35,   35,  254,  100,
        95,  101,  102,  104,   35,   35,   98,  103,   35,  105,
        28,   84,  111,  106,   35,   35,   85,  107,  107,   61,
 
-      108,  107,   35,  248,  107,  110,  112,  114,  113,   35,
+      108,  107,   35,  253,  107,  110,  112,  114,  113,   35,
        75,   78,   99,   35,   35,  116,  117,  117,   61,  118,
       117,  134,   35,  117,  120,  121,  121,   61,  122,  121,
-       35,  246,  121,  124,  125,  125,   61,  126,  125,   35,
+       35,  251,  121,  124,  125,  125,   61,  126,  125,   35,
       137,  125,  128,  135,  102,  129,   35,  130,  130,   61,
       131,  130,  136,   35,  130,  133,   28,  139,   28,  141,
        35,  144,  140,   35,  142,   35,  151,   35,   35,   28,
-      153,   28,  155,  143,  244,  154,   35,  156,  145,  146,
+      153,   28,  155,  143,  249,  154,   35,  156,  145,  146,
       146,   61,  147,  146,  150,   35,  146,  149,   28,  158,
        28,  160,   28,  163,  159,  167,  161,   35,  164,   28,
 
-      165,   28,  169,   28,  171,  166,   35,  170,  213,  172,
-      177,   35,   28,  139,   35,  173,   35,  178,  140,  215,
-      179,   28,  181,   28,  183,  174,  208,  182,   35,  184,
+      165,   28,  169,   28,  171,  166,   35,  170,  216,  172,
+      177,   35,   28,  139,   35,  173,   35,  178,  140,  218,
+      179,   28,  181,   28,  183,  174,  209,  182,   35,  184,
       185,   35,  186,  186,   61,  187,  186,   28,  153,  186,
       189,   28,  158,  154,   28,  163,   35,  159,  190,   35,
-      164,   28,  169,  192,   35,   35,  191,  170,  198,   35,
-       28,  181,   28,  202,   28,  204,  182,  215,  203,  207,
-      205,   64,  210,  229,  197,  216,  217,   28,  202,   35,
-      215,  229,  230,  203,  222,  222,   61,  223,  222,   35,
-      215,  222,  225,  237,  227,  231,   28,  233,   28,  235,
-
-       28,  233,  234,  238,  236,  215,  234,  240,   35,  215,
-      215,  200,  229,  196,  239,  226,  221,  219,  212,  176,
-      207,  200,  196,  194,  176,  241,  242,  245,   26,   26,
-       26,   26,   28,   28,   28,   30,   30,   30,   30,   35,
-       35,   35,   35,   57,  115,   57,   57,   58,   58,   58,
-       58,   60,   86,   60,   60,   34,   34,   34,   34,   64,
-       64,   35,   64,   83,   83,   83,   83,   85,   29,   85,
-       85,  109,  109,  109,  109,  119,  119,  119,  119,  123,
-      123,  123,  123,  127,  127,  127,  127,  132,  132,  132,
-      132,  138,  138,  138,  138,  140,   54,  140,  140,  148,
-
-      148,  148,  148,  152,  152,  152,  152,  154,   52,  154,
-      154,  157,  157,  157,  157,  159,   35,  159,  159,  162,
-      162,  162,  162,  164,   29,  164,  164,  168,  168,  168,
-      168,  170,  250,  170,  170,  175,  175,  175,  175,  142,
-       27,  142,  142,  180,  180,  180,  180,  182,   27,  182,
-      182,  188,  188,  188,  188,  156,  250,  156,  156,  161,
-      250,  161,  161,  166,  250,  166,  166,  172,  250,  172,
-      172,  193,  193,  193,  193,  195,  195,  195,  195,  184,
-      250,  184,  184,  199,  199,  199,  199,  201,  201,  201,
-      201,  203,  250,  203,  203,  206,  206,  206,  206,  209,
-
-      209,  209,  209,  211,  211,  211,  211,  214,  214,  214,
-      214,  218,  218,  218,  218,  205,  250,  205,  205,  220,
-      220,  220,  220,  224,  224,  224,  224,  210,  250,  210,
-      210,  228,  228,  228,  228,  232,  232,  232,  232,  234,
-      250,  234,  234,  236,  250,  236,  236,  243,  243,  243,
-      243,  247,  247,  247,  247,    5,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250
+      164,   28,  169,  192,   35,  234,  191,  170,  197,   35,
+      199,   35,   28,  181,   28,  203,   28,  205,  182,  236,
+      204,  218,  206,   64,  211,   28,  203,   35,  198,  219,
+      220,  204,  225,  225,   61,  226,  225,  234,  218,  225,
+      228,   35,  232,   28,  238,  242,  235,   28,  240,  239,
+
+      218,   28,  238,  241,  245,   35,  218,  239,  215,  218,
+      218,  243,  208,  201,  234,  231,  196,  229,  224,  222,
+      215,  213,  176,  208,  244,  247,  246,  201,  250,   26,
+       26,   26,   26,   28,   28,   28,   30,   30,   30,   30,
+       35,   35,   35,   35,   57,  196,   57,   57,   58,   58,
+       58,   58,   60,  194,   60,   60,   34,   34,   34,   34,
+       64,   64,  176,   64,   83,   83,   83,   83,   85,  115,
+       85,   85,  109,  109,  109,  109,  119,  119,  119,  119,
+      123,  123,  123,  123,  127,  127,  127,  127,  132,  132,
+      132,  132,  138,  138,  138,  138,  140,   86,  140,  140,
+
+      148,  148,  148,  148,  152,  152,  152,  152,  154,   35,
+      154,  154,  157,  157,  157,  157,  159,   29,  159,  159,
+      162,  162,  162,  162,  164,   54,  164,  164,  168,  168,
+      168,  168,  170,   52,  170,  170,  175,  175,  175,  175,
+      142,   35,  142,  142,  180,  180,  180,  180,  182,   29,
+      182,  182,  188,  188,  188,  188,  156,  255,  156,  156,
+      161,   27,  161,  161,  166,   27,  166,  166,  172,  255,
+      172,  172,  193,  193,  193,  193,  195,  195,  195,  195,
+      184,  255,  184,  184,  200,  200,  200,  200,  202,  202,
+      202,  202,  204,  255,  204,  204,  207,  207,  207,  207,
+
+      210,  210,  210,  210,  212,  212,  212,  212,  214,  214,
+      214,  214,  217,  217,  217,  217,  221,  221,  221,  221,
+      206,  255,  206,  206,  223,  223,  223,  223,  227,  227,
+      227,  227,  211,  255,  211,  211,  230,  230,  230,  230,
+      233,  233,  233,  233,  237,  237,  237,  237,  239,  255,
+      239,  239,  241,  255,  241,  241,  248,  248,  248,  248,
+      252,  252,  252,  252,    5,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255
+
     } ;
 
-static yyconst flex_int16_t yy_chk[690] =
+static yyconst flex_int16_t yy_chk[699] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -660,7 +665,7 @@ static yyconst flex_int16_t yy_chk[690] =
        14,   11,   11,   47,   14,   11,   19,   19,   41,   15,
        16,   11,   12,   12,   12,   12,   12,   14,   16,   12,
        12,   12,   15,   18,   16,   20,   21,   23,   21,   23,
-      247,   25,   20,   38,   25,   38,   45,   18,   25,   30,
+      252,   25,   20,   38,   25,   38,   45,   18,   25,   30,
        30,   18,   31,   31,   31,   30,   40,   45,   40,   31,
 
        34,   34,   34,   34,   39,   42,   46,   34,   34,   36,
@@ -670,63 +675,65 @@ static yyconst flex_int16_t yy_chk[690] =
        58,   51,   65,   67,   50,   58,   54,   53,   54,   61,
        61,   52,   68,   67,   69,   61,   70,   71,   72,   70,
        73,   71,   74,   75,   77,   75,   68,   76,   82,   76,
-       72,   79,   73,   69,   78,   87,   78,   81,  245,   79,
+       72,   79,   73,   69,   78,   87,   78,   81,  250,   79,
        74,   80,   80,   81,   80,   91,   77,   80,   89,   82,
        83,   83,   89,   87,   90,   94,   83,   88,   88,   88,
 
-       88,   88,   95,  243,   88,   88,   90,   92,   91,   92,
+       88,   88,   95,  248,   88,   88,   90,   92,   91,   92,
        95,   98,   98,  103,   98,   94,   96,   96,   96,   96,
        96,  103,  106,   96,   96,   97,   97,   97,   97,   97,
-      100,  242,   97,   97,   99,   99,   99,   99,   99,  104,
+      100,  247,   97,   97,   99,   99,   99,   99,   99,  104,
       106,   99,   99,  104,  101,  100,  101,  102,  102,  102,
       102,  102,  105,  105,  102,  102,  107,  107,  109,  109,
       111,  112,  107,  113,  109,  115,  116,  112,  116,  117,
-      117,  119,  119,  111,  240,  117,  129,  119,  113,  114,
-      114,  114,  114,  114,  115,  197,  114,  114,  121,  121,
+      117,  119,  119,  111,  245,  117,  129,  119,  113,  114,
+      114,  114,  114,  114,  115,  198,  114,  114,  121,  121,
       123,  123,  125,  125,  121,  129,  123,  134,  125,  127,
 
-      127,  130,  130,  132,  132,  127,  135,  130,  197,  132,
-      137,  137,  138,  138,  143,  134,  145,  143,  138,  228,
+      127,  130,  130,  132,  132,  127,  135,  130,  198,  132,
+      137,  137,  138,  138,  143,  134,  145,  143,  138,  233,
       145,  146,  146,  148,  148,  135,  191,  146,  191,  148,
       150,  150,  151,  151,  151,  151,  151,  152,  152,  151,
       151,  157,  157,  152,  162,  162,  173,  157,  167,  167,
-      162,  168,  168,  174,  174,  178,  173,  168,  179,  179,
-      180,  180,  186,  186,  188,  188,  180,  198,  186,  220,
-      188,  192,  192,  216,  178,  198,  198,  201,  201,  213,
-      230,  217,  216,  201,  208,  208,  208,  208,  208,  227,
-      231,  208,  208,  227,  213,  217,  222,  222,  224,  224,
-
-      232,  232,  222,  230,  224,  238,  232,  237,  237,  241,
-      239,  218,  214,  211,  231,  209,  206,  199,  195,  193,
-      190,  185,  177,  175,  136,  238,  239,  241,  251,  251,
-      251,  251,  252,  252,  252,  253,  253,  253,  253,  254,
-      254,  254,  254,  255,   93,  255,  255,  256,  256,  256,
-      256,  257,   64,  257,  257,  258,  258,  258,  258,  259,
-      259,   35,  259,  260,  260,  260,  260,  261,   28,  261,
-      261,  262,  262,  262,  262,  263,  263,  263,  263,  264,
-      264,  264,  264,  265,  265,  265,  265,  266,  266,  266,
-      266,  267,  267,  267,  267,  268,   24,  268,  268,  269,
-
-      269,  269,  269,  270,  270,  270,  270,  271,   22,  271,
-      271,  272,  272,  272,  272,  273,   17,  273,  273,  274,
-      274,  274,  274,  275,    6,  275,  275,  276,  276,  276,
-      276,  277,    5,  277,  277,  278,  278,  278,  278,  279,
-        4,  279,  279,  280,  280,  280,  280,  281,    3,  281,
-      281,  282,  282,  282,  282,  283,    0,  283,  283,  284,
-        0,  284,  284,  285,    0,  285,  285,  286,    0,  286,
-      286,  287,  287,  287,  287,  288,  288,  288,  288,  289,
-        0,  289,  289,  290,  290,  290,  290,  291,  291,  291,
-      291,  292,    0,  292,  292,  293,  293,  293,  293,  294,
-
-      294,  294,  294,  295,  295,  295,  295,  296,  296,  296,
-      296,  297,  297,  297,  297,  298,    0,  298,  298,  299,
-      299,  299,  299,  300,  300,  300,  300,  301,    0,  301,
-      301,  302,  302,  302,  302,  303,  303,  303,  303,  304,
-        0,  304,  304,  305,    0,  305,  305,  306,  306,  306,
-      306,  307,  307,  307,  307,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
-      250,  250,  250,  250,  250,  250,  250,  250,  250
+      162,  168,  168,  174,  174,  220,  173,  168,  178,  178,
+      179,  179,  180,  180,  186,  186,  188,  188,  180,  220,
+      186,  199,  188,  192,  192,  202,  202,  216,  178,  199,
+      199,  202,  209,  209,  209,  209,  209,  219,  235,  209,
+      209,  232,  216,  225,  225,  232,  219,  227,  227,  225,
+
+      236,  237,  237,  227,  242,  242,  243,  237,  230,  244,
+      246,  235,  223,  221,  217,  214,  212,  210,  207,  200,
+      197,  195,  193,  190,  236,  244,  243,  185,  246,  256,
+      256,  256,  256,  257,  257,  257,  258,  258,  258,  258,
+      259,  259,  259,  259,  260,  177,  260,  260,  261,  261,
+      261,  261,  262,  175,  262,  262,  263,  263,  263,  263,
+      264,  264,  136,  264,  265,  265,  265,  265,  266,   93,
+      266,  266,  267,  267,  267,  267,  268,  268,  268,  268,
+      269,  269,  269,  269,  270,  270,  270,  270,  271,  271,
+      271,  271,  272,  272,  272,  272,  273,   64,  273,  273,
+
+      274,  274,  274,  274,  275,  275,  275,  275,  276,   35,
+      276,  276,  277,  277,  277,  277,  278,   28,  278,  278,
+      279,  279,  279,  279,  280,   24,  280,  280,  281,  281,
+      281,  281,  282,   22,  282,  282,  283,  283,  283,  283,
+      284,   17,  284,  284,  285,  285,  285,  285,  286,    6,
+      286,  286,  287,  287,  287,  287,  288,    5,  288,  288,
+      289,    4,  289,  289,  290,    3,  290,  290,  291,    0,
+      291,  291,  292,  292,  292,  292,  293,  293,  293,  293,
+      294,    0,  294,  294,  295,  295,  295,  295,  296,  296,
+      296,  296,  297,    0,  297,  297,  298,  298,  298,  298,
+
+      299,  299,  299,  299,  300,  300,  300,  300,  301,  301,
+      301,  301,  302,  302,  302,  302,  303,  303,  303,  303,
+      304,    0,  304,  304,  305,  305,  305,  305,  306,  306,
+      306,  306,  307,    0,  307,  307,  308,  308,  308,  308,
+      309,  309,  309,  309,  310,  310,  310,  310,  311,    0,
+      311,  311,  312,    0,  312,  312,  313,  313,  313,  313,
+      314,  314,  314,  314,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255,  255,  255,  255,  255,  255,  255
+
     } ;
 
 #define YY_TRAILING_MASK 0x2000
@@ -883,7 +890,7 @@ static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
 #define DPC ((DiskParseContext*)yyextra)
 
 
-#line 887 "libxlu_disk_l.c"
+#line 894 "libxlu_disk_l.c"
 
 #define INITIAL 0
 #define LEXERR 1
@@ -1124,7 +1131,7 @@ YY_DECL
 
  /*----- the scanner rules which do the parsing -----*/
 
-#line 1128 "libxlu_disk_l.c"
+#line 1135 "libxlu_disk_l.c"
 
 	if ( !yyg->yy_init )
 		{
@@ -1188,14 +1195,14 @@ yy_match:
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 251 )
+				if ( yy_current_state >= 256 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			*yyg->yy_state_ptr++ = yy_current_state;
 			++yy_cp;
 			}
-		while ( yy_current_state != 250 );
+		while ( yy_current_state != 255 );
 
 yy_find_action:
 		yy_current_state = *--yyg->yy_state_ptr;
@@ -1286,48 +1293,54 @@ case 8:
 /* rule 8 can match eol */
 YY_RULE_SETUP
 #line 171 "libxlu_disk_l.l"
-{ STRIP(','); setbackendtype(DPC,FROMEQUALS); }
+{ STRIP(','); SAVESTRING("backend", backend_domname, FROMEQUALS); }
 	YY_BREAK
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 173 "libxlu_disk_l.l"
-{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+#line 172 "libxlu_disk_l.l"
+{ STRIP(','); setbackendtype(DPC,FROMEQUALS); }
 	YY_BREAK
 case 10:
 /* rule 10 can match eol */
 YY_RULE_SETUP
 #line 174 "libxlu_disk_l.l"
+{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+	YY_BREAK
+case 11:
+/* rule 11 can match eol */
+YY_RULE_SETUP
+#line 175 "libxlu_disk_l.l"
 { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
 	YY_BREAK
 /* the target magic parameter, eats the rest of the string */
-case 11:
+case 12:
 YY_RULE_SETUP
-#line 178 "libxlu_disk_l.l"
+#line 179 "libxlu_disk_l.l"
 { STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
 	YY_BREAK
 /* unknown parameters */
-case 12:
-/* rule 12 can match eol */
+case 13:
+/* rule 13 can match eol */
 YY_RULE_SETUP
-#line 182 "libxlu_disk_l.l"
+#line 183 "libxlu_disk_l.l"
 { xlu__disk_err(DPC,yytext,"unknown parameter"); }
 	YY_BREAK
 /* deprecated prefixes */
 /* the "/.*" in these patterns ensures that they count as if they
    * matched the whole string, so these patterns take precedence */
-case 13:
+case 14:
 YY_RULE_SETUP
-#line 189 "libxlu_disk_l.l"
+#line 190 "libxlu_disk_l.l"
 {
                     STRIP(':');
                     DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
                     setformat(DPC, yytext);
                  }
 	YY_BREAK
-case 14:
+case 15:
 YY_RULE_SETUP
-#line 195 "libxlu_disk_l.l"
+#line 196 "libxlu_disk_l.l"
 {
                     char *newscript;
                     STRIP(':');
@@ -1341,30 +1354,22 @@ YY_RULE_SETUP
                     free(newscript);
                 }
 	YY_BREAK
-case 15:
+case 16:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
 yyg->yy_c_buf_p = yy_cp = yy_bp + 8;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
-#line 208 "libxlu_disk_l.l"
-{ DPC->had_depr_prefix=1; DEPRECATE(0); }
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
 #line 209 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
 	YY_BREAK
 case 17:
-*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
-YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 210 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
 	YY_BREAK
 case 18:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
+yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 211 "libxlu_disk_l.l"
@@ -1372,7 +1377,7 @@ YY_RULE_SETUP
 	YY_BREAK
 case 19:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
+yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 212 "libxlu_disk_l.l"
@@ -1380,26 +1385,34 @@ YY_RULE_SETUP
 	YY_BREAK
 case 20:
 *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
-yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
+yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 #line 213 "libxlu_disk_l.l"
 { DPC->had_depr_prefix=1; DEPRECATE(0); }
 	YY_BREAK
 case 21:
-/* rule 21 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
+YY_RULE_SETUP
+#line 214 "libxlu_disk_l.l"
+{ DPC->had_depr_prefix=1; DEPRECATE(0); }
+	YY_BREAK
+case 22:
+/* rule 22 can match eol */
 YY_RULE_SETUP
-#line 215 "libxlu_disk_l.l"
+#line 216 "libxlu_disk_l.l"
 {
 		  xlu__disk_err(DPC,yytext,"unknown deprecated disk prefix");
 		  return 0;
 		}
 	YY_BREAK
 /* positional parameters */
-case 22:
-/* rule 22 can match eol */
+case 23:
+/* rule 23 can match eol */
 YY_RULE_SETUP
-#line 222 "libxlu_disk_l.l"
+#line 223 "libxlu_disk_l.l"
 {
     STRIP(',');
 
@@ -1426,27 +1439,27 @@ YY_RULE_SETUP
     }
 }
 	YY_BREAK
-case 23:
+case 24:
 YY_RULE_SETUP
-#line 248 "libxlu_disk_l.l"
+#line 249 "libxlu_disk_l.l"
 {
     BEGIN(LEXERR);
     yymore();
 }
 	YY_BREAK
-case 24:
+case 25:
 YY_RULE_SETUP
-#line 252 "libxlu_disk_l.l"
+#line 253 "libxlu_disk_l.l"
 {
     xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
 }
 	YY_BREAK
-case 25:
+case 26:
 YY_RULE_SETUP
-#line 255 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 1450 "libxlu_disk_l.c"
+#line 1463 "libxlu_disk_l.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(LEXERR):
 				yyterminate();
@@ -1710,7 +1723,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 251 )
+			if ( yy_current_state >= 256 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1734,11 +1747,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 251 )
+		if ( yy_current_state >= 256 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 250);
+	yy_is_jam = (yy_current_state == 255);
 	if ( ! yy_is_jam )
 		*yyg->yy_state_ptr++ = yy_current_state;
 
@@ -2538,4 +2551,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
 
 #define YYTABLES_NAME "yytables"
 
-#line 255 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h
index de03908..0176249 100644
--- a/tools/libxl/libxlu_disk_l.h
+++ b/tools/libxl/libxlu_disk_l.h
@@ -344,7 +344,7 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
 #undef YY_DECL
 #endif
 
-#line 255 "libxlu_disk_l.l"
+#line 256 "libxlu_disk_l.l"
 
 #line 350 "libxlu_disk_l.h"
 #undef xlu__disk_yyIN_HEADER
diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l
index bee16a1..7c4e7f1 100644
--- a/tools/libxl/libxlu_disk_l.l
+++ b/tools/libxl/libxlu_disk_l.l
@@ -168,6 +168,7 @@ devtype=disk,?	{ DPC->disk->is_cdrom = 0; }
 devtype=[^,]*,?	{ xlu__disk_err(DPC,yytext,"unknown value for type"); }
 
 access=[^,]*,?	{ STRIP(','); setaccess(DPC, FROMEQUALS); }
+backend=[^,]*,? { STRIP(','); SAVESTRING("backend", backend_domname, FROMEQUALS); }
 backendtype=[^,]*,? { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
 
 vdev=[^,]*,?	{ STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 87d189d..c1a969b 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -162,29 +162,6 @@ static int qualifier_to_id(const char *p, uint32_t *id_r)
     return 1;
 }
 
-static int domain_qualifier_to_domid(const char *p, uint32_t *domid_r,
-                                     int *was_name_r)
-{
-    int was_name, rc;
-
-    was_name = qualifier_to_id(p, domid_r);
-    if (was_name_r)
-        *was_name_r = was_name;
-
-    if (was_name) {
-        rc = libxl_name_to_domid(ctx, p, domid_r);
-        if (rc)
-            return rc;
-    } else {
-        rc = libxl_domain_info(ctx, NULL, *domid_r);
-        /* error only if domain does not exist */
-        if (rc == ERROR_INVAL)
-            return rc;
-    }
-
-    return 0;
-}
-
 static int cpupool_qualifier_to_cpupoolid(const char *p, uint32_t *poolid_r,
                                      int *was_name_r)
 {
@@ -199,14 +176,14 @@ static uint32_t find_domain(const char *p) __attribute__((warn_unused_result));
 static uint32_t find_domain(const char *p)
 {
     uint32_t domid;
-    int rc, was_name;
+    int rc;
 
-    rc = domain_qualifier_to_domid(p, &domid, &was_name);
+    rc = libxl_domain_qualifier_to_domid(ctx, p, &domid);
     if (rc) {
         fprintf(stderr, "%s is an invalid domain identifier (rc=%d)\n", p, rc);
         exit(2);
     }
-    common_domname = was_name ? p : libxl_domid_to_name(ctx, domid);
+    common_domname = libxl_domid_to_name(ctx, domid);
     return domid;
 }
 
@@ -1097,12 +1074,7 @@ static void parse_config_data(const char *config_source,
                      break;
                   *p2 = '\0';
                   if (!strcmp(p, "backend")) {
-                     if(domain_qualifier_to_domid(p2 + 1, &(vtpm->backend_domid), 0))
-                     {
-                        fprintf(stderr,
-                              "Specified vtpm backend domain `%s' does not exist!\n", p2 + 1);
-                        exit(1);
-                     }
+                     vtpm->backend_domname = strdup(p2 + 1);
                      got_backend = true;
                   } else if(!strcmp(p, "uuid")) {
                      if( libxl_uuid_from_string(&vtpm->uuid, p2 + 1) ) {
@@ -1202,17 +1174,7 @@ static void parse_config_data(const char *config_source,
                     free(nic->ifname);
                     nic->ifname = strdup(p2 + 1);
                 } else if (!strcmp(p, "backend")) {
-                    if(libxl_name_to_domid(ctx, (p2 + 1), &(nic->backend_domid))) {
-                        fprintf(stderr, "Specified backend domain does not exist, defaulting to Dom0\n");
-                        nic->backend_domid = 0;
-                    }
-                    if (nic->backend_domid != 0 && run_hotplug_scripts) {
-                        fprintf(stderr, "ERROR: the vif 'backend=' option "
-                                "cannot be used in conjunction with "
-                                "run_hotplug_scripts, please set "
-                                "run_hotplug_scripts to 0 in xl.conf\n");
-                        exit(EXIT_FAILURE);
-                    }
+                    nic->backend_domname = strdup(p2 + 1);
                 } else if (!strcmp(p, "rate")) {
                     parse_vif_rate(&config, (p2 + 1), nic);
                 } else if (!strcmp(p, "accel")) {
@@ -2558,8 +2520,6 @@ static void cd_insert(uint32_t domid, const char *virtdev, char *phys)
 
     parse_disk_config(&config, buf, &disk);
 
-    disk.backend_domid = 0;
-
     libxl_cdrom_insert(ctx, domid, &disk, NULL);
 
     libxl_device_disk_dispose(&disk);
@@ -5596,11 +5556,7 @@ int main_networkattach(int argc, char **argv)
         } else if (MATCH_OPTION("script", *argv, oparg)) {
             replace_string(&nic.script, oparg);
         } else if (MATCH_OPTION("backend", *argv, oparg)) {
-            if(libxl_name_to_domid(ctx, oparg, &val)) {
-                fprintf(stderr, "Specified backend domain does not exist, defaulting to Dom0\n");
-                val = 0;
-            }
-            nic.backend_domid = val;
+            replace_string(&nic.backend_domname, oparg);
         } else if (MATCH_OPTION("vifname", *argv, oparg)) {
             replace_string(&nic.ifname, oparg);
         } else if (MATCH_OPTION("model", *argv, oparg)) {
@@ -5705,15 +5661,15 @@ int main_networkdetach(int argc, char **argv)
 int main_blockattach(int argc, char **argv)
 {
     int opt;
-    uint32_t fe_domid, be_domid = 0;
-    libxl_device_disk disk = { 0 };
+    uint32_t fe_domid;
+    libxl_device_disk disk;
     XLU_Config *config = 0;
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "block-attach", 2) {
         /* No options */
     }
 
-    if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
+    if (libxl_domain_qualifier_to_domid(ctx, argv[optind], &fe_domid) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
@@ -5722,8 +5678,6 @@ int main_blockattach(int argc, char **argv)
     parse_disk_config_multistring
         (&config, argc-optind, (const char* const*)argv + optind, &disk);
 
-    disk.backend_domid = be_domid;
-
     if (dryrun_only) {
         char *json = libxl_device_disk_to_json(ctx, &disk);
         printf("disk: %s\n", json);
@@ -5753,7 +5707,7 @@ int main_blocklist(int argc, char **argv)
            "Vdev", "BE", "handle", "state", "evt-ch", "ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
         uint32_t domid;
-        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
+        if (libxl_domain_qualifier_to_domid(ctx, *argv, &domid) < 0) {
             fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
             continue;
         }
@@ -5805,14 +5759,13 @@ int main_vtpmattach(int argc, char **argv)
     int opt;
     libxl_device_vtpm vtpm;
     char *oparg;
-    unsigned int val;
     uint32_t domid;
 
     SWITCH_FOREACH_OPT(opt, "", NULL, "vtpm-attach", 1) {
         /* No options */
     }
 
-    if (domain_qualifier_to_domid(argv[optind], &domid, 0) < 0) {
+    if (libxl_domain_qualifier_to_domid(ctx, argv[optind], &domid) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
@@ -5826,12 +5779,7 @@ int main_vtpmattach(int argc, char **argv)
                 return 1;
             }
         } else if (MATCH_OPTION("backend", *argv, oparg)) {
-            if(domain_qualifier_to_domid(oparg, &val, 0)) {
-                fprintf(stderr,
-                      "Specified backend domain does not exist, defaulting to Dom0\n");
-                val = 0;
-            }
-            vtpm.backend_domid = val;
+            replace_string(&vtpm.backend_domname, oparg);
         } else {
             fprintf(stderr, "unrecognized argument `%s'\n", *argv);
             return 1;
@@ -5871,7 +5819,7 @@ int main_vtpmlist(int argc, char **argv)
            "Idx", "BE", "Uuid", "handle", "state", "evt-ch", "ring-ref", "BE-path");
     for (argv += optind, argc -= optind; argc > 0; --argc, ++argv) {
         uint32_t domid;
-        if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
+        if (libxl_domain_qualifier_to_domid(ctx, *argv, &domid) < 0) {
             fprintf(stderr, "%s is an invalid domain identifier\n", *argv);
             continue;
         }
@@ -6779,7 +6727,7 @@ int main_cpupoolmigrate(int argc, char **argv)
     dom = argv[optind++];
     pool = argv[optind];
 
-    if (domain_qualifier_to_domid(dom, &domid, NULL) ||
+    if (libxl_domain_qualifier_to_domid(ctx, dom, &domid) ||
         !libxl_domid_to_name(ctx, domid)) {
         fprintf(stderr, "unknown domain \'%s\'\n", dom);
         return -ERROR_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:58:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:58:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScEi-0006o2-Ag; Wed, 17 Apr 2013 23:58:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEg-0006nc-EF
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:58 +0000
Received: from [85.158.137.99:2917] by server-10.bemta-3.messagelabs.com id
	C7/8B-19664-5073F615; Wed, 17 Apr 2013 23:57:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1366243076!14734155!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21576 invoked from network); 17 Apr 2013 23:57:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEd-0002At-Tz
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEd-0007d0-SN
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:55 +0000
Date: Wed, 17 Apr 2013 23:57:55 +0000
Message-Id: <E1UScEd-0007d0-SN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: properly initialize device
	structures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26c35e5cb93a7b4dcde940620eb7ac1845ed6e5a
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Apr 12 11:22:26 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:56:27 2013 +0100

    libxl: properly initialize device structures
    
    This avoids returning unallocated memory in the libxl_device_vtpm
    structure in libxl_device_vtpm_list, and uses libxl_device_nic_init
    instead of memset when initializing libxl_device_nics.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fa6dfed..0f936c0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1850,6 +1850,8 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
                 GCSPRINTF("%s/%s/backend",
                    fe_path, *dir));
 
+          libxl_device_vtpm_init(vtpm);
+
           vtpm->devid = atoi(*dir);
 
           tmp = libxl__xs_read(gc, XBT_NULL,
@@ -1953,7 +1955,7 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
     if (!vtpms)
         return ERROR_FAIL;
 
-    memset(vtpm, 0, sizeof (libxl_device_vtpm));
+    libxl_device_vtpm_init(vtpm);
     rc = 1;
     for (i = 0; i < nb; ++i) {
         if(devid == vtpms[i].devid) {
@@ -2932,7 +2934,7 @@ static void libxl__device_nic_from_xs_be(libxl__gc *gc,
     char *tmp;
     int rc;
 
-    memset(nic, 0, sizeof(*nic));
+    libxl_device_nic_init(nic);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/handle", be_path), &len);
@@ -2971,7 +2973,7 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
     char *dompath, *path;
     int rc = ERROR_FAIL;
 
-    memset(nic, 0, sizeof (libxl_device_nic));
+    libxl_device_nic_init(nic);
     dompath = libxl__xs_get_dompath(gc, domid);
     if (!dompath)
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 17 23:58:01 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 17 Apr 2013 23:58:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UScEi-0006o2-Ag; Wed, 17 Apr 2013 23:58:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEg-0006nc-EF
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:58 +0000
Received: from [85.158.137.99:2917] by server-10.bemta-3.messagelabs.com id
	C7/8B-19664-5073F615; Wed, 17 Apr 2013 23:57:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-217.messagelabs.com!1366243076!14734155!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21576 invoked from network); 17 Apr 2013 23:57:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Apr 2013 23:57:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEd-0002At-Tz
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UScEd-0007d0-SN
	for xen-changelog@lists.xensource.com; Wed, 17 Apr 2013 23:57:55 +0000
Date: Wed, 17 Apr 2013 23:57:55 +0000
Message-Id: <E1UScEd-0007d0-SN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: properly initialize device
	structures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26c35e5cb93a7b4dcde940620eb7ac1845ed6e5a
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Apr 12 11:22:26 2013 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 17 14:56:27 2013 +0100

    libxl: properly initialize device structures
    
    This avoids returning unallocated memory in the libxl_device_vtpm
    structure in libxl_device_vtpm_list, and uses libxl_device_nic_init
    instead of memset when initializing libxl_device_nics.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fa6dfed..0f936c0 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1850,6 +1850,8 @@ libxl_device_vtpm *libxl_device_vtpm_list(libxl_ctx *ctx, uint32_t domid, int *n
                 GCSPRINTF("%s/%s/backend",
                    fe_path, *dir));
 
+          libxl_device_vtpm_init(vtpm);
+
           vtpm->devid = atoi(*dir);
 
           tmp = libxl__xs_read(gc, XBT_NULL,
@@ -1953,7 +1955,7 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
     if (!vtpms)
         return ERROR_FAIL;
 
-    memset(vtpm, 0, sizeof (libxl_device_vtpm));
+    libxl_device_vtpm_init(vtpm);
     rc = 1;
     for (i = 0; i < nb; ++i) {
         if(devid == vtpms[i].devid) {
@@ -2932,7 +2934,7 @@ static void libxl__device_nic_from_xs_be(libxl__gc *gc,
     char *tmp;
     int rc;
 
-    memset(nic, 0, sizeof(*nic));
+    libxl_device_nic_init(nic);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/handle", be_path), &len);
@@ -2971,7 +2973,7 @@ int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
     char *dompath, *path;
     int rc = ERROR_FAIL;
 
-    memset(nic, 0, sizeof (libxl_device_nic));
+    libxl_device_nic_init(nic);
     dompath = libxl__xs_get_dompath(gc, domid);
     if (!dompath)
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 20:55:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 20:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USvrK-00041Q-UD; Thu, 18 Apr 2013 20:55:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrJ-00041K-Qa
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:10 +0000
Received: from [85.158.138.51:62855] by server-15.bemta-3.messagelabs.com id
	A3/50-23142-CAD50715; Thu, 18 Apr 2013 20:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1366318506!20868397!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19738 invoked from network); 18 Apr 2013 20:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 20:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrF-0007g2-6U
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrE-0005l3-VG
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:05 +0000
Date: Thu, 18 Apr 2013 20:55:04 +0000
Message-Id: <E1USvrE-0005l3-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: don't pass negative time to
	gtime_to_gtsc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d013250f4ec417608d1f869638e5cb3df9e1c51e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 15:25:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:25:07 2013 +0200

    x86: don't pass negative time to gtime_to_gtsc()
    
    scale_delta(), which is being called by that function, doesn't cope
    with that.
    
    Also print a warning message, so hopefully we can eventually figure why
    occasionally a negative value results from the calculation in the first
    place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: eb60be3dd870aecfa47bed1118069680389c15f7
    master date: 2013-04-11 12:07:55 +0200
---
 xen/arch/x86/time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 65d58a4..4c6c233 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -832,7 +832,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         if ( is_hvm_domain(d) )
         {
             struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+
             stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+            if ( (s64)stime < 0 )
+            {
+                printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
+                       " (offsets %" PRId64 "/%" PRId64 ")\n",
+                       d->domain_id, v->vcpu_id, stime,
+		       pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
+                stime = 0;
+            }
         }
         tsc_stamp = gtime_to_gtsc(d, stime);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 20:55:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 20:55:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USvrK-00041Q-UD; Thu, 18 Apr 2013 20:55:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrJ-00041K-Qa
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:10 +0000
Received: from [85.158.138.51:62855] by server-15.bemta-3.messagelabs.com id
	A3/50-23142-CAD50715; Thu, 18 Apr 2013 20:55:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1366318506!20868397!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19738 invoked from network); 18 Apr 2013 20:55:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 20:55:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrF-0007g2-6U
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrE-0005l3-VG
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:05 +0000
Date: Thu, 18 Apr 2013 20:55:04 +0000
Message-Id: <E1USvrE-0005l3-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: don't pass negative time to
	gtime_to_gtsc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d013250f4ec417608d1f869638e5cb3df9e1c51e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 15:25:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:25:07 2013 +0200

    x86: don't pass negative time to gtime_to_gtsc()
    
    scale_delta(), which is being called by that function, doesn't cope
    with that.
    
    Also print a warning message, so hopefully we can eventually figure why
    occasionally a negative value results from the calculation in the first
    place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: eb60be3dd870aecfa47bed1118069680389c15f7
    master date: 2013-04-11 12:07:55 +0200
---
 xen/arch/x86/time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 65d58a4..4c6c233 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -832,7 +832,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         if ( is_hvm_domain(d) )
         {
             struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+
             stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+            if ( (s64)stime < 0 )
+            {
+                printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
+                       " (offsets %" PRId64 "/%" PRId64 ")\n",
+                       d->domain_id, v->vcpu_id, stime,
+		       pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
+                stime = 0;
+            }
         }
         tsc_stamp = gtime_to_gtsc(d, stime);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 20:55:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 20:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USvrV-000422-1S; Thu, 18 Apr 2013 20:55:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrT-00041f-J9
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:19 +0000
Received: from [85.158.138.51:49053] by server-15.bemta-3.messagelabs.com id
	1A/60-23142-6BD50715; Thu, 18 Apr 2013 20:55:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1366318516!9093035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26029 invoked from network); 18 Apr 2013 20:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 20:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrQ-0007g5-Gu
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrP-0005lR-Ie
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:15 +0000
Date: Thu, 18 Apr 2013 20:55:15 +0000
Message-Id: <E1USvrP-0005lR-Ie@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] iommu/crash: Interrupt remapping
	is also disabled on crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d03bb04de8718bb6519ab3023db22c80ffd0360
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 18 15:26:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:26:28 2013 +0200

    iommu/crash: Interrupt remapping is also disabled on crash
    
    This fixes a regression side-effect caused by:
      IOMMU: properly check whether interrupt remapping is enabled
        git: fae0372140befb88d890a30704a8ec058c902af8
         hg: 26742:e1ec14bad0cb
    
    On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then
    disable the IOAPIC.
    
    On systems which support interrupt remapping, the variable iommu_intremap
    remains set, meaning that disable_IO_APIC() issues interrupt remapping
    invalidate requests.
    
    IOAPIC interrupt remapping used to be conditional on iommu_enabled, but is now
    conditional on iommu_intremap, following the above changeset.
    
    This behaviour can be fixed by also indicating that interrupt remapping is not
    enabled after shutting down the IOMMU.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 53fd1d8458de01169dfb56feb315f02c2b521a86
    master date: 2013-04-16 10:34:32 +0200
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 4e275a6..159dce9 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -531,7 +531,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = 0;
+    iommu_enabled = iommu_intremap = 0;
 }
 
 int iommu_do_domctl(
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 20:55:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 20:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USvrV-000422-1S; Thu, 18 Apr 2013 20:55:21 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrT-00041f-J9
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:19 +0000
Received: from [85.158.138.51:49053] by server-15.bemta-3.messagelabs.com id
	1A/60-23142-6BD50715; Thu, 18 Apr 2013 20:55:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-174.messagelabs.com!1366318516!9093035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26029 invoked from network); 18 Apr 2013 20:55:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 20:55:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrQ-0007g5-Gu
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USvrP-0005lR-Ie
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 20:55:15 +0000
Date: Thu, 18 Apr 2013 20:55:15 +0000
Message-Id: <E1USvrP-0005lR-Ie@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] iommu/crash: Interrupt remapping
	is also disabled on crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d03bb04de8718bb6519ab3023db22c80ffd0360
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 18 15:26:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:26:28 2013 +0200

    iommu/crash: Interrupt remapping is also disabled on crash
    
    This fixes a regression side-effect caused by:
      IOMMU: properly check whether interrupt remapping is enabled
        git: fae0372140befb88d890a30704a8ec058c902af8
         hg: 26742:e1ec14bad0cb
    
    On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then
    disable the IOAPIC.
    
    On systems which support interrupt remapping, the variable iommu_intremap
    remains set, meaning that disable_IO_APIC() issues interrupt remapping
    invalidate requests.
    
    IOAPIC interrupt remapping used to be conditional on iommu_enabled, but is now
    conditional on iommu_intremap, following the above changeset.
    
    This behaviour can be fixed by also indicating that interrupt remapping is not
    enabled after shutting down the IOMMU.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 53fd1d8458de01169dfb56feb315f02c2b521a86
    master date: 2013-04-16 10:34:32 +0200
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 4e275a6..159dce9 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -531,7 +531,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = 0;
+    iommu_enabled = iommu_intremap = 0;
 }
 
 int iommu_do_domctl(
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 23:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 23:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USyfg-0000TI-65; Thu, 18 Apr 2013 23:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyff-0000TD-3b
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:19 +0000
Received: from [85.158.139.211:47719] by server-1.bemta-5.messagelabs.com id
	81/99-14063-3E780715; Thu, 18 Apr 2013 23:55:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1366329312!19442530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5748 invoked from network); 18 Apr 2013 23:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 23:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfR-00015z-Tj
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfP-0001Si-7e
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:03 +0000
Date: Thu, 18 Apr 2013 23:55:03 +0000
Message-Id: <E1USyfP-0001Si-7e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: don't pass negative time to
	gtime_to_gtsc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ea05d169a56b3010f8f4a48557471c457bb0654
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 15:28:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:28:44 2013 +0200

    x86: don't pass negative time to gtime_to_gtsc()
    
    scale_delta(), which is being called by that function, doesn't cope
    with that.
    
    Also print a warning message, so hopefully we can eventually figure why
    occasionally a negative value results from the calculation in the first
    place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: eb60be3dd870aecfa47bed1118069680389c15f7
    master date: 2013-04-11 12:07:55 +0200
---
 xen/arch/x86/time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 468f822..a176b88 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -821,7 +821,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         if ( is_hvm_domain(d) )
         {
             struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+
             stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+            if ( (s64)stime < 0 )
+            {
+                printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
+                       " (offsets %" PRId64 "/%" PRId64 ")\n",
+                       d->domain_id, v->vcpu_id, stime,
+		       pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
+                stime = 0;
+            }
         }
         tsc_stamp = gtime_to_gtsc(d, stime);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 23:55:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 23:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USyfg-0000TI-65; Thu, 18 Apr 2013 23:55:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyff-0000TD-3b
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:19 +0000
Received: from [85.158.139.211:47719] by server-1.bemta-5.messagelabs.com id
	81/99-14063-3E780715; Thu, 18 Apr 2013 23:55:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1366329312!19442530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5748 invoked from network); 18 Apr 2013 23:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 23:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfR-00015z-Tj
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfP-0001Si-7e
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:03 +0000
Date: Thu, 18 Apr 2013 23:55:03 +0000
Message-Id: <E1USyfP-0001Si-7e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: don't pass negative time to
	gtime_to_gtsc()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4ea05d169a56b3010f8f4a48557471c457bb0654
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 15:28:44 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:28:44 2013 +0200

    x86: don't pass negative time to gtime_to_gtsc()
    
    scale_delta(), which is being called by that function, doesn't cope
    with that.
    
    Also print a warning message, so hopefully we can eventually figure why
    occasionally a negative value results from the calculation in the first
    place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: eb60be3dd870aecfa47bed1118069680389c15f7
    master date: 2013-04-11 12:07:55 +0200
---
 xen/arch/x86/time.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 468f822..a176b88 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -821,7 +821,16 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
         if ( is_hvm_domain(d) )
         {
             struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
+
             stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
+            if ( (s64)stime < 0 )
+            {
+                printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
+                       " (offsets %" PRId64 "/%" PRId64 ")\n",
+                       d->domain_id, v->vcpu_id, stime,
+		       pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
+                stime = 0;
+            }
         }
         tsc_stamp = gtime_to_gtsc(d, stime);
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 23:55:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 23:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USyfq-0000Tn-9G; Thu, 18 Apr 2013 23:55:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfo-0000TV-PY
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:29 +0000
Received: from [85.158.138.51:59476] by server-4.bemta-3.messagelabs.com id
	C6/D9-21470-0F780715; Thu, 18 Apr 2013 23:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366329325!26013919!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18728 invoked from network); 18 Apr 2013 23:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 23:55:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfk-000162-Iv
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfi-0001U1-Oy
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:22 +0000
Date: Thu, 18 Apr 2013 23:55:22 +0000
Message-Id: <E1USyfi-0001U1-Oy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] iommu/crash: Interrupt remapping
	is also disabled on crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f4537b51116009bfb8359681a758ef5860cfd0db
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 18 15:29:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:29:45 2013 +0200

    iommu/crash: Interrupt remapping is also disabled on crash
    
    This fixes a regression side-effect caused by:
      IOMMU: properly check whether interrupt remapping is enabled
        git: fae0372140befb88d890a30704a8ec058c902af8
         hg: 26742:e1ec14bad0cb
    
    On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then
    disable the IOAPIC.
    
    On systems which support interrupt remapping, the variable iommu_intremap
    remains set, meaning that disable_IO_APIC() issues interrupt remapping
    invalidate requests.
    
    IOAPIC interrupt remapping used to be conditional on iommu_enabled, but is now
    conditional on iommu_intremap, following the above changeset.
    
    This behaviour can be fixed by also indicating that interrupt remapping is not
    enabled after shutting down the IOMMU.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 53fd1d8458de01169dfb56feb315f02c2b521a86
    master date: 2013-04-16 10:34:32 +0200
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index cf506e2..5e8ac40 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -436,7 +436,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = 0;
+    iommu_enabled = iommu_intremap = 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Apr 18 23:55:38 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 18 Apr 2013 23:55:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1USyfq-0000Tn-9G; Thu, 18 Apr 2013 23:55:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfo-0000TV-PY
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:29 +0000
Received: from [85.158.138.51:59476] by server-4.bemta-3.messagelabs.com id
	C6/D9-21470-0F780715; Thu, 18 Apr 2013 23:55:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366329325!26013919!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18728 invoked from network); 18 Apr 2013 23:55:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Apr 2013 23:55:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfk-000162-Iv
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1USyfi-0001U1-Oy
	for xen-changelog@lists.xensource.com; Thu, 18 Apr 2013 23:55:22 +0000
Date: Thu, 18 Apr 2013 23:55:22 +0000
Message-Id: <E1USyfi-0001U1-Oy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] iommu/crash: Interrupt remapping
	is also disabled on crash
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f4537b51116009bfb8359681a758ef5860cfd0db
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Apr 18 15:29:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 15:29:45 2013 +0200

    iommu/crash: Interrupt remapping is also disabled on crash
    
    This fixes a regression side-effect caused by:
      IOMMU: properly check whether interrupt remapping is enabled
        git: fae0372140befb88d890a30704a8ec058c902af8
         hg: 26742:e1ec14bad0cb
    
    On the crash path in nmi_shootdown_cpus(), we shut down the IOMMU, then
    disable the IOAPIC.
    
    On systems which support interrupt remapping, the variable iommu_intremap
    remains set, meaning that disable_IO_APIC() issues interrupt remapping
    invalidate requests.
    
    IOAPIC interrupt remapping used to be conditional on iommu_enabled, but is now
    conditional on iommu_intremap, following the above changeset.
    
    This behaviour can be fixed by also indicating that interrupt remapping is not
    enabled after shutting down the IOMMU.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 53fd1d8458de01169dfb56feb315f02c2b521a86
    master date: 2013-04-16 10:34:32 +0200
---
 xen/drivers/passthrough/iommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index cf506e2..5e8ac40 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -436,7 +436,7 @@ void iommu_crash_shutdown(void)
     const struct iommu_ops *ops = iommu_get_ops();
     if ( iommu_enabled )
         ops->crash_shutdown();
-    iommu_enabled = 0;
+    iommu_enabled = iommu_intremap = 0;
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 03:22:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 03:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UT1u0-00019e-D3; Fri, 19 Apr 2013 03:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1ty-00019Y-Cl
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:18 +0000
Received: from [85.158.143.99:19085] by server-1.bemta-4.messagelabs.com id
	C2/B7-06203-968B0715; Fri, 19 Apr 2013 03:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1366341734!23199825!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8855 invoked from network); 19 Apr 2013 03:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 03:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1tt-00022G-CO
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1tt-0006e5-9Z
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:13 +0000
Date: Fri, 19 Apr 2013 03:22:13 +0000
Message-Id: <E1UT1tt-0006e5-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix various issues with
	handling guest IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e414c4074d9a86a23727a385416fd21b67ee079f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:19:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:19:51 2013 +0200

    x86: fix various issues with handling guest IRQs
    
    - properly revoke IRQ access in map_domain_pirq() error path
    - don't permit replacing an in use IRQ
    - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI
    - track IRQ access permission in host IRQ terms, not guest IRQ ones
      (and with that, also disallow Dom0 access to IRQ0)
    
    This is CVE-2013-1919 / XSA-46.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    master commit: 545607eb3cfeb2abf5742d1bb869734f317fcfe5
    master date: 2013-04-18 16:11:23 +0200
---
 tools/libxl/libxl_create.c            |   12 ++++---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 +++++++++----
 xen/arch/x86/irq.c                    |   50 +++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/common/domctl.c                   |    5 ++-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 ++++++++++++
 9 files changed, 93 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index c6011fa..12c2047 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -969,14 +969,16 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     }
 
     for (i = 0; i < d_config->b_info.num_irqs; i++) {
-        uint32_t irq = d_config->b_info.irqs[i];
+        int irq = d_config->b_info.irqs[i];
 
-        LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
+        LOG(DEBUG, "dom%d irq %d", domid, irq);
 
-        ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+        ret = irq >= 0 ? xc_physdev_map_pirq(CTX->xch, domid, irq, &irq)
+                       : -EOVERFLOW;
+        if (!ret)
+            ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
         if ( ret<0 ){
-            LOGE(ERROR,
-                 "failed give dom%d access to irq %"PRId32, domid, irq);
+            LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
             ret = ERROR_FAIL;
         }
     }
diff --git a/tools/python/xen/xend/server/irqif.py b/tools/python/xen/xend/server/irqif.py
index ae0b1ff..723f346 100644
--- a/tools/python/xen/xend/server/irqif.py
+++ b/tools/python/xen/xend/server/irqif.py
@@ -73,6 +73,12 @@ class IRQController(DevController):
        
         pirq = get_param('irq')
 
+        rc = xc.physdev_map_pirq(domid = self.getDomid(),
+                                 index = pirq,
+                                 pirq  = pirq)
+        if rc < 0:
+            raise VmError('irq: Failed to map irq %x' % (pirq))
+
         rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
             #todo non-fatal
             raise VmError(
                 'irq: Failed to configure irq: %d' % (pirq))
-        rc = xc.physdev_map_pirq(domid = self.getDomid(),
-                                index = pirq,
-                                pirq  = pirq)
-        if rc < 0:
-            raise VmError(
-                'irq: Failed to map irq %x' % (pirq))
         back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
         return (self.allocateDeviceID(), back, {})
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index d4c7bd6..469d363 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1219,7 +1219,7 @@ int __init construct_dom0(
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 0, d->nr_pirqs - 1);
+    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index c0ca4ac..f1146cd 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -772,9 +772,13 @@ long arch_do_domctl(
             goto bind_out;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto bind_out;
+        }
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -803,9 +807,13 @@ long arch_do_domctl(
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto unbind_out;
+        }
 
         if ( iommu_enabled )
         {
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 5833612..078036f 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -184,6 +184,14 @@ int create_irq(int node)
         desc->arch.used = IRQ_UNUSED;
         irq = ret;
     }
+    else if ( dom0 )
+    {
+        ret = irq_permit_access(dom0, irq);
+        if ( ret )
+            printk(XENLOG_G_ERR
+                   "Could not grant Dom0 access to IRQ%d (error %d)\n",
+                   irq, ret);
+    }
 
     return irq;
 }
@@ -280,6 +288,17 @@ void clear_irq_vector(int irq)
 void destroy_irq(unsigned int irq)
 {
     BUG_ON(!MSI_IRQ(irq));
+
+    if ( dom0 )
+    {
+        int err = irq_deny_access(dom0, irq);
+
+        if ( err )
+            printk(XENLOG_G_ERR
+                   "Could not revoke Dom0 access to IRQ%u (error %d)\n",
+                   irq, err);
+    }
+
     dynamic_irq_cleanup(irq);
     clear_irq_vector(irq);
 }
@@ -1858,7 +1877,7 @@ int map_domain_pirq(
 
     if ( !IS_PRIV(current->domain) &&
          !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+           irq_access_permitted(current->domain, irq)))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
@@ -1887,17 +1906,18 @@ int map_domain_pirq(
         return ret;
     }
 
-    ret = irq_permit_access(d, pirq);
+    ret = irq_permit_access(d, irq);
     if ( ret )
     {
-        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not permit access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
         return ret;
     }
 
     ret = prepare_domain_irq_pirq(d, irq, pirq, &info);
     if ( ret )
-        return ret;
+        goto revoke;
 
     desc = irq_to_desc(irq);
 
@@ -1921,8 +1941,14 @@ int map_domain_pirq(
         spin_lock_irqsave(&desc->lock, flags);
 
         if ( desc->handler != &no_irq_type )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
+            pci_disable_msi(msi_desc);
+            ret = -EBUSY;
+            goto done;
+        }
         setup_msi_handler(desc, msi_desc);
 
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
@@ -1951,7 +1977,14 @@ int map_domain_pirq(
 
 done:
     if ( ret )
+    {
         cleanup_domain_irq_pirq(d, irq, info);
+ revoke:
+        if ( irq_deny_access(d, irq) )
+            printk(XENLOG_G_ERR
+                   "dom%d: could not revoke access to IRQ%d (pirq %d)\n",
+                   d->domain_id, irq, pirq);
+    }
     return ret;
 }
 
@@ -2017,10 +2050,11 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     if ( !forced_unbind )
         cleanup_domain_irq_pirq(d, irq, info);
 
-    ret = irq_deny_access(d, pirq);
+    ret = irq_deny_access(d, irq);
     if ( ret )
-        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not deny access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
 
  done:
     return ret;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 0c3ada1..6cfdab3 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -147,7 +147,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
         if ( irq == -1 )
             irq = create_irq(NUMA_NO_NODE);
 
-        if ( irq < 0 || irq >= nr_irqs )
+        if ( irq < nr_irqs_gsi || irq >= nr_irqs )
         {
             dprintk(XENLOG_G_ERR, "dom%d: can't create irq for msi!\n",
                     d->domain_id);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 4b4b49c..cbc8146 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -25,6 +25,7 @@
 #include <xen/paging.h>
 #include <xen/hypercall.h>
 #include <asm/current.h>
+#include <asm/irq.h>
 #include <asm/page.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
@@ -897,9 +898,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
         else if ( xsm_irq_permission(d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = irq_permit_access(d, pirq);
+            ret = pirq_permit_access(d, pirq);
         else
-            ret = irq_deny_access(d, pirq);
+            ret = pirq_deny_access(d, pirq);
 
         rcu_unlock_domain(d);
     }
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 46219bd..176082b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -369,7 +369,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
 
-    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+    if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
         return -EPERM;
 
     spin_lock(&d->event_lock);
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index 63bb49f..b755ecb 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,4 +28,22 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
+#define pirq_permit_access(d, i) ({                     \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_deny_access(d, i) ({                       \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_access_permitted(d, i) ({                  \
+    struct domain *d__ = (d);                           \
+    rangeset_contains_singleton(d__->irq_caps,          \
+                                domain_pirq_to_irq(d__, i));\
+})
+
 #endif /* __XEN_IOCAP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 03:22:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 03:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UT1u0-00019e-D3; Fri, 19 Apr 2013 03:22:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1ty-00019Y-Cl
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:18 +0000
Received: from [85.158.143.99:19085] by server-1.bemta-4.messagelabs.com id
	C2/B7-06203-968B0715; Fri, 19 Apr 2013 03:22:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1366341734!23199825!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8855 invoked from network); 19 Apr 2013 03:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 03:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1tt-00022G-CO
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1tt-0006e5-9Z
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:13 +0000
Date: Fri, 19 Apr 2013 03:22:13 +0000
Message-Id: <E1UT1tt-0006e5-9Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix various issues with
	handling guest IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e414c4074d9a86a23727a385416fd21b67ee079f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:19:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:19:51 2013 +0200

    x86: fix various issues with handling guest IRQs
    
    - properly revoke IRQ access in map_domain_pirq() error path
    - don't permit replacing an in use IRQ
    - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI
    - track IRQ access permission in host IRQ terms, not guest IRQ ones
      (and with that, also disallow Dom0 access to IRQ0)
    
    This is CVE-2013-1919 / XSA-46.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    master commit: 545607eb3cfeb2abf5742d1bb869734f317fcfe5
    master date: 2013-04-18 16:11:23 +0200
---
 tools/libxl/libxl_create.c            |   12 ++++---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 +++++++++----
 xen/arch/x86/irq.c                    |   50 +++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/common/domctl.c                   |    5 ++-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 ++++++++++++
 9 files changed, 93 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index c6011fa..12c2047 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -969,14 +969,16 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     }
 
     for (i = 0; i < d_config->b_info.num_irqs; i++) {
-        uint32_t irq = d_config->b_info.irqs[i];
+        int irq = d_config->b_info.irqs[i];
 
-        LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
+        LOG(DEBUG, "dom%d irq %d", domid, irq);
 
-        ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+        ret = irq >= 0 ? xc_physdev_map_pirq(CTX->xch, domid, irq, &irq)
+                       : -EOVERFLOW;
+        if (!ret)
+            ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
         if ( ret<0 ){
-            LOGE(ERROR,
-                 "failed give dom%d access to irq %"PRId32, domid, irq);
+            LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
             ret = ERROR_FAIL;
         }
     }
diff --git a/tools/python/xen/xend/server/irqif.py b/tools/python/xen/xend/server/irqif.py
index ae0b1ff..723f346 100644
--- a/tools/python/xen/xend/server/irqif.py
+++ b/tools/python/xen/xend/server/irqif.py
@@ -73,6 +73,12 @@ class IRQController(DevController):
        
         pirq = get_param('irq')
 
+        rc = xc.physdev_map_pirq(domid = self.getDomid(),
+                                 index = pirq,
+                                 pirq  = pirq)
+        if rc < 0:
+            raise VmError('irq: Failed to map irq %x' % (pirq))
+
         rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
             #todo non-fatal
             raise VmError(
                 'irq: Failed to configure irq: %d' % (pirq))
-        rc = xc.physdev_map_pirq(domid = self.getDomid(),
-                                index = pirq,
-                                pirq  = pirq)
-        if rc < 0:
-            raise VmError(
-                'irq: Failed to map irq %x' % (pirq))
         back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
         return (self.allocateDeviceID(), back, {})
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index d4c7bd6..469d363 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1219,7 +1219,7 @@ int __init construct_dom0(
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 0, d->nr_pirqs - 1);
+    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index c0ca4ac..f1146cd 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -772,9 +772,13 @@ long arch_do_domctl(
             goto bind_out;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto bind_out;
+        }
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -803,9 +807,13 @@ long arch_do_domctl(
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto unbind_out;
+        }
 
         if ( iommu_enabled )
         {
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 5833612..078036f 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -184,6 +184,14 @@ int create_irq(int node)
         desc->arch.used = IRQ_UNUSED;
         irq = ret;
     }
+    else if ( dom0 )
+    {
+        ret = irq_permit_access(dom0, irq);
+        if ( ret )
+            printk(XENLOG_G_ERR
+                   "Could not grant Dom0 access to IRQ%d (error %d)\n",
+                   irq, ret);
+    }
 
     return irq;
 }
@@ -280,6 +288,17 @@ void clear_irq_vector(int irq)
 void destroy_irq(unsigned int irq)
 {
     BUG_ON(!MSI_IRQ(irq));
+
+    if ( dom0 )
+    {
+        int err = irq_deny_access(dom0, irq);
+
+        if ( err )
+            printk(XENLOG_G_ERR
+                   "Could not revoke Dom0 access to IRQ%u (error %d)\n",
+                   irq, err);
+    }
+
     dynamic_irq_cleanup(irq);
     clear_irq_vector(irq);
 }
@@ -1858,7 +1877,7 @@ int map_domain_pirq(
 
     if ( !IS_PRIV(current->domain) &&
          !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+           irq_access_permitted(current->domain, irq)))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
@@ -1887,17 +1906,18 @@ int map_domain_pirq(
         return ret;
     }
 
-    ret = irq_permit_access(d, pirq);
+    ret = irq_permit_access(d, irq);
     if ( ret )
     {
-        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not permit access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
         return ret;
     }
 
     ret = prepare_domain_irq_pirq(d, irq, pirq, &info);
     if ( ret )
-        return ret;
+        goto revoke;
 
     desc = irq_to_desc(irq);
 
@@ -1921,8 +1941,14 @@ int map_domain_pirq(
         spin_lock_irqsave(&desc->lock, flags);
 
         if ( desc->handler != &no_irq_type )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
+            pci_disable_msi(msi_desc);
+            ret = -EBUSY;
+            goto done;
+        }
         setup_msi_handler(desc, msi_desc);
 
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
@@ -1951,7 +1977,14 @@ int map_domain_pirq(
 
 done:
     if ( ret )
+    {
         cleanup_domain_irq_pirq(d, irq, info);
+ revoke:
+        if ( irq_deny_access(d, irq) )
+            printk(XENLOG_G_ERR
+                   "dom%d: could not revoke access to IRQ%d (pirq %d)\n",
+                   d->domain_id, irq, pirq);
+    }
     return ret;
 }
 
@@ -2017,10 +2050,11 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     if ( !forced_unbind )
         cleanup_domain_irq_pirq(d, irq, info);
 
-    ret = irq_deny_access(d, pirq);
+    ret = irq_deny_access(d, irq);
     if ( ret )
-        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not deny access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
 
  done:
     return ret;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 0c3ada1..6cfdab3 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -147,7 +147,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
         if ( irq == -1 )
             irq = create_irq(NUMA_NO_NODE);
 
-        if ( irq < 0 || irq >= nr_irqs )
+        if ( irq < nr_irqs_gsi || irq >= nr_irqs )
         {
             dprintk(XENLOG_G_ERR, "dom%d: can't create irq for msi!\n",
                     d->domain_id);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 4b4b49c..cbc8146 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -25,6 +25,7 @@
 #include <xen/paging.h>
 #include <xen/hypercall.h>
 #include <asm/current.h>
+#include <asm/irq.h>
 #include <asm/page.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
@@ -897,9 +898,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
         else if ( xsm_irq_permission(d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = irq_permit_access(d, pirq);
+            ret = pirq_permit_access(d, pirq);
         else
-            ret = irq_deny_access(d, pirq);
+            ret = pirq_deny_access(d, pirq);
 
         rcu_unlock_domain(d);
     }
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 46219bd..176082b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -369,7 +369,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
 
-    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+    if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
         return -EPERM;
 
     spin_lock(&d->event_lock);
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index 63bb49f..b755ecb 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,4 +28,22 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
+#define pirq_permit_access(d, i) ({                     \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_deny_access(d, i) ({                       \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_access_permitted(d, i) ({                  \
+    struct domain *d__ = (d);                           \
+    rangeset_contains_singleton(d__->irq_caps,          \
+                                domain_pirq_to_irq(d__, i));\
+})
+
 #endif /* __XEN_IOCAP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 03:22:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 03:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UT1u5-00019y-Fw; Fri, 19 Apr 2013 03:22:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u3-00019d-4q
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:23 +0000
Received: from [85.158.139.211:37087] by server-5.bemta-5.messagelabs.com id
	E3/36-02762-168B0715; Fri, 19 Apr 2013 03:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1366341725!19573779!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6720 invoked from network); 19 Apr 2013 03:22:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 03:22:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1tj-00022D-5V
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1ti-0006dh-Nn
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:02 +0000
Date: Fri, 19 Apr 2013 03:22:02 +0000
Message-Id: <E1UT1ti-0006dh-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: clear EFLAGS.NT in SYSENTER
	entry path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68a30a91bad2d4ff1f7c0d4302ec1060d573f6da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:18:42 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:18:42 2013 +0200

    x86: clear EFLAGS.NT in SYSENTER entry path
    
    ... as it causes problems if we happen to exit back via IRET: In the
    course of trying to handle the fault, the hypervisor creates a stack
    frame by hand, and uses PUSHFQ to set the respective EFLAGS field, but
    expects to be able to IRET through that stack frame to the second
    portion of the fixup code (which causes a #GP due to the stored EFLAGS
    having NT set).
    
    And even if this worked (e.g if we cleared NT in that path), it would
    then (through the fail safe callback) cause a #GP in the guest with the
    SYSENTER handler's first instruction as the source, which in turn would
    allow guest user mode code to crash the guest kernel.
    
    Inject a #GP on the fake (NULL) address of the SYSENTER instruction
    instead, just like in the case where the guest kernel didn't register
    a corresponding entry point.
    
    This is CVE-2013-1917 / XSA-44.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fdac9515607b757c044e7ef0d61b1453ef999b08
    master date: 2013-04-18 16:00:35 +0200
---
 xen/arch/x86/acpi/suspend.c |    8 ++++++--
 xen/arch/x86/cpu/common.c   |    5 ++++-
 xen/arch/x86/x86_64/entry.S |    7 +++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index d13bed0..f2e2133 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -81,8 +81,12 @@ void restore_rest_processor_state(void)
     }
 
 #else /* !defined(CONFIG_X86_64) */
-    if ( supervisor_mode_kernel && cpu_has_sep )
-        wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    if ( cpu_has_sep )
+    {
+        wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+        if ( supervisor_mode_kernel )
+            wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    }
 #endif
 
     /* Maybe load the debug registers. */
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a287816..321d942 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -655,8 +655,11 @@ void __cpuinit cpu_init(void)
 #if defined(CONFIG_X86_32)
 	t->ss0  = __HYPERVISOR_DS;
 	t->esp0 = get_stack_bottom();
-	if ( supervisor_mode_kernel && cpu_has_sep )
+	if ( cpu_has_sep ) {
+	    wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+	    if ( supervisor_mode_kernel )
 		wrmsr(MSR_IA32_SYSENTER_ESP, &t->esp1, 0);
+	}
 #elif defined(CONFIG_X86_64)
 	/* Bottom-of-stack must be 16-byte aligned! */
 	BUG_ON((get_stack_bottom() & 15) != 0);
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 8390db2..c606599 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -285,7 +285,14 @@ sysenter_eflags_saved:
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
+        testl $X86_EFLAGS_NT,UREGS_eflags(%rsp)
         leaq  VCPU_trap_bounce(%rbx),%rdx
+UNLIKELY_START(nz, sysenter_nt_set)
+        pushfq
+        andl  $~X86_EFLAGS_NT,(%rsp)
+        popfq
+        xorl  %eax,%eax
+UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 03:22:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 03:22:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UT1u5-00019y-Fw; Fri, 19 Apr 2013 03:22:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u3-00019d-4q
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:23 +0000
Received: from [85.158.139.211:37087] by server-5.bemta-5.messagelabs.com id
	E3/36-02762-168B0715; Fri, 19 Apr 2013 03:22:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1366341725!19573779!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6720 invoked from network); 19 Apr 2013 03:22:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 03:22:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1tj-00022D-5V
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1ti-0006dh-Nn
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:02 +0000
Date: Fri, 19 Apr 2013 03:22:02 +0000
Message-Id: <E1UT1ti-0006dh-Nn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: clear EFLAGS.NT in SYSENTER
	entry path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68a30a91bad2d4ff1f7c0d4302ec1060d573f6da
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:18:42 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:18:42 2013 +0200

    x86: clear EFLAGS.NT in SYSENTER entry path
    
    ... as it causes problems if we happen to exit back via IRET: In the
    course of trying to handle the fault, the hypervisor creates a stack
    frame by hand, and uses PUSHFQ to set the respective EFLAGS field, but
    expects to be able to IRET through that stack frame to the second
    portion of the fixup code (which causes a #GP due to the stored EFLAGS
    having NT set).
    
    And even if this worked (e.g if we cleared NT in that path), it would
    then (through the fail safe callback) cause a #GP in the guest with the
    SYSENTER handler's first instruction as the source, which in turn would
    allow guest user mode code to crash the guest kernel.
    
    Inject a #GP on the fake (NULL) address of the SYSENTER instruction
    instead, just like in the case where the guest kernel didn't register
    a corresponding entry point.
    
    This is CVE-2013-1917 / XSA-44.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fdac9515607b757c044e7ef0d61b1453ef999b08
    master date: 2013-04-18 16:00:35 +0200
---
 xen/arch/x86/acpi/suspend.c |    8 ++++++--
 xen/arch/x86/cpu/common.c   |    5 ++++-
 xen/arch/x86/x86_64/entry.S |    7 +++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index d13bed0..f2e2133 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -81,8 +81,12 @@ void restore_rest_processor_state(void)
     }
 
 #else /* !defined(CONFIG_X86_64) */
-    if ( supervisor_mode_kernel && cpu_has_sep )
-        wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    if ( cpu_has_sep )
+    {
+        wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+        if ( supervisor_mode_kernel )
+            wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    }
 #endif
 
     /* Maybe load the debug registers. */
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a287816..321d942 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -655,8 +655,11 @@ void __cpuinit cpu_init(void)
 #if defined(CONFIG_X86_32)
 	t->ss0  = __HYPERVISOR_DS;
 	t->esp0 = get_stack_bottom();
-	if ( supervisor_mode_kernel && cpu_has_sep )
+	if ( cpu_has_sep ) {
+	    wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+	    if ( supervisor_mode_kernel )
 		wrmsr(MSR_IA32_SYSENTER_ESP, &t->esp1, 0);
+	}
 #elif defined(CONFIG_X86_64)
 	/* Bottom-of-stack must be 16-byte aligned! */
 	BUG_ON((get_stack_bottom() & 15) != 0);
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 8390db2..c606599 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -285,7 +285,14 @@ sysenter_eflags_saved:
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
+        testl $X86_EFLAGS_NT,UREGS_eflags(%rsp)
         leaq  VCPU_trap_bounce(%rbx),%rdx
+UNLIKELY_START(nz, sysenter_nt_set)
+        pushfq
+        andl  $~X86_EFLAGS_NT,(%rsp)
+        popfq
+        xorl  %eax,%eax
+UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 03:22:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 03:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UT1u8-0001AR-Ks; Fri, 19 Apr 2013 03:22:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u7-0001AH-KC
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:27 +0000
Received: from [85.158.137.99:13836] by server-14.bemta-3.messagelabs.com id
	88/F7-27076-278B0715; Fri, 19 Apr 2013 03:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1366341744!12430492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24493 invoked from network); 19 Apr 2013 03:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 03:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u3-00022J-JR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u3-0006eS-HX
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:23 +0000
Date: Fri, 19 Apr 2013 03:22:23 +0000
Message-Id: <E1UT1u3-0006eS-HX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: Fix SEGV in network-attach
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f1a6ff38b8e7bb97a016794115de28553a6559f
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Apr 18 17:42:04 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 18 17:42:04 2013 +0100

    libxl: Fix SEGV in network-attach
    
    When "device/vif" directory exists but is empty l!=NULL, but nb==0, so
    l[nb-1] is invalid.  Add missing check.
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3a58ef4..a6e9601 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2572,7 +2572,8 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
             goto out_free;
         }
         if (!(l = libxl__xs_directory(gc, XBT_NULL,
-                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb))) {
+                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb)) ||
+            nb == 0) {
             nic->devid = 0;
         } else {
             nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 03:22:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 03:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UT1u8-0001AR-Ks; Fri, 19 Apr 2013 03:22:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u7-0001AH-KC
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:27 +0000
Received: from [85.158.137.99:13836] by server-14.bemta-3.messagelabs.com id
	88/F7-27076-278B0715; Fri, 19 Apr 2013 03:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1366341744!12430492!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24493 invoked from network); 19 Apr 2013 03:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 03:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u3-00022J-JR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UT1u3-0006eS-HX
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 03:22:23 +0000
Date: Fri, 19 Apr 2013 03:22:23 +0000
Message-Id: <E1UT1u3-0006eS-HX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] libxl: Fix SEGV in network-attach
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9f1a6ff38b8e7bb97a016794115de28553a6559f
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Apr 18 17:42:04 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 18 17:42:04 2013 +0100

    libxl: Fix SEGV in network-attach
    
    When "device/vif" directory exists but is empty l!=NULL, but nb==0, so
    l[nb-1] is invalid.  Add missing check.
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 3a58ef4..a6e9601 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2572,7 +2572,8 @@ void libxl__device_nic_add(libxl__egc *egc, uint32_t domid,
             goto out_free;
         }
         if (!(l = libxl__xs_directory(gc, XBT_NULL,
-                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb))) {
+                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb)) ||
+            nb == 0) {
             nic->devid = 0;
         } else {
             nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWN-0004kn-Fu; Fri, 19 Apr 2013 22:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWM-0004ki-Mw
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:06 +0000
Received: from [85.158.143.99:44289] by server-3.bemta-4.messagelabs.com id
	05/44-02186-AF0C1715; Fri, 19 Apr 2013 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1366409464!28614670!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24813 invoked from network); 19 Apr 2013 22:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWK-000790-3U
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWJ-0000Fy-Rx
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:03 +0000
Date: Fri, 19 Apr 2013 22:11:03 +0000
Message-Id: <E1UTJWJ-0000Fy-Rx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Detect posted interrupt capability
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b266924990af96ee47ee299e1b6bb87fac2e2548
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:32:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:32:02 2013 +0200

    VMX: Detect posted interrupt capability
    
    Check whether the Hardware supports posted interrupt capability.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   12 +++++++++++-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    6 ++++++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9926ffb..d634d48 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -92,6 +92,7 @@ static void __init vmx_display_features(void)
     P(cpu_has_vmx_unrestricted_guest, "Unrestricted Guest");
     P(cpu_has_vmx_apic_reg_virt, "APIC Register Virtualization");
     P(cpu_has_vmx_virtual_intr_delivery, "Virtual Interrupt Delivery");
+    P(cpu_has_vmx_posted_intr_processing, "Posted Interrupt Processing");
     P(cpu_has_vmx_vmcs_shadowing, "VMCS shadowing");
 #undef P
 
@@ -143,7 +144,8 @@ static int vmx_init_vmcs_config(void)
 
     min = (PIN_BASED_EXT_INTR_MASK |
            PIN_BASED_NMI_EXITING);
-    opt = PIN_BASED_VIRTUAL_NMIS;
+    opt = (PIN_BASED_VIRTUAL_NMIS |
+           PIN_BASED_POSTED_INTERRUPT);
     _vmx_pin_based_exec_control = adjust_vmx_controls(
         "Pin-Based Exec Control", min, opt,
         MSR_IA32_VMX_PINBASED_CTLS, &mismatch);
@@ -269,6 +271,14 @@ static int vmx_init_vmcs_config(void)
     _vmx_vmexit_control = adjust_vmx_controls(
         "VMExit Control", min, opt, MSR_IA32_VMX_EXIT_CTLS, &mismatch);
 
+    /*
+     * "Process posted interrupt" can be set only when "virtual-interrupt
+     * delivery" and "acknowledge interrupt on exit" is set
+     */
+    if ( !(_vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
+          || !(_vmx_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT) )
+        _vmx_pin_based_exec_control  &= ~ PIN_BASED_POSTED_INTERRUPT;
+
     min = 0;
     opt = VM_ENTRY_LOAD_GUEST_PAT;
     _vmx_vmentry_control = adjust_vmx_controls(
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 37e6734..3a5c91a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -165,6 +165,7 @@ extern u32 vmx_cpu_based_exec_control;
 #define PIN_BASED_NMI_EXITING           0x00000008
 #define PIN_BASED_VIRTUAL_NMIS          0x00000020
 #define PIN_BASED_PREEMPT_TIMER         0x00000040
+#define PIN_BASED_POSTED_INTERRUPT      0x00000080
 extern u32 vmx_pin_based_exec_control;
 
 #define VM_EXIT_SAVE_DEBUG_CNTRLS       0x00000004
@@ -256,6 +257,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
     (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
 #define cpu_has_vmx_virtualize_x2apic_mode \
     (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)
+#define cpu_has_vmx_posted_intr_processing \
+    (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT)
 #define cpu_has_vmx_vmcs_shadowing \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VMCS_SHADOWING)
 
@@ -280,6 +283,7 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
 /* VMCS field encodings. */
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
+    POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
     GUEST_ES_SELECTOR               = 0x00000800,
     GUEST_CS_SELECTOR               = 0x00000802,
     GUEST_SS_SELECTOR               = 0x00000804,
@@ -314,6 +318,8 @@ enum vmcs_field {
     VIRTUAL_APIC_PAGE_ADDR_HIGH     = 0x00002013,
     APIC_ACCESS_ADDR                = 0x00002014,
     APIC_ACCESS_ADDR_HIGH           = 0x00002015,
+    PI_DESC_ADDR                    = 0x00002016,
+    PI_DESC_ADDR_HIGH               = 0x00002017,
     EPT_POINTER                     = 0x0000201a,
     EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWN-0004kn-Fu; Fri, 19 Apr 2013 22:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWM-0004ki-Mw
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:06 +0000
Received: from [85.158.143.99:44289] by server-3.bemta-4.messagelabs.com id
	05/44-02186-AF0C1715; Fri, 19 Apr 2013 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1366409464!28614670!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24813 invoked from network); 19 Apr 2013 22:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWK-000790-3U
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWJ-0000Fy-Rx
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:03 +0000
Date: Fri, 19 Apr 2013 22:11:03 +0000
Message-Id: <E1UTJWJ-0000Fy-Rx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Detect posted interrupt capability
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b266924990af96ee47ee299e1b6bb87fac2e2548
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:32:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:32:02 2013 +0200

    VMX: Detect posted interrupt capability
    
    Check whether the Hardware supports posted interrupt capability.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vmx/vmcs.c        |   12 +++++++++++-
 xen/include/asm-x86/hvm/vmx/vmcs.h |    6 ++++++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9926ffb..d634d48 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -92,6 +92,7 @@ static void __init vmx_display_features(void)
     P(cpu_has_vmx_unrestricted_guest, "Unrestricted Guest");
     P(cpu_has_vmx_apic_reg_virt, "APIC Register Virtualization");
     P(cpu_has_vmx_virtual_intr_delivery, "Virtual Interrupt Delivery");
+    P(cpu_has_vmx_posted_intr_processing, "Posted Interrupt Processing");
     P(cpu_has_vmx_vmcs_shadowing, "VMCS shadowing");
 #undef P
 
@@ -143,7 +144,8 @@ static int vmx_init_vmcs_config(void)
 
     min = (PIN_BASED_EXT_INTR_MASK |
            PIN_BASED_NMI_EXITING);
-    opt = PIN_BASED_VIRTUAL_NMIS;
+    opt = (PIN_BASED_VIRTUAL_NMIS |
+           PIN_BASED_POSTED_INTERRUPT);
     _vmx_pin_based_exec_control = adjust_vmx_controls(
         "Pin-Based Exec Control", min, opt,
         MSR_IA32_VMX_PINBASED_CTLS, &mismatch);
@@ -269,6 +271,14 @@ static int vmx_init_vmcs_config(void)
     _vmx_vmexit_control = adjust_vmx_controls(
         "VMExit Control", min, opt, MSR_IA32_VMX_EXIT_CTLS, &mismatch);
 
+    /*
+     * "Process posted interrupt" can be set only when "virtual-interrupt
+     * delivery" and "acknowledge interrupt on exit" is set
+     */
+    if ( !(_vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
+          || !(_vmx_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT) )
+        _vmx_pin_based_exec_control  &= ~ PIN_BASED_POSTED_INTERRUPT;
+
     min = 0;
     opt = VM_ENTRY_LOAD_GUEST_PAT;
     _vmx_vmentry_control = adjust_vmx_controls(
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 37e6734..3a5c91a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -165,6 +165,7 @@ extern u32 vmx_cpu_based_exec_control;
 #define PIN_BASED_NMI_EXITING           0x00000008
 #define PIN_BASED_VIRTUAL_NMIS          0x00000020
 #define PIN_BASED_PREEMPT_TIMER         0x00000040
+#define PIN_BASED_POSTED_INTERRUPT      0x00000080
 extern u32 vmx_pin_based_exec_control;
 
 #define VM_EXIT_SAVE_DEBUG_CNTRLS       0x00000004
@@ -256,6 +257,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
     (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
 #define cpu_has_vmx_virtualize_x2apic_mode \
     (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)
+#define cpu_has_vmx_posted_intr_processing \
+    (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT)
 #define cpu_has_vmx_vmcs_shadowing \
     (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VMCS_SHADOWING)
 
@@ -280,6 +283,7 @@ extern bool_t cpu_has_vmx_ins_outs_instr_info;
 /* VMCS field encodings. */
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
+    POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
     GUEST_ES_SELECTOR               = 0x00000800,
     GUEST_CS_SELECTOR               = 0x00000802,
     GUEST_SS_SELECTOR               = 0x00000804,
@@ -314,6 +318,8 @@ enum vmcs_field {
     VIRTUAL_APIC_PAGE_ADDR_HIGH     = 0x00002013,
     APIC_ACCESS_ADDR                = 0x00002014,
     APIC_ACCESS_ADDR_HIGH           = 0x00002015,
+    PI_DESC_ADDR                    = 0x00002016,
+    PI_DESC_ADDR_HIGH               = 0x00002017,
     EPT_POINTER                     = 0x0000201a,
     EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWY-0004lf-JW; Fri, 19 Apr 2013 22:11:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWX-0004lX-MA
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:17 +0000
Received: from [85.158.138.51:40242] by server-9.bemta-3.messagelabs.com id
	33/AC-32531-401C1715; Fri, 19 Apr 2013 22:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1366409474!29076681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24239 invoked from network); 19 Apr 2013 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWU-000793-Bc
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWU-0000GT-8U
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:14 +0000
Date: Fri, 19 Apr 2013 22:11:14 +0000
Message-Id: <E1UTJWU-0000GT-8U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Turn on posted interrupt bit in
	vmcs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c0ac49b1d6c3d54fc1f75661742a988ca7cf255
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:34:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:34:04 2013 +0200

    VMX: Turn on posted interrupt bit in vmcs
    
    Turn on posted interrupt for vcpu if posted interrupt is avaliable.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    6 ++++++
 xen/arch/x86/hvm/vmx/vmx.c         |    5 +++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
 4 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d634d48..ef0ee7f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -926,6 +926,12 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(GUEST_INTR_STATUS, 0);
     }
 
+    if ( cpu_has_vmx_posted_intr_processing )
+    {
+        __vmwrite(PI_DESC_ADDR, virt_to_maddr(&v->arch.hvm_vmx.pi_desc));
+        __vmwrite(POSTED_INTR_NOTIFICATION_VECTOR, posted_intr_vector);
+    }
+
     /* Host data selectors. */
     __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
     __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e36dbcb..0aa4b82 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -75,6 +75,8 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content);
 static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content);
 static void vmx_invlpg_intercept(unsigned long vaddr);
 
+uint8_t __read_mostly posted_intr_vector;
+
 static int vmx_domain_initialise(struct domain *d)
 {
     int rc;
@@ -1521,6 +1523,9 @@ struct hvm_function_table * __init start_vmx(void)
 
         setup_ept_dump();
     }
+ 
+    if ( cpu_has_vmx_posted_intr_processing )
+        alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
 
     setup_vmcs_dump();
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 3a5c91a..f30e5ac 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -21,6 +21,7 @@
 
 #include <asm/hvm/io.h>
 #include <asm/hvm/vpmu.h>
+#include <irq_vectors.h>
 
 extern void vmcs_dump_vcpu(struct vcpu *v);
 extern void setup_vmcs_dump(void);
@@ -73,6 +74,12 @@ struct vmx_domain {
     unsigned long apic_access_mfn;
 };
 
+struct pi_desc {
+    DECLARE_BITMAP(pir, NR_VECTORS);
+    u32 control;
+    u32 rsvd[7];
+} __attribute__ ((aligned (64)));
+
 #define ept_get_wl(ept)   ((ept)->ept_wl)
 #define ept_get_asr(ept)  ((ept)->asr)
 #define ept_get_eptp(ept) ((ept)->eptp)
@@ -113,6 +120,7 @@ struct arch_vmx_struct {
 
     uint32_t             eoi_exitmap_changed;
     uint64_t             eoi_exit_bitmap[4];
+    struct pi_desc       pi_desc;
 
     unsigned long        host_cr0;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index d4d6feb..7efe0f3 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -217,6 +217,7 @@ void vmx_update_secondary_exec_control(struct vcpu *v);
 #define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
 
 extern u64 vmx_ept_vpid_cap;
+extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_exec_only_supported        \
     (vmx_ept_vpid_cap & VMX_EPT_EXEC_ONLY_SUPPORTED)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWY-0004lf-JW; Fri, 19 Apr 2013 22:11:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWX-0004lX-MA
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:17 +0000
Received: from [85.158.138.51:40242] by server-9.bemta-3.messagelabs.com id
	33/AC-32531-401C1715; Fri, 19 Apr 2013 22:11:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1366409474!29076681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24239 invoked from network); 19 Apr 2013 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWU-000793-Bc
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWU-0000GT-8U
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:14 +0000
Date: Fri, 19 Apr 2013 22:11:14 +0000
Message-Id: <E1UTJWU-0000GT-8U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Turn on posted interrupt bit in
	vmcs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1c0ac49b1d6c3d54fc1f75661742a988ca7cf255
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:34:04 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:34:04 2013 +0200

    VMX: Turn on posted interrupt bit in vmcs
    
    Turn on posted interrupt for vcpu if posted interrupt is avaliable.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vmx/vmcs.c        |    6 ++++++
 xen/arch/x86/hvm/vmx/vmx.c         |    5 +++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h  |    1 +
 4 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d634d48..ef0ee7f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -926,6 +926,12 @@ static int construct_vmcs(struct vcpu *v)
         __vmwrite(GUEST_INTR_STATUS, 0);
     }
 
+    if ( cpu_has_vmx_posted_intr_processing )
+    {
+        __vmwrite(PI_DESC_ADDR, virt_to_maddr(&v->arch.hvm_vmx.pi_desc));
+        __vmwrite(POSTED_INTR_NOTIFICATION_VECTOR, posted_intr_vector);
+    }
+
     /* Host data selectors. */
     __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
     __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index e36dbcb..0aa4b82 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -75,6 +75,8 @@ static int vmx_msr_read_intercept(unsigned int msr, uint64_t *msr_content);
 static int vmx_msr_write_intercept(unsigned int msr, uint64_t msr_content);
 static void vmx_invlpg_intercept(unsigned long vaddr);
 
+uint8_t __read_mostly posted_intr_vector;
+
 static int vmx_domain_initialise(struct domain *d)
 {
     int rc;
@@ -1521,6 +1523,9 @@ struct hvm_function_table * __init start_vmx(void)
 
         setup_ept_dump();
     }
+ 
+    if ( cpu_has_vmx_posted_intr_processing )
+        alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
 
     setup_vmcs_dump();
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 3a5c91a..f30e5ac 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -21,6 +21,7 @@
 
 #include <asm/hvm/io.h>
 #include <asm/hvm/vpmu.h>
+#include <irq_vectors.h>
 
 extern void vmcs_dump_vcpu(struct vcpu *v);
 extern void setup_vmcs_dump(void);
@@ -73,6 +74,12 @@ struct vmx_domain {
     unsigned long apic_access_mfn;
 };
 
+struct pi_desc {
+    DECLARE_BITMAP(pir, NR_VECTORS);
+    u32 control;
+    u32 rsvd[7];
+} __attribute__ ((aligned (64)));
+
 #define ept_get_wl(ept)   ((ept)->ept_wl)
 #define ept_get_asr(ept)  ((ept)->asr)
 #define ept_get_eptp(ept) ((ept)->eptp)
@@ -113,6 +120,7 @@ struct arch_vmx_struct {
 
     uint32_t             eoi_exitmap_changed;
     uint64_t             eoi_exit_bitmap[4];
+    struct pi_desc       pi_desc;
 
     unsigned long        host_cr0;
 
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index d4d6feb..7efe0f3 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -217,6 +217,7 @@ void vmx_update_secondary_exec_control(struct vcpu *v);
 #define MODRM_EAX_ECX   ".byte 0xc1\n" /* EAX, ECX */
 
 extern u64 vmx_ept_vpid_cap;
+extern uint8_t posted_intr_vector;
 
 #define cpu_has_vmx_ept_exec_only_supported        \
     (vmx_ept_vpid_cap & VMX_EPT_EXEC_ONLY_SUPPORTED)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWm-0004nU-MR; Fri, 19 Apr 2013 22:11:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWl-0004n8-KW
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:31 +0000
Received: from [85.158.139.211:57925] by server-3.bemta-5.messagelabs.com id
	4F/02-17256-F01C1715; Fri, 19 Apr 2013 22:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1366409484!19600537!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9131 invoked from network); 19 Apr 2013 22:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWe-000799-Iy
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWe-0000Gp-GU
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:24 +0000
Date: Fri, 19 Apr 2013 22:11:24 +0000
Message-Id: <E1UTJWe-0000Gp-GU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Add posted interrupt supporting
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7dafa375bc13772e2e3274d975d544af4208939
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:34:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:34:49 2013 +0200

    VMX: Add posted interrupt supporting
    
    Add the supporting of using posted interrupt to deliver interrupt.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vlapic.c         |   18 -----------
 xen/arch/x86/hvm/vmx/vmx.c        |   62 +++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/bitops.h      |   10 ++++++
 xen/include/asm-x86/hvm/hvm.h     |    2 +
 xen/include/asm-x86/hvm/vlapic.h  |   15 +++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h |   25 +++++++++++++++
 6 files changed, 114 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 4b25cc8..f241a7c 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -90,24 +90,6 @@ static const unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
     ((vlapic_get_reg(vlapic, APIC_LVTT) & APIC_TIMER_MODE_MASK) \
      == APIC_TIMER_MODE_TSC_DEADLINE)
 
-
-/*
- * Generic APIC bitmap vector update & search routines.
- */
-
-#define VEC_POS(v) ((v)%32)
-#define REG_POS(v) (((v)/32) * 0x10)
-#define vlapic_test_and_set_vector(vec, bitmap)                         \
-    test_and_set_bit(VEC_POS(vec),                                      \
-                     (unsigned long *)((bitmap) + REG_POS(vec)))
-#define vlapic_test_and_clear_vector(vec, bitmap)                       \
-    test_and_clear_bit(VEC_POS(vec),                                    \
-                       (unsigned long *)((bitmap) + REG_POS(vec)))
-#define vlapic_set_vector(vec, bitmap)                                  \
-    set_bit(VEC_POS(vec), (unsigned long *)((bitmap) + REG_POS(vec)))
-#define vlapic_clear_vector(vec, bitmap)                                \
-    clear_bit(VEC_POS(vec), (unsigned long *)((bitmap) + REG_POS(vec)))
-
 static int vlapic_find_highest_vector(void *bitmap)
 {
     uint32_t *word = bitmap;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 0aa4b82..799b60e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -55,6 +55,7 @@
 #include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/event.h>
 
 enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
 
@@ -1447,6 +1448,60 @@ static void vmx_process_isr(int isr, struct vcpu *v)
     vmx_vmcs_exit(v);
 }
 
+static void __vmx_deliver_posted_interrupt(struct vcpu *v)
+{
+    bool_t running = v->is_running;
+
+    vcpu_unblock(v);
+    if ( running && (in_irq() || (v != current)) )
+    {
+        unsigned int cpu = v->processor;
+
+        if ( !test_and_set_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))
+             && (cpu != smp_processor_id()) )
+            send_IPI_mask(cpumask_of(cpu), posted_intr_vector);
+    }
+}
+
+static void vmx_deliver_posted_intr(struct vcpu *v, u8 vector)
+{
+    if ( pi_test_and_set_pir(vector, &v->arch.hvm_vmx.pi_desc) )
+        return;
+
+    if ( unlikely(v->arch.hvm_vmx.eoi_exitmap_changed) )
+    {
+        /*
+         * If EOI exitbitmap needs to changed or notification vector
+         * can't be allocated, interrupt will not be injected till
+         * VMEntry as it used to be.
+         */
+        pi_set_on(&v->arch.hvm_vmx.pi_desc);
+    }
+    else if ( !pi_test_and_set_on(&v->arch.hvm_vmx.pi_desc) )
+    {
+        __vmx_deliver_posted_interrupt(v);
+        return;
+    }
+
+    vcpu_kick(v);
+}
+
+static void vmx_sync_pir_to_irr(struct vcpu *v)
+{
+    struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int group, i;
+    DECLARE_BITMAP(pending_intr, NR_VECTORS);
+
+    if ( !pi_test_and_clear_on(&v->arch.hvm_vmx.pi_desc) )
+        return;
+
+    for ( group = 0; group < ARRAY_SIZE(pending_intr); group++ )
+        pending_intr[group] = pi_get_pir(&v->arch.hvm_vmx.pi_desc, group);
+
+    for_each_set_bit(i, pending_intr, NR_VECTORS)
+        vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
+}
+
 static struct hvm_function_table __read_mostly vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
@@ -1497,6 +1552,8 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
     .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled,
     .process_isr          = vmx_process_isr,
+    .deliver_posted_intr  = vmx_deliver_posted_intr,
+    .sync_pir_to_irr      = vmx_sync_pir_to_irr,
     .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
 };
 
@@ -1526,6 +1583,11 @@ struct hvm_function_table * __init start_vmx(void)
  
     if ( cpu_has_vmx_posted_intr_processing )
         alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
+    else
+    {
+        hvm_funcs.deliver_posted_intr = NULL;
+        hvm_funcs.sync_pir_to_irr = NULL;
+    }
 
     setup_vmcs_dump();
 
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 2bbd169..c3cbd26 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -367,6 +367,16 @@ static inline unsigned int __scanbit(unsigned long val, unsigned long max)
   ((off)+(__scanbit(~(((*(const unsigned long *)addr)) >> (off)), size))) : \
   __find_next_zero_bit(addr,size,off)))
 
+/**
+ * for_each_set_bit - iterate over every set bit in a memory region
+ * @bit: The integer iterator
+ * @addr: The address to base the search on
+ * @size: The maximum size to search
+ */
+#define for_each_set_bit(bit, addr, size)               \
+    for ( (bit) = find_first_bit(addr, size);           \
+          (bit) < (size);                               \
+          (bit) = find_next_bit(addr, size, (bit) + 1) )
 
 /**
  * find_first_set_bit - find the first set bit in @word
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 2fa2ea5..85dc85b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -184,6 +184,8 @@ struct hvm_function_table {
     void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
     int (*virtual_intr_delivery_enabled)(void);
     void (*process_isr)(int isr, struct vcpu *v);
+    void (*deliver_posted_intr)(struct vcpu *v, u8 vector);
+    void (*sync_pir_to_irr)(struct vcpu *v);
 
     /*Walk nested p2m  */
     int (*nhvm_hap_walk_L1_p2m)(struct vcpu *v, paddr_t L2_gpa,
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 101ef57..40fd306 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -54,6 +54,21 @@
 #define vlapic_x2apic_mode(vlapic)                              \
     ((vlapic)->hw.apic_base_msr & MSR_IA32_APICBASE_EXTD)
 
+/*
+ * Generic APIC bitmap vector update & search routines.
+ */
+
+#define VEC_POS(v) ((v) % 32)
+#define REG_POS(v) (((v) / 32) * 0x10)
+#define vlapic_test_and_set_vector(vec, bitmap)                         \
+    test_and_set_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+#define vlapic_test_and_clear_vector(vec, bitmap)                       \
+    test_and_clear_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+#define vlapic_set_vector(vec, bitmap)                                  \
+    set_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+#define vlapic_clear_vector(vec, bitmap)                                \
+    clear_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+
 struct vlapic {
     struct hvm_hw_lapic      hw;
     struct hvm_hw_lapic_regs *regs;
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 7efe0f3..c33b9f9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -99,6 +99,31 @@ void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
 void vmx_update_secondary_exec_control(struct vcpu *v);
 
+#define POSTED_INTR_ON  0
+static inline int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
+{
+    return test_and_set_bit(vector, pi_desc->pir);
+}
+
+static inline int pi_test_and_set_on(struct pi_desc *pi_desc)
+{
+    return test_and_set_bit(POSTED_INTR_ON, &pi_desc->control);
+}
+
+static inline void pi_set_on(struct pi_desc *pi_desc)
+{
+    set_bit(POSTED_INTR_ON, &pi_desc->control);
+}
+
+static inline int pi_test_and_clear_on(struct pi_desc *pi_desc)
+{
+    return test_and_clear_bit(POSTED_INTR_ON, &pi_desc->control);
+}
+
+static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
+{
+    return xchg(&pi_desc->pir[group], 0);
+}
 
 /*
  * Exit Reasons
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWm-0004nU-MR; Fri, 19 Apr 2013 22:11:32 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWl-0004n8-KW
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:31 +0000
Received: from [85.158.139.211:57925] by server-3.bemta-5.messagelabs.com id
	4F/02-17256-F01C1715; Fri, 19 Apr 2013 22:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1366409484!19600537!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9131 invoked from network); 19 Apr 2013 22:11:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWe-000799-Iy
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWe-0000Gp-GU
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:24 +0000
Date: Fri, 19 Apr 2013 22:11:24 +0000
Message-Id: <E1UTJWe-0000Gp-GU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Add posted interrupt supporting
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d7dafa375bc13772e2e3274d975d544af4208939
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:34:49 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:34:49 2013 +0200

    VMX: Add posted interrupt supporting
    
    Add the supporting of using posted interrupt to deliver interrupt.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vlapic.c         |   18 -----------
 xen/arch/x86/hvm/vmx/vmx.c        |   62 +++++++++++++++++++++++++++++++++++++
 xen/include/asm-x86/bitops.h      |   10 ++++++
 xen/include/asm-x86/hvm/hvm.h     |    2 +
 xen/include/asm-x86/hvm/vlapic.h  |   15 +++++++++
 xen/include/asm-x86/hvm/vmx/vmx.h |   25 +++++++++++++++
 6 files changed, 114 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 4b25cc8..f241a7c 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -90,24 +90,6 @@ static const unsigned int vlapic_lvt_mask[VLAPIC_LVT_NUM] =
     ((vlapic_get_reg(vlapic, APIC_LVTT) & APIC_TIMER_MODE_MASK) \
      == APIC_TIMER_MODE_TSC_DEADLINE)
 
-
-/*
- * Generic APIC bitmap vector update & search routines.
- */
-
-#define VEC_POS(v) ((v)%32)
-#define REG_POS(v) (((v)/32) * 0x10)
-#define vlapic_test_and_set_vector(vec, bitmap)                         \
-    test_and_set_bit(VEC_POS(vec),                                      \
-                     (unsigned long *)((bitmap) + REG_POS(vec)))
-#define vlapic_test_and_clear_vector(vec, bitmap)                       \
-    test_and_clear_bit(VEC_POS(vec),                                    \
-                       (unsigned long *)((bitmap) + REG_POS(vec)))
-#define vlapic_set_vector(vec, bitmap)                                  \
-    set_bit(VEC_POS(vec), (unsigned long *)((bitmap) + REG_POS(vec)))
-#define vlapic_clear_vector(vec, bitmap)                                \
-    clear_bit(VEC_POS(vec), (unsigned long *)((bitmap) + REG_POS(vec)))
-
 static int vlapic_find_highest_vector(void *bitmap)
 {
     uint32_t *word = bitmap;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 0aa4b82..799b60e 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -55,6 +55,7 @@
 #include <asm/debugger.h>
 #include <asm/apic.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/event.h>
 
 enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
 
@@ -1447,6 +1448,60 @@ static void vmx_process_isr(int isr, struct vcpu *v)
     vmx_vmcs_exit(v);
 }
 
+static void __vmx_deliver_posted_interrupt(struct vcpu *v)
+{
+    bool_t running = v->is_running;
+
+    vcpu_unblock(v);
+    if ( running && (in_irq() || (v != current)) )
+    {
+        unsigned int cpu = v->processor;
+
+        if ( !test_and_set_bit(VCPU_KICK_SOFTIRQ, &softirq_pending(cpu))
+             && (cpu != smp_processor_id()) )
+            send_IPI_mask(cpumask_of(cpu), posted_intr_vector);
+    }
+}
+
+static void vmx_deliver_posted_intr(struct vcpu *v, u8 vector)
+{
+    if ( pi_test_and_set_pir(vector, &v->arch.hvm_vmx.pi_desc) )
+        return;
+
+    if ( unlikely(v->arch.hvm_vmx.eoi_exitmap_changed) )
+    {
+        /*
+         * If EOI exitbitmap needs to changed or notification vector
+         * can't be allocated, interrupt will not be injected till
+         * VMEntry as it used to be.
+         */
+        pi_set_on(&v->arch.hvm_vmx.pi_desc);
+    }
+    else if ( !pi_test_and_set_on(&v->arch.hvm_vmx.pi_desc) )
+    {
+        __vmx_deliver_posted_interrupt(v);
+        return;
+    }
+
+    vcpu_kick(v);
+}
+
+static void vmx_sync_pir_to_irr(struct vcpu *v)
+{
+    struct vlapic *vlapic = vcpu_vlapic(v);
+    unsigned int group, i;
+    DECLARE_BITMAP(pending_intr, NR_VECTORS);
+
+    if ( !pi_test_and_clear_on(&v->arch.hvm_vmx.pi_desc) )
+        return;
+
+    for ( group = 0; group < ARRAY_SIZE(pending_intr); group++ )
+        pending_intr[group] = pi_get_pir(&v->arch.hvm_vmx.pi_desc, group);
+
+    for_each_set_bit(i, pending_intr, NR_VECTORS)
+        vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
+}
+
 static struct hvm_function_table __read_mostly vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
@@ -1497,6 +1552,8 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .update_eoi_exit_bitmap = vmx_update_eoi_exit_bitmap,
     .virtual_intr_delivery_enabled = vmx_virtual_intr_delivery_enabled,
     .process_isr          = vmx_process_isr,
+    .deliver_posted_intr  = vmx_deliver_posted_intr,
+    .sync_pir_to_irr      = vmx_sync_pir_to_irr,
     .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
 };
 
@@ -1526,6 +1583,11 @@ struct hvm_function_table * __init start_vmx(void)
  
     if ( cpu_has_vmx_posted_intr_processing )
         alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
+    else
+    {
+        hvm_funcs.deliver_posted_intr = NULL;
+        hvm_funcs.sync_pir_to_irr = NULL;
+    }
 
     setup_vmcs_dump();
 
diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h
index 2bbd169..c3cbd26 100644
--- a/xen/include/asm-x86/bitops.h
+++ b/xen/include/asm-x86/bitops.h
@@ -367,6 +367,16 @@ static inline unsigned int __scanbit(unsigned long val, unsigned long max)
   ((off)+(__scanbit(~(((*(const unsigned long *)addr)) >> (off)), size))) : \
   __find_next_zero_bit(addr,size,off)))
 
+/**
+ * for_each_set_bit - iterate over every set bit in a memory region
+ * @bit: The integer iterator
+ * @addr: The address to base the search on
+ * @size: The maximum size to search
+ */
+#define for_each_set_bit(bit, addr, size)               \
+    for ( (bit) = find_first_bit(addr, size);           \
+          (bit) < (size);                               \
+          (bit) = find_next_bit(addr, size, (bit) + 1) )
 
 /**
  * find_first_set_bit - find the first set bit in @word
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 2fa2ea5..85dc85b 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -184,6 +184,8 @@ struct hvm_function_table {
     void (*update_eoi_exit_bitmap)(struct vcpu *v, u8 vector, u8 trig);
     int (*virtual_intr_delivery_enabled)(void);
     void (*process_isr)(int isr, struct vcpu *v);
+    void (*deliver_posted_intr)(struct vcpu *v, u8 vector);
+    void (*sync_pir_to_irr)(struct vcpu *v);
 
     /*Walk nested p2m  */
     int (*nhvm_hap_walk_L1_p2m)(struct vcpu *v, paddr_t L2_gpa,
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 101ef57..40fd306 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -54,6 +54,21 @@
 #define vlapic_x2apic_mode(vlapic)                              \
     ((vlapic)->hw.apic_base_msr & MSR_IA32_APICBASE_EXTD)
 
+/*
+ * Generic APIC bitmap vector update & search routines.
+ */
+
+#define VEC_POS(v) ((v) % 32)
+#define REG_POS(v) (((v) / 32) * 0x10)
+#define vlapic_test_and_set_vector(vec, bitmap)                         \
+    test_and_set_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+#define vlapic_test_and_clear_vector(vec, bitmap)                       \
+    test_and_clear_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+#define vlapic_set_vector(vec, bitmap)                                  \
+    set_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+#define vlapic_clear_vector(vec, bitmap)                                \
+    clear_bit(VEC_POS(vec), (uint32_t *)((bitmap) + REG_POS(vec)))
+
 struct vlapic {
     struct hvm_hw_lapic      hw;
     struct hvm_hw_lapic_regs *regs;
diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h
index 7efe0f3..c33b9f9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -99,6 +99,31 @@ void vmx_update_exception_bitmap(struct vcpu *v);
 void vmx_update_cpu_exec_control(struct vcpu *v);
 void vmx_update_secondary_exec_control(struct vcpu *v);
 
+#define POSTED_INTR_ON  0
+static inline int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
+{
+    return test_and_set_bit(vector, pi_desc->pir);
+}
+
+static inline int pi_test_and_set_on(struct pi_desc *pi_desc)
+{
+    return test_and_set_bit(POSTED_INTR_ON, &pi_desc->control);
+}
+
+static inline void pi_set_on(struct pi_desc *pi_desc)
+{
+    set_bit(POSTED_INTR_ON, &pi_desc->control);
+}
+
+static inline int pi_test_and_clear_on(struct pi_desc *pi_desc)
+{
+    return test_and_clear_bit(POSTED_INTR_ON, &pi_desc->control);
+}
+
+static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
+{
+    return xchg(&pi_desc->pir[group], 0);
+}
 
 /*
  * Exit Reasons
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWt-0004oj-Q1; Fri, 19 Apr 2013 22:11:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWs-0004oF-EL
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:38 +0000
Received: from [193.109.254.147:28388] by server-8.bemta-14.messagelabs.com id
	F1/10-07222-911C1715; Fri, 19 Apr 2013 22:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1366409495!8738675!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8179 invoked from network); 19 Apr 2013 22:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWp-00079H-KH
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWo-0000HI-O6
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:34 +0000
Date: Fri, 19 Apr 2013 22:11:34 +0000
Message-Id: <E1UTJWo-0000HI-O6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: Call vlapic_set_irq() to
	delivery virtual interrupt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04015d6326f17e4aafb32593b94dac44b72ef4c1
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:35:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:35:43 2013 +0200

    x86/HVM: Call vlapic_set_irq() to delivery virtual interrupt
    
    Move kick_vcpu into vlapic_set_irq. And call it to deliver virtual interrupt
    instead set vIRR directly.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vioapic.c       |    3 +--
 xen/arch/x86/hvm/vlapic.c        |   14 ++++++++------
 xen/arch/x86/hvm/vmsi.c          |    3 +--
 xen/include/asm-x86/hvm/vlapic.h |    2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index d3de695..d3c681b 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -263,8 +263,7 @@ static void ioapic_inj_irq(
     ASSERT((delivery_mode == dest_Fixed) ||
            (delivery_mode == dest_LowestPrio));
 
-    if ( vlapic_set_irq(target, vector, trig_mode) )
-        vcpu_kick(vlapic_vcpu(target));
+    vlapic_set_irq(target, vector, trig_mode);
 }
 
 static inline int pit_channel0_enabled(void)
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index f241a7c..20c8fe3 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -122,16 +122,19 @@ static int vlapic_find_highest_irr(struct vlapic *vlapic)
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
-int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
+void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
+    struct vcpu *target = vlapic_vcpu(vlapic);
+
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     if ( hvm_funcs.update_eoi_exit_bitmap )
-        hvm_funcs.update_eoi_exit_bitmap(vlapic_vcpu(vlapic), vec ,trig);
+        hvm_funcs.update_eoi_exit_bitmap(target, vec, trig);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return !vlapic_test_and_set_irr(vec, vlapic);
+    if ( !vlapic_test_and_set_irr(vec, vlapic) )
+        vcpu_kick(target);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)
@@ -297,9 +300,8 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
     {
     case APIC_DM_FIXED:
     case APIC_DM_LOWEST:
-        if ( vlapic_enabled(vlapic) &&
-             !vlapic_test_and_set_irr(vector, vlapic) )
-            vcpu_kick(v);
+        if ( vlapic_enabled(vlapic) )
+            vlapic_set_irq(vlapic, vector, 0);
         break;
 
     case APIC_DM_REMRD:
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index cfc7c80..36de312 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -57,8 +57,7 @@ static void vmsi_inj_irq(
     {
     case dest_Fixed:
     case dest_LowestPrio:
-        if ( vlapic_set_irq(target, vector, trig_mode) )
-            vcpu_kick(vlapic_vcpu(target));
+        vlapic_set_irq(target, vector, trig_mode);
         break;
     default:
         gdprintk(XENLOG_WARNING, "error delivery mode %d\n", delivery_mode);
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 40fd306..3277125 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -95,7 +95,7 @@ static inline void vlapic_set_reg(
 
 bool_t is_vlapic_lvtpc_enabled(struct vlapic *vlapic);
 
-int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig);
+void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig);
 
 int vlapic_has_pending_irq(struct vcpu *v);
 int vlapic_ack_pending_irq(struct vcpu *v, int vector);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:45 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJWt-0004oj-Q1; Fri, 19 Apr 2013 22:11:39 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWs-0004oF-EL
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:38 +0000
Received: from [193.109.254.147:28388] by server-8.bemta-14.messagelabs.com id
	F1/10-07222-911C1715; Fri, 19 Apr 2013 22:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1366409495!8738675!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8179 invoked from network); 19 Apr 2013 22:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWp-00079H-KH
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWo-0000HI-O6
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:34 +0000
Date: Fri, 19 Apr 2013 22:11:34 +0000
Message-Id: <E1UTJWo-0000HI-O6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: Call vlapic_set_irq() to
	delivery virtual interrupt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04015d6326f17e4aafb32593b94dac44b72ef4c1
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:35:43 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:35:43 2013 +0200

    x86/HVM: Call vlapic_set_irq() to delivery virtual interrupt
    
    Move kick_vcpu into vlapic_set_irq. And call it to deliver virtual interrupt
    instead set vIRR directly.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vioapic.c       |    3 +--
 xen/arch/x86/hvm/vlapic.c        |   14 ++++++++------
 xen/arch/x86/hvm/vmsi.c          |    3 +--
 xen/include/asm-x86/hvm/vlapic.h |    2 +-
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c
index d3de695..d3c681b 100644
--- a/xen/arch/x86/hvm/vioapic.c
+++ b/xen/arch/x86/hvm/vioapic.c
@@ -263,8 +263,7 @@ static void ioapic_inj_irq(
     ASSERT((delivery_mode == dest_Fixed) ||
            (delivery_mode == dest_LowestPrio));
 
-    if ( vlapic_set_irq(target, vector, trig_mode) )
-        vcpu_kick(vlapic_vcpu(target));
+    vlapic_set_irq(target, vector, trig_mode);
 }
 
 static inline int pit_channel0_enabled(void)
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index f241a7c..20c8fe3 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -122,16 +122,19 @@ static int vlapic_find_highest_irr(struct vlapic *vlapic)
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
-int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
+void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
 {
+    struct vcpu *target = vlapic_vcpu(vlapic);
+
     if ( trig )
         vlapic_set_vector(vec, &vlapic->regs->data[APIC_TMR]);
 
     if ( hvm_funcs.update_eoi_exit_bitmap )
-        hvm_funcs.update_eoi_exit_bitmap(vlapic_vcpu(vlapic), vec ,trig);
+        hvm_funcs.update_eoi_exit_bitmap(target, vec, trig);
 
     /* We may need to wake up target vcpu, besides set pending bit here */
-    return !vlapic_test_and_set_irr(vec, vlapic);
+    if ( !vlapic_test_and_set_irr(vec, vlapic) )
+        vcpu_kick(target);
 }
 
 static int vlapic_find_highest_isr(struct vlapic *vlapic)
@@ -297,9 +300,8 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
     {
     case APIC_DM_FIXED:
     case APIC_DM_LOWEST:
-        if ( vlapic_enabled(vlapic) &&
-             !vlapic_test_and_set_irr(vector, vlapic) )
-            vcpu_kick(v);
+        if ( vlapic_enabled(vlapic) )
+            vlapic_set_irq(vlapic, vector, 0);
         break;
 
     case APIC_DM_REMRD:
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index cfc7c80..36de312 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -57,8 +57,7 @@ static void vmsi_inj_irq(
     {
     case dest_Fixed:
     case dest_LowestPrio:
-        if ( vlapic_set_irq(target, vector, trig_mode) )
-            vcpu_kick(vlapic_vcpu(target));
+        vlapic_set_irq(target, vector, trig_mode);
         break;
     default:
         gdprintk(XENLOG_WARNING, "error delivery mode %d\n", delivery_mode);
diff --git a/xen/include/asm-x86/hvm/vlapic.h b/xen/include/asm-x86/hvm/vlapic.h
index 40fd306..3277125 100644
--- a/xen/include/asm-x86/hvm/vlapic.h
+++ b/xen/include/asm-x86/hvm/vlapic.h
@@ -95,7 +95,7 @@ static inline void vlapic_set_reg(
 
 bool_t is_vlapic_lvtpc_enabled(struct vlapic *vlapic);
 
-int vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig);
+void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig);
 
 int vlapic_has_pending_irq(struct vcpu *v);
 int vlapic_ack_pending_irq(struct vcpu *v, int vector);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJX4-0004qa-TO; Fri, 19 Apr 2013 22:11:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJX3-0004qD-4n
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:49 +0000
Received: from [85.158.139.83:61594] by server-12.bemta-5.messagelabs.com id
	8A/E5-11486-421C1715; Fri, 19 Apr 2013 22:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1366409506!27808037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18384 invoked from network); 19 Apr 2013 22:11:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWz-00079N-QE
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWz-0000IL-Nx
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:45 +0000
Date: Fri, 19 Apr 2013 22:11:45 +0000
Message-Id: <E1UTJWz-0000IL-Nx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Use posted interrupt to deliver
	virutal interrupt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d266f6b2c5c3d2d0da42f1e40ba1fb2ac8fdf1a
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:36:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:36:28 2013 +0200

    VMX: Use posted interrupt to deliver virutal interrupt
    
    Deliver virtual interrupt through posted way if posted interrupt
    is enabled.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vlapic.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 20c8fe3..9e1db88 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -119,6 +119,9 @@ static void vlapic_clear_irr(int vector, struct vlapic *vlapic)
 
 static int vlapic_find_highest_irr(struct vlapic *vlapic)
 {
+    if ( hvm_funcs.sync_pir_to_irr )
+        hvm_funcs.sync_pir_to_irr(vlapic_vcpu(vlapic));
+
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
@@ -132,8 +135,9 @@ void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
     if ( hvm_funcs.update_eoi_exit_bitmap )
         hvm_funcs.update_eoi_exit_bitmap(target, vec, trig);
 
-    /* We may need to wake up target vcpu, besides set pending bit here */
-    if ( !vlapic_test_and_set_irr(vec, vlapic) )
+    if ( hvm_funcs.deliver_posted_intr )
+        hvm_funcs.deliver_posted_intr(target, vec);
+    else if ( !vlapic_test_and_set_irr(vec, vlapic) )
         vcpu_kick(target);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:11:55 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:11:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJX4-0004qa-TO; Fri, 19 Apr 2013 22:11:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJX3-0004qD-4n
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:49 +0000
Received: from [85.158.139.83:61594] by server-12.bemta-5.messagelabs.com id
	8A/E5-11486-421C1715; Fri, 19 Apr 2013 22:11:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-182.messagelabs.com!1366409506!27808037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18384 invoked from network); 19 Apr 2013 22:11:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWz-00079N-QE
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJWz-0000IL-Nx
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:45 +0000
Date: Fri, 19 Apr 2013 22:11:45 +0000
Message-Id: <E1UTJWz-0000IL-Nx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: Use posted interrupt to deliver
	virutal interrupt
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8d266f6b2c5c3d2d0da42f1e40ba1fb2ac8fdf1a
Author:     Yang Zhang <yang.z.zhang@Intel.com>
AuthorDate: Thu Apr 18 11:36:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 11:36:28 2013 +0200

    VMX: Use posted interrupt to deliver virutal interrupt
    
    Deliver virtual interrupt through posted way if posted interrupt
    is enabled.
    
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Reviewed-by: Jun Nakajima <jun.nakajima@intel.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (from a release perspective)
---
 xen/arch/x86/hvm/vlapic.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 20c8fe3..9e1db88 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -119,6 +119,9 @@ static void vlapic_clear_irr(int vector, struct vlapic *vlapic)
 
 static int vlapic_find_highest_irr(struct vlapic *vlapic)
 {
+    if ( hvm_funcs.sync_pir_to_irr )
+        hvm_funcs.sync_pir_to_irr(vlapic_vcpu(vlapic));
+
     return vlapic_find_highest_vector(&vlapic->regs->data[APIC_IRR]);
 }
 
@@ -132,8 +135,9 @@ void vlapic_set_irq(struct vlapic *vlapic, uint8_t vec, uint8_t trig)
     if ( hvm_funcs.update_eoi_exit_bitmap )
         hvm_funcs.update_eoi_exit_bitmap(target, vec, trig);
 
-    /* We may need to wake up target vcpu, besides set pending bit here */
-    if ( !vlapic_test_and_set_irr(vec, vlapic) )
+    if ( hvm_funcs.deliver_posted_intr )
+        hvm_funcs.deliver_posted_intr(target, vec);
+    else if ( !vlapic_test_and_set_irr(vec, vlapic) )
         vcpu_kick(target);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXF-0004t6-2E; Fri, 19 Apr 2013 22:12:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXD-0004sc-NR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:00 +0000
Received: from [85.158.139.83:61823] by server-15.bemta-5.messagelabs.com id
	61/D9-22815-F21C1715; Fri, 19 Apr 2013 22:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1366409516!29114263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7834 invoked from network); 19 Apr 2013 22:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXA-00079W-0l
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJX9-0000Iu-Ux
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:55 +0000
Date: Fri, 19 Apr 2013 22:11:55 +0000
Message-Id: <E1UTJX9-0000Iu-Ux@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: gic: implement IPIs using SGI
	mechanism
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 691835f2a10b41cce4664c5fe7046f49ad3e0535
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 13:52:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 14:58:19 2013 +0100

    arm: gic: implement IPIs using SGI mechanism
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm32/mode_switch.S |    2 +-
 xen/arch/arm/gic.c               |   85 +++++++++++++++++++++++++++++++++++---
 xen/arch/arm/smp.c               |   14 ++----
 xen/include/asm-arm/gic.h        |   22 +++++++++-
 4 files changed, 105 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm32/mode_switch.S b/xen/arch/arm/arm32/mode_switch.S
index bc2be74..d6741d0 100644
--- a/xen/arch/arm/arm32/mode_switch.S
+++ b/xen/arch/arm/arm32/mode_switch.S
@@ -43,7 +43,7 @@ kick_cpus:
         mov   r2, #0x1
         str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
         mov   r2, #0xfe0000
-        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody, SGI0 = Event check */
         dsb
         str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
         mov   pc, lr
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 3124da3..0d1ab5a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -358,10 +358,52 @@ void __init gic_init(void)
     spin_unlock(&gic.lock);
 }
 
+void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi)
+{
+    unsigned long mask = cpumask_bits(cpumask)[0];
+
+    ASSERT(sgi < 16); /* There are only 16 SGIs */
+
+    mask &= cpumask_bits(&cpu_online_map)[0];
+
+    ASSERT(mask < 0x100); /* The target bitmap only supports 8 CPUs */
+
+    dsb();
+
+    GICD[GICD_SGIR] = GICD_SGI_TARGET_LIST
+        | (mask<<GICD_SGI_TARGET_SHIFT)
+        | sgi;
+}
+
+void send_SGI_one(unsigned int cpu, enum gic_sgi sgi)
+{
+    ASSERT(cpu < 7);  /* Targets bitmap only supports 8 CPUs */
+    send_SGI_mask(cpumask_of(cpu), sgi);
+}
+
+void send_SGI_self(enum gic_sgi sgi)
+{
+    ASSERT(sgi < 16); /* There are only 16 SGIs */
+
+    dsb();
+
+    GICD[GICD_SGIR] = GICD_SGI_TARGET_SELF
+        | sgi;
+}
+
+void send_SGI_allbutself(enum gic_sgi sgi)
+{
+   ASSERT(sgi < 16); /* There are only 16 SGIs */
+
+   dsb();
+
+   GICD[GICD_SGIR] = GICD_SGI_TARGET_OTHERS
+       | sgi;
+}
+
 void smp_send_state_dump(unsigned int cpu)
 {
-    printk("WARNING: unable to send state dump request to CPU%d\n", cpu);
-    /* XXX TODO -- send an SGI */
+    send_SGI_one(cpu, GIC_SGI_DUMP_STATE);
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
@@ -594,6 +636,28 @@ out:
     return retval;
 }
 
+static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
+{
+    /* Lower the priority */
+    GICC[GICC_EOIR] = sgi;
+
+    switch (sgi)
+    {
+    case GIC_SGI_EVENT_CHECK:
+        /* Nothing to do, will check for events on return path */
+        break;
+    case GIC_SGI_DUMP_STATE:
+        dump_execstate(regs);
+        break;
+    default:
+        panic("Unhandled SGI %d on CPU%d\n", sgi, smp_processor_id());
+        break;
+    }
+
+    /* Deactivate */
+    GICC[GICC_DIR] = sgi;
+}
+
 /* Accept an interrupt from the GIC and dispatch its handler */
 void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
 {
@@ -604,14 +668,23 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
     do  {
         intack = GICC[GICC_IAR];
         irq = intack & GICC_IA_IRQ;
-        local_irq_enable();
 
-        if (likely(irq < 1021))
+        if ( likely(irq >= 16 && irq < 1021) )
+        {
+            local_irq_enable();
             do_IRQ(regs, irq, is_fiq);
+            local_irq_disable();
+        }
+        else if (unlikely(irq < 16))
+        {
+            unsigned int cpu = (intack & GICC_IA_CPU_MASK) >> GICC_IA_CPU_SHIFT;
+            do_sgi(regs, cpu, irq);
+        }
         else
+        {
+            local_irq_disable();
             break;
-
-        local_irq_disable();
+        }
     } while (1);
 }
 
diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
index 12260f4..2a429bd 100644
--- a/xen/arch/arm/smp.c
+++ b/xen/arch/arm/smp.c
@@ -3,10 +3,11 @@
 #include <asm/smp.h>
 #include <asm/cpregs.h>
 #include <asm/page.h>
+#include <asm/gic.h>
 
 void flush_tlb_mask(const cpumask_t *mask)
 {
-    /* XXX IPI other processors */
+    /* No need to IPI other processors on ARM, the processor takes care of it. */
     flush_xen_data_tlb();
 }
 
@@ -15,17 +16,12 @@ void smp_call_function(
     void *info,
     int wait)
 {
-    /* TODO: No SMP just now, does not include self so nothing to do.
-       cpumask_t allbutself = cpu_online_map;
-       cpu_clear(smp_processor_id(), allbutself);
-       on_selected_cpus(&allbutself, func, info, wait);
-    */
+    printk("%s not implmented\n", __func__);
 }
+
 void smp_send_event_check_mask(const cpumask_t *mask)
 {
-    /* TODO: No SMP just now, does not include self so nothing to do.
-       send_IPI_mask(mask, EVENT_CHECK_VECTOR);
-    */
+    send_SGI_mask(mask, GIC_SGI_EVENT_CHECK);
 }
 
 /*
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 6bf50bb..24c0d5c 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -51,6 +51,13 @@
 #define GICD_SPENDSGIRN (0xF2C/4)
 #define GICD_ICPIDR2    (0xFE8/4)
 
+#define GICD_SGI_TARGET_LIST   (0UL<<24)
+#define GICD_SGI_TARGET_OTHERS (1UL<<24)
+#define GICD_SGI_TARGET_SELF   (2UL<<24)
+#define GICD_SGI_TARGET_SHIFT  (16)
+#define GICD_SGI_TARGET_MASK   (0xFFUL<<GICD_SGI_TARGET_SHIFT)
+#define GICD_SGI_GROUP1        (1UL<<15)
+
 #define GICC_CTLR       (0x0000/4)
 #define GICC_PMR        (0x0004/4)
 #define GICC_BPR        (0x0008/4)
@@ -83,8 +90,9 @@
 #define GICC_CTL_ENABLE 0x1
 #define GICC_CTL_EOI    (0x1 << 9)
 
-#define GICC_IA_IRQ     0x03ff
-#define GICC_IA_CPU     0x1c00
+#define GICC_IA_IRQ       0x03ff
+#define GICC_IA_CPU_MASK  0x1c00
+#define GICC_IA_CPU_SHIFT 10
 
 #define GICH_HCR_EN       (1 << 0)
 #define GICH_HCR_UIE      (1 << 1)
@@ -157,6 +165,16 @@ extern int gicv_setup(struct domain *d);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+/* SGI (AKA IPIs) */
+enum gic_sgi {
+    GIC_SGI_EVENT_CHECK = 0,
+    GIC_SGI_DUMP_STATE  = 1,
+};
+extern void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi);
+extern void send_SGI_one(unsigned int cpu, enum gic_sgi sgi);
+extern void send_SGI_self(enum gic_sgi sgi);
+extern void send_SGI_allbutself(enum gic_sgi sgi);
+
 /* print useful debug info */
 extern void gic_dump_info(struct vcpu *v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:03 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXF-0004t6-2E; Fri, 19 Apr 2013 22:12:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXD-0004sc-NR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:00 +0000
Received: from [85.158.139.83:61823] by server-15.bemta-5.messagelabs.com id
	61/D9-22815-F21C1715; Fri, 19 Apr 2013 22:11:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-182.messagelabs.com!1366409516!29114263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7834 invoked from network); 19 Apr 2013 22:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXA-00079W-0l
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJX9-0000Iu-Ux
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:11:55 +0000
Date: Fri, 19 Apr 2013 22:11:55 +0000
Message-Id: <E1UTJX9-0000Iu-Ux@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: gic: implement IPIs using SGI
	mechanism
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 691835f2a10b41cce4664c5fe7046f49ad3e0535
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 13:52:32 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 14:58:19 2013 +0100

    arm: gic: implement IPIs using SGI mechanism
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm32/mode_switch.S |    2 +-
 xen/arch/arm/gic.c               |   85 +++++++++++++++++++++++++++++++++++---
 xen/arch/arm/smp.c               |   14 ++----
 xen/include/asm-arm/gic.h        |   22 +++++++++-
 4 files changed, 105 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/arm32/mode_switch.S b/xen/arch/arm/arm32/mode_switch.S
index bc2be74..d6741d0 100644
--- a/xen/arch/arm/arm32/mode_switch.S
+++ b/xen/arch/arm/arm32/mode_switch.S
@@ -43,7 +43,7 @@ kick_cpus:
         mov   r2, #0x1
         str   r2, [r0, #(GICD_CTLR * 4)]      /* enable distributor */
         mov   r2, #0xfe0000
-        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody */
+        str   r2, [r0, #(GICD_SGIR * 4)]      /* send IPI to everybody, SGI0 = Event check */
         dsb
         str   r2, [r0, #(GICD_CTLR * 4)]      /* disable distributor */
         mov   pc, lr
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 3124da3..0d1ab5a 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -358,10 +358,52 @@ void __init gic_init(void)
     spin_unlock(&gic.lock);
 }
 
+void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi)
+{
+    unsigned long mask = cpumask_bits(cpumask)[0];
+
+    ASSERT(sgi < 16); /* There are only 16 SGIs */
+
+    mask &= cpumask_bits(&cpu_online_map)[0];
+
+    ASSERT(mask < 0x100); /* The target bitmap only supports 8 CPUs */
+
+    dsb();
+
+    GICD[GICD_SGIR] = GICD_SGI_TARGET_LIST
+        | (mask<<GICD_SGI_TARGET_SHIFT)
+        | sgi;
+}
+
+void send_SGI_one(unsigned int cpu, enum gic_sgi sgi)
+{
+    ASSERT(cpu < 7);  /* Targets bitmap only supports 8 CPUs */
+    send_SGI_mask(cpumask_of(cpu), sgi);
+}
+
+void send_SGI_self(enum gic_sgi sgi)
+{
+    ASSERT(sgi < 16); /* There are only 16 SGIs */
+
+    dsb();
+
+    GICD[GICD_SGIR] = GICD_SGI_TARGET_SELF
+        | sgi;
+}
+
+void send_SGI_allbutself(enum gic_sgi sgi)
+{
+   ASSERT(sgi < 16); /* There are only 16 SGIs */
+
+   dsb();
+
+   GICD[GICD_SGIR] = GICD_SGI_TARGET_OTHERS
+       | sgi;
+}
+
 void smp_send_state_dump(unsigned int cpu)
 {
-    printk("WARNING: unable to send state dump request to CPU%d\n", cpu);
-    /* XXX TODO -- send an SGI */
+    send_SGI_one(cpu, GIC_SGI_DUMP_STATE);
 }
 
 /* Set up the per-CPU parts of the GIC for a secondary CPU */
@@ -594,6 +636,28 @@ out:
     return retval;
 }
 
+static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
+{
+    /* Lower the priority */
+    GICC[GICC_EOIR] = sgi;
+
+    switch (sgi)
+    {
+    case GIC_SGI_EVENT_CHECK:
+        /* Nothing to do, will check for events on return path */
+        break;
+    case GIC_SGI_DUMP_STATE:
+        dump_execstate(regs);
+        break;
+    default:
+        panic("Unhandled SGI %d on CPU%d\n", sgi, smp_processor_id());
+        break;
+    }
+
+    /* Deactivate */
+    GICC[GICC_DIR] = sgi;
+}
+
 /* Accept an interrupt from the GIC and dispatch its handler */
 void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
 {
@@ -604,14 +668,23 @@ void gic_interrupt(struct cpu_user_regs *regs, int is_fiq)
     do  {
         intack = GICC[GICC_IAR];
         irq = intack & GICC_IA_IRQ;
-        local_irq_enable();
 
-        if (likely(irq < 1021))
+        if ( likely(irq >= 16 && irq < 1021) )
+        {
+            local_irq_enable();
             do_IRQ(regs, irq, is_fiq);
+            local_irq_disable();
+        }
+        else if (unlikely(irq < 16))
+        {
+            unsigned int cpu = (intack & GICC_IA_CPU_MASK) >> GICC_IA_CPU_SHIFT;
+            do_sgi(regs, cpu, irq);
+        }
         else
+        {
+            local_irq_disable();
             break;
-
-        local_irq_disable();
+        }
     } while (1);
 }
 
diff --git a/xen/arch/arm/smp.c b/xen/arch/arm/smp.c
index 12260f4..2a429bd 100644
--- a/xen/arch/arm/smp.c
+++ b/xen/arch/arm/smp.c
@@ -3,10 +3,11 @@
 #include <asm/smp.h>
 #include <asm/cpregs.h>
 #include <asm/page.h>
+#include <asm/gic.h>
 
 void flush_tlb_mask(const cpumask_t *mask)
 {
-    /* XXX IPI other processors */
+    /* No need to IPI other processors on ARM, the processor takes care of it. */
     flush_xen_data_tlb();
 }
 
@@ -15,17 +16,12 @@ void smp_call_function(
     void *info,
     int wait)
 {
-    /* TODO: No SMP just now, does not include self so nothing to do.
-       cpumask_t allbutself = cpu_online_map;
-       cpu_clear(smp_processor_id(), allbutself);
-       on_selected_cpus(&allbutself, func, info, wait);
-    */
+    printk("%s not implmented\n", __func__);
 }
+
 void smp_send_event_check_mask(const cpumask_t *mask)
 {
-    /* TODO: No SMP just now, does not include self so nothing to do.
-       send_IPI_mask(mask, EVENT_CHECK_VECTOR);
-    */
+    send_SGI_mask(mask, GIC_SGI_EVENT_CHECK);
 }
 
 /*
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 6bf50bb..24c0d5c 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -51,6 +51,13 @@
 #define GICD_SPENDSGIRN (0xF2C/4)
 #define GICD_ICPIDR2    (0xFE8/4)
 
+#define GICD_SGI_TARGET_LIST   (0UL<<24)
+#define GICD_SGI_TARGET_OTHERS (1UL<<24)
+#define GICD_SGI_TARGET_SELF   (2UL<<24)
+#define GICD_SGI_TARGET_SHIFT  (16)
+#define GICD_SGI_TARGET_MASK   (0xFFUL<<GICD_SGI_TARGET_SHIFT)
+#define GICD_SGI_GROUP1        (1UL<<15)
+
 #define GICC_CTLR       (0x0000/4)
 #define GICC_PMR        (0x0004/4)
 #define GICC_BPR        (0x0008/4)
@@ -83,8 +90,9 @@
 #define GICC_CTL_ENABLE 0x1
 #define GICC_CTL_EOI    (0x1 << 9)
 
-#define GICC_IA_IRQ     0x03ff
-#define GICC_IA_CPU     0x1c00
+#define GICC_IA_IRQ       0x03ff
+#define GICC_IA_CPU_MASK  0x1c00
+#define GICC_IA_CPU_SHIFT 10
 
 #define GICH_HCR_EN       (1 << 0)
 #define GICH_HCR_UIE      (1 << 1)
@@ -157,6 +165,16 @@ extern int gicv_setup(struct domain *d);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+/* SGI (AKA IPIs) */
+enum gic_sgi {
+    GIC_SGI_EVENT_CHECK = 0,
+    GIC_SGI_DUMP_STATE  = 1,
+};
+extern void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi);
+extern void send_SGI_one(unsigned int cpu, enum gic_sgi sgi);
+extern void send_SGI_self(enum gic_sgi sgi);
+extern void send_SGI_allbutself(enum gic_sgi sgi);
+
 /* print useful debug info */
 extern void gic_dump_info(struct vcpu *v);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXS-0004w0-5c; Fri, 19 Apr 2013 22:12:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXQ-0004v3-QB
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:12 +0000
Received: from [85.158.139.211:6876] by server-16.bemta-5.messagelabs.com id
	F6/97-02543-831C1715; Fri, 19 Apr 2013 22:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1366409526!19661418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32495 invoked from network); 19 Apr 2013 22:12:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXK-0007A6-7b
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXK-0000Jn-49
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:06 +0000
Date: Fri, 19 Apr 2013 22:12:06 +0000
Message-Id: <E1UTJXK-0000Jn-49@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: correct secondary CPU bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 153c66d80275ca7d2d617c26743b61083ecfa936
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 13:52:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 14:58:34 2013 +0100

    arm64: correct secondary CPU bringup
    
    The current cpuid is held in x22 not x12.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm64/head.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index bbde419..c18ef2b 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -307,7 +307,7 @@ paging:
         dsb   sy
         ldr   x0, =smp_up_cpu
         ldr   x1, [x0]               /* Which CPU is being booted? */
-        cmp   x1, x12                /* Is it us? */
+        cmp   x1, x22                /* Is it us? */
         b.ne  1b
 
 launch:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXS-0004w0-5c; Fri, 19 Apr 2013 22:12:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXQ-0004v3-QB
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:12 +0000
Received: from [85.158.139.211:6876] by server-16.bemta-5.messagelabs.com id
	F6/97-02543-831C1715; Fri, 19 Apr 2013 22:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1366409526!19661418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32495 invoked from network); 19 Apr 2013 22:12:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXK-0007A6-7b
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXK-0000Jn-49
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:06 +0000
Date: Fri, 19 Apr 2013 22:12:06 +0000
Message-Id: <E1UTJXK-0000Jn-49@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: correct secondary CPU bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 153c66d80275ca7d2d617c26743b61083ecfa936
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 13:52:33 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 14:58:34 2013 +0100

    arm64: correct secondary CPU bringup
    
    The current cpuid is held in x22 not x12.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/arm64/head.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index bbde419..c18ef2b 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -307,7 +307,7 @@ paging:
         dsb   sy
         ldr   x0, =smp_up_cpu
         ldr   x1, [x0]               /* Which CPU is being booted? */
-        cmp   x1, x12                /* Is it us? */
+        cmp   x1, x22                /* Is it us? */
         b.ne  1b
 
 launch:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXg-0004yk-8R; Fri, 19 Apr 2013 22:12:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXe-0004y4-Jn
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:26 +0000
Received: from [85.158.139.83:62316] by server-7.bemta-5.messagelabs.com id
	B5/86-12441-441C1715; Fri, 19 Apr 2013 22:12:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1366409536!17704259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11701 invoked from network); 19 Apr 2013 22:12:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXU-0007AB-Fg
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXU-0000KB-DY
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:16 +0000
Date: Fri, 19 Apr 2013 22:12:16 +0000
Message-Id: <E1UTJXU-0000KB-DY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: vgic: fix race in
	vgic_vcpu_inject_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e83d6b9432af603200f065b499b8e4b78e92842d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 13:52:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 14:58:43 2013 +0100

    arm: vgic: fix race in vgic_vcpu_inject_irq
    
    The initial check for a still pending interrupt (!list_empty(&n->inflight))
    needs to be covered by the vgic lock to avoid trying to insert the IRQ into the
    inflight list simultaneously on 2 pCPUS. Expand the area covered by the lock
    appropriately.
    
    Also consolidate the unlocks on the exit path into one location.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index d9ceaaa..4d8da02 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -584,9 +584,14 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
 
-    /* irq still pending */
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    /* irq already pending */
     if (!list_empty(&n->inflight))
+    {
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
+    }
 
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
 
@@ -601,17 +606,16 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     if ( rank->ienable & (1 << (irq % 32)) )
         gic_set_guest_irq(v, irq, GICH_LR_PENDING, priority);
 
-    spin_lock_irqsave(&v->arch.vgic.lock, flags);
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
         if ( iter->priority > priority )
         {
             list_add_tail(&n->inflight, &iter->inflight);
-            spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
-            return;
+            goto out;
         }
     }
     list_add_tail(&n->inflight, &v->arch.vgic.inflight_irqs);
+out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXg-0004yk-8R; Fri, 19 Apr 2013 22:12:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXe-0004y4-Jn
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:26 +0000
Received: from [85.158.139.83:62316] by server-7.bemta-5.messagelabs.com id
	B5/86-12441-441C1715; Fri, 19 Apr 2013 22:12:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-182.messagelabs.com!1366409536!17704259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11701 invoked from network); 19 Apr 2013 22:12:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXU-0007AB-Fg
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXU-0000KB-DY
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:16 +0000
Date: Fri, 19 Apr 2013 22:12:16 +0000
Message-Id: <E1UTJXU-0000KB-DY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: vgic: fix race in
	vgic_vcpu_inject_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e83d6b9432af603200f065b499b8e4b78e92842d
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 17 13:52:34 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 14:58:43 2013 +0100

    arm: vgic: fix race in vgic_vcpu_inject_irq
    
    The initial check for a still pending interrupt (!list_empty(&n->inflight))
    needs to be covered by the vgic lock to avoid trying to insert the IRQ into the
    inflight list simultaneously on 2 pCPUS. Expand the area covered by the lock
    appropriately.
    
    Also consolidate the unlocks on the exit path into one location.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/vgic.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index d9ceaaa..4d8da02 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -584,9 +584,14 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
 
-    /* irq still pending */
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    /* irq already pending */
     if (!list_empty(&n->inflight))
+    {
+        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
         return;
+    }
 
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
 
@@ -601,17 +606,16 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
     if ( rank->ienable & (1 << (irq % 32)) )
         gic_set_guest_irq(v, irq, GICH_LR_PENDING, priority);
 
-    spin_lock_irqsave(&v->arch.vgic.lock, flags);
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
         if ( iter->priority > priority )
         {
             list_add_tail(&n->inflight, &iter->inflight);
-            spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
-            return;
+            goto out;
         }
     }
     list_add_tail(&n->inflight, &v->arch.vgic.inflight_irqs);
+out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
     /* we have a new higher priority irq, inject it into the guest */
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXn-00050M-C7; Fri, 19 Apr 2013 22:12:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXl-0004zC-QU
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:34 +0000
Received: from [85.158.139.83:13883] by server-3.bemta-5.messagelabs.com id
	A3/92-17256-D41C1715; Fri, 19 Apr 2013 22:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1366409547!29217589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3043 invoked from network); 19 Apr 2013 22:12:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXe-0007AH-Tm
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXe-0000Kq-RR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:26 +0000
Date: Fri, 19 Apr 2013 22:12:26 +0000
Message-Id: <E1UTJXe-0000Kq-RR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: clear EFLAGS.NT in SYSENTER entry
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fdac9515607b757c044e7ef0d61b1453ef999b08
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:00:35 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:00:35 2013 +0200

    x86: clear EFLAGS.NT in SYSENTER entry path
    
    ... as it causes problems if we happen to exit back via IRET: In the
    course of trying to handle the fault, the hypervisor creates a stack
    frame by hand, and uses PUSHFQ to set the respective EFLAGS field, but
    expects to be able to IRET through that stack frame to the second
    portion of the fixup code (which causes a #GP due to the stored EFLAGS
    having NT set).
    
    And even if this worked (e.g if we cleared NT in that path), it would
    then (through the fail safe callback) cause a #GP in the guest with the
    SYSENTER handler's first instruction as the source, which in turn would
    allow guest user mode code to crash the guest kernel.
    
    Inject a #GP on the fake (NULL) address of the SYSENTER instruction
    instead, just like in the case where the guest kernel didn't register
    a corresponding entry point.
    
    This is CVE-2013-1917 / XSA-44.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_64/entry.S |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 03e352b..5beeccb 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -282,7 +282,14 @@ sysenter_eflags_saved:
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
+        testl $X86_EFLAGS_NT,UREGS_eflags(%rsp)
         leaq  VCPU_trap_bounce(%rbx),%rdx
+UNLIKELY_START(nz, sysenter_nt_set)
+        pushfq
+        andl  $~X86_EFLAGS_NT,(%rsp)
+        popfq
+        xorl  %eax,%eax
+UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXn-00050M-C7; Fri, 19 Apr 2013 22:12:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXl-0004zC-QU
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:34 +0000
Received: from [85.158.139.83:13883] by server-3.bemta-5.messagelabs.com id
	A3/92-17256-D41C1715; Fri, 19 Apr 2013 22:12:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1366409547!29217589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3043 invoked from network); 19 Apr 2013 22:12:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXe-0007AH-Tm
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXe-0000Kq-RR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:26 +0000
Date: Fri, 19 Apr 2013 22:12:26 +0000
Message-Id: <E1UTJXe-0000Kq-RR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: clear EFLAGS.NT in SYSENTER entry
	path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fdac9515607b757c044e7ef0d61b1453ef999b08
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:00:35 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:00:35 2013 +0200

    x86: clear EFLAGS.NT in SYSENTER entry path
    
    ... as it causes problems if we happen to exit back via IRET: In the
    course of trying to handle the fault, the hypervisor creates a stack
    frame by hand, and uses PUSHFQ to set the respective EFLAGS field, but
    expects to be able to IRET through that stack frame to the second
    portion of the fixup code (which causes a #GP due to the stored EFLAGS
    having NT set).
    
    And even if this worked (e.g if we cleared NT in that path), it would
    then (through the fail safe callback) cause a #GP in the guest with the
    SYSENTER handler's first instruction as the source, which in turn would
    allow guest user mode code to crash the guest kernel.
    
    Inject a #GP on the fake (NULL) address of the SYSENTER instruction
    instead, just like in the case where the guest kernel didn't register
    a corresponding entry point.
    
    This is CVE-2013-1917 / XSA-44.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_64/entry.S |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 03e352b..5beeccb 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -282,7 +282,14 @@ sysenter_eflags_saved:
         cmpb  $0,VCPU_sysenter_disables_events(%rbx)
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
+        testl $X86_EFLAGS_NT,UREGS_eflags(%rsp)
         leaq  VCPU_trap_bounce(%rbx),%rdx
+UNLIKELY_START(nz, sysenter_nt_set)
+        pushfq
+        andl  $~X86_EFLAGS_NT,(%rsp)
+        popfq
+        xorl  %eax,%eax
+UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXu-00051x-FY; Fri, 19 Apr 2013 22:12:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXs-00051U-S4
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:41 +0000
Received: from [85.158.137.99:11409] by server-1.bemta-3.messagelabs.com id
	3D/5F-13706-751C1715; Fri, 19 Apr 2013 22:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1366409557!12590369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19145 invoked from network); 19 Apr 2013 22:12:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXp-0007AP-47
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXp-0000LH-29
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:37 +0000
Date: Fri, 19 Apr 2013 22:12:37 +0000
Message-Id: <E1UTJXp-0000LH-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix various issues with handling
	guest IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 545607eb3cfeb2abf5742d1bb869734f317fcfe5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:11:23 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:11:23 2013 +0200

    x86: fix various issues with handling guest IRQs
    
    - properly revoke IRQ access in map_domain_pirq() error path
    - don't permit replacing an in use IRQ
    - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI
    - track IRQ access permission in host IRQ terms, not guest IRQ ones
      (and with that, also disallow Dom0 access to IRQ0)
    
    This is CVE-2013-1919 / XSA-46.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/libxl/libxl_create.c            |   12 ++++---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 +++++++++----
 xen/arch/x86/irq.c                    |   50 +++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/common/domctl.c                   |    5 ++-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 ++++++++++++
 9 files changed, 93 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 19a56c0..cb9c822 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -966,14 +966,16 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     }
 
     for (i = 0; i < d_config->b_info.num_irqs; i++) {
-        uint32_t irq = d_config->b_info.irqs[i];
+        int irq = d_config->b_info.irqs[i];
 
-        LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
+        LOG(DEBUG, "dom%d irq %d", domid, irq);
 
-        ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+        ret = irq >= 0 ? xc_physdev_map_pirq(CTX->xch, domid, irq, &irq)
+                       : -EOVERFLOW;
+        if (!ret)
+            ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
         if (ret < 0) {
-            LOGE(ERROR,
-                 "failed give dom%d access to irq %"PRId32, domid, irq);
+            LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
             ret = ERROR_FAIL;
         }
     }
diff --git a/tools/python/xen/xend/server/irqif.py b/tools/python/xen/xend/server/irqif.py
index ae0b1ff..723f346 100644
--- a/tools/python/xen/xend/server/irqif.py
+++ b/tools/python/xen/xend/server/irqif.py
@@ -73,6 +73,12 @@ class IRQController(DevController):
        
         pirq = get_param('irq')
 
+        rc = xc.physdev_map_pirq(domid = self.getDomid(),
+                                 index = pirq,
+                                 pirq  = pirq)
+        if rc < 0:
+            raise VmError('irq: Failed to map irq %x' % (pirq))
+
         rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
             #todo non-fatal
             raise VmError(
                 'irq: Failed to configure irq: %d' % (pirq))
-        rc = xc.physdev_map_pirq(domid = self.getDomid(),
-                                index = pirq,
-                                pirq  = pirq)
-        if rc < 0:
-            raise VmError(
-                'irq: Failed to map irq %x' % (pirq))
         back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
         return (self.allocateDeviceID(), back, {})
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index c8f435d..7ae084f 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1080,7 +1080,7 @@ int __init construct_dom0(
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 0, d->nr_pirqs - 1);
+    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index a196e2a..8fb4fa9 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -578,9 +578,13 @@ long arch_do_domctl(
             break;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            break;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                break;
+        }
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -602,9 +606,13 @@ long arch_do_domctl(
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            break;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                break;
+        }
 
         ret = xsm_unbind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index fa6b9a2..bbf4130 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -185,6 +185,14 @@ int create_irq(int node)
         desc->arch.used = IRQ_UNUSED;
         irq = ret;
     }
+    else if ( dom0 )
+    {
+        ret = irq_permit_access(dom0, irq);
+        if ( ret )
+            printk(XENLOG_G_ERR
+                   "Could not grant Dom0 access to IRQ%d (error %d)\n",
+                   irq, ret);
+    }
 
     return irq;
 }
@@ -281,6 +289,17 @@ void clear_irq_vector(int irq)
 void destroy_irq(unsigned int irq)
 {
     BUG_ON(!MSI_IRQ(irq));
+
+    if ( dom0 )
+    {
+        int err = irq_deny_access(dom0, irq);
+
+        if ( err )
+            printk(XENLOG_G_ERR
+                   "Could not revoke Dom0 access to IRQ%u (error %d)\n",
+                   irq, err);
+    }
+
     dynamic_irq_cleanup(irq);
     clear_irq_vector(irq);
 }
@@ -1873,7 +1892,7 @@ int map_domain_pirq(
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
-         !irq_access_permitted(current->domain, pirq))
+         !irq_access_permitted(current->domain, irq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
@@ -1902,17 +1921,18 @@ int map_domain_pirq(
         return ret;
     }
 
-    ret = irq_permit_access(d, pirq);
+    ret = irq_permit_access(d, irq);
     if ( ret )
     {
-        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not permit access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
         return ret;
     }
 
     ret = prepare_domain_irq_pirq(d, irq, pirq, &info);
     if ( ret )
-        return ret;
+        goto revoke;
 
     desc = irq_to_desc(irq);
 
@@ -1936,8 +1956,14 @@ int map_domain_pirq(
         spin_lock_irqsave(&desc->lock, flags);
 
         if ( desc->handler != &no_irq_type )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
+            pci_disable_msi(msi_desc);
+            ret = -EBUSY;
+            goto done;
+        }
 
         ret = setup_msi_irq(desc, msi_desc);
         if ( ret )
@@ -1972,7 +1998,14 @@ int map_domain_pirq(
 
 done:
     if ( ret )
+    {
         cleanup_domain_irq_pirq(d, irq, info);
+ revoke:
+        if ( irq_deny_access(d, irq) )
+            printk(XENLOG_G_ERR
+                   "dom%d: could not revoke access to IRQ%d (pirq %d)\n",
+                   d->domain_id, irq, pirq);
+    }
     return ret;
 }
 
@@ -2043,10 +2076,11 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     if ( !forced_unbind )
         cleanup_domain_irq_pirq(d, irq, info);
 
-    ret = irq_deny_access(d, pirq);
+    ret = irq_deny_access(d, irq);
     if ( ret )
-        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not deny access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
 
  done:
     return ret;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 876ac9d..eb8a407 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -144,7 +144,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
         if ( irq == -1 )
             irq = create_irq(NUMA_NO_NODE);
 
-        if ( irq < 0 || irq >= nr_irqs )
+        if ( irq < nr_irqs_gsi || irq >= nr_irqs )
         {
             dprintk(XENLOG_G_ERR, "dom%d: can't create irq for msi!\n",
                     d->domain_id);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6bd8efd..73b12c8 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -25,6 +25,7 @@
 #include <xen/paging.h>
 #include <xen/hypercall.h>
 #include <asm/current.h>
+#include <asm/irq.h>
 #include <asm/page.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
@@ -777,9 +778,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = irq_permit_access(d, pirq);
+            ret = pirq_permit_access(d, pirq);
         else
-            ret = irq_deny_access(d, pirq);
+            ret = pirq_deny_access(d, pirq);
     }
     break;
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0a6684c..64c976b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -369,7 +369,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
 
-    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+    if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
         return -EPERM;
 
     spin_lock(&d->event_lock);
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index 63bb49f..b755ecb 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,4 +28,22 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
+#define pirq_permit_access(d, i) ({                     \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_deny_access(d, i) ({                       \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_access_permitted(d, i) ({                  \
+    struct domain *d__ = (d);                           \
+    rangeset_contains_singleton(d__->irq_caps,          \
+                                domain_pirq_to_irq(d__, i));\
+})
+
 #endif /* __XEN_IOCAP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJXu-00051x-FY; Fri, 19 Apr 2013 22:12:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXs-00051U-S4
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:41 +0000
Received: from [85.158.137.99:11409] by server-1.bemta-3.messagelabs.com id
	3D/5F-13706-751C1715; Fri, 19 Apr 2013 22:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-217.messagelabs.com!1366409557!12590369!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19145 invoked from network); 19 Apr 2013 22:12:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXp-0007AP-47
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXp-0000LH-29
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:37 +0000
Date: Fri, 19 Apr 2013 22:12:37 +0000
Message-Id: <E1UTJXp-0000LH-29@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix various issues with handling
	guest IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 545607eb3cfeb2abf5742d1bb869734f317fcfe5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:11:23 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:11:23 2013 +0200

    x86: fix various issues with handling guest IRQs
    
    - properly revoke IRQ access in map_domain_pirq() error path
    - don't permit replacing an in use IRQ
    - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI
    - track IRQ access permission in host IRQ terms, not guest IRQ ones
      (and with that, also disallow Dom0 access to IRQ0)
    
    This is CVE-2013-1919 / XSA-46.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 tools/libxl/libxl_create.c            |   12 ++++---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 +++++++++----
 xen/arch/x86/irq.c                    |   50 +++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/common/domctl.c                   |    5 ++-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 ++++++++++++
 9 files changed, 93 insertions(+), 30 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 19a56c0..cb9c822 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -966,14 +966,16 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev,
     }
 
     for (i = 0; i < d_config->b_info.num_irqs; i++) {
-        uint32_t irq = d_config->b_info.irqs[i];
+        int irq = d_config->b_info.irqs[i];
 
-        LOG(DEBUG, "dom%d irq %"PRIx32, domid, irq);
+        LOG(DEBUG, "dom%d irq %d", domid, irq);
 
-        ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
+        ret = irq >= 0 ? xc_physdev_map_pirq(CTX->xch, domid, irq, &irq)
+                       : -EOVERFLOW;
+        if (!ret)
+            ret = xc_domain_irq_permission(CTX->xch, domid, irq, 1);
         if (ret < 0) {
-            LOGE(ERROR,
-                 "failed give dom%d access to irq %"PRId32, domid, irq);
+            LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq);
             ret = ERROR_FAIL;
         }
     }
diff --git a/tools/python/xen/xend/server/irqif.py b/tools/python/xen/xend/server/irqif.py
index ae0b1ff..723f346 100644
--- a/tools/python/xen/xend/server/irqif.py
+++ b/tools/python/xen/xend/server/irqif.py
@@ -73,6 +73,12 @@ class IRQController(DevController):
        
         pirq = get_param('irq')
 
+        rc = xc.physdev_map_pirq(domid = self.getDomid(),
+                                 index = pirq,
+                                 pirq  = pirq)
+        if rc < 0:
+            raise VmError('irq: Failed to map irq %x' % (pirq))
+
         rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
             #todo non-fatal
             raise VmError(
                 'irq: Failed to configure irq: %d' % (pirq))
-        rc = xc.physdev_map_pirq(domid = self.getDomid(),
-                                index = pirq,
-                                pirq  = pirq)
-        if rc < 0:
-            raise VmError(
-                'irq: Failed to map irq %x' % (pirq))
         back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
         return (self.allocateDeviceID(), back, {})
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index c8f435d..7ae084f 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1080,7 +1080,7 @@ int __init construct_dom0(
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 0, d->nr_pirqs - 1);
+    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index a196e2a..8fb4fa9 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -578,9 +578,13 @@ long arch_do_domctl(
             break;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            break;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                break;
+        }
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -602,9 +606,13 @@ long arch_do_domctl(
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            break;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                break;
+        }
 
         ret = xsm_unbind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index fa6b9a2..bbf4130 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -185,6 +185,14 @@ int create_irq(int node)
         desc->arch.used = IRQ_UNUSED;
         irq = ret;
     }
+    else if ( dom0 )
+    {
+        ret = irq_permit_access(dom0, irq);
+        if ( ret )
+            printk(XENLOG_G_ERR
+                   "Could not grant Dom0 access to IRQ%d (error %d)\n",
+                   irq, ret);
+    }
 
     return irq;
 }
@@ -281,6 +289,17 @@ void clear_irq_vector(int irq)
 void destroy_irq(unsigned int irq)
 {
     BUG_ON(!MSI_IRQ(irq));
+
+    if ( dom0 )
+    {
+        int err = irq_deny_access(dom0, irq);
+
+        if ( err )
+            printk(XENLOG_G_ERR
+                   "Could not revoke Dom0 access to IRQ%u (error %d)\n",
+                   irq, err);
+    }
+
     dynamic_irq_cleanup(irq);
     clear_irq_vector(irq);
 }
@@ -1873,7 +1892,7 @@ int map_domain_pirq(
     ASSERT(spin_is_locked(&d->event_lock));
 
     if ( !IS_PRIV(current->domain) &&
-         !irq_access_permitted(current->domain, pirq))
+         !irq_access_permitted(current->domain, irq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
@@ -1902,17 +1921,18 @@ int map_domain_pirq(
         return ret;
     }
 
-    ret = irq_permit_access(d, pirq);
+    ret = irq_permit_access(d, irq);
     if ( ret )
     {
-        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not permit access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
         return ret;
     }
 
     ret = prepare_domain_irq_pirq(d, irq, pirq, &info);
     if ( ret )
-        return ret;
+        goto revoke;
 
     desc = irq_to_desc(irq);
 
@@ -1936,8 +1956,14 @@ int map_domain_pirq(
         spin_lock_irqsave(&desc->lock, flags);
 
         if ( desc->handler != &no_irq_type )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
+            pci_disable_msi(msi_desc);
+            ret = -EBUSY;
+            goto done;
+        }
 
         ret = setup_msi_irq(desc, msi_desc);
         if ( ret )
@@ -1972,7 +1998,14 @@ int map_domain_pirq(
 
 done:
     if ( ret )
+    {
         cleanup_domain_irq_pirq(d, irq, info);
+ revoke:
+        if ( irq_deny_access(d, irq) )
+            printk(XENLOG_G_ERR
+                   "dom%d: could not revoke access to IRQ%d (pirq %d)\n",
+                   d->domain_id, irq, pirq);
+    }
     return ret;
 }
 
@@ -2043,10 +2076,11 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     if ( !forced_unbind )
         cleanup_domain_irq_pirq(d, irq, info);
 
-    ret = irq_deny_access(d, pirq);
+    ret = irq_deny_access(d, irq);
     if ( ret )
-        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not deny access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
 
  done:
     return ret;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 876ac9d..eb8a407 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -144,7 +144,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p,
         if ( irq == -1 )
             irq = create_irq(NUMA_NO_NODE);
 
-        if ( irq < 0 || irq >= nr_irqs )
+        if ( irq < nr_irqs_gsi || irq >= nr_irqs )
         {
             dprintk(XENLOG_G_ERR, "dom%d: can't create irq for msi!\n",
                     d->domain_id);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 6bd8efd..73b12c8 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -25,6 +25,7 @@
 #include <xen/paging.h>
 #include <xen/hypercall.h>
 #include <asm/current.h>
+#include <asm/irq.h>
 #include <asm/page.h>
 #include <public/domctl.h>
 #include <xsm/xsm.h>
@@ -777,9 +778,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         else if ( xsm_irq_permission(XSM_HOOK, d, pirq, allow) )
             ret = -EPERM;
         else if ( allow )
-            ret = irq_permit_access(d, pirq);
+            ret = pirq_permit_access(d, pirq);
         else
-            ret = irq_deny_access(d, pirq);
+            ret = pirq_deny_access(d, pirq);
     }
     break;
 
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 0a6684c..64c976b 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -369,7 +369,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
 
-    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+    if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
         return -EPERM;
 
     spin_lock(&d->event_lock);
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index 63bb49f..b755ecb 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,4 +28,22 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
+#define pirq_permit_access(d, i) ({                     \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_deny_access(d, i) ({                       \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_access_permitted(d, i) ({                  \
+    struct domain *d__ = (d);                           \
+    rangeset_contains_singleton(d__->irq_caps,          \
+                                domain_pirq_to_irq(d__, i));\
+})
+
 #endif /* __XEN_IOCAP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJY4-00054D-Ku; Fri, 19 Apr 2013 22:12:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJY2-00053c-Dx
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:50 +0000
Received: from [193.109.254.147:30199] by server-2.bemta-14.messagelabs.com id
	9A/66-14115-161C1715; Fri, 19 Apr 2013 22:12:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1366409567!8700503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24647 invoked from network); 19 Apr 2013 22:12:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXz-0007AY-Ch
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXz-0000Ld-9Q
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:47 +0000
Date: Fri, 19 Apr 2013 22:12:47 +0000
Message-Id: <E1UTJXz-0000Ld-9Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8b5421f45c2b528bab1c8695271f99743b708fa
Merge: e83d6b9432af603200f065b499b8e4b78e92842d 545607eb3cfeb2abf5742d1bb869734f317fcfe5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Apr 18 15:15:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 15:15:26 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 tools/libxl/libxl_create.c            |   12 ++++---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 +++++++++----
 xen/arch/x86/irq.c                    |   50 +++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/arch/x86/x86_64/entry.S           |    7 ++++
 xen/common/domctl.c                   |    5 ++-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 ++++++++++++
 10 files changed, 100 insertions(+), 30 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:12:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:12:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJY4-00054D-Ku; Fri, 19 Apr 2013 22:12:52 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJY2-00053c-Dx
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:50 +0000
Received: from [193.109.254.147:30199] by server-2.bemta-14.messagelabs.com id
	9A/66-14115-161C1715; Fri, 19 Apr 2013 22:12:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1366409567!8700503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24647 invoked from network); 19 Apr 2013 22:12:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXz-0007AY-Ch
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJXz-0000Ld-9Q
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:47 +0000
Date: Fri, 19 Apr 2013 22:12:47 +0000
Message-Id: <E1UTJXz-0000Ld-9Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d8b5421f45c2b528bab1c8695271f99743b708fa
Merge: e83d6b9432af603200f065b499b8e4b78e92842d 545607eb3cfeb2abf5742d1bb869734f317fcfe5
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Apr 18 15:15:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Apr 18 15:15:26 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 tools/libxl/libxl_create.c            |   12 ++++---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 +++++++++----
 xen/arch/x86/irq.c                    |   50 +++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/arch/x86/x86_64/entry.S           |    7 ++++
 xen/common/domctl.c                   |    5 ++-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 ++++++++++++
 10 files changed, 100 insertions(+), 30 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYG-00056p-OD; Fri, 19 Apr 2013 22:13:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYG-00056a-37
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:04 +0000
Received: from [85.158.138.51:8245] by server-8.bemta-3.messagelabs.com id
	82/99-20604-B61C1715; Fri, 19 Apr 2013 22:12:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1366409577!22782230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15128 invoked from network); 19 Apr 2013 22:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJY9-0007Ah-Lq
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJY9-0000M7-I5
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:57 +0000
Date: Fri, 19 Apr 2013 22:12:57 +0000
Message-Id: <E1UTJY9-0000M7-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove IS_PRIV access check
	bypasses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 764012376a096a45bced88ee2ec1a6c17c6c22c7
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Apr 18 17:01:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 17:01:45 2013 +0200

    x86: remove IS_PRIV access check bypasses
    
    Several domctl functions dealing with rangesets contain a short-circuit
    bypass if the domain is privileged. Since the construction of domain 0
    permits access to all I/O ranges, the call to irq_access_permitted will
    normally return true even without the IS_PRIV check, and the presence of
    the IS_PRIV check prevents the creation of a privileged domain without
    access to specific devices or IO memory ranges.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c |    6 ++----
 xen/arch/x86/irq.c    |    3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 8fb4fa9..9580390 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -645,8 +645,7 @@ long arch_do_domctl(
             break;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
+        if ( !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
         ret = xsm_iomem_mapping(XSM_HOOK, d, mfn, mfn + nr_mfns - 1, add);
@@ -723,8 +722,7 @@ long arch_do_domctl(
         }
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
+        if ( !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
         ret = xsm_ioport_mapping(XSM_HOOK, d, fmp, fmp + np - 1, add);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index bbf4130..b0b0c65 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1891,8 +1891,7 @@ int map_domain_pirq(
 
     ASSERT(spin_is_locked(&d->event_lock));
 
-    if ( !IS_PRIV(current->domain) &&
-         !irq_access_permitted(current->domain, irq))
+    if ( !irq_access_permitted(current->domain, irq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYG-00056p-OD; Fri, 19 Apr 2013 22:13:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYG-00056a-37
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:04 +0000
Received: from [85.158.138.51:8245] by server-8.bemta-3.messagelabs.com id
	82/99-20604-B61C1715; Fri, 19 Apr 2013 22:12:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-174.messagelabs.com!1366409577!22782230!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15128 invoked from network); 19 Apr 2013 22:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJY9-0007Ah-Lq
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJY9-0000M7-I5
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:12:57 +0000
Date: Fri, 19 Apr 2013 22:12:57 +0000
Message-Id: <E1UTJY9-0000M7-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove IS_PRIV access check
	bypasses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 764012376a096a45bced88ee2ec1a6c17c6c22c7
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Thu Apr 18 17:01:45 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 17:01:45 2013 +0200

    x86: remove IS_PRIV access check bypasses
    
    Several domctl functions dealing with rangesets contain a short-circuit
    bypass if the domain is privileged. Since the construction of domain 0
    permits access to all I/O ranges, the call to irq_access_permitted will
    normally return true even without the IS_PRIV check, and the presence of
    the IS_PRIV check prevents the creation of a privileged domain without
    access to specific devices or IO memory ranges.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c |    6 ++----
 xen/arch/x86/irq.c    |    3 +--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 8fb4fa9..9580390 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -645,8 +645,7 @@ long arch_do_domctl(
             break;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
+        if ( !iomem_access_permitted(current->domain, mfn, mfn + nr_mfns - 1) )
             break;
 
         ret = xsm_iomem_mapping(XSM_HOOK, d, mfn, mfn + nr_mfns - 1, add);
@@ -723,8 +722,7 @@ long arch_do_domctl(
         }
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
+        if ( !ioports_access_permitted(current->domain, fmp, fmp + np - 1) )
             break;
 
         ret = xsm_ioport_mapping(XSM_HOOK, d, fmp, fmp + np - 1, add);
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index bbf4130..b0b0c65 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1891,8 +1891,7 @@ int map_domain_pirq(
 
     ASSERT(spin_is_locked(&d->event_lock));
 
-    if ( !IS_PRIV(current->domain) &&
-         !irq_access_permitted(current->domain, irq))
+    if ( !irq_access_permitted(current->domain, irq))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYO-00058m-Qt; Fri, 19 Apr 2013 22:13:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYM-00058M-Qr
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:12 +0000
Received: from [85.158.139.211:2253] by server-13.bemta-5.messagelabs.com id
	FB/AF-20553-571C1715; Fri, 19 Apr 2013 22:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1366409587!19614060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30873 invoked from network); 19 Apr 2013 22:13:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:13:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYJ-0007BD-QR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYJ-0000ND-Ox
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:07 +0000
Date: Fri, 19 Apr 2013 22:13:07 +0000
Message-Id: <E1UTJYJ-0000ND-Ox@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove IS_PRIV bypass on IRQ check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit abd10cf98fed1f8eb01b7826a171873a3b75c396
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Apr 19 10:50:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 10:50:08 2013 +0200

    x86: remove IS_PRIV bypass on IRQ check
    
    This prevents a process in dom0 from granting a domU access to an IRQ without
    adding the IRQ to the domU's list of permitted IRQs. This operation currently
    succeeds in dom0 but would fail if the device model were running in a stubdom,
    so making the failure consistent should ease debugging of the device-model
    stubdoms.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c |   29 +++++++++--------------------
 1 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 9580390..1f16ad2 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -565,9 +565,8 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        xen_domctl_bind_pt_irq_t * bind;
-
-        bind = &(domctl->u.bind_pt_irq);
+        xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
+        int irq;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
@@ -577,14 +576,10 @@ long arch_do_domctl(
         if ( ret )
             break;
 
+        irq = domain_pirq_to_irq(d, bind->machine_irq);
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-        {
-            int irq = domain_pirq_to_irq(d, bind->machine_irq);
-
-            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
-                break;
-        }
+        if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -601,18 +596,12 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        xen_domctl_bind_pt_irq_t * bind;
-
-        bind = &(domctl->u.bind_pt_irq);
+        xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
+        int irq = domain_pirq_to_irq(d, bind->machine_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-        {
-            int irq = domain_pirq_to_irq(d, bind->machine_irq);
-
-            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
-                break;
-        }
+        if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+            break;
 
         ret = xsm_unbind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYO-00058m-Qt; Fri, 19 Apr 2013 22:13:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYM-00058M-Qr
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:12 +0000
Received: from [85.158.139.211:2253] by server-13.bemta-5.messagelabs.com id
	FB/AF-20553-571C1715; Fri, 19 Apr 2013 22:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1366409587!19614060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30873 invoked from network); 19 Apr 2013 22:13:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:13:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYJ-0007BD-QR
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYJ-0000ND-Ox
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:07 +0000
Date: Fri, 19 Apr 2013 22:13:07 +0000
Message-Id: <E1UTJYJ-0000ND-Ox@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove IS_PRIV bypass on IRQ check
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit abd10cf98fed1f8eb01b7826a171873a3b75c396
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Fri Apr 19 10:50:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 10:50:08 2013 +0200

    x86: remove IS_PRIV bypass on IRQ check
    
    This prevents a process in dom0 from granting a domU access to an IRQ without
    adding the IRQ to the domU's list of permitted IRQs. This operation currently
    succeeds in dom0 but would fail if the device model were running in a stubdom,
    so making the failure consistent should ease debugging of the device-model
    stubdoms.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
 xen/arch/x86/domctl.c |   29 +++++++++--------------------
 1 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 9580390..1f16ad2 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -565,9 +565,8 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_bind_pt_irq:
     {
-        xen_domctl_bind_pt_irq_t * bind;
-
-        bind = &(domctl->u.bind_pt_irq);
+        xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
+        int irq;
 
         ret = -EINVAL;
         if ( !is_hvm_domain(d) )
@@ -577,14 +576,10 @@ long arch_do_domctl(
         if ( ret )
             break;
 
+        irq = domain_pirq_to_irq(d, bind->machine_irq);
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-        {
-            int irq = domain_pirq_to_irq(d, bind->machine_irq);
-
-            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
-                break;
-        }
+        if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+            break;
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -601,18 +596,12 @@ long arch_do_domctl(
 
     case XEN_DOMCTL_unbind_pt_irq:
     {
-        xen_domctl_bind_pt_irq_t * bind;
-
-        bind = &(domctl->u.bind_pt_irq);
+        xen_domctl_bind_pt_irq_t *bind = &domctl->u.bind_pt_irq;
+        int irq = domain_pirq_to_irq(d, bind->machine_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) )
-        {
-            int irq = domain_pirq_to_irq(d, bind->machine_irq);
-
-            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
-                break;
-        }
+        if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+            break;
 
         ret = xsm_unbind_pt_irq(XSM_HOOK, d, bind);
         if ( ret )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYc-0005BK-UT; Fri, 19 Apr 2013 22:13:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYb-0005B1-Oo
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:25 +0000
Received: from [85.158.137.99:55791] by server-12.bemta-3.messagelabs.com id
	8D/BC-01357-081C1715; Fri, 19 Apr 2013 22:13:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1366409598!1390574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 750 invoked from network); 19 Apr 2013 22:13:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:13:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYU-0007BM-0k
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYT-0000Nb-V6
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:17 +0000
Date: Fri, 19 Apr 2013 22:13:17 +0000
Message-Id: <E1UTJYT-0000Nb-V6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/S3: Fix cpu pool scheduling after
	suspend/resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9aa356bc9f7533c3cb7f02c823f532532876d444
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Fri Apr 19 12:29:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 12:29:01 2013 +0200

    x86/S3: Fix cpu pool scheduling after suspend/resume
    
    This review is another S3 scheduler problem with the system_state
    variable introduced with the following changeset:
    http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=269f543ea750ed567d18f2e819e5d5ce58eda5c5
    
    Specifically, the cpu_callback function that takes the CPU down during
    suspend, and back up during resume. We were seeing situations where,
    after S3, only CPU0 was in cpupool0. Guest performance suffered
    greatly, since all vcpus were only on a single pcpu. Guests under high
    CPU load showed the problem much more quickly than an idle guest.
    
    Removing this if condition forces the CPUs to go through the expected
    online/offline state, and be properly scheduled after S3.
    
    This also includes a necessary partial change proposed earlier by
    Tomasz Wroblewski here:
    http://lists.xen.org/archives/html/xen-devel/2013-01/msg02206.html
    
    It should also resolve the issues discussed in this thread:
    http://lists.xen.org/archives/html/xen-devel/2012-11/msg01801.html
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c       |   56 +++++++++++++++++++++++++++++++++++--------
 xen/include/xen/sched-if.h |    1 +
 2 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index b3d8f2b..2aaa486 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -41,16 +41,28 @@ static struct cpupool *alloc_cpupool_struct(void)
 {
     struct cpupool *c = xzalloc(struct cpupool);
 
-    if ( c && zalloc_cpumask_var(&c->cpu_valid) )
-        return c;
-    xfree(c);
-    return NULL;
+    if ( !c || !zalloc_cpumask_var(&c->cpu_valid) )
+    {
+        xfree(c);
+        c = NULL;
+    }
+    else if ( !zalloc_cpumask_var(&c->cpu_suspended) )
+    {
+        free_cpumask_var(c->cpu_valid);
+        xfree(c);
+        c = NULL;
+    }
+
+    return c;
 }
 
 static void free_cpupool_struct(struct cpupool *c)
 {
     if ( c )
+    {
+        free_cpumask_var(c->cpu_suspended);
         free_cpumask_var(c->cpu_valid);
+    }
     xfree(c);
 }
 
@@ -417,14 +429,32 @@ void cpupool_rm_domain(struct domain *d)
 
 /*
  * called to add a new cpu to pool admin
- * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0
+ * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0,
+ * unless we are resuming from S3, in which case we put the cpu back
+ * in the cpupool it was in prior to suspend.
  */
 static void cpupool_cpu_add(unsigned int cpu)
 {
     spin_lock(&cpupool_lock);
     cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
-    cpupool_assign_cpu_locked(cpupool0, cpu);
+
+    if ( system_state == SYS_STATE_resume )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+        {
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_suspended ) )
+            {
+                cpupool_assign_cpu_locked(*c, cpu);
+                cpumask_clear_cpu(cpu, (*c)->cpu_suspended);
+            }
+        }
+    }
+
+    if ( cpumask_test_cpu(cpu, &cpupool_free_cpus) )
+        cpupool_assign_cpu_locked(cpupool0, cpu);
     spin_unlock(&cpupool_lock);
 }
 
@@ -436,7 +466,7 @@ static void cpupool_cpu_add(unsigned int cpu)
 static int cpupool_cpu_remove(unsigned int cpu)
 {
     int ret = 0;
-	
+
     spin_lock(&cpupool_lock);
     if ( !cpumask_test_cpu(cpu, cpupool0->cpu_valid))
         ret = -EBUSY;
@@ -633,9 +663,14 @@ static int cpu_callback(
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
-    if ( (system_state == SYS_STATE_suspend) ||
-         (system_state == SYS_STATE_resume) )
-        goto out;
+    if ( system_state == SYS_STATE_suspend )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
+                cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+    }
 
     switch ( action )
     {
@@ -650,7 +685,6 @@ static int cpu_callback(
         break;
     }
 
-out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 2023ea3..ad4d80c 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -203,6 +203,7 @@ struct cpupool
 {
     int              cpupool_id;
     cpumask_var_t    cpu_valid;      /* all cpus assigned to pool */
+    cpumask_var_t    cpu_suspended;  /* cpus in S3 that should be in this pool */
     struct cpupool   *next;
     unsigned int     n_dom;
     struct scheduler *sched;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:28 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYc-0005BK-UT; Fri, 19 Apr 2013 22:13:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYb-0005B1-Oo
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:25 +0000
Received: from [85.158.137.99:55791] by server-12.bemta-3.messagelabs.com id
	8D/BC-01357-081C1715; Fri, 19 Apr 2013 22:13:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1366409598!1390574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 750 invoked from network); 19 Apr 2013 22:13:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:13:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYU-0007BM-0k
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYT-0000Nb-V6
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:17 +0000
Date: Fri, 19 Apr 2013 22:13:17 +0000
Message-Id: <E1UTJYT-0000Nb-V6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/S3: Fix cpu pool scheduling after
	suspend/resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9aa356bc9f7533c3cb7f02c823f532532876d444
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Fri Apr 19 12:29:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 12:29:01 2013 +0200

    x86/S3: Fix cpu pool scheduling after suspend/resume
    
    This review is another S3 scheduler problem with the system_state
    variable introduced with the following changeset:
    http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=269f543ea750ed567d18f2e819e5d5ce58eda5c5
    
    Specifically, the cpu_callback function that takes the CPU down during
    suspend, and back up during resume. We were seeing situations where,
    after S3, only CPU0 was in cpupool0. Guest performance suffered
    greatly, since all vcpus were only on a single pcpu. Guests under high
    CPU load showed the problem much more quickly than an idle guest.
    
    Removing this if condition forces the CPUs to go through the expected
    online/offline state, and be properly scheduled after S3.
    
    This also includes a necessary partial change proposed earlier by
    Tomasz Wroblewski here:
    http://lists.xen.org/archives/html/xen-devel/2013-01/msg02206.html
    
    It should also resolve the issues discussed in this thread:
    http://lists.xen.org/archives/html/xen-devel/2012-11/msg01801.html
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c       |   56 +++++++++++++++++++++++++++++++++++--------
 xen/include/xen/sched-if.h |    1 +
 2 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index b3d8f2b..2aaa486 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -41,16 +41,28 @@ static struct cpupool *alloc_cpupool_struct(void)
 {
     struct cpupool *c = xzalloc(struct cpupool);
 
-    if ( c && zalloc_cpumask_var(&c->cpu_valid) )
-        return c;
-    xfree(c);
-    return NULL;
+    if ( !c || !zalloc_cpumask_var(&c->cpu_valid) )
+    {
+        xfree(c);
+        c = NULL;
+    }
+    else if ( !zalloc_cpumask_var(&c->cpu_suspended) )
+    {
+        free_cpumask_var(c->cpu_valid);
+        xfree(c);
+        c = NULL;
+    }
+
+    return c;
 }
 
 static void free_cpupool_struct(struct cpupool *c)
 {
     if ( c )
+    {
+        free_cpumask_var(c->cpu_suspended);
         free_cpumask_var(c->cpu_valid);
+    }
     xfree(c);
 }
 
@@ -417,14 +429,32 @@ void cpupool_rm_domain(struct domain *d)
 
 /*
  * called to add a new cpu to pool admin
- * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0
+ * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0,
+ * unless we are resuming from S3, in which case we put the cpu back
+ * in the cpupool it was in prior to suspend.
  */
 static void cpupool_cpu_add(unsigned int cpu)
 {
     spin_lock(&cpupool_lock);
     cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
-    cpupool_assign_cpu_locked(cpupool0, cpu);
+
+    if ( system_state == SYS_STATE_resume )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+        {
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_suspended ) )
+            {
+                cpupool_assign_cpu_locked(*c, cpu);
+                cpumask_clear_cpu(cpu, (*c)->cpu_suspended);
+            }
+        }
+    }
+
+    if ( cpumask_test_cpu(cpu, &cpupool_free_cpus) )
+        cpupool_assign_cpu_locked(cpupool0, cpu);
     spin_unlock(&cpupool_lock);
 }
 
@@ -436,7 +466,7 @@ static void cpupool_cpu_add(unsigned int cpu)
 static int cpupool_cpu_remove(unsigned int cpu)
 {
     int ret = 0;
-	
+
     spin_lock(&cpupool_lock);
     if ( !cpumask_test_cpu(cpu, cpupool0->cpu_valid))
         ret = -EBUSY;
@@ -633,9 +663,14 @@ static int cpu_callback(
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
-    if ( (system_state == SYS_STATE_suspend) ||
-         (system_state == SYS_STATE_resume) )
-        goto out;
+    if ( system_state == SYS_STATE_suspend )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
+                cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+    }
 
     switch ( action )
     {
@@ -650,7 +685,6 @@ static int cpu_callback(
         break;
     }
 
-out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index 2023ea3..ad4d80c 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -203,6 +203,7 @@ struct cpupool
 {
     int              cpupool_id;
     cpumask_var_t    cpu_valid;      /* all cpus assigned to pool */
+    cpumask_var_t    cpu_suspended;  /* cpus in S3 that should be in this pool */
     struct cpupool   *next;
     unsigned int     n_dom;
     struct scheduler *sched;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYo-0005DY-1P; Fri, 19 Apr 2013 22:13:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYm-0005D4-Ox
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:36 +0000
Received: from [85.158.138.51:8816] by server-16.bemta-3.messagelabs.com id
	E8/DA-20692-A81C1715; Fri, 19 Apr 2013 22:13:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1366409608!28143553!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6991 invoked from network); 19 Apr 2013 22:13:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:13:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYe-0007BR-74
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYe-0000O0-4S
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:28 +0000
Date: Fri, 19 Apr 2013 22:13:28 +0000
Message-Id: <E1UTJYe-0000O0-4S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: adjust correct table when there's
	no posted interrupt support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4e1e0ecc023caf4cf3b87a4aa4d5e210760f4e8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 19 12:31:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 12:31:18 2013 +0200

    VMX: adjust correct table when there's no posted interrupt support
    
    The caller of start_vmx() will overwrite hvm_funcs, so there's no point
    in adjusting that table in start_vmx().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 799b60e..6866cd0 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1585,8 +1585,8 @@ struct hvm_function_table * __init start_vmx(void)
         alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
     else
     {
-        hvm_funcs.deliver_posted_intr = NULL;
-        hvm_funcs.sync_pir_to_irr = NULL;
+        vmx_function_table.deliver_posted_intr = NULL;
+        vmx_function_table.sync_pir_to_irr = NULL;
     }
 
     setup_vmcs_dump();
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Apr 19 22:13:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 19 Apr 2013 22:13:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTJYo-0005DY-1P; Fri, 19 Apr 2013 22:13:38 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYm-0005D4-Ox
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:36 +0000
Received: from [85.158.138.51:8816] by server-16.bemta-3.messagelabs.com id
	E8/DA-20692-A81C1715; Fri, 19 Apr 2013 22:13:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1366409608!28143553!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6991 invoked from network); 19 Apr 2013 22:13:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Apr 2013 22:13:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYe-0007BR-74
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTJYe-0000O0-4S
	for xen-changelog@lists.xensource.com; Fri, 19 Apr 2013 22:13:28 +0000
Date: Fri, 19 Apr 2013 22:13:28 +0000
Message-Id: <E1UTJYe-0000O0-4S@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VMX: adjust correct table when there's
	no posted interrupt support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e4e1e0ecc023caf4cf3b87a4aa4d5e210760f4e8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 19 12:31:18 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 12:31:18 2013 +0200

    VMX: adjust correct table when there's no posted interrupt support
    
    The caller of start_vmx() will overwrite hvm_funcs, so there's no point
    in adjusting that table in start_vmx().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/vmx/vmx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 799b60e..6866cd0 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1585,8 +1585,8 @@ struct hvm_function_table * __init start_vmx(void)
         alloc_direct_apic_vector(&posted_intr_vector, event_check_interrupt);
     else
     {
-        hvm_funcs.deliver_posted_intr = NULL;
-        hvm_funcs.sync_pir_to_irr = NULL;
+        vmx_function_table.deliver_posted_intr = NULL;
+        vmx_function_table.sync_pir_to_irr = NULL;
     }
 
     setup_vmcs_dump();
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNbv-00032P-L3; Sat, 20 Apr 2013 02:33:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNbu-00032I-Q1
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:06 +0000
Received: from [193.109.254.147:34777] by server-10.bemta-14.messagelabs.com
	id 0D/14-11798-26EF1715; Sat, 20 Apr 2013 02:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1366425184!1794962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12709 invoked from network); 20 Apr 2013 02:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNbs-0000BU-56
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNbr-0006gK-W9
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:04 +0000
Date: Sat, 20 Apr 2013 02:33:03 +0000
Message-Id: <E1UTNbr-0006gK-W9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: clear EFLAGS.NT in SYSENTER
	entry path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 584eb7c15e4c94baaba93468776572dd7373a33c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:23:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:23:07 2013 +0200

    x86: clear EFLAGS.NT in SYSENTER entry path
    
    ... as it causes problems if we happen to exit back via IRET: In the
    course of trying to handle the fault, the hypervisor creates a stack
    frame by hand, and uses PUSHFQ to set the respective EFLAGS field, but
    expects to be able to IRET through that stack frame to the second
    portion of the fixup code (which causes a #GP due to the stored EFLAGS
    having NT set).
    
    And even if this worked (e.g if we cleared NT in that path), it would
    then (through the fail safe callback) cause a #GP in the guest with the
    SYSENTER handler's first instruction as the source, which in turn would
    allow guest user mode code to crash the guest kernel.
    
    Inject a #GP on the fake (NULL) address of the SYSENTER instruction
    instead, just like in the case where the guest kernel didn't register
    a corresponding entry point.
    
    On 32-bit we also need to make sure we clear SYSENTER_CS for all CPUs
    (neither #RESET nor #INIT guarantee this).
    
    This is CVE-2013-1917 / XSA-44.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fdac9515607b757c044e7ef0d61b1453ef999b08
    master date: 2013-04-18 16:00:35 +0200
---
 xen/arch/x86/acpi/suspend.c |    8 ++++++--
 xen/arch/x86/cpu/common.c   |    5 ++++-
 xen/arch/x86/x86_64/entry.S |    7 +++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index 6f2ff5b..1c3aff4 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -81,8 +81,12 @@ void restore_rest_processor_state(void)
     }
 
 #else /* !defined(CONFIG_X86_64) */
-    if ( supervisor_mode_kernel && cpu_has_sep )
-        wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    if ( cpu_has_sep )
+    {
+        wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+        if ( supervisor_mode_kernel )
+            wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    }
 #endif
 
     /* Maybe load the debug registers. */
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index c3ddab6..a3a6b96 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -715,8 +715,11 @@ void __cpuinit cpu_init(void)
 #if defined(CONFIG_X86_32)
 	t->ss0  = __HYPERVISOR_DS;
 	t->esp0 = get_stack_bottom();
-	if ( supervisor_mode_kernel && cpu_has_sep )
+	if ( cpu_has_sep ) {
+	    wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+	    if ( supervisor_mode_kernel )
 		wrmsr(MSR_IA32_SYSENTER_ESP, &t->esp1, 0);
+	}
 #elif defined(CONFIG_X86_64)
 	/* Bottom-of-stack must be 16-byte aligned! */
 	BUG_ON((get_stack_bottom() & 15) != 0);
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 2b8c99a..7b392d8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -288,7 +288,14 @@ sysenter_eflags_saved:
         movl  $3,UREGS_cs(%rsp)  /* ring 3 null cs */
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
+        testl $X86_EFLAGS_NT,UREGS_eflags(%rsp)
         leaq  VCPU_trap_bounce(%rbx),%rdx
+UNLIKELY_START(nz, sysenter_nt_set)
+        pushfq
+        andl  $~X86_EFLAGS_NT,(%rsp)
+        popfq
+        xorl  %eax,%eax
+UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:18 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNbv-00032P-L3; Sat, 20 Apr 2013 02:33:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNbu-00032I-Q1
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:06 +0000
Received: from [193.109.254.147:34777] by server-10.bemta-14.messagelabs.com
	id 0D/14-11798-26EF1715; Sat, 20 Apr 2013 02:33:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1366425184!1794962!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12709 invoked from network); 20 Apr 2013 02:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNbs-0000BU-56
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNbr-0006gK-W9
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:04 +0000
Date: Sat, 20 Apr 2013 02:33:03 +0000
Message-Id: <E1UTNbr-0006gK-W9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: clear EFLAGS.NT in SYSENTER
	entry path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 584eb7c15e4c94baaba93468776572dd7373a33c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:23:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:23:07 2013 +0200

    x86: clear EFLAGS.NT in SYSENTER entry path
    
    ... as it causes problems if we happen to exit back via IRET: In the
    course of trying to handle the fault, the hypervisor creates a stack
    frame by hand, and uses PUSHFQ to set the respective EFLAGS field, but
    expects to be able to IRET through that stack frame to the second
    portion of the fixup code (which causes a #GP due to the stored EFLAGS
    having NT set).
    
    And even if this worked (e.g if we cleared NT in that path), it would
    then (through the fail safe callback) cause a #GP in the guest with the
    SYSENTER handler's first instruction as the source, which in turn would
    allow guest user mode code to crash the guest kernel.
    
    Inject a #GP on the fake (NULL) address of the SYSENTER instruction
    instead, just like in the case where the guest kernel didn't register
    a corresponding entry point.
    
    On 32-bit we also need to make sure we clear SYSENTER_CS for all CPUs
    (neither #RESET nor #INIT guarantee this).
    
    This is CVE-2013-1917 / XSA-44.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citirx.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: fdac9515607b757c044e7ef0d61b1453ef999b08
    master date: 2013-04-18 16:00:35 +0200
---
 xen/arch/x86/acpi/suspend.c |    8 ++++++--
 xen/arch/x86/cpu/common.c   |    5 ++++-
 xen/arch/x86/x86_64/entry.S |    7 +++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c
index 6f2ff5b..1c3aff4 100644
--- a/xen/arch/x86/acpi/suspend.c
+++ b/xen/arch/x86/acpi/suspend.c
@@ -81,8 +81,12 @@ void restore_rest_processor_state(void)
     }
 
 #else /* !defined(CONFIG_X86_64) */
-    if ( supervisor_mode_kernel && cpu_has_sep )
-        wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    if ( cpu_has_sep )
+    {
+        wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+        if ( supervisor_mode_kernel )
+            wrmsr(MSR_IA32_SYSENTER_ESP, &this_cpu(init_tss).esp1, 0);
+    }
 #endif
 
     /* Maybe load the debug registers. */
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index c3ddab6..a3a6b96 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -715,8 +715,11 @@ void __cpuinit cpu_init(void)
 #if defined(CONFIG_X86_32)
 	t->ss0  = __HYPERVISOR_DS;
 	t->esp0 = get_stack_bottom();
-	if ( supervisor_mode_kernel && cpu_has_sep )
+	if ( cpu_has_sep ) {
+	    wrmsr(MSR_IA32_SYSENTER_CS, 0, 0);
+	    if ( supervisor_mode_kernel )
 		wrmsr(MSR_IA32_SYSENTER_ESP, &t->esp1, 0);
+	}
 #elif defined(CONFIG_X86_64)
 	/* Bottom-of-stack must be 16-byte aligned! */
 	BUG_ON((get_stack_bottom() & 15) != 0);
diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index 2b8c99a..7b392d8 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -288,7 +288,14 @@ sysenter_eflags_saved:
         movl  $3,UREGS_cs(%rsp)  /* ring 3 null cs */
         movq  VCPU_sysenter_addr(%rbx),%rax
         setne %cl
+        testl $X86_EFLAGS_NT,UREGS_eflags(%rsp)
         leaq  VCPU_trap_bounce(%rbx),%rdx
+UNLIKELY_START(nz, sysenter_nt_set)
+        pushfq
+        andl  $~X86_EFLAGS_NT,(%rsp)
+        popfq
+        xorl  %eax,%eax
+UNLIKELY_END(sysenter_nt_set)
         testq %rax,%rax
         leal  (,%rcx,TBF_INTERRUPT),%ecx
 UNLIKELY_START(z, sysenter_gpf)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNc8-000339-OC; Sat, 20 Apr 2013 02:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNc7-00032n-3X
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:19 +0000
Received: from [85.158.143.99:14581] by server-3.bemta-4.messagelabs.com id
	11/9B-02186-D6EF1715; Sat, 20 Apr 2013 02:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1366425195!23860217!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22880 invoked from network); 20 Apr 2013 02:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNc3-0000BX-D5
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNc2-0006gi-C4
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:14 +0000
Date: Sat, 20 Apr 2013 02:33:14 +0000
Message-Id: <E1UTNc2-0006gi-C4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: fix various issues with
	handling guest IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d3d1288618ec903ad6a0e994ddfe0975cbac1584
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:24:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:24:08 2013 +0200

    x86: fix various issues with handling guest IRQs
    
    - properly revoke IRQ access in map_domain_pirq() error path
    - don't permit replacing an in use IRQ
    - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI
    - track IRQ access permission in host IRQ terms, not guest IRQ ones
      (and with that, also disallow Dom0 access to IRQ0)
    
    This is CVE-2013-1919 / XSA-46.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    master commit: 545607eb3cfeb2abf5742d1bb869734f317fcfe5
    master date: 2013-04-18 16:11:23 +0200
---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 ++++++++++----
 xen/arch/x86/irq.c                    |   46 ++++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/common/domctl.c                   |    4 +-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 +++++++++++++
 8 files changed, 82 insertions(+), 24 deletions(-)

diff --git a/tools/python/xen/xend/server/irqif.py b/tools/python/xen/xend/server/irqif.py
index ae0b1ff..723f346 100644
--- a/tools/python/xen/xend/server/irqif.py
+++ b/tools/python/xen/xend/server/irqif.py
@@ -73,6 +73,12 @@ class IRQController(DevController):
        
         pirq = get_param('irq')
 
+        rc = xc.physdev_map_pirq(domid = self.getDomid(),
+                                 index = pirq,
+                                 pirq  = pirq)
+        if rc < 0:
+            raise VmError('irq: Failed to map irq %x' % (pirq))
+
         rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
             #todo non-fatal
             raise VmError(
                 'irq: Failed to configure irq: %d' % (pirq))
-        rc = xc.physdev_map_pirq(domid = self.getDomid(),
-                                index = pirq,
-                                pirq  = pirq)
-        if rc < 0:
-            raise VmError(
-                'irq: Failed to map irq %x' % (pirq))
         back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
         return (self.allocateDeviceID(), back, {})
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 8285048..93215d2 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1201,7 +1201,7 @@ int __init construct_dom0(
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 0, d->nr_pirqs - 1);
+    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index b285003..9090139 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -908,9 +908,13 @@ long arch_do_domctl(
             goto bind_out;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto bind_out;
+        }
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -938,9 +942,13 @@ long arch_do_domctl(
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto unbind_out;
+        }
 
         if ( iommu_enabled )
         {
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 3f6b6a7..7e2c212 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -174,6 +174,15 @@ int create_irq(void)
 out:
      spin_unlock_irqrestore(&vector_lock, flags);
 
+    if ( irq > 0 && dom0 )
+    {
+        ret = irq_permit_access(dom0, irq);
+        if ( ret )
+            printk(XENLOG_G_ERR
+                   "Could not grant Dom0 access to IRQ%d (error %d)\n",
+                   irq, ret);
+    }
+
     return irq;
 }
 
@@ -258,6 +267,17 @@ void clear_irq_vector(int irq)
 void destroy_irq(unsigned int irq)
 {
     BUG_ON(!MSI_IRQ(irq));
+
+    if ( dom0 )
+    {
+        int err = irq_deny_access(dom0, irq);
+
+        if ( err )
+            printk(XENLOG_G_ERR
+                   "Could not revoke Dom0 access to IRQ%u (error %d)\n",
+                   irq, err);
+    }
+
     dynamic_irq_cleanup(irq);
     clear_irq_vector(irq);
 }
@@ -1604,7 +1624,7 @@ int map_domain_pirq(
 
     if ( !IS_PRIV(current->domain) &&
          !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+           irq_access_permitted(current->domain, irq)))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
@@ -1625,11 +1645,12 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = irq_permit_access(d, pirq);
+    ret = irq_permit_access(d, irq);
     if ( ret )
     {
-        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not permit access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
         return ret;
     }
 
@@ -1651,8 +1672,14 @@ int map_domain_pirq(
         spin_lock_irqsave(&desc->lock, flags);
 
         if ( desc->handler != &no_irq_type )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
+            pci_disable_msi(msi_desc);
+            ret = -EBUSY;
+            goto done;
+        }
         desc->handler = &pci_msi_type;
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
              && !desc->chip_data->used_vectors )
@@ -1680,6 +1707,10 @@ int map_domain_pirq(
     }
 
 done:
+    if ( ret && irq_deny_access(d, irq) )
+        printk(XENLOG_G_ERR
+               "dom%d: could not revoke access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
     return ret;
 }
 
@@ -1736,10 +1767,11 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     if (msi_desc)
         msi_free_irq(msi_desc);
 
-    ret = irq_deny_access(d, pirq);
+    ret = irq_deny_access(d, irq);
     if ( ret )
-        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not deny access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
 
     if ( desc->handler == &pci_msi_type )
         desc->handler = &no_irq_type;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 8feb84a..bf1ff16 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -147,7 +147,7 @@ static int physdev_map_pirq(struct physdev_map_pirq *map)
         if ( irq == -1 )
             irq = create_irq();
 
-        if ( irq < 0 || irq >= nr_irqs )
+        if ( irq < nr_irqs_gsi || irq >= nr_irqs )
         {
             dprintk(XENLOG_G_ERR, "dom%d: can't create irq for msi!\n",
                     d->domain_id);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 981cb1a..d9a1f53 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -854,9 +854,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( op->u.irq_permission.allow_access )
-            ret = irq_permit_access(d, pirq);
+            ret = pirq_permit_access(d, pirq);
         else
-            ret = irq_deny_access(d, pirq);
+            ret = pirq_deny_access(d, pirq);
 
         rcu_unlock_domain(d);
     }
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 5c7bdb6..e4a779d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -332,7 +332,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
 
-    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+    if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
         return -EPERM;
 
     spin_lock(&d->event_lock);
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index 63bb49f..b755ecb 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,4 +28,22 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
+#define pirq_permit_access(d, i) ({                     \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_deny_access(d, i) ({                       \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_access_permitted(d, i) ({                  \
+    struct domain *d__ = (d);                           \
+    rangeset_contains_singleton(d__->irq_caps,          \
+                                domain_pirq_to_irq(d__, i));\
+})
+
 #endif /* __XEN_IOCAP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:26 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNc8-000339-OC; Sat, 20 Apr 2013 02:33:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNc7-00032n-3X
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:19 +0000
Received: from [85.158.143.99:14581] by server-3.bemta-4.messagelabs.com id
	11/9B-02186-D6EF1715; Sat, 20 Apr 2013 02:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-216.messagelabs.com!1366425195!23860217!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22880 invoked from network); 20 Apr 2013 02:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNc3-0000BX-D5
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNc2-0006gi-C4
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:14 +0000
Date: Sat, 20 Apr 2013 02:33:14 +0000
Message-Id: <E1UTNc2-0006gi-C4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] x86: fix various issues with
	handling guest IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d3d1288618ec903ad6a0e994ddfe0975cbac1584
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Apr 18 16:24:08 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 16:24:08 2013 +0200

    x86: fix various issues with handling guest IRQs
    
    - properly revoke IRQ access in map_domain_pirq() error path
    - don't permit replacing an in use IRQ
    - don't accept inputs in the GSI range for MAP_PIRQ_TYPE_MSI
    - track IRQ access permission in host IRQ terms, not guest IRQ ones
      (and with that, also disallow Dom0 access to IRQ0)
    
    This is CVE-2013-1919 / XSA-46.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    master commit: 545607eb3cfeb2abf5742d1bb869734f317fcfe5
    master date: 2013-04-18 16:11:23 +0200
---
 tools/python/xen/xend/server/irqif.py |   12 ++++----
 xen/arch/x86/domain_build.c           |    2 +-
 xen/arch/x86/domctl.c                 |   20 ++++++++++----
 xen/arch/x86/irq.c                    |   46 ++++++++++++++++++++++++++++-----
 xen/arch/x86/physdev.c                |    2 +-
 xen/common/domctl.c                   |    4 +-
 xen/common/event_channel.c            |    2 +-
 xen/include/xen/iocap.h               |   18 +++++++++++++
 8 files changed, 82 insertions(+), 24 deletions(-)

diff --git a/tools/python/xen/xend/server/irqif.py b/tools/python/xen/xend/server/irqif.py
index ae0b1ff..723f346 100644
--- a/tools/python/xen/xend/server/irqif.py
+++ b/tools/python/xen/xend/server/irqif.py
@@ -73,6 +73,12 @@ class IRQController(DevController):
        
         pirq = get_param('irq')
 
+        rc = xc.physdev_map_pirq(domid = self.getDomid(),
+                                 index = pirq,
+                                 pirq  = pirq)
+        if rc < 0:
+            raise VmError('irq: Failed to map irq %x' % (pirq))
+
         rc = xc.domain_irq_permission(domid        = self.getDomid(),
                                       pirq         = pirq,
                                       allow_access = True)
@@ -81,12 +87,6 @@ class IRQController(DevController):
             #todo non-fatal
             raise VmError(
                 'irq: Failed to configure irq: %d' % (pirq))
-        rc = xc.physdev_map_pirq(domid = self.getDomid(),
-                                index = pirq,
-                                pirq  = pirq)
-        if rc < 0:
-            raise VmError(
-                'irq: Failed to map irq %x' % (pirq))
         back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
         return (self.allocateDeviceID(), back, {})
 
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 8285048..93215d2 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1201,7 +1201,7 @@ int __init construct_dom0(
     /* DOM0 is permitted full I/O capabilities. */
     rc |= ioports_permit_access(dom0, 0, 0xFFFF);
     rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 0, d->nr_pirqs - 1);
+    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index b285003..9090139 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -908,9 +908,13 @@ long arch_do_domctl(
             goto bind_out;
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto bind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto bind_out;
+        }
 
         ret = -ESRCH;
         if ( iommu_enabled )
@@ -938,9 +942,13 @@ long arch_do_domctl(
         bind = &(domctl->u.bind_pt_irq);
 
         ret = -EPERM;
-        if ( !IS_PRIV(current->domain) &&
-             !irq_access_permitted(current->domain, bind->machine_irq) )
-            goto unbind_out;
+        if ( !IS_PRIV(current->domain) )
+        {
+            int irq = domain_pirq_to_irq(d, bind->machine_irq);
+
+            if ( irq <= 0 || !irq_access_permitted(current->domain, irq) )
+                goto unbind_out;
+        }
 
         if ( iommu_enabled )
         {
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 3f6b6a7..7e2c212 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -174,6 +174,15 @@ int create_irq(void)
 out:
      spin_unlock_irqrestore(&vector_lock, flags);
 
+    if ( irq > 0 && dom0 )
+    {
+        ret = irq_permit_access(dom0, irq);
+        if ( ret )
+            printk(XENLOG_G_ERR
+                   "Could not grant Dom0 access to IRQ%d (error %d)\n",
+                   irq, ret);
+    }
+
     return irq;
 }
 
@@ -258,6 +267,17 @@ void clear_irq_vector(int irq)
 void destroy_irq(unsigned int irq)
 {
     BUG_ON(!MSI_IRQ(irq));
+
+    if ( dom0 )
+    {
+        int err = irq_deny_access(dom0, irq);
+
+        if ( err )
+            printk(XENLOG_G_ERR
+                   "Could not revoke Dom0 access to IRQ%u (error %d)\n",
+                   irq, err);
+    }
+
     dynamic_irq_cleanup(irq);
     clear_irq_vector(irq);
 }
@@ -1604,7 +1624,7 @@ int map_domain_pirq(
 
     if ( !IS_PRIV(current->domain) &&
          !(IS_PRIV_FOR(current->domain, d) &&
-           irq_access_permitted(current->domain, pirq)))
+           irq_access_permitted(current->domain, irq)))
         return -EPERM;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs || irq < 0 || irq >= nr_irqs )
@@ -1625,11 +1645,12 @@ int map_domain_pirq(
         return 0;
     }
 
-    ret = irq_permit_access(d, pirq);
+    ret = irq_permit_access(d, irq);
     if ( ret )
     {
-        dprintk(XENLOG_G_ERR, "dom%d: could not permit access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not permit access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
         return ret;
     }
 
@@ -1651,8 +1672,14 @@ int map_domain_pirq(
         spin_lock_irqsave(&desc->lock, flags);
 
         if ( desc->handler != &no_irq_type )
+        {
+            spin_unlock_irqrestore(&desc->lock, flags);
             dprintk(XENLOG_G_ERR, "dom%d: irq %d in use\n",
                     d->domain_id, irq);
+            pci_disable_msi(msi_desc);
+            ret = -EBUSY;
+            goto done;
+        }
         desc->handler = &pci_msi_type;
         if ( opt_irq_vector_map == OPT_IRQ_VECTOR_MAP_PERDEV
              && !desc->chip_data->used_vectors )
@@ -1680,6 +1707,10 @@ int map_domain_pirq(
     }
 
 done:
+    if ( ret && irq_deny_access(d, irq) )
+        printk(XENLOG_G_ERR
+               "dom%d: could not revoke access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
     return ret;
 }
 
@@ -1736,10 +1767,11 @@ int unmap_domain_pirq(struct domain *d, int pirq)
     if (msi_desc)
         msi_free_irq(msi_desc);
 
-    ret = irq_deny_access(d, pirq);
+    ret = irq_deny_access(d, irq);
     if ( ret )
-        dprintk(XENLOG_G_ERR, "dom%d: could not deny access to irq %d\n",
-                d->domain_id, pirq);
+        printk(XENLOG_G_ERR
+               "dom%d: could not deny access to IRQ%d (pirq %d)\n",
+               d->domain_id, irq, pirq);
 
     if ( desc->handler == &pci_msi_type )
         desc->handler = &no_irq_type;
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 8feb84a..bf1ff16 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -147,7 +147,7 @@ static int physdev_map_pirq(struct physdev_map_pirq *map)
         if ( irq == -1 )
             irq = create_irq();
 
-        if ( irq < 0 || irq >= nr_irqs )
+        if ( irq < nr_irqs_gsi || irq >= nr_irqs )
         {
             dprintk(XENLOG_G_ERR, "dom%d: can't create irq for msi!\n",
                     d->domain_id);
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 981cb1a..d9a1f53 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -854,9 +854,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
         if ( pirq >= d->nr_pirqs )
             ret = -EINVAL;
         else if ( op->u.irq_permission.allow_access )
-            ret = irq_permit_access(d, pirq);
+            ret = pirq_permit_access(d, pirq);
         else
-            ret = irq_deny_access(d, pirq);
+            ret = pirq_deny_access(d, pirq);
 
         rcu_unlock_domain(d);
     }
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 5c7bdb6..e4a779d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -332,7 +332,7 @@ static long evtchn_bind_pirq(evtchn_bind_pirq_t *bind)
     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
         return -EINVAL;
 
-    if ( !is_hvm_domain(d) && !irq_access_permitted(d, pirq) )
+    if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
         return -EPERM;
 
     spin_lock(&d->event_lock);
diff --git a/xen/include/xen/iocap.h b/xen/include/xen/iocap.h
index 63bb49f..b755ecb 100644
--- a/xen/include/xen/iocap.h
+++ b/xen/include/xen/iocap.h
@@ -28,4 +28,22 @@
 #define irq_access_permitted(d, i)                      \
     rangeset_contains_singleton((d)->irq_caps, i)
 
+#define pirq_permit_access(d, i) ({                     \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_add_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_deny_access(d, i) ({                       \
+    struct domain *d__ = (d);                           \
+    int i__ = domain_pirq_to_irq(d__, i);               \
+    i__ > 0 ? rangeset_remove_singleton(d__->irq_caps, i__)\
+            : -EINVAL;                                  \
+})
+#define pirq_access_permitted(d, i) ({                  \
+    struct domain *d__ = (d);                           \
+    rangeset_contains_singleton(d__->irq_caps,          \
+                                domain_pirq_to_irq(d__, i));\
+})
+
 #endif /* __XEN_IOCAP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNcH-00034C-TW; Sat, 20 Apr 2013 02:33:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcG-000341-J5
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:28 +0000
Received: from [193.109.254.147:47546] by server-12.bemta-14.messagelabs.com
	id 52/BB-05449-77EF1715; Sat, 20 Apr 2013 02:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1366425205!6255042!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9675 invoked from network); 20 Apr 2013 02:33:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcD-0000Bb-Qq
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcD-0006hn-JU
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:25 +0000
Date: Sat, 20 Apr 2013 02:33:25 +0000
Message-Id: <E1UTNcD-0006hn-JU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] Fix rcu domain locking for
	transitive grants
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a12ed396652c22988e0e7a3f5bd57c882872da8e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Apr 18 17:38:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 17:38:17 2013 +0200

    Fix rcu domain locking for transitive grants
    
    When acquiring a transitive grant for copy then the owning domain
    needs to be locked down as well as the granting domain. This was being
    done, but the unlocking was not. The acquire code now stores the
    struct domain * of the owning domain (rather than the domid) in the
    active entry in the granting domain. The release code then does the
    unlock on the owning domain.  Note that I believe I also fixed a bug
    where, for non-transitive grants the active entry contained a
    reference to the acquiring domain rather than the granting
    domain. From my reading of the code this would stop the release code
    for transitive grants from terminating its recursion correctly.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    master commit: f544bf377ee829e1342abd818ac30478c6f3a134
    master date: 2011-03-08 16:30:30 +0000
    
    Also, for non-transitive grants we now avoid incorrectly recursing
    in __release_grant_for_copy.
    
    This is CVE-2013-1964 / XSA-50.
    
    Reported-by: Manuel Bouyer <bouyer@antioche.eu.org>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Manuel Bouyer <bouyer@antioche.eu.org>
---
 xen/common/grant_table.c      |   55 ++++++++++++++++++----------------------
 xen/include/xen/grant_table.h |    2 +-
 2 files changed, 26 insertions(+), 31 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index a180aef..e0f91ab 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -598,7 +598,7 @@ __gnttab_map_grant_ref(
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
-            act->trans_dom = rd->domain_id;
+            act->trans_domain = rd;
             act->trans_gref = op->ref;
         }
     }
@@ -1629,11 +1629,10 @@ __release_grant_for_copy(
     struct active_grant_entry *act;
     unsigned long r_frame;
     uint16_t *status;
-    domid_t trans_domid;
     grant_ref_t trans_gref;
     int released_read;
     int released_write;
-    struct domain *trans_dom;
+    struct domain *td;
 
     released_read = 0;
     released_write = 0;
@@ -1647,15 +1646,13 @@ __release_grant_for_copy(
     if (rd->grant_table->gt_version == 1)
     {
         status = &sha->flags;
-        trans_domid = rd->domain_id;
-        /* Shut the compiler up.  This'll never be used, because
-           trans_domid == rd->domain_id, but gcc doesn't know that. */
-        trans_gref = 0x1234567;
+        td = rd;
+        trans_gref = gref;
     }
     else
     {
         status = &status_entry(rd->grant_table, gref);
-        trans_domid = act->trans_dom;
+        td = act->trans_domain;
         trans_gref = act->trans_gref;
     }
 
@@ -1683,21 +1680,16 @@ __release_grant_for_copy(
 
     spin_unlock(&rd->grant_table->lock);
 
-    if ( trans_domid != rd->domain_id )
+    if ( td != rd )
     {
-        if ( released_write || released_read )
-        {
-            trans_dom = rcu_lock_domain_by_id(trans_domid);
-            if ( trans_dom != NULL )
-            {
-                /* Recursive calls, but they're tail calls, so it's
-                   okay. */
-                if ( released_write )
-                    __release_grant_for_copy(trans_dom, trans_gref, 0);
-                else if ( released_read )
-                    __release_grant_for_copy(trans_dom, trans_gref, 1);
-            }
-        }
+        /* Recursive calls, but they're tail calls, so it's
+           okay. */
+        if ( released_write )
+            __release_grant_for_copy(td, trans_gref, 0);
+        else if ( released_read )
+            __release_grant_for_copy(td, trans_gref, 1);
+
+	rcu_unlock_domain(td);
     }
 }
 
@@ -1734,7 +1726,7 @@ __acquire_grant_for_copy(
     uint32_t old_pin;
     domid_t trans_domid;
     grant_ref_t trans_gref;
-    struct domain *rrd;
+    struct domain *td;
     unsigned long gfn;
     unsigned long grant_frame;
     unsigned trans_page_off;
@@ -1788,8 +1780,8 @@ __acquire_grant_for_copy(
                                status) ) != GNTST_okay )
              goto unlock_out;
 
-        trans_domid = ld->domain_id;
-        trans_gref = 0;
+        td = rd;
+        trans_gref = gref;
         if ( sha2 && (shah->flags & GTF_type_mask) == GTF_transitive )
         {
             if ( !allow_transitive )
@@ -1811,14 +1803,15 @@ __acquire_grant_for_copy(
                that you don't need to go out of your way to avoid it
                in the guest. */
 
-            rrd = rcu_lock_domain_by_id(trans_domid);
-            if ( rrd == NULL )
+            /* We need to leave the rrd locked during the grant copy */
+            td = rcu_lock_domain_by_id(trans_domid);
+            if ( td == NULL )
                 PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grant referenced bad domain %d\n",
                          trans_domid);
             spin_unlock(&rd->grant_table->lock);
 
-            rc = __acquire_grant_for_copy(rrd, trans_gref, rd,
+            rc = __acquire_grant_for_copy(td, trans_gref, rd,
                                           readonly, &grant_frame,
                                           &trans_page_off, &trans_length,
                                           0, &ignore);
@@ -1826,6 +1819,7 @@ __acquire_grant_for_copy(
             spin_lock(&rd->grant_table->lock);
             if ( rc != GNTST_okay ) {
                 __fixup_status_for_copy_pin(act, status);
+                rcu_unlock_domain(td);
                 spin_unlock(&rd->grant_table->lock);
                 return rc;
             }
@@ -1837,6 +1831,7 @@ __acquire_grant_for_copy(
             if ( act->pin != old_pin )
             {
                 __fixup_status_for_copy_pin(act, status);
+                rcu_unlock_domain(td);
                 spin_unlock(&rd->grant_table->lock);
                 return __acquire_grant_for_copy(rd, gref, ld, readonly,
                                                 frame, page_off, length,
@@ -1848,7 +1843,7 @@ __acquire_grant_for_copy(
                sub-page, but we always treat it as one because that
                blocks mappings of transitive grants. */
             is_sub_page = 1;
-            *owning_domain = rrd;
+            *owning_domain = td;
             act->gfn = -1ul;
         }
         else if ( sha1 )
@@ -1894,7 +1889,7 @@ __acquire_grant_for_copy(
             act->is_sub_page = is_sub_page;
             act->start = trans_page_off;
             act->length = trans_length;
-            act->trans_dom = trans_domid;
+            act->trans_domain = td;
             act->trans_gref = trans_gref;
             act->frame = grant_frame;
         }
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 20c8354..c161705 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -32,7 +32,7 @@
 struct active_grant_entry {
     u32           pin;    /* Reference count information.             */
     domid_t       domid;  /* Domain being granted access.             */
-    domid_t       trans_dom;
+    struct domain *trans_domain;
     uint32_t      trans_gref;
     unsigned long frame;  /* Frame being granted.                     */
     unsigned long gfn;    /* Guest's idea of the frame being granted. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:37 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNcH-00034C-TW; Sat, 20 Apr 2013 02:33:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcG-000341-J5
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:28 +0000
Received: from [193.109.254.147:47546] by server-12.bemta-14.messagelabs.com
	id 52/BB-05449-77EF1715; Sat, 20 Apr 2013 02:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1366425205!6255042!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9675 invoked from network); 20 Apr 2013 02:33:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcD-0000Bb-Qq
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcD-0006hn-JU
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:25 +0000
Date: Sat, 20 Apr 2013 02:33:25 +0000
Message-Id: <E1UTNcD-0006hn-JU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] Fix rcu domain locking for
	transitive grants
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a12ed396652c22988e0e7a3f5bd57c882872da8e
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Thu Apr 18 17:38:17 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Apr 18 17:38:17 2013 +0200

    Fix rcu domain locking for transitive grants
    
    When acquiring a transitive grant for copy then the owning domain
    needs to be locked down as well as the granting domain. This was being
    done, but the unlocking was not. The acquire code now stores the
    struct domain * of the owning domain (rather than the domid) in the
    active entry in the granting domain. The release code then does the
    unlock on the owning domain.  Note that I believe I also fixed a bug
    where, for non-transitive grants the active entry contained a
    reference to the acquiring domain rather than the granting
    domain. From my reading of the code this would stop the release code
    for transitive grants from terminating its recursion correctly.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    master commit: f544bf377ee829e1342abd818ac30478c6f3a134
    master date: 2011-03-08 16:30:30 +0000
    
    Also, for non-transitive grants we now avoid incorrectly recursing
    in __release_grant_for_copy.
    
    This is CVE-2013-1964 / XSA-50.
    
    Reported-by: Manuel Bouyer <bouyer@antioche.eu.org>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Manuel Bouyer <bouyer@antioche.eu.org>
---
 xen/common/grant_table.c      |   55 ++++++++++++++++++----------------------
 xen/include/xen/grant_table.h |    2 +-
 2 files changed, 26 insertions(+), 31 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index a180aef..e0f91ab 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -598,7 +598,7 @@ __gnttab_map_grant_ref(
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
-            act->trans_dom = rd->domain_id;
+            act->trans_domain = rd;
             act->trans_gref = op->ref;
         }
     }
@@ -1629,11 +1629,10 @@ __release_grant_for_copy(
     struct active_grant_entry *act;
     unsigned long r_frame;
     uint16_t *status;
-    domid_t trans_domid;
     grant_ref_t trans_gref;
     int released_read;
     int released_write;
-    struct domain *trans_dom;
+    struct domain *td;
 
     released_read = 0;
     released_write = 0;
@@ -1647,15 +1646,13 @@ __release_grant_for_copy(
     if (rd->grant_table->gt_version == 1)
     {
         status = &sha->flags;
-        trans_domid = rd->domain_id;
-        /* Shut the compiler up.  This'll never be used, because
-           trans_domid == rd->domain_id, but gcc doesn't know that. */
-        trans_gref = 0x1234567;
+        td = rd;
+        trans_gref = gref;
     }
     else
     {
         status = &status_entry(rd->grant_table, gref);
-        trans_domid = act->trans_dom;
+        td = act->trans_domain;
         trans_gref = act->trans_gref;
     }
 
@@ -1683,21 +1680,16 @@ __release_grant_for_copy(
 
     spin_unlock(&rd->grant_table->lock);
 
-    if ( trans_domid != rd->domain_id )
+    if ( td != rd )
     {
-        if ( released_write || released_read )
-        {
-            trans_dom = rcu_lock_domain_by_id(trans_domid);
-            if ( trans_dom != NULL )
-            {
-                /* Recursive calls, but they're tail calls, so it's
-                   okay. */
-                if ( released_write )
-                    __release_grant_for_copy(trans_dom, trans_gref, 0);
-                else if ( released_read )
-                    __release_grant_for_copy(trans_dom, trans_gref, 1);
-            }
-        }
+        /* Recursive calls, but they're tail calls, so it's
+           okay. */
+        if ( released_write )
+            __release_grant_for_copy(td, trans_gref, 0);
+        else if ( released_read )
+            __release_grant_for_copy(td, trans_gref, 1);
+
+	rcu_unlock_domain(td);
     }
 }
 
@@ -1734,7 +1726,7 @@ __acquire_grant_for_copy(
     uint32_t old_pin;
     domid_t trans_domid;
     grant_ref_t trans_gref;
-    struct domain *rrd;
+    struct domain *td;
     unsigned long gfn;
     unsigned long grant_frame;
     unsigned trans_page_off;
@@ -1788,8 +1780,8 @@ __acquire_grant_for_copy(
                                status) ) != GNTST_okay )
              goto unlock_out;
 
-        trans_domid = ld->domain_id;
-        trans_gref = 0;
+        td = rd;
+        trans_gref = gref;
         if ( sha2 && (shah->flags & GTF_type_mask) == GTF_transitive )
         {
             if ( !allow_transitive )
@@ -1811,14 +1803,15 @@ __acquire_grant_for_copy(
                that you don't need to go out of your way to avoid it
                in the guest. */
 
-            rrd = rcu_lock_domain_by_id(trans_domid);
-            if ( rrd == NULL )
+            /* We need to leave the rrd locked during the grant copy */
+            td = rcu_lock_domain_by_id(trans_domid);
+            if ( td == NULL )
                 PIN_FAIL(unlock_out_clear, GNTST_general_error,
                          "transitive grant referenced bad domain %d\n",
                          trans_domid);
             spin_unlock(&rd->grant_table->lock);
 
-            rc = __acquire_grant_for_copy(rrd, trans_gref, rd,
+            rc = __acquire_grant_for_copy(td, trans_gref, rd,
                                           readonly, &grant_frame,
                                           &trans_page_off, &trans_length,
                                           0, &ignore);
@@ -1826,6 +1819,7 @@ __acquire_grant_for_copy(
             spin_lock(&rd->grant_table->lock);
             if ( rc != GNTST_okay ) {
                 __fixup_status_for_copy_pin(act, status);
+                rcu_unlock_domain(td);
                 spin_unlock(&rd->grant_table->lock);
                 return rc;
             }
@@ -1837,6 +1831,7 @@ __acquire_grant_for_copy(
             if ( act->pin != old_pin )
             {
                 __fixup_status_for_copy_pin(act, status);
+                rcu_unlock_domain(td);
                 spin_unlock(&rd->grant_table->lock);
                 return __acquire_grant_for_copy(rd, gref, ld, readonly,
                                                 frame, page_off, length,
@@ -1848,7 +1843,7 @@ __acquire_grant_for_copy(
                sub-page, but we always treat it as one because that
                blocks mappings of transitive grants. */
             is_sub_page = 1;
-            *owning_domain = rrd;
+            *owning_domain = td;
             act->gfn = -1ul;
         }
         else if ( sha1 )
@@ -1894,7 +1889,7 @@ __acquire_grant_for_copy(
             act->is_sub_page = is_sub_page;
             act->start = trans_page_off;
             act->length = trans_length;
-            act->trans_dom = trans_domid;
+            act->trans_domain = td;
             act->trans_gref = trans_gref;
             act->frame = grant_frame;
         }
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 20c8354..c161705 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -32,7 +32,7 @@
 struct active_grant_entry {
     u32           pin;    /* Reference count information.             */
     domid_t       domid;  /* Domain being granted access.             */
-    domid_t       trans_dom;
+    struct domain *trans_domain;
     uint32_t      trans_gref;
     unsigned long frame;  /* Frame being granted.                     */
     unsigned long gfn;    /* Guest's idea of the frame being granted. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNcT-00035O-0t; Sat, 20 Apr 2013 02:33:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcR-00035D-PH
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:39 +0000
Received: from [85.158.137.99:38791] by server-8.bemta-3.messagelabs.com id
	85/B8-20604-28EF1715; Sat, 20 Apr 2013 02:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1366425217!12934108!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31706 invoked from network); 20 Apr 2013 02:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcO-0000Bl-2D
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcN-0006iD-Ut
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:36 +0000
Date: Sat, 20 Apr 2013 02:33:35 +0000
Message-Id: <E1UTNcN-0006iD-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] libxl: Fix SEGV in network-attach
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21c31a811ca1705b71417fab520d9b39ae2ab3a7
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Apr 18 17:44:17 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 18 17:44:17 2013 +0100

    libxl: Fix SEGV in network-attach
    
    When "device/vif" directory exists but is empty l!=NULL, but nb==0, so
    l[nb-1] is invalid.  Add missing check.
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 9f1a6ff38b8e7bb97a016794115de28553a6559f)
    
    Conflicts:
    	tools/libxl/libxl.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 19ef6a0..fbc6c07 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1207,7 +1207,8 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
             goto out_free;
         }
         if (!(l = libxl__xs_directory(&gc, XBT_NULL,
-                                     libxl__sprintf(&gc, "%s/device/vif", dompath), &nb))) {
+                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb)) ||
+            nb == 0) {
             nic->devid = 0;
         } else {
             nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:44 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNcT-00035O-0t; Sat, 20 Apr 2013 02:33:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcR-00035D-PH
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:39 +0000
Received: from [85.158.137.99:38791] by server-8.bemta-3.messagelabs.com id
	85/B8-20604-28EF1715; Sat, 20 Apr 2013 02:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-217.messagelabs.com!1366425217!12934108!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31706 invoked from network); 20 Apr 2013 02:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcO-0000Bl-2D
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcN-0006iD-Ut
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:36 +0000
Date: Sat, 20 Apr 2013 02:33:35 +0000
Message-Id: <E1UTNcN-0006iD-Ut@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] libxl: Fix SEGV in network-attach
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21c31a811ca1705b71417fab520d9b39ae2ab3a7
Author:     Ian Jackson <ian.jackson@eu.citrix.com>
AuthorDate: Thu Apr 18 17:44:17 2013 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu Apr 18 17:44:17 2013 +0100

    libxl: Fix SEGV in network-attach
    
    When "device/vif" directory exists but is empty l!=NULL, but nb==0, so
    l[nb-1] is invalid.  Add missing check.
    
    Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 9f1a6ff38b8e7bb97a016794115de28553a6559f)
    
    Conflicts:
    	tools/libxl/libxl.c
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 19ef6a0..fbc6c07 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1207,7 +1207,8 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
             goto out_free;
         }
         if (!(l = libxl__xs_directory(&gc, XBT_NULL,
-                                     libxl__sprintf(&gc, "%s/device/vif", dompath), &nb))) {
+                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb)) ||
+            nb == 0) {
             nic->devid = 0;
         } else {
             nic->devid = strtoul(l[nb - 1], NULL, 10) + 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNcc-00036p-47; Sat, 20 Apr 2013 02:33:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNca-00036Y-TC
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:48 +0000
Received: from [193.109.254.147:47846] by server-16.bemta-14.messagelabs.com
	id 51/5F-29589-C8EF1715; Sat, 20 Apr 2013 02:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1366425226!1907464!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23048 invoked from network); 20 Apr 2013 02:33:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcY-0000Bs-AW
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcY-0006iZ-7t
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:46 +0000
Date: Sat, 20 Apr 2013 02:33:46 +0000
Message-Id: <E1UTNcY-0006iZ-7t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] libxl: fix build error after
	21c31a81
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7348a9ff855ba2cdb5412fe3709f1214264b42a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 19 09:17:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 09:17:02 2013 +0200

    libxl: fix build error after 21c31a81
    
    "libxl: Fix SEGV in network-attach" dropped a necessary &.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxl/libxl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fbc6c07..3c2e1b2 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1207,7 +1207,7 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
             goto out_free;
         }
         if (!(l = libxl__xs_directory(&gc, XBT_NULL,
-                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb)) ||
+                                      libxl__sprintf(&gc, "%s/device/vif", dompath), &nb)) ||
             nb == 0) {
             nic->devid = 0;
         } else {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 20 02:33:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 20 Apr 2013 02:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UTNcc-00036p-47; Sat, 20 Apr 2013 02:33:50 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNca-00036Y-TC
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:48 +0000
Received: from [193.109.254.147:47846] by server-16.bemta-14.messagelabs.com
	id 51/5F-29589-C8EF1715; Sat, 20 Apr 2013 02:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1366425226!1907464!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23048 invoked from network); 20 Apr 2013 02:33:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Apr 2013 02:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcY-0000Bs-AW
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UTNcY-0006iZ-7t
	for xen-changelog@lists.xensource.com; Sat, 20 Apr 2013 02:33:46 +0000
Date: Sat, 20 Apr 2013 02:33:46 +0000
Message-Id: <E1UTNcY-0006iZ-7t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] libxl: fix build error after
	21c31a81
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c7348a9ff855ba2cdb5412fe3709f1214264b42a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Apr 19 09:17:02 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Apr 19 09:17:02 2013 +0200

    libxl: fix build error after 21c31a81
    
    "libxl: Fix SEGV in network-attach" dropped a necessary &.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxl/libxl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index fbc6c07..3c2e1b2 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1207,7 +1207,7 @@ int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic)
             goto out_free;
         }
         if (!(l = libxl__xs_directory(&gc, XBT_NULL,
-                                     libxl__sprintf(gc, "%s/device/vif", dompath), &nb)) ||
+                                      libxl__sprintf(&gc, "%s/device/vif", dompath), &nb)) ||
             nb == 0) {
             nic->devid = 0;
         } else {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMem-0006ii-Gl; Mon, 22 Apr 2013 19:44:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMel-0006iZ-TD
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:08 +0000
Received: from [85.158.143.99:31920] by server-2.bemta-4.messagelabs.com id
	58/95-12656-60395715; Mon, 22 Apr 2013 19:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1366659844!26105836!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11512 invoked from network); 22 Apr 2013 19:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMei-0000fq-D1
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMeh-0005iE-7J
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:03 +0000
Date: Mon, 22 Apr 2013 19:44:03 +0000
Message-Id: <E1UUMeh-0005iE-7J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: update error indicators
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fdef9a6cabe9810793f80df88d559a22998157b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 22 13:57:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 13:57:13 2013 +0200

    EFI: update error indicators
    
    ... from gnu-efi-3.0t. Decode a few of them in x86's PrintErrMesg().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/efi/boot.c  |    9 +++++++++
 xen/include/efi/efierr.h |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 4005b5e..3de0ce7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -234,6 +234,15 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     case EFI_VOLUME_FULL:
         mesg = L"Volume is full";
         break;
+    case EFI_SECURITY_VIOLATION:
+        mesg = L"Security violation";
+        break;
+    case EFI_CRC_ERROR:
+        mesg = L"CRC error";
+        break;
+    case EFI_COMPROMISED_DATA:
+        mesg = L"Compromised data";
+        break;
     default:
         PrintErr(L"ErrCode: ");
         DisplayUint(ErrCode, 0);
diff --git a/xen/include/efi/efierr.h b/xen/include/efi/efierr.h
index 669d7ba..dfd3d3c 100644
--- a/xen/include/efi/efierr.h
+++ b/xen/include/efi/efierr.h
@@ -50,6 +50,13 @@ Revision History
 #define EFI_ICMP_ERROR                  EFIERR(22)
 #define EFI_TFTP_ERROR                  EFIERR(23)
 #define EFI_PROTOCOL_ERROR              EFIERR(24)
+#define EFI_INCOMPATIBLE_VERSION        EFIERR(25)
+#define EFI_SECURITY_VIOLATION          EFIERR(26)
+#define EFI_CRC_ERROR                   EFIERR(27)
+#define EFI_END_OF_MEDIA                EFIERR(28)
+#define EFI_END_OF_FILE                 EFIERR(31)
+#define EFI_INVALID_LANGUAGE            EFIERR(32)
+#define EFI_COMPROMISED_DATA            EFIERR(33)
 
 #define EFI_WARN_UNKOWN_GLYPH           EFIWARN(1)
 #define EFI_WARN_DELETE_FAILURE         EFIWARN(2)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMem-0006ii-Gl; Mon, 22 Apr 2013 19:44:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMel-0006iZ-TD
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:08 +0000
Received: from [85.158.143.99:31920] by server-2.bemta-4.messagelabs.com id
	58/95-12656-60395715; Mon, 22 Apr 2013 19:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1366659844!26105836!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11512 invoked from network); 22 Apr 2013 19:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMei-0000fq-D1
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMeh-0005iE-7J
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:03 +0000
Date: Mon, 22 Apr 2013 19:44:03 +0000
Message-Id: <E1UUMeh-0005iE-7J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] EFI: update error indicators
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fdef9a6cabe9810793f80df88d559a22998157b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 22 13:57:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 13:57:13 2013 +0200

    EFI: update error indicators
    
    ... from gnu-efi-3.0t. Decode a few of them in x86's PrintErrMesg().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/efi/boot.c  |    9 +++++++++
 xen/include/efi/efierr.h |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 4005b5e..3de0ce7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -234,6 +234,15 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     case EFI_VOLUME_FULL:
         mesg = L"Volume is full";
         break;
+    case EFI_SECURITY_VIOLATION:
+        mesg = L"Security violation";
+        break;
+    case EFI_CRC_ERROR:
+        mesg = L"CRC error";
+        break;
+    case EFI_COMPROMISED_DATA:
+        mesg = L"Compromised data";
+        break;
     default:
         PrintErr(L"ErrCode: ");
         DisplayUint(ErrCode, 0);
diff --git a/xen/include/efi/efierr.h b/xen/include/efi/efierr.h
index 669d7ba..dfd3d3c 100644
--- a/xen/include/efi/efierr.h
+++ b/xen/include/efi/efierr.h
@@ -50,6 +50,13 @@ Revision History
 #define EFI_ICMP_ERROR                  EFIERR(22)
 #define EFI_TFTP_ERROR                  EFIERR(23)
 #define EFI_PROTOCOL_ERROR              EFIERR(24)
+#define EFI_INCOMPATIBLE_VERSION        EFIERR(25)
+#define EFI_SECURITY_VIOLATION          EFIERR(26)
+#define EFI_CRC_ERROR                   EFIERR(27)
+#define EFI_END_OF_MEDIA                EFIERR(28)
+#define EFI_END_OF_FILE                 EFIERR(31)
+#define EFI_INVALID_LANGUAGE            EFIERR(32)
+#define EFI_COMPROMISED_DATA            EFIERR(33)
 
 #define EFI_WARN_UNKOWN_GLYPH           EFIWARN(1)
 #define EFI_WARN_DELETE_FAILURE         EFIWARN(2)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMex-0006ja-K8; Mon, 22 Apr 2013 19:44:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMew-0006jQ-0J
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:18 +0000
Received: from [85.158.138.51:37043] by server-11.bemta-3.messagelabs.com id
	54/73-01263-11395715; Mon, 22 Apr 2013 19:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366659854!26489889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27274 invoked from network); 22 Apr 2013 19:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMes-0000ft-KW
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMes-0005ic-IE
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:14 +0000
Date: Mon, 22 Apr 2013 19:44:14 +0000
Message-Id: <E1UUMes-0005ic-IE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: pass boot services variable
	info to runtime code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9be8a4447103d92843fcfeaad8be42408c90e9a9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 22 13:58:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 13:58:01 2013 +0200

    x86/EFI: pass boot services variable info to runtime code
    
    EFI variables can be flagged as being accessible only within boot services.
    This makes it awkward for us to figure out how much space they use at
    runtime. In theory we could figure this out by simply comparing the results
    from QueryVariableInfo() to the space used by all of our variables, but
    that fails if the platform doesn't garbage collect on every boot. Thankfully,
    calling QueryVariableInfo() while still inside boot services gives a more
    reliable answer. This patch passes that information from the EFI boot stub
    up to the efi platform code.
    
    Based on a similarly named Linux patch by Matthew Garrett <matthew.garrett@nebula.com>.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/efi/boot.c       |   17 +++++++++++++++++
 xen/arch/x86/efi/efi.h        |    3 +++
 xen/arch/x86/efi/runtime.c    |   36 ++++++++++++++++++++++++++++++++++++
 xen/include/efi/efiapi.h      |    4 ++++
 xen/include/public/platform.h |    1 +
 5 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 3de0ce7..44bc7b7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -1240,6 +1240,23 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     /* Collect PCI ROM contents. */
     setup_efi_pci();
 
+    /* Get snapshot of variable store parameters. */
+    status = efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       &efi_boot_max_var_store_size,
+                                       &efi_boot_remain_var_store_size,
+                                       &efi_boot_max_var_size);
+    if ( EFI_ERROR(status) )
+    {
+        efi_boot_max_var_store_size = 0;
+        efi_boot_remain_var_store_size = 0;
+        efi_boot_max_var_size = status;
+        PrintStr(L"Warning: Could not query variable store: ");
+        DisplayUint(status, 0);
+        PrintStr(newline);
+    }
+
     /* Allocate space for trampoline (in first Mb). */
     cfg.addr = 0x100000;
     cfg.size = trampoline_end - trampoline_start;
diff --git a/xen/arch/x86/efi/efi.h b/xen/arch/x86/efi/efi.h
index 43dbd17..a80d5f1 100644
--- a/xen/arch/x86/efi/efi.h
+++ b/xen/arch/x86/efi/efi.h
@@ -32,5 +32,8 @@ extern l4_pgentry_t *efi_l4_pgtable;
 
 extern const struct efi_pci_rom *efi_pci_roms;
 
+extern UINT64 efi_boot_max_var_store_size, efi_boot_remain_var_store_size,
+              efi_boot_max_var_size;
+
 unsigned long efi_rs_enter(void);
 void efi_rs_leave(unsigned long);
diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index aafdfeb..be3f537 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -28,6 +28,10 @@ UINTN __read_mostly efi_memmap_size;
 UINTN __read_mostly efi_mdesc_size;
 void *__read_mostly efi_memmap;
 
+UINT64 __read_mostly efi_boot_max_var_store_size;
+UINT64 __read_mostly efi_boot_remain_var_store_size;
+UINT64 __read_mostly efi_boot_max_var_size;
+
 struct efi __read_mostly efi = {
 	.acpi   = EFI_INVALID_TABLE_ADDR,
 	.acpi20 = EFI_INVALID_TABLE_ADDR,
@@ -464,6 +468,35 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
     break;
 
     case XEN_EFI_query_variable_info:
+        if ( op->misc & ~XEN_EFI_VARINFO_BOOT_SNAPSHOT )
+            return -EINVAL;
+
+        if ( op->misc & XEN_EFI_VARINFO_BOOT_SNAPSHOT )
+        {
+            if ( (op->u.query_variable_info.attr
+                  & ~EFI_VARIABLE_APPEND_WRITE) !=
+                 (EFI_VARIABLE_NON_VOLATILE |
+                  EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                  EFI_VARIABLE_RUNTIME_ACCESS) )
+                return -EINVAL;
+
+            op->u.query_variable_info.max_store_size =
+                efi_boot_max_var_store_size;
+            op->u.query_variable_info.remain_store_size =
+                efi_boot_remain_var_store_size;
+            if ( efi_boot_max_var_store_size )
+            {
+                op->u.query_variable_info.max_size = efi_boot_max_var_size;
+                status = EFI_SUCCESS;
+            }
+            else
+            {
+                op->u.query_variable_info.max_size = 0;
+                status = efi_boot_max_var_size;
+            }
+            break;
+        }
+
         cr3 = efi_rs_enter();
         if ( (efi_rs->Hdr.Revision >> 16) < 2 )
         {
@@ -480,6 +513,9 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 
     case XEN_EFI_query_capsule_capabilities:
     case XEN_EFI_update_capsule:
+        if ( op->misc )
+            return -EINVAL;
+
         cr3 = efi_rs_enter();
         if ( (efi_rs->Hdr.Revision >> 16) < 2 )
         {
diff --git a/xen/include/efi/efiapi.h b/xen/include/efi/efiapi.h
index 7c276cf..a616d12 100644
--- a/xen/include/efi/efiapi.h
+++ b/xen/include/efi/efiapi.h
@@ -213,6 +213,10 @@ VOID
 #define EFI_VARIABLE_NON_VOLATILE           0x00000001
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS     0x00000002
 #define EFI_VARIABLE_RUNTIME_ACCESS         0x00000004
+#define EFI_VARIABLE_HARDWARE_ERROR_RECORD  0x00000008
+#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
+#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
+#define EFI_VARIABLE_APPEND_WRITE           0x00000040
 
 // Variable size limitation
 #define EFI_MAXIMUM_VARIABLE_SIZE           1024
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index d7d2a5b..4341f54 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -184,6 +184,7 @@ struct xenpf_efi_runtime_call {
             struct xenpf_efi_guid vendor_guid;
         } get_next_variable_name;
 
+#define XEN_EFI_VARINFO_BOOT_SNAPSHOT       0x00000001
         struct {
             uint32_t attr;
             uint64_t max_store_size;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMex-0006ja-K8; Mon, 22 Apr 2013 19:44:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMew-0006jQ-0J
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:18 +0000
Received: from [85.158.138.51:37043] by server-11.bemta-3.messagelabs.com id
	54/73-01263-11395715; Mon, 22 Apr 2013 19:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366659854!26489889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27274 invoked from network); 22 Apr 2013 19:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMes-0000ft-KW
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMes-0005ic-IE
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:14 +0000
Date: Mon, 22 Apr 2013 19:44:14 +0000
Message-Id: <E1UUMes-0005ic-IE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: pass boot services variable
	info to runtime code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9be8a4447103d92843fcfeaad8be42408c90e9a9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 22 13:58:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 13:58:01 2013 +0200

    x86/EFI: pass boot services variable info to runtime code
    
    EFI variables can be flagged as being accessible only within boot services.
    This makes it awkward for us to figure out how much space they use at
    runtime. In theory we could figure this out by simply comparing the results
    from QueryVariableInfo() to the space used by all of our variables, but
    that fails if the platform doesn't garbage collect on every boot. Thankfully,
    calling QueryVariableInfo() while still inside boot services gives a more
    reliable answer. This patch passes that information from the EFI boot stub
    up to the efi platform code.
    
    Based on a similarly named Linux patch by Matthew Garrett <matthew.garrett@nebula.com>.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/efi/boot.c       |   17 +++++++++++++++++
 xen/arch/x86/efi/efi.h        |    3 +++
 xen/arch/x86/efi/runtime.c    |   36 ++++++++++++++++++++++++++++++++++++
 xen/include/efi/efiapi.h      |    4 ++++
 xen/include/public/platform.h |    1 +
 5 files changed, 61 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 3de0ce7..44bc7b7 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -1240,6 +1240,23 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     /* Collect PCI ROM contents. */
     setup_efi_pci();
 
+    /* Get snapshot of variable store parameters. */
+    status = efi_rs->QueryVariableInfo(EFI_VARIABLE_NON_VOLATILE |
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       &efi_boot_max_var_store_size,
+                                       &efi_boot_remain_var_store_size,
+                                       &efi_boot_max_var_size);
+    if ( EFI_ERROR(status) )
+    {
+        efi_boot_max_var_store_size = 0;
+        efi_boot_remain_var_store_size = 0;
+        efi_boot_max_var_size = status;
+        PrintStr(L"Warning: Could not query variable store: ");
+        DisplayUint(status, 0);
+        PrintStr(newline);
+    }
+
     /* Allocate space for trampoline (in first Mb). */
     cfg.addr = 0x100000;
     cfg.size = trampoline_end - trampoline_start;
diff --git a/xen/arch/x86/efi/efi.h b/xen/arch/x86/efi/efi.h
index 43dbd17..a80d5f1 100644
--- a/xen/arch/x86/efi/efi.h
+++ b/xen/arch/x86/efi/efi.h
@@ -32,5 +32,8 @@ extern l4_pgentry_t *efi_l4_pgtable;
 
 extern const struct efi_pci_rom *efi_pci_roms;
 
+extern UINT64 efi_boot_max_var_store_size, efi_boot_remain_var_store_size,
+              efi_boot_max_var_size;
+
 unsigned long efi_rs_enter(void);
 void efi_rs_leave(unsigned long);
diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index aafdfeb..be3f537 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -28,6 +28,10 @@ UINTN __read_mostly efi_memmap_size;
 UINTN __read_mostly efi_mdesc_size;
 void *__read_mostly efi_memmap;
 
+UINT64 __read_mostly efi_boot_max_var_store_size;
+UINT64 __read_mostly efi_boot_remain_var_store_size;
+UINT64 __read_mostly efi_boot_max_var_size;
+
 struct efi __read_mostly efi = {
 	.acpi   = EFI_INVALID_TABLE_ADDR,
 	.acpi20 = EFI_INVALID_TABLE_ADDR,
@@ -464,6 +468,35 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
     break;
 
     case XEN_EFI_query_variable_info:
+        if ( op->misc & ~XEN_EFI_VARINFO_BOOT_SNAPSHOT )
+            return -EINVAL;
+
+        if ( op->misc & XEN_EFI_VARINFO_BOOT_SNAPSHOT )
+        {
+            if ( (op->u.query_variable_info.attr
+                  & ~EFI_VARIABLE_APPEND_WRITE) !=
+                 (EFI_VARIABLE_NON_VOLATILE |
+                  EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                  EFI_VARIABLE_RUNTIME_ACCESS) )
+                return -EINVAL;
+
+            op->u.query_variable_info.max_store_size =
+                efi_boot_max_var_store_size;
+            op->u.query_variable_info.remain_store_size =
+                efi_boot_remain_var_store_size;
+            if ( efi_boot_max_var_store_size )
+            {
+                op->u.query_variable_info.max_size = efi_boot_max_var_size;
+                status = EFI_SUCCESS;
+            }
+            else
+            {
+                op->u.query_variable_info.max_size = 0;
+                status = efi_boot_max_var_size;
+            }
+            break;
+        }
+
         cr3 = efi_rs_enter();
         if ( (efi_rs->Hdr.Revision >> 16) < 2 )
         {
@@ -480,6 +513,9 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 
     case XEN_EFI_query_capsule_capabilities:
     case XEN_EFI_update_capsule:
+        if ( op->misc )
+            return -EINVAL;
+
         cr3 = efi_rs_enter();
         if ( (efi_rs->Hdr.Revision >> 16) < 2 )
         {
diff --git a/xen/include/efi/efiapi.h b/xen/include/efi/efiapi.h
index 7c276cf..a616d12 100644
--- a/xen/include/efi/efiapi.h
+++ b/xen/include/efi/efiapi.h
@@ -213,6 +213,10 @@ VOID
 #define EFI_VARIABLE_NON_VOLATILE           0x00000001
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS     0x00000002
 #define EFI_VARIABLE_RUNTIME_ACCESS         0x00000004
+#define EFI_VARIABLE_HARDWARE_ERROR_RECORD  0x00000008
+#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
+#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
+#define EFI_VARIABLE_APPEND_WRITE           0x00000040
 
 // Variable size limitation
 #define EFI_MAXIMUM_VARIABLE_SIZE           1024
diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h
index d7d2a5b..4341f54 100644
--- a/xen/include/public/platform.h
+++ b/xen/include/public/platform.h
@@ -184,6 +184,7 @@ struct xenpf_efi_runtime_call {
             struct xenpf_efi_guid vendor_guid;
         } get_next_variable_name;
 
+#define XEN_EFI_VARINFO_BOOT_SNAPSHOT       0x00000001
         struct {
             uint32_t attr;
             uint64_t max_store_size;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMf7-0006kZ-NO; Mon, 22 Apr 2013 19:44:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMf6-0006kO-5q
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:28 +0000
Received: from [85.158.138.51:37379] by server-6.bemta-3.messagelabs.com id
	09/8A-11048-B1395715; Mon, 22 Apr 2013 19:44:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1366659865!19590511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32442 invoked from network); 22 Apr 2013 19:44:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMf2-0000fz-R2
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMf2-0005iy-OO
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:24 +0000
Date: Mon, 22 Apr 2013 19:44:24 +0000
Message-Id: <E1UUMf2-0005iy-OO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mwait_idle: stop using driver_data
	for static flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e96e50c36fe32aa3e5d5da370f58da89fd35cb3
Author:     Len Brown <len.brown@intel.com>
AuthorDate: Mon Apr 22 14:00:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 14:00:16 2013 +0200

    x86/mwait_idle: stop using driver_data for static flags
    
    The (Linux) commit 4202735e8ab6ecfb0381631a0d0b58fefe0bd4e2
    (cpuidle: Split cpuidle_state structure and move per-cpu statistics fields)
    observed that the MWAIT flags for Cn on every processor to date were the
    same, and created get_driver_data() to supply them.
    
    Unfortunately, that assumption is false, going forward.
    So here we restore the MWAIT flags to the cpuidle_state table.
    However, instead restoring the old "driver_data" field,
    we put the flags into the existing "flags" field,
    where they probalby should have lived all along.
    
    This patch does not change any operation.
    
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c |   51 +++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 21447e1..111c149 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -108,6 +108,16 @@ static const struct cpuidle_state {
 #define CPUIDLE_FLAG_TLB_FLUSHED	0x10000
 
 /*
+ * MWAIT takes an 8-bit "hint" in EAX "suggesting"
+ * the C-state (top nibble) and sub-state (bottom nibble)
+ * 0x00 means "MWAIT(C1)", 0x10 means "MWAIT(C2)" etc.
+ *
+ * We store the hint at the top of our "flags" for each state.
+ */
+#define flg2MWAIT(flags) (((flags) >> 24) & 0xFF)
+#define MWAIT2flg(eax) ((eax & 0xFF) << 24)
+
+/*
  * States are indexed by the cstate number,
  * which is also the index into the MWAIT hint array.
  * Thus C0 is a dummy.
@@ -116,18 +126,19 @@ static const struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-NHM",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 3,
 		.target_residency = 6,
 	},
 	{ /* MWAIT C2 */
 		.name = "C3-NHM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 20,
 		.target_residency = 80,
 	},
 	{ /* MWAIT C3 */
 		.name = "C6-NHM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 200,
 		.target_residency = 800,
 	}
@@ -137,24 +148,25 @@ static const struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-SNB",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 1,
 		.target_residency = 1,
 	},
 	{ /* MWAIT C2 */
 		.name = "C3-SNB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 80,
 		.target_residency = 211,
 	},
 	{ /* MWAIT C3 */
 		.name = "C6-SNB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 104,
 		.target_residency = 345,
 	},
 	{ /* MWAIT C4 */
 		.name = "C7-SNB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 109,
 		.target_residency = 345,
 	}
@@ -164,24 +176,25 @@ static const struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-IVB",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 1,
 		.target_residency = 1,
 	},
 	{ /* MWAIT C2 */
 		.name = "C3-IVB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 59,
 		.target_residency = 156,
 	},
 	{ /* MWAIT C3 */
 		.name = "C6-IVB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 80,
 		.target_residency = 300,
 	},
 	{ /* MWAIT C4 */
 		.name = "C7-IVB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 87,
 		.target_residency = 300,
 	}
@@ -191,44 +204,32 @@ static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-ATM",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 1,
 		.target_residency = 4,
 	},
 	{ /* MWAIT C2 */
 		.name = "C2-ATM",
+		.flags = MWAIT2flg(0x10),
 		.exit_latency = 20,
 		.target_residency = 80,
 	},
 	{ /* MWAIT C3 */ },
 	{ /* MWAIT C4 */
 		.name = "C4-ATM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 100,
 		.target_residency = 400,
 	},
 	{ /* MWAIT C5 */ },
 	{ /* MWAIT C6 */
 		.name = "C6-ATM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 140,
 		.target_residency = 560,
 	}
 };
 
-static u32 get_driver_data(unsigned int cstate)
-{
-	static const u32 driver_data[] = {
-		[1] /* MWAIT C1 */ = 0x00,
-		[2] /* MWAIT C2 */ = 0x10,
-		[3] /* MWAIT C3 */ = 0x20,
-		[4] /* MWAIT C4 */ = 0x30,
-		[5] /* MWAIT C5 */ = 0x40,
-		[6] /* MWAIT C6 */ = 0x52,
-	};
-
-	return driver_data[cstate < ARRAY_SIZE(driver_data) ? cstate : 0];
-}
-
 static void mwait_idle(void)
 {
 	unsigned int cpu = smp_processor_id();
@@ -477,7 +478,7 @@ static int mwait_idle_cpu_init(struct notifier_block *nfb,
 
 		cx = dev->states + dev->count;
 		cx->type = cstate;
-		cx->address = get_driver_data(cstate);
+		cx->address = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		cx->entry_method = ACPI_CSTATE_EM_FFH;
 		cx->latency = cpuidle_state_table[cstate].exit_latency;
 		cx->target_residency =
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:32 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMf7-0006kZ-NO; Mon, 22 Apr 2013 19:44:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMf6-0006kO-5q
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:28 +0000
Received: from [85.158.138.51:37379] by server-6.bemta-3.messagelabs.com id
	09/8A-11048-B1395715; Mon, 22 Apr 2013 19:44:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1366659865!19590511!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32442 invoked from network); 22 Apr 2013 19:44:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMf2-0000fz-R2
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMf2-0005iy-OO
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:24 +0000
Date: Mon, 22 Apr 2013 19:44:24 +0000
Message-Id: <E1UUMf2-0005iy-OO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mwait_idle: stop using driver_data
	for static flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e96e50c36fe32aa3e5d5da370f58da89fd35cb3
Author:     Len Brown <len.brown@intel.com>
AuthorDate: Mon Apr 22 14:00:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 14:00:16 2013 +0200

    x86/mwait_idle: stop using driver_data for static flags
    
    The (Linux) commit 4202735e8ab6ecfb0381631a0d0b58fefe0bd4e2
    (cpuidle: Split cpuidle_state structure and move per-cpu statistics fields)
    observed that the MWAIT flags for Cn on every processor to date were the
    same, and created get_driver_data() to supply them.
    
    Unfortunately, that assumption is false, going forward.
    So here we restore the MWAIT flags to the cpuidle_state table.
    However, instead restoring the old "driver_data" field,
    we put the flags into the existing "flags" field,
    where they probalby should have lived all along.
    
    This patch does not change any operation.
    
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c |   51 +++++++++++++++++++++--------------------
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 21447e1..111c149 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -108,6 +108,16 @@ static const struct cpuidle_state {
 #define CPUIDLE_FLAG_TLB_FLUSHED	0x10000
 
 /*
+ * MWAIT takes an 8-bit "hint" in EAX "suggesting"
+ * the C-state (top nibble) and sub-state (bottom nibble)
+ * 0x00 means "MWAIT(C1)", 0x10 means "MWAIT(C2)" etc.
+ *
+ * We store the hint at the top of our "flags" for each state.
+ */
+#define flg2MWAIT(flags) (((flags) >> 24) & 0xFF)
+#define MWAIT2flg(eax) ((eax & 0xFF) << 24)
+
+/*
  * States are indexed by the cstate number,
  * which is also the index into the MWAIT hint array.
  * Thus C0 is a dummy.
@@ -116,18 +126,19 @@ static const struct cpuidle_state nehalem_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-NHM",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 3,
 		.target_residency = 6,
 	},
 	{ /* MWAIT C2 */
 		.name = "C3-NHM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 20,
 		.target_residency = 80,
 	},
 	{ /* MWAIT C3 */
 		.name = "C6-NHM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 200,
 		.target_residency = 800,
 	}
@@ -137,24 +148,25 @@ static const struct cpuidle_state snb_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-SNB",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 1,
 		.target_residency = 1,
 	},
 	{ /* MWAIT C2 */
 		.name = "C3-SNB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 80,
 		.target_residency = 211,
 	},
 	{ /* MWAIT C3 */
 		.name = "C6-SNB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 104,
 		.target_residency = 345,
 	},
 	{ /* MWAIT C4 */
 		.name = "C7-SNB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 109,
 		.target_residency = 345,
 	}
@@ -164,24 +176,25 @@ static const struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-IVB",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 1,
 		.target_residency = 1,
 	},
 	{ /* MWAIT C2 */
 		.name = "C3-IVB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 59,
 		.target_residency = 156,
 	},
 	{ /* MWAIT C3 */
 		.name = "C6-IVB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 80,
 		.target_residency = 300,
 	},
 	{ /* MWAIT C4 */
 		.name = "C7-IVB",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 87,
 		.target_residency = 300,
 	}
@@ -191,44 +204,32 @@ static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
 		.name = "C1-ATM",
+		.flags = MWAIT2flg(0x00),
 		.exit_latency = 1,
 		.target_residency = 4,
 	},
 	{ /* MWAIT C2 */
 		.name = "C2-ATM",
+		.flags = MWAIT2flg(0x10),
 		.exit_latency = 20,
 		.target_residency = 80,
 	},
 	{ /* MWAIT C3 */ },
 	{ /* MWAIT C4 */
 		.name = "C4-ATM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x30) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 100,
 		.target_residency = 400,
 	},
 	{ /* MWAIT C5 */ },
 	{ /* MWAIT C6 */
 		.name = "C6-ATM",
-		.flags = CPUIDLE_FLAG_TLB_FLUSHED,
+		.flags = MWAIT2flg(0x52) | CPUIDLE_FLAG_TLB_FLUSHED,
 		.exit_latency = 140,
 		.target_residency = 560,
 	}
 };
 
-static u32 get_driver_data(unsigned int cstate)
-{
-	static const u32 driver_data[] = {
-		[1] /* MWAIT C1 */ = 0x00,
-		[2] /* MWAIT C2 */ = 0x10,
-		[3] /* MWAIT C3 */ = 0x20,
-		[4] /* MWAIT C4 */ = 0x30,
-		[5] /* MWAIT C5 */ = 0x40,
-		[6] /* MWAIT C6 */ = 0x52,
-	};
-
-	return driver_data[cstate < ARRAY_SIZE(driver_data) ? cstate : 0];
-}
-
 static void mwait_idle(void)
 {
 	unsigned int cpu = smp_processor_id();
@@ -477,7 +478,7 @@ static int mwait_idle_cpu_init(struct notifier_block *nfb,
 
 		cx = dev->states + dev->count;
 		cx->type = cstate;
-		cx->address = get_driver_data(cstate);
+		cx->address = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		cx->entry_method = ACPI_CSTATE_EM_FFH;
 		cx->latency = cpuidle_state_table[cstate].exit_latency;
 		cx->target_residency =
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMfH-0006li-QY; Mon, 22 Apr 2013 19:44:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfG-0006lU-Kh
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:38 +0000
Received: from [85.158.137.99:36351] by server-15.bemta-3.messagelabs.com id
	A3/AA-23142-52395715; Mon, 22 Apr 2013 19:44:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1366659875!18529517!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18650 invoked from network); 22 Apr 2013 19:44:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfD-0000g7-Fu
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfD-0005lG-E5
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:35 +0000
Date: Mon, 22 Apr 2013 19:44:35 +0000
Message-Id: <E1UUMfD-0005lG-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: code clean-ups;
	no functional changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a76d139f183a20b3d6cbae4259cf0585bf876eb3
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:55 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:31:58 2013 +0100

    mini-os/x86-64 entry: code clean-ups; no functional changes
    
    Make use of tabs and spaces consistent in arch/x86/x86_64.S
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   61 +++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index a65e5d5..79099f1 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -78,6 +78,7 @@ NMI_MASK = 0x80000000
 	jmp  hypercall_page + (__HYPERVISOR_iret * 32)
 .endm
 
+
 /*
  * Exception entry point. This expects an error code/orig_rax on the stack
  * and the exception handler in %rax.	
@@ -103,7 +104,7 @@ ENTRY(error_entry)
 	movq %r15,(%rsp) 
 
 error_call_handler:
-	movq %rdi, RDI(%rsp)            
+	movq %rdi, RDI(%rsp)
 	movq %rsp,%rdi
 	movq ORIG_RAX(%rsp),%rsi	# get error code 
 	movq $-1,ORIG_RAX(%rsp)
@@ -111,9 +112,9 @@ error_call_handler:
 	jmp error_exit
 
 .macro zeroentry sym
-    movq (%rsp),%rcx
-    movq 8(%rsp),%r11
-    addq $0x10,%rsp /* skip rcx and r11 */
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
 	pushq $0	/* push error code/oldrax */ 
 	pushq %rax	/* push real oldrax to the rdi slot */ 
 	leaq  \sym(%rip),%rax
@@ -121,9 +122,9 @@ error_call_handler:
 .endm	
 
 .macro errorentry sym
-        movq (%rsp),%rcx
-        movq 8(%rsp),%r11
-        addq $0x10,%rsp /* rsp points to the error code */
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* rsp points to the error code */
 	pushq %rax
 	leaq  \sym(%rip),%rax
 	jmp error_entry
@@ -147,39 +148,39 @@ error_call_handler:
 
 
 ENTRY(hypervisor_callback)
-    zeroentry hypervisor_callback2
+	zeroentry hypervisor_callback2
 
 ENTRY(hypervisor_callback2)
-        movq %rdi, %rsp 
-11:     movq %gs:8,%rax
-        incl %gs:0
-        cmovzq %rax,%rsp
-        pushq %rdi
-        call do_hypervisor_callback 
-        popq %rsp
-        decl %gs:0
-        jmp error_exit
-
-restore_all_enable_events:  
+	movq %rdi, %rsp
+11:	movq %gs:8,%rax
+	incl %gs:0
+	cmovzq %rax,%rsp
+	pushq %rdi
+	call do_hypervisor_callback
+	popq %rsp
+	decl %gs:0
+	jmp error_exit
+
+restore_all_enable_events:
 	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
 
 scrit:	/**** START OF CRITICAL REGION ****/
 	XEN_TEST_PENDING(%rsi)
 	jnz  14f			# process more events if necessary...
 	XEN_PUT_VCPU_INFO(%rsi)
-        RESTORE_ALL
-        HYPERVISOR_IRET 0
-        
+	RESTORE_ALL
+	HYPERVISOR_IRET 0
+
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
 	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
-        movq %rsp,%rdi                  # set the argument again
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
+	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
 
@@ -193,7 +194,7 @@ retint_restore_args:
 	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
 	jnz restore_all_enable_events	#        != 0 => enable event delivery
 	XEN_PUT_VCPU_INFO(%rsi)
-		
+
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:44:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:44:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMfH-0006li-QY; Mon, 22 Apr 2013 19:44:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfG-0006lU-Kh
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:38 +0000
Received: from [85.158.137.99:36351] by server-15.bemta-3.messagelabs.com id
	A3/AA-23142-52395715; Mon, 22 Apr 2013 19:44:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1366659875!18529517!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18650 invoked from network); 22 Apr 2013 19:44:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfD-0000g7-Fu
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfD-0005lG-E5
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:35 +0000
Date: Mon, 22 Apr 2013 19:44:35 +0000
Message-Id: <E1UUMfD-0005lG-E5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: code clean-ups;
	no functional changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a76d139f183a20b3d6cbae4259cf0585bf876eb3
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:55 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:31:58 2013 +0100

    mini-os/x86-64 entry: code clean-ups; no functional changes
    
    Make use of tabs and spaces consistent in arch/x86/x86_64.S
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   61 +++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index a65e5d5..79099f1 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -78,6 +78,7 @@ NMI_MASK = 0x80000000
 	jmp  hypercall_page + (__HYPERVISOR_iret * 32)
 .endm
 
+
 /*
  * Exception entry point. This expects an error code/orig_rax on the stack
  * and the exception handler in %rax.	
@@ -103,7 +104,7 @@ ENTRY(error_entry)
 	movq %r15,(%rsp) 
 
 error_call_handler:
-	movq %rdi, RDI(%rsp)            
+	movq %rdi, RDI(%rsp)
 	movq %rsp,%rdi
 	movq ORIG_RAX(%rsp),%rsi	# get error code 
 	movq $-1,ORIG_RAX(%rsp)
@@ -111,9 +112,9 @@ error_call_handler:
 	jmp error_exit
 
 .macro zeroentry sym
-    movq (%rsp),%rcx
-    movq 8(%rsp),%r11
-    addq $0x10,%rsp /* skip rcx and r11 */
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
 	pushq $0	/* push error code/oldrax */ 
 	pushq %rax	/* push real oldrax to the rdi slot */ 
 	leaq  \sym(%rip),%rax
@@ -121,9 +122,9 @@ error_call_handler:
 .endm	
 
 .macro errorentry sym
-        movq (%rsp),%rcx
-        movq 8(%rsp),%r11
-        addq $0x10,%rsp /* rsp points to the error code */
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* rsp points to the error code */
 	pushq %rax
 	leaq  \sym(%rip),%rax
 	jmp error_entry
@@ -147,39 +148,39 @@ error_call_handler:
 
 
 ENTRY(hypervisor_callback)
-    zeroentry hypervisor_callback2
+	zeroentry hypervisor_callback2
 
 ENTRY(hypervisor_callback2)
-        movq %rdi, %rsp 
-11:     movq %gs:8,%rax
-        incl %gs:0
-        cmovzq %rax,%rsp
-        pushq %rdi
-        call do_hypervisor_callback 
-        popq %rsp
-        decl %gs:0
-        jmp error_exit
-
-restore_all_enable_events:  
+	movq %rdi, %rsp
+11:	movq %gs:8,%rax
+	incl %gs:0
+	cmovzq %rax,%rsp
+	pushq %rdi
+	call do_hypervisor_callback
+	popq %rsp
+	decl %gs:0
+	jmp error_exit
+
+restore_all_enable_events:
 	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
 
 scrit:	/**** START OF CRITICAL REGION ****/
 	XEN_TEST_PENDING(%rsi)
 	jnz  14f			# process more events if necessary...
 	XEN_PUT_VCPU_INFO(%rsi)
-        RESTORE_ALL
-        HYPERVISOR_IRET 0
-        
+	RESTORE_ALL
+	HYPERVISOR_IRET 0
+
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
 	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp) 
-	movq %rbp,4*8(%rsp) 
-	movq %r12,3*8(%rsp) 
-	movq %r13,2*8(%rsp) 
-	movq %r14,1*8(%rsp) 
-	movq %r15,(%rsp) 
-        movq %rsp,%rdi                  # set the argument again
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
+	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
 
@@ -193,7 +194,7 @@ retint_restore_args:
 	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
 	jnz restore_all_enable_events	#        != 0 => enable event delivery
 	XEN_PUT_VCPU_INFO(%rsi)
-		
+
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMfe-0006oh-UR; Mon, 22 Apr 2013 19:45:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfd-0006oQ-KU
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:02 +0000
Received: from [85.158.137.99:37248] by server-4.bemta-3.messagelabs.com id
	18/80-21470-A3395715; Mon, 22 Apr 2013 19:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1366659896!13571272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7391 invoked from network); 22 Apr 2013 19:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfY-0000gJ-NL
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfY-0005m3-LG
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:56 +0000
Date: Mon, 22 Apr 2013 19:44:56 +0000
Message-Id: <E1UUMfY-0005m3-LG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: code refactoring;
	no functional changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf65a5d69b1f83a1b4f598c4e1d531a3ff2dbfe1
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:57 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:35 2013 +0100

    mini-os/x86-64 entry: code refactoring; no functional changes
    
    Re-arrange assembly code blocks so that they are in called
    order instead of jumping around, enhancing readability.
    Macros are grouped together as well.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |  113 +++++++++++++++++++-------------------
 1 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 24f35cd..d9b34a7 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -36,6 +36,22 @@ hypercall_page:
         .org 0x3000
 
 
+#define XEN_GET_VCPU_INFO(reg)	movq HYPERVISOR_shared_info,reg
+#define XEN_PUT_VCPU_INFO(reg)
+#define XEN_PUT_VCPU_INFO_fixup
+#define XEN_LOCKED_BLOCK_EVENTS(reg)	movb $1,evtchn_upcall_mask(reg)
+#define XEN_LOCKED_UNBLOCK_EVENTS(reg)	movb $0,evtchn_upcall_mask(reg)
+#define XEN_TEST_PENDING(reg)	testb $0xFF,evtchn_upcall_pending(reg)
+
+#define XEN_BLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
+                    			XEN_LOCKED_BLOCK_EVENTS(reg)	; \
+    				            XEN_PUT_VCPU_INFO(reg)
+
+#define XEN_UNBLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
+                				XEN_LOCKED_UNBLOCK_EVENTS(reg)	; \
+    			            	XEN_PUT_VCPU_INFO(reg)
+
+
 /* Offsets into shared_info_t. */                
 #define evtchn_upcall_pending		/* 0 */
 #define evtchn_upcall_mask		1
@@ -46,6 +62,27 @@ NMI_MASK = 0x80000000
 #define ORIG_RAX 120       /* + error_code */ 
 #define EFLAGS 144
 
+
+/* Macros */
+.macro zeroentry sym
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
+	pushq $0	/* push error code/oldrax */
+	pushq %rax	/* push real oldrax to the rdi slot */
+	leaq  \sym(%rip),%rax
+	jmp error_entry
+.endm
+
+.macro errorentry sym
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* rsp points to the error code */
+	pushq %rax
+	leaq  \sym(%rip),%rax
+	jmp error_entry
+.endm
+
 .macro RESTORE_ALL
 	movq (%rsp),%r11
 	movq 1*8(%rsp),%r10
@@ -130,42 +167,10 @@ error_call_handler:
 	call *%rax
 	jmp error_exit
 
-.macro zeroentry sym
-	movq (%rsp),%rcx
-	movq 8(%rsp),%r11
-	addq $0x10,%rsp /* skip rcx and r11 */
-	pushq $0	/* push error code/oldrax */ 
-	pushq %rax	/* push real oldrax to the rdi slot */ 
-	leaq  \sym(%rip),%rax
-	jmp error_entry
-.endm	
-
-.macro errorentry sym
-	movq (%rsp),%rcx
-	movq 8(%rsp),%r11
-	addq $0x10,%rsp /* rsp points to the error code */
-	pushq %rax
-	leaq  \sym(%rip),%rax
-	jmp error_entry
-.endm
-
-#define XEN_GET_VCPU_INFO(reg)	movq HYPERVISOR_shared_info,reg
-#define XEN_PUT_VCPU_INFO(reg)
-#define XEN_PUT_VCPU_INFO_fixup
-#define XEN_LOCKED_BLOCK_EVENTS(reg)	movb $1,evtchn_upcall_mask(reg)
-#define XEN_LOCKED_UNBLOCK_EVENTS(reg)	movb $0,evtchn_upcall_mask(reg)
-#define XEN_TEST_PENDING(reg)	testb $0xFF,evtchn_upcall_pending(reg)
-
-#define XEN_BLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
-                    			XEN_LOCKED_BLOCK_EVENTS(reg)	; \
-    				            XEN_PUT_VCPU_INFO(reg)
-
-#define XEN_UNBLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
-                				XEN_LOCKED_UNBLOCK_EVENTS(reg)	; \
-    			            	XEN_PUT_VCPU_INFO(reg)
-
-
 
+/*
+ * Xen event (virtual interrupt) entry point.
+ */
 ENTRY(hypervisor_callback)
 	zeroentry hypervisor_callback2
 
@@ -178,7 +183,23 @@ ENTRY(hypervisor_callback2)
 	call do_hypervisor_callback
 	popq %rsp
 	decl %gs:0
-	jmp error_exit
+
+error_exit:
+	RESTORE_REST
+	XEN_BLOCK_EVENTS(%rsi)		
+
+retint_kernel:
+retint_restore_args:
+	movl EFLAGS-6*8(%rsp), %eax
+	shr $9, %eax			# EAX[0] == IRET_EFLAGS.IF
+	XEN_GET_VCPU_INFO(%rsi)
+	andb evtchn_upcall_mask(%rsi),%al
+	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
+	jnz restore_all_enable_events	#        != 0 => enable event delivery
+	XEN_PUT_VCPU_INFO(%rsi)
+
+	RESTORE_ALL
+	HYPERVISOR_IRET 0
 
 restore_all_enable_events:
 	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
@@ -198,26 +219,6 @@ scrit:	/**** START OF CRITICAL REGION ****/
 ecrit:  /**** END OF CRITICAL REGION ****/
 
 
-retint_kernel:
-retint_restore_args:
-	movl EFLAGS-6*8(%rsp), %eax
-	shr $9, %eax			# EAX[0] == IRET_EFLAGS.IF
-	XEN_GET_VCPU_INFO(%rsi)
-	andb evtchn_upcall_mask(%rsi),%al
-	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
-	jnz restore_all_enable_events	#        != 0 => enable event delivery
-	XEN_PUT_VCPU_INFO(%rsi)
-
-	RESTORE_ALL
-	HYPERVISOR_IRET 0
-
-
-error_exit:
-	RESTORE_REST
-	XEN_BLOCK_EVENTS(%rsi)		
-	jmp retint_kernel
-
-
 
 ENTRY(failsafe_callback)
         popq  %rcx
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:06 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMfe-0006oh-UR; Mon, 22 Apr 2013 19:45:02 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfd-0006oQ-KU
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:02 +0000
Received: from [85.158.137.99:37248] by server-4.bemta-3.messagelabs.com id
	18/80-21470-A3395715; Mon, 22 Apr 2013 19:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-217.messagelabs.com!1366659896!13571272!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7391 invoked from network); 22 Apr 2013 19:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfY-0000gJ-NL
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfY-0005m3-LG
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:56 +0000
Date: Mon, 22 Apr 2013 19:44:56 +0000
Message-Id: <E1UUMfY-0005m3-LG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: code refactoring;
	no functional changes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf65a5d69b1f83a1b4f598c4e1d531a3ff2dbfe1
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:57 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:35 2013 +0100

    mini-os/x86-64 entry: code refactoring; no functional changes
    
    Re-arrange assembly code blocks so that they are in called
    order instead of jumping around, enhancing readability.
    Macros are grouped together as well.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |  113 +++++++++++++++++++-------------------
 1 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 24f35cd..d9b34a7 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -36,6 +36,22 @@ hypercall_page:
         .org 0x3000
 
 
+#define XEN_GET_VCPU_INFO(reg)	movq HYPERVISOR_shared_info,reg
+#define XEN_PUT_VCPU_INFO(reg)
+#define XEN_PUT_VCPU_INFO_fixup
+#define XEN_LOCKED_BLOCK_EVENTS(reg)	movb $1,evtchn_upcall_mask(reg)
+#define XEN_LOCKED_UNBLOCK_EVENTS(reg)	movb $0,evtchn_upcall_mask(reg)
+#define XEN_TEST_PENDING(reg)	testb $0xFF,evtchn_upcall_pending(reg)
+
+#define XEN_BLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
+                    			XEN_LOCKED_BLOCK_EVENTS(reg)	; \
+    				            XEN_PUT_VCPU_INFO(reg)
+
+#define XEN_UNBLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
+                				XEN_LOCKED_UNBLOCK_EVENTS(reg)	; \
+    			            	XEN_PUT_VCPU_INFO(reg)
+
+
 /* Offsets into shared_info_t. */                
 #define evtchn_upcall_pending		/* 0 */
 #define evtchn_upcall_mask		1
@@ -46,6 +62,27 @@ NMI_MASK = 0x80000000
 #define ORIG_RAX 120       /* + error_code */ 
 #define EFLAGS 144
 
+
+/* Macros */
+.macro zeroentry sym
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* skip rcx and r11 */
+	pushq $0	/* push error code/oldrax */
+	pushq %rax	/* push real oldrax to the rdi slot */
+	leaq  \sym(%rip),%rax
+	jmp error_entry
+.endm
+
+.macro errorentry sym
+	movq (%rsp),%rcx
+	movq 8(%rsp),%r11
+	addq $0x10,%rsp /* rsp points to the error code */
+	pushq %rax
+	leaq  \sym(%rip),%rax
+	jmp error_entry
+.endm
+
 .macro RESTORE_ALL
 	movq (%rsp),%r11
 	movq 1*8(%rsp),%r10
@@ -130,42 +167,10 @@ error_call_handler:
 	call *%rax
 	jmp error_exit
 
-.macro zeroentry sym
-	movq (%rsp),%rcx
-	movq 8(%rsp),%r11
-	addq $0x10,%rsp /* skip rcx and r11 */
-	pushq $0	/* push error code/oldrax */ 
-	pushq %rax	/* push real oldrax to the rdi slot */ 
-	leaq  \sym(%rip),%rax
-	jmp error_entry
-.endm	
-
-.macro errorentry sym
-	movq (%rsp),%rcx
-	movq 8(%rsp),%r11
-	addq $0x10,%rsp /* rsp points to the error code */
-	pushq %rax
-	leaq  \sym(%rip),%rax
-	jmp error_entry
-.endm
-
-#define XEN_GET_VCPU_INFO(reg)	movq HYPERVISOR_shared_info,reg
-#define XEN_PUT_VCPU_INFO(reg)
-#define XEN_PUT_VCPU_INFO_fixup
-#define XEN_LOCKED_BLOCK_EVENTS(reg)	movb $1,evtchn_upcall_mask(reg)
-#define XEN_LOCKED_UNBLOCK_EVENTS(reg)	movb $0,evtchn_upcall_mask(reg)
-#define XEN_TEST_PENDING(reg)	testb $0xFF,evtchn_upcall_pending(reg)
-
-#define XEN_BLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
-                    			XEN_LOCKED_BLOCK_EVENTS(reg)	; \
-    				            XEN_PUT_VCPU_INFO(reg)
-
-#define XEN_UNBLOCK_EVENTS(reg)	XEN_GET_VCPU_INFO(reg)			; \
-                				XEN_LOCKED_UNBLOCK_EVENTS(reg)	; \
-    			            	XEN_PUT_VCPU_INFO(reg)
-
-
 
+/*
+ * Xen event (virtual interrupt) entry point.
+ */
 ENTRY(hypervisor_callback)
 	zeroentry hypervisor_callback2
 
@@ -178,7 +183,23 @@ ENTRY(hypervisor_callback2)
 	call do_hypervisor_callback
 	popq %rsp
 	decl %gs:0
-	jmp error_exit
+
+error_exit:
+	RESTORE_REST
+	XEN_BLOCK_EVENTS(%rsi)		
+
+retint_kernel:
+retint_restore_args:
+	movl EFLAGS-6*8(%rsp), %eax
+	shr $9, %eax			# EAX[0] == IRET_EFLAGS.IF
+	XEN_GET_VCPU_INFO(%rsi)
+	andb evtchn_upcall_mask(%rsi),%al
+	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
+	jnz restore_all_enable_events	#        != 0 => enable event delivery
+	XEN_PUT_VCPU_INFO(%rsi)
+
+	RESTORE_ALL
+	HYPERVISOR_IRET 0
 
 restore_all_enable_events:
 	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
@@ -198,26 +219,6 @@ scrit:	/**** START OF CRITICAL REGION ****/
 ecrit:  /**** END OF CRITICAL REGION ****/
 
 
-retint_kernel:
-retint_restore_args:
-	movl EFLAGS-6*8(%rsp), %eax
-	shr $9, %eax			# EAX[0] == IRET_EFLAGS.IF
-	XEN_GET_VCPU_INFO(%rsi)
-	andb evtchn_upcall_mask(%rsi),%al
-	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
-	jnz restore_all_enable_events	#        != 0 => enable event delivery
-	XEN_PUT_VCPU_INFO(%rsi)
-
-	RESTORE_ALL
-	HYPERVISOR_IRET 0
-
-
-error_exit:
-	RESTORE_REST
-	XEN_BLOCK_EVENTS(%rsi)		
-	jmp retint_kernel
-
-
 
 ENTRY(failsafe_callback)
         popq  %rcx
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMfw-0006rX-3c; Mon, 22 Apr 2013 19:45:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfu-0006r8-DQ
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:18 +0000
Received: from [85.158.138.51:50239] by server-3.bemta-3.messagelabs.com id
	7E/D3-26934-C4395715; Mon, 22 Apr 2013 19:45:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366659914!26489977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29322 invoked from network); 22 Apr 2013 19:45:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfj-0000hI-Bd
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfi-0005mY-RB
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:07 +0000
Date: Mon, 22 Apr 2013 19:45:06 +0000
Message-Id: <E1UUMfi-0005mY-RB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: remove
	unnecessary event blocking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae81a2fe4c70d3905fecb91112f0524c68e46902
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:58 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:46 2013 +0100

    mini-os/x86-64 entry: remove unnecessary event blocking
    
    We don't need to block events here because:
     - if we came from "hypervisor_callback", events are disabled at this point,
       no need to block again;
     - if we came from "error_entry", we shouldn't touch event mask, for
       exception hanlding are meant to be interrupted by Xen events (virtual
       irq).
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index d9b34a7..909024d 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -186,7 +186,6 @@ ENTRY(hypervisor_callback2)
 
 error_exit:
 	RESTORE_REST
-	XEN_BLOCK_EVENTS(%rsi)		
 
 retint_kernel:
 retint_restore_args:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMfw-0006rX-3c; Mon, 22 Apr 2013 19:45:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfu-0006r8-DQ
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:18 +0000
Received: from [85.158.138.51:50239] by server-3.bemta-3.messagelabs.com id
	7E/D3-26934-C4395715; Mon, 22 Apr 2013 19:45:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-174.messagelabs.com!1366659914!26489977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29322 invoked from network); 22 Apr 2013 19:45:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfj-0000hI-Bd
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfi-0005mY-RB
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:07 +0000
Date: Mon, 22 Apr 2013 19:45:06 +0000
Message-Id: <E1UUMfi-0005mY-RB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: remove
	unnecessary event blocking
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae81a2fe4c70d3905fecb91112f0524c68e46902
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:58 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:46 2013 +0100

    mini-os/x86-64 entry: remove unnecessary event blocking
    
    We don't need to block events here because:
     - if we came from "hypervisor_callback", events are disabled at this point,
       no need to block again;
     - if we came from "error_entry", we shouldn't touch event mask, for
       exception hanlding are meant to be interrupted by Xen events (virtual
       irq).
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index d9b34a7..909024d 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -186,7 +186,6 @@ ENTRY(hypervisor_callback2)
 
 error_exit:
 	RESTORE_REST
-	XEN_BLOCK_EVENTS(%rsi)		
 
 retint_kernel:
 retint_restore_args:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMg5-0006t1-6V; Mon, 22 Apr 2013 19:45:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMg3-0006si-79
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:27 +0000
Received: from [85.158.138.51:50517] by server-11.bemta-3.messagelabs.com id
	B6/34-01263-65395715; Mon, 22 Apr 2013 19:45:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1366659924!29382914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10804 invoked from network); 22 Apr 2013 19:45:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfz-0000hQ-W6
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfz-0005mw-U3
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:23 +0000
Date: Mon, 22 Apr 2013 19:45:23 +0000
Message-Id: <E1UUMfz-0005mw-U3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: defer
	RESTORE_REST until return
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04823e2ad2a8902bf6d24dc1677c72ac9658b792
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:59 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:49 2013 +0100

    mini-os/x86-64 entry: defer RESTORE_REST until return
    
    No need to do a RESTORE_REST at this point because if we saw pending
    events after we enabled event delivery, we have to do a SAVE_REST again.
    Instead, we do a "lazy" RESTORE_REST, deferring it until actual return.
    The offset of saved-on-stack rflags register is changed as well.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 909024d..20ab477 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -60,7 +60,7 @@ NMI_MASK = 0x80000000
 
 #define RDI 112
 #define ORIG_RAX 120       /* + error_code */ 
-#define EFLAGS 144
+#define RFLAGS 144
 
 
 /* Macros */
@@ -185,18 +185,17 @@ ENTRY(hypervisor_callback2)
 	decl %gs:0
 
 error_exit:
-	RESTORE_REST
-
 retint_kernel:
-retint_restore_args:
-	movl EFLAGS-6*8(%rsp), %eax
-	shr $9, %eax			# EAX[0] == IRET_EFLAGS.IF
+	movl RFLAGS(%rsp), %eax
+	shr $9, %eax			# EAX[0] == IRET_RFLAGS.IF
 	XEN_GET_VCPU_INFO(%rsi)
 	andb evtchn_upcall_mask(%rsi),%al
-	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
+	andb $1,%al			# EAX[0] == IRET_RFLAGS.IF & event_mask
 	jnz restore_all_enable_events	#        != 0 => enable event delivery
 	XEN_PUT_VCPU_INFO(%rsi)
 
+retint_restore_args:
+	RESTORE_REST
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
@@ -207,12 +206,13 @@ scrit:	/**** START OF CRITICAL REGION ****/
 	XEN_TEST_PENDING(%rsi)
 	jnz  14f			# process more events if necessary...
 	XEN_PUT_VCPU_INFO(%rsi)
+
+	RESTORE_REST
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
-	SAVE_REST
 	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:31 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMg5-0006t1-6V; Mon, 22 Apr 2013 19:45:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMg3-0006si-79
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:27 +0000
Received: from [85.158.138.51:50517] by server-11.bemta-3.messagelabs.com id
	B6/34-01263-65395715; Mon, 22 Apr 2013 19:45:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-174.messagelabs.com!1366659924!29382914!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10804 invoked from network); 22 Apr 2013 19:45:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfz-0000hQ-W6
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfz-0005mw-U3
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:23 +0000
Date: Mon, 22 Apr 2013 19:45:23 +0000
Message-Id: <E1UUMfz-0005mw-U3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: defer
	RESTORE_REST until return
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 04823e2ad2a8902bf6d24dc1677c72ac9658b792
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:59 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:49 2013 +0100

    mini-os/x86-64 entry: defer RESTORE_REST until return
    
    No need to do a RESTORE_REST at this point because if we saw pending
    events after we enabled event delivery, we have to do a SAVE_REST again.
    Instead, we do a "lazy" RESTORE_REST, deferring it until actual return.
    The offset of saved-on-stack rflags register is changed as well.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 909024d..20ab477 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -60,7 +60,7 @@ NMI_MASK = 0x80000000
 
 #define RDI 112
 #define ORIG_RAX 120       /* + error_code */ 
-#define EFLAGS 144
+#define RFLAGS 144
 
 
 /* Macros */
@@ -185,18 +185,17 @@ ENTRY(hypervisor_callback2)
 	decl %gs:0
 
 error_exit:
-	RESTORE_REST
-
 retint_kernel:
-retint_restore_args:
-	movl EFLAGS-6*8(%rsp), %eax
-	shr $9, %eax			# EAX[0] == IRET_EFLAGS.IF
+	movl RFLAGS(%rsp), %eax
+	shr $9, %eax			# EAX[0] == IRET_RFLAGS.IF
 	XEN_GET_VCPU_INFO(%rsi)
 	andb evtchn_upcall_mask(%rsi),%al
-	andb $1,%al			# EAX[0] == IRET_EFLAGS.IF & event_mask
+	andb $1,%al			# EAX[0] == IRET_RFLAGS.IF & event_mask
 	jnz restore_all_enable_events	#        != 0 => enable event delivery
 	XEN_PUT_VCPU_INFO(%rsi)
 
+retint_restore_args:
+	RESTORE_REST
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
@@ -207,12 +206,13 @@ scrit:	/**** START OF CRITICAL REGION ****/
 	XEN_TEST_PENDING(%rsi)
 	jnz  14f			# process more events if necessary...
 	XEN_PUT_VCPU_INFO(%rsi)
+
+	RESTORE_REST
 	RESTORE_ALL
 	HYPERVISOR_IRET 0
 
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
-	SAVE_REST
 	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgH-0006vF-Aa; Mon, 22 Apr 2013 19:45:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgF-0006uy-MU
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:39 +0000
Received: from [85.158.139.211:10709] by server-13.bemta-5.messagelabs.com id
	0C/77-20553-26395715; Mon, 22 Apr 2013 19:45:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1366659934!19600135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30189 invoked from network); 22 Apr 2013 19:45:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgA-0000hY-5S
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgA-0005ns-3Y
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:34 +0000
Date: Mon, 22 Apr 2013 19:45:34 +0000
Message-Id: <E1UUMgA-0005ns-3Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: check against
	nested events and try to fix up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b09ea2a57899624ba8da6b2efdf1901cda847616
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:47:00 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:51 2013 +0100

    mini-os/x86-64 entry: check against nested events and try to fix up
    
    In hypervisor_callback, check against event re-entrant.
    If we came from the critical region in interrupt context,
    try to fix up by coalescing the two stack frames.
    The execution is resumed as if the second event never happened.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   87 +++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 14 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 20ab477..f022eb3 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -57,10 +57,15 @@ hypercall_page:
 #define evtchn_upcall_mask		1
 
 NMI_MASK = 0x80000000
+KERNEL_CS_MASK = 0xfc
 
-#define RDI 112
-#define ORIG_RAX 120       /* + error_code */ 
-#define RFLAGS 144
+#define RAX       80
+#define RDI      112
+#define ORIG_RAX 120       /* + error_code */
+#define RIP      128
+#define CS       136
+#define RFLAGS   144
+#define RSP      152
 
 
 /* Macros */
@@ -176,6 +181,14 @@ ENTRY(hypervisor_callback)
 
 ENTRY(hypervisor_callback2)
 	movq %rdi, %rsp
+
+	/* check against event re-entrant */
+	movq RIP(%rsp),%rax
+	cmpq $scrit,%rax
+	jb 11f
+	cmpq $ecrit,%rax
+	jb  critical_region_fixup
+
 11:	movq %gs:8,%rax
 	incl %gs:0
 	cmovzq %rax,%rsp
@@ -200,22 +213,68 @@ retint_restore_args:
 	HYPERVISOR_IRET 0
 
 restore_all_enable_events:
-	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
-
-scrit:	/**** START OF CRITICAL REGION ****/
-	XEN_TEST_PENDING(%rsi)
-	jnz  14f			# process more events if necessary...
-	XEN_PUT_VCPU_INFO(%rsi)
-
 	RESTORE_REST
 	RESTORE_ALL
+	pushq %rax                      # save rax for it will be clobbered later
+	RSP_OFFSET=8                    # record the stack frame layout changes
+	XEN_GET_VCPU_INFO(%rax)         # safe to use rax since it is saved
+	XEN_UNBLOCK_EVENTS(%rax)
+
+scrit:	/**** START OF CRITICAL REGION ****/
+	XEN_TEST_PENDING(%rax)
+	jz 12f
+	XEN_LOCKED_BLOCK_EVENTS(%rax)   # if pending, mask events and handle
+	                                # by jumping to hypervisor_prologue
+12:	popq %rax                       # all registers restored from this point
+
+restore_end:
+	jnz hypervisor_prologue         # safe to jump out of critical region
+	                                # because events are masked if ZF = 0
 	HYPERVISOR_IRET 0
+ecrit:  /**** END OF CRITICAL REGION ****/
 
-14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
-	XEN_PUT_VCPU_INFO(%rsi)
-	movq %rsp,%rdi                  # set the argument again
+# Set up the stack as Xen does before calling event callback
+hypervisor_prologue:
+	pushq %r11
+	pushq %rcx
+	jmp hypervisor_callback
+
+# [How we do the fixup]. We want to merge the current stack frame with the
+# just-interrupted frame. How we do this depends on where in the critical
+# region the interrupted handler was executing, and so if rax has been
+# restored. We determine by comparing interrupted rip with "restore_end".
+# We always copy all registers below RIP from the current stack frame
+# to the end of the previous activation frame so that we can continue
+# as if we've never even reached 11 running in the old activation frame.
+
+critical_region_fixup:
+	# Set up source and destination region pointers
+	leaq RIP(%rsp),%rsi   # esi points at end of src region
+	# Acquire interrupted rsp which was saved-on-stack. This points to
+	# the end of dst region. Note that it is not necessarily current rsp
+	# plus 0xb0, because the second interrupt might align the stack frame.
+	movq RSP(%rsp),%rdi   # edi points at end of dst region
+
+	cmpq $restore_end,%rax
+	jae  13f
+
+	# If interrupted rip is before restore_end
+	# then rax hasn't been restored yet
+	movq (%rdi),%rax
+	movq %rax, RAX(%rsp)  # save rax
+	addq $RSP_OFFSET,%rdi
+
+	# Set up the copy
+13:	movq $RIP,%rcx
+	shr  $3,%rcx          # convert bytes into count of 64-bit entities
+15:	subq $8,%rsi          # pre-decrementing copy loop
+	subq $8,%rdi
+	movq (%rsi),%rax
+	movq %rax,(%rdi)
+	loop 15b
+16:	movq %rdi,%rsp        # final rdi is top of merged stack
+	andb $KERNEL_CS_MASK,CS(%rsp)      # CS might have changed
 	jmp  11b
-ecrit:  /**** END OF CRITICAL REGION ****/
 
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:43 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgH-0006vF-Aa; Mon, 22 Apr 2013 19:45:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgF-0006uy-MU
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:39 +0000
Received: from [85.158.139.211:10709] by server-13.bemta-5.messagelabs.com id
	0C/77-20553-26395715; Mon, 22 Apr 2013 19:45:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1366659934!19600135!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30189 invoked from network); 22 Apr 2013 19:45:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgA-0000hY-5S
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgA-0005ns-3Y
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:34 +0000
Date: Mon, 22 Apr 2013 19:45:34 +0000
Message-Id: <E1UUMgA-0005ns-3Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: check against
	nested events and try to fix up
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b09ea2a57899624ba8da6b2efdf1901cda847616
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:47:00 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:51 2013 +0100

    mini-os/x86-64 entry: check against nested events and try to fix up
    
    In hypervisor_callback, check against event re-entrant.
    If we came from the critical region in interrupt context,
    try to fix up by coalescing the two stack frames.
    The execution is resumed as if the second event never happened.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   87 +++++++++++++++++++++++++++++++------
 1 files changed, 73 insertions(+), 14 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 20ab477..f022eb3 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -57,10 +57,15 @@ hypercall_page:
 #define evtchn_upcall_mask		1
 
 NMI_MASK = 0x80000000
+KERNEL_CS_MASK = 0xfc
 
-#define RDI 112
-#define ORIG_RAX 120       /* + error_code */ 
-#define RFLAGS 144
+#define RAX       80
+#define RDI      112
+#define ORIG_RAX 120       /* + error_code */
+#define RIP      128
+#define CS       136
+#define RFLAGS   144
+#define RSP      152
 
 
 /* Macros */
@@ -176,6 +181,14 @@ ENTRY(hypervisor_callback)
 
 ENTRY(hypervisor_callback2)
 	movq %rdi, %rsp
+
+	/* check against event re-entrant */
+	movq RIP(%rsp),%rax
+	cmpq $scrit,%rax
+	jb 11f
+	cmpq $ecrit,%rax
+	jb  critical_region_fixup
+
 11:	movq %gs:8,%rax
 	incl %gs:0
 	cmovzq %rax,%rsp
@@ -200,22 +213,68 @@ retint_restore_args:
 	HYPERVISOR_IRET 0
 
 restore_all_enable_events:
-	XEN_UNBLOCK_EVENTS(%rsi)        # %rsi is already set up...
-
-scrit:	/**** START OF CRITICAL REGION ****/
-	XEN_TEST_PENDING(%rsi)
-	jnz  14f			# process more events if necessary...
-	XEN_PUT_VCPU_INFO(%rsi)
-
 	RESTORE_REST
 	RESTORE_ALL
+	pushq %rax                      # save rax for it will be clobbered later
+	RSP_OFFSET=8                    # record the stack frame layout changes
+	XEN_GET_VCPU_INFO(%rax)         # safe to use rax since it is saved
+	XEN_UNBLOCK_EVENTS(%rax)
+
+scrit:	/**** START OF CRITICAL REGION ****/
+	XEN_TEST_PENDING(%rax)
+	jz 12f
+	XEN_LOCKED_BLOCK_EVENTS(%rax)   # if pending, mask events and handle
+	                                # by jumping to hypervisor_prologue
+12:	popq %rax                       # all registers restored from this point
+
+restore_end:
+	jnz hypervisor_prologue         # safe to jump out of critical region
+	                                # because events are masked if ZF = 0
 	HYPERVISOR_IRET 0
+ecrit:  /**** END OF CRITICAL REGION ****/
 
-14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
-	XEN_PUT_VCPU_INFO(%rsi)
-	movq %rsp,%rdi                  # set the argument again
+# Set up the stack as Xen does before calling event callback
+hypervisor_prologue:
+	pushq %r11
+	pushq %rcx
+	jmp hypervisor_callback
+
+# [How we do the fixup]. We want to merge the current stack frame with the
+# just-interrupted frame. How we do this depends on where in the critical
+# region the interrupted handler was executing, and so if rax has been
+# restored. We determine by comparing interrupted rip with "restore_end".
+# We always copy all registers below RIP from the current stack frame
+# to the end of the previous activation frame so that we can continue
+# as if we've never even reached 11 running in the old activation frame.
+
+critical_region_fixup:
+	# Set up source and destination region pointers
+	leaq RIP(%rsp),%rsi   # esi points at end of src region
+	# Acquire interrupted rsp which was saved-on-stack. This points to
+	# the end of dst region. Note that it is not necessarily current rsp
+	# plus 0xb0, because the second interrupt might align the stack frame.
+	movq RSP(%rsp),%rdi   # edi points at end of dst region
+
+	cmpq $restore_end,%rax
+	jae  13f
+
+	# If interrupted rip is before restore_end
+	# then rax hasn't been restored yet
+	movq (%rdi),%rax
+	movq %rax, RAX(%rsp)  # save rax
+	addq $RSP_OFFSET,%rdi
+
+	# Set up the copy
+13:	movq $RIP,%rcx
+	shr  $3,%rcx          # convert bytes into count of 64-bit entities
+15:	subq $8,%rsi          # pre-decrementing copy loop
+	subq $8,%rdi
+	movq (%rsi),%rax
+	movq %rax,(%rdi)
+	loop 15b
+16:	movq %rdi,%rsp        # final rdi is top of merged stack
+	andb $KERNEL_CS_MASK,CS(%rsp)      # CS might have changed
 	jmp  11b
-ecrit:  /**** END OF CRITICAL REGION ****/
 
 
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgP-0006we-EH; Mon, 22 Apr 2013 19:45:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgN-0006wJ-G7
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:47 +0000
Received: from [85.158.143.99:30464] by server-3.bemta-4.messagelabs.com id
	AE/67-02186-A6395715; Mon, 22 Apr 2013 19:45:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1366659944!28961998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20439 invoked from network); 22 Apr 2013 19:45:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgK-0000hl-BU
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgK-0005oE-94
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:44 +0000
Date: Mon, 22 Apr 2013 19:45:44 +0000
Message-Id: <E1UUMgK-0005oE-94@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: do not use is_running to
	decide whether we can write directly to the LR registers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 071c61e7367987a9f71dc18c3c58a5dba659a5c8
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Apr 19 18:24:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:34:10 2013 +0100

    xen/arm: do not use is_running to decide whether we can write directly to the LR registers
    
    During context switch is_running is set for the next vcpu before the
    gic state is actually saved.
    This leads to possible nasty races when interrupts need to be injected
    after is_running is set to the next vcpu but before the currently
    running gic state has been saved from the previous vcpu.
    
    Use current instead of is_running to check which one is the currently
    running vcpu: set_current is called right before __context_switch and
    schedule_tail with interrupt disabled.
    
    Re-enabled interrupts after ctxt_switch_from, so that all the context
    switch saving functions don't have to worry about receiving interrupts
    while saving state.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    5 ++---
 xen/arch/arm/gic.c    |    9 ++++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index e308813..eae42af 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -213,11 +213,10 @@ static void ctxt_switch_to(struct vcpu *n)
 
 static void schedule_tail(struct vcpu *prev)
 {
-    /* Re-enable interrupts before restoring state which may fault. */
-    local_irq_enable();
-
     ctxt_switch_from(prev);
 
+    local_irq_enable();
+
     /* TODO
        update_runstate_area(current);
     */
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0d1ab5a..c3887a9 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -64,12 +64,15 @@ irq_desc_t *__irq_to_desc(int irq)
 void gic_save_state(struct vcpu *v)
 {
     int i;
+    ASSERT(!local_irq_is_enabled());
 
-    spin_lock_irq(&gic.lock);
+    /* No need for spinlocks here because interrupts are disabled around
+     * this call and it only accesses struct vcpu fields that cannot be
+     * accessed simultaneously by another pCPU.
+     */
     for ( i=0; i<nr_lrs; i++)
         v->arch.gic_lr[i] = GICH[GICH_LR + i];
     v->arch.lr_mask = this_cpu(lr_mask);
-    spin_unlock_irq(&gic.lock);
     v->arch.gic_apr = GICH[GICH_APR];
     /* Disable until next VCPU scheduled */
     GICH[GICH_HCR] = 0;
@@ -524,7 +527,7 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
 
     spin_lock_irqsave(&gic.lock, flags);
 
-    if ( v->is_running && list_empty(&v->arch.vgic.lr_pending) )
+    if ( v == current && list_empty(&v->arch.vgic.lr_pending) )
     {
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if (i < nr_lrs) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:45:53 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:45:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgP-0006we-EH; Mon, 22 Apr 2013 19:45:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgN-0006wJ-G7
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:47 +0000
Received: from [85.158.143.99:30464] by server-3.bemta-4.messagelabs.com id
	AE/67-02186-A6395715; Mon, 22 Apr 2013 19:45:46 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-216.messagelabs.com!1366659944!28961998!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20439 invoked from network); 22 Apr 2013 19:45:45 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgK-0000hl-BU
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgK-0005oE-94
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:44 +0000
Date: Mon, 22 Apr 2013 19:45:44 +0000
Message-Id: <E1UUMgK-0005oE-94@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: do not use is_running to
	decide whether we can write directly to the LR registers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 071c61e7367987a9f71dc18c3c58a5dba659a5c8
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Fri Apr 19 18:24:03 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:34:10 2013 +0100

    xen/arm: do not use is_running to decide whether we can write directly to the LR registers
    
    During context switch is_running is set for the next vcpu before the
    gic state is actually saved.
    This leads to possible nasty races when interrupts need to be injected
    after is_running is set to the next vcpu but before the currently
    running gic state has been saved from the previous vcpu.
    
    Use current instead of is_running to check which one is the currently
    running vcpu: set_current is called right before __context_switch and
    schedule_tail with interrupt disabled.
    
    Re-enabled interrupts after ctxt_switch_from, so that all the context
    switch saving functions don't have to worry about receiving interrupts
    while saving state.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    5 ++---
 xen/arch/arm/gic.c    |    9 ++++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index e308813..eae42af 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -213,11 +213,10 @@ static void ctxt_switch_to(struct vcpu *n)
 
 static void schedule_tail(struct vcpu *prev)
 {
-    /* Re-enable interrupts before restoring state which may fault. */
-    local_irq_enable();
-
     ctxt_switch_from(prev);
 
+    local_irq_enable();
+
     /* TODO
        update_runstate_area(current);
     */
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 0d1ab5a..c3887a9 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -64,12 +64,15 @@ irq_desc_t *__irq_to_desc(int irq)
 void gic_save_state(struct vcpu *v)
 {
     int i;
+    ASSERT(!local_irq_is_enabled());
 
-    spin_lock_irq(&gic.lock);
+    /* No need for spinlocks here because interrupts are disabled around
+     * this call and it only accesses struct vcpu fields that cannot be
+     * accessed simultaneously by another pCPU.
+     */
     for ( i=0; i<nr_lrs; i++)
         v->arch.gic_lr[i] = GICH[GICH_LR + i];
     v->arch.lr_mask = this_cpu(lr_mask);
-    spin_unlock_irq(&gic.lock);
     v->arch.gic_apr = GICH[GICH_APR];
     /* Disable until next VCPU scheduled */
     GICH[GICH_HCR] = 0;
@@ -524,7 +527,7 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
 
     spin_lock_irqsave(&gic.lock, flags);
 
-    if ( v->is_running && list_empty(&v->arch.vgic.lr_pending) )
+    if ( v == current && list_empty(&v->arch.vgic.lr_pending) )
     {
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if (i < nr_lrs) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:46:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:46:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgj-00070S-Hn; Mon, 22 Apr 2013 19:46:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgi-000702-BJ
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:08 +0000
Received: from [85.158.137.99:51891] by server-5.bemta-3.messagelabs.com id
	56/5D-30636-F7395715; Mon, 22 Apr 2013 19:46:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1366659965!13507613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26237 invoked from network); 22 Apr 2013 19:46:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:46:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMge-0000iT-Vo
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMge-0005p5-S1
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:04 +0000
Date: Mon, 22 Apr 2013 19:46:04 +0000
Message-Id: <E1UUMge-0005p5-S1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit beb0975bcfd49d0ddd89267af8860c520d2db251
Merge: 592d3ef961cafda917a7f123999dc04d426254ee 9be8a4447103d92843fcfeaad8be42408c90e9a9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Apr 22 12:59:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:59:26 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/efi/boot.c       |   26 ++++++++++++++++++++++++++
 xen/arch/x86/efi/efi.h        |    3 +++
 xen/arch/x86/efi/runtime.c    |   36 ++++++++++++++++++++++++++++++++++++
 xen/include/efi/efiapi.h      |    4 ++++
 xen/include/efi/efierr.h      |    7 +++++++
 xen/include/public/platform.h |    1 +
 6 files changed, 77 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:46:11 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:46:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgj-00070S-Hn; Mon, 22 Apr 2013 19:46:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgi-000702-BJ
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:08 +0000
Received: from [85.158.137.99:51891] by server-5.bemta-3.messagelabs.com id
	56/5D-30636-F7395715; Mon, 22 Apr 2013 19:46:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-217.messagelabs.com!1366659965!13507613!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26237 invoked from network); 22 Apr 2013 19:46:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:46:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMge-0000iT-Vo
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMge-0005p5-S1
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:04 +0000
Date: Mon, 22 Apr 2013 19:46:04 +0000
Message-Id: <E1UUMge-0005p5-S1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit beb0975bcfd49d0ddd89267af8860c520d2db251
Merge: 592d3ef961cafda917a7f123999dc04d426254ee 9be8a4447103d92843fcfeaad8be42408c90e9a9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Apr 22 12:59:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:59:26 2013 +0100

    Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

 xen/arch/x86/efi/boot.c       |   26 ++++++++++++++++++++++++++
 xen/arch/x86/efi/efi.h        |    3 +++
 xen/arch/x86/efi/runtime.c    |   36 ++++++++++++++++++++++++++++++++++++
 xen/include/efi/efiapi.h      |    4 ++++
 xen/include/efi/efierr.h      |    7 +++++++
 xen/include/public/platform.h |    1 +
 6 files changed, 77 insertions(+), 0 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:46:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:46:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgw-00072L-LA; Mon, 22 Apr 2013 19:46:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgv-000720-2P
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:21 +0000
Received: from [85.158.139.83:56858] by server-3.bemta-5.messagelabs.com id
	0E/47-17256-78395715; Mon, 22 Apr 2013 19:46:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1366659955!29546526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3132 invoked from network); 22 Apr 2013 19:45:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgU-0000hu-Ha
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgU-0005oc-Fg
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:54 +0000
Date: Mon, 22 Apr 2013 19:45:54 +0000
Message-Id: <E1UUMgU-0005oc-Fg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Add unsafe decompressors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 592d3ef961cafda917a7f123999dc04d426254ee
Author:     Bastian Blank <bastian@waldi.eu.org>
AuthorDate: Thu Apr 18 12:49:54 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:46:30 2013 +0100

    libxc: Add unsafe decompressors
    
    Add decompressors based on hypervisor code.  This are used in mini-os by
    pv-grub.
    
    This enables pv-grub to boot kernels compressed with e.g. xz, which are
    becoming more common.
    
    Signed-off-by: Bastian Blank <waldi@debian.org>
    
    Adjusted to use terminology "unsafe" rather than "trusted" to indicate
    that the user had better sanitise the data (or not care, as in stub
    domains) as suggested by Tim Deegan. This was effectively a sed script.
    
    Minimise the changes to hypervisor code by moving the "compat layer" into the
    relevant libxc source files (which include the Xen ones).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile                             |    2 +-
 tools/libxc/Makefile                         |    8 ++++
 tools/libxc/xc_dom_bzimageloader.c           |   11 +++++
 tools/libxc/xc_dom_decompress_unsafe.c       |   48 +++++++++++++++++++++
 tools/libxc/xc_dom_decompress_unsafe.h       |   20 +++++++++
 tools/libxc/xc_dom_decompress_unsafe_bzip2.c |   14 ++++++
 tools/libxc/xc_dom_decompress_unsafe_lzma.c  |   14 ++++++
 tools/libxc/xc_dom_decompress_unsafe_lzo1x.c |   49 ++++++++++++++++++++++
 tools/libxc/xc_dom_decompress_unsafe_xz.c    |   57 ++++++++++++++++++++++++++
 xen/common/decompress.h                      |   13 ++++++
 xen/common/lzo.c                             |    3 +
 xen/common/unlzma.c                          |    2 +
 xen/common/unlzo.c                           |    3 +
 xen/common/xz/private.h                      |    3 +
 14 files changed, 246 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 427e4d6..a2ac044 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -331,7 +331,7 @@ $(TARGETS_MINIOS): mini-os-%:
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index d44abf9..640e333 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -68,6 +68,14 @@ GUEST_SRCS-$(CONFIG_X86)     += xc_hvm_build_x86.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_arm.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_hvm_build_arm.c
 
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_bzip2.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzma.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzo1x.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_xz.c
+endif
+
 OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 
 -include $(XEN_TARGET_ARCH)/Makefile
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 6daa78c..3870c6d 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -35,6 +35,8 @@
 #include "xg_private.h"
 #include "xc_dom.h"
 
+#ifndef __MINIOS__
+
 #if defined(HAVE_BZLIB)
 
 #include <bzlib.h>
@@ -562,6 +564,15 @@ static int xc_try_lzo1x_decode(
 
 #endif
 
+#else /* __MINIOS__ */
+
+int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+int xc_try_xz_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+
+#endif /* !__MINIOS__ */
+
 struct setup_header {
     uint8_t  _pad0[0x1f1];  /* skip uninteresting stuff */
     uint8_t  setup_sects;
diff --git a/tools/libxc/xc_dom_decompress_unsafe.c b/tools/libxc/xc_dom_decompress_unsafe.c
new file mode 100644
index 0000000..164e355
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+static struct xc_dom_image *unsafe_dom;
+static unsigned char *output_blob;
+static unsigned int output_size;
+
+static void unsafe_error(const char *msg)
+{
+    xc_dom_panic(unsafe_dom->xch, XC_INVALID_KERNEL, "%s", msg);
+}
+
+static int unsafe_flush(void *src, unsigned int size)
+{
+    void *n = realloc(output_blob, output_size + size);
+    if (!n)
+        return -1;
+    output_blob = n;
+
+    memcpy(&output_blob[output_size], src, size);
+    output_size += size;
+    return size;
+}
+
+int xc_dom_decompress_unsafe(
+    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    int ret;
+
+    unsafe_dom = dom;
+    output_blob = NULL;
+    output_size = 0;
+
+    ret = fn(dom->kernel_blob, dom->kernel_size, NULL, unsafe_flush, NULL, NULL, unsafe_error);
+
+    if (ret)
+        free(output_blob);
+    else {
+        *blob = output_blob;
+        *size = output_size;
+    }
+
+    return ret;
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe.h b/tools/libxc/xc_dom_decompress_unsafe.h
new file mode 100644
index 0000000..64f6886
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe.h
@@ -0,0 +1,20 @@
+#include "xc_dom.h"
+
+typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
+                          int (*fill)(void*, unsigned int),
+                          int (*flush)(void*, unsigned int),
+                          unsigned char *outbuf, unsigned int *posp,
+                          void (*error)(const char *x));
+
+int xc_dom_decompress_unsafe(
+    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+
+int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+int xc_try_xz_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
diff --git a/tools/libxc/xc_dom_decompress_unsafe_bzip2.c b/tools/libxc/xc_dom_decompress_unsafe_bzip2.c
new file mode 100644
index 0000000..4dcabe4
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_bzip2.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+#include "../../xen/common/bunzip2.c"
+
+int xc_try_bzip2_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(bunzip2, dom, blob, size);
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzma.c b/tools/libxc/xc_dom_decompress_unsafe_lzma.c
new file mode 100644
index 0000000..4ee8cdb
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_lzma.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+#include "../../xen/common/unlzma.c"
+
+int xc_try_lzma_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlzma, dom, blob, size);
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c b/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c
new file mode 100644
index 0000000..57c73e3
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <endian.h>
+#include <stdint.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+typedef uint8_t u8;
+typedef uint32_t u32;
+typedef uint16_t u16;
+
+#define likely(a) a
+#define noinline
+#define unlikely(a) a
+
+static inline u16 be16_to_cpup(const u16 *p)
+{
+	u16 v = *p;
+#if BYTE_ORDER == LITTLE_ENDIAN
+	return (((v & 0x00ffU) << 8) |
+                ((v & 0xff00U) >> 8));
+#else
+	return v;
+#endif
+}
+
+static inline u32 be32_to_cpup(const u32 *p)
+{
+	u32 v = *p;
+#if BYTE_ORDER == LITTLE_ENDIAN
+	return (((v & 0x000000ffUL) << 24) |
+                ((v & 0x0000ff00UL) <<  8) |
+                ((v & 0x00ff0000UL) >>  8) |
+                ((v & 0xff000000UL) >> 24));
+#else
+	return v;
+#endif
+}
+
+#include "../../xen/common/lzo.c"
+#include "../../xen/common/unlzo.c"
+
+int xc_try_lzo1x_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlzo, dom, blob, size);
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe_xz.c b/tools/libxc/xc_dom_decompress_unsafe_xz.c
new file mode 100644
index 0000000..2a32d40
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_xz.c
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <endian.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+// TODO
+#define XZ_DEC_X86
+
+typedef char bool_t;
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint32_t __le32;
+
+static inline u32 cpu_to_le32(const u32 v)
+{
+#if BYTE_ORDER == BIG_ENDIAN
+	return (((v & 0x000000ffUL) << 24) |
+	        ((v & 0x0000ff00UL) <<  8) |
+	        ((v & 0x00ff0000UL) >>  8) |
+	        ((v & 0xff000000UL) >> 24));
+#else
+	return v;
+#endif
+}
+
+static inline u32 le32_to_cpup(const u32 *p)
+{
+	return cpu_to_le32(*p);
+}
+
+#define min(x,y) ({ \
+        const typeof(x) _x = (x);       \
+        const typeof(y) _y = (y);       \
+        (void) (&_x == &_y);            \
+        _x < _y ? _x : _y; })
+
+#define min_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
+#define max_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
+
+#define __force
+#define always_inline
+
+#include "../../xen/common/unxz.c"
+
+int xc_try_xz_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unxz, dom, blob, size);
+}
diff --git a/xen/common/decompress.h b/xen/common/decompress.h
index bd62b5d..61e83e5 100644
--- a/xen/common/decompress.h
+++ b/xen/common/decompress.h
@@ -1,3 +1,5 @@
+#ifdef __XEN__
+
 #include <xen/config.h>
 #include <xen/cache.h>
 #include <xen/decompress.h>
@@ -15,3 +17,14 @@
 
 #define large_malloc xmalloc_bytes
 #define large_free xfree
+
+#else
+
+#define STATIC static
+#define INIT
+#define INITDATA
+
+#define large_malloc malloc
+#define large_free free
+
+#endif
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index eeb200b..f1213d2 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -68,7 +68,10 @@
  *  Richard Purdie <rpurdie@openedhand.com>
  */
 
+#ifdef __XEN__
 #include <xen/types.h>
+#endif
+
 #include <xen/lzo.h>
 #define get_unaligned(_p) (*(_p))
 #define put_unaligned(_val,_p) (*(_p)=_val)
diff --git a/xen/common/unlzma.c b/xen/common/unlzma.c
index 719fd0d..4d04330 100644
--- a/xen/common/unlzma.c
+++ b/xen/common/unlzma.c
@@ -54,7 +54,9 @@ static long long INIT read_int(unsigned char *ptr, int size)
  * Copyright (c) 1999-2005  Igor Pavlov
  */
 
+#ifdef __XEN__
 #include <xen/compiler.h>
+#endif
 
 #define LZMA_IOBUF_SIZE	0x10000
 
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 57d16f3..fc794b0 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -32,7 +32,10 @@
 
 #include "decompress.h"
 #include <xen/lzo.h>
+
+#ifdef __XEN__
 #include <asm/byteorder.h>
+#endif
 
 #if 1 /* ndef CONFIG_??? */
 static inline u16 INIT get_unaligned_be16(void *p)
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index 369bcb3..7ea2489 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -10,8 +10,11 @@
 #ifndef XZ_PRIVATE_H
 #define XZ_PRIVATE_H
 
+#ifdef __XEN__
 #include <xen/kernel.h>
 #include <asm/byteorder.h>
+#endif
+
 #define get_le32(p) le32_to_cpup((const uint32_t *)(p))
 
 #if 1 /* ndef CONFIG_??? */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:46:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:46:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMgw-00072L-LA; Mon, 22 Apr 2013 19:46:22 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgv-000720-2P
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:21 +0000
Received: from [85.158.139.83:56858] by server-3.bemta-5.messagelabs.com id
	0E/47-17256-78395715; Mon, 22 Apr 2013 19:46:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-182.messagelabs.com!1366659955!29546526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3132 invoked from network); 22 Apr 2013 19:45:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:45:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgU-0000hu-Ha
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgU-0005oc-Fg
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:45:54 +0000
Date: Mon, 22 Apr 2013 19:45:54 +0000
Message-Id: <E1UUMgU-0005oc-Fg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Add unsafe decompressors
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 592d3ef961cafda917a7f123999dc04d426254ee
Author:     Bastian Blank <bastian@waldi.eu.org>
AuthorDate: Thu Apr 18 12:49:54 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:46:30 2013 +0100

    libxc: Add unsafe decompressors
    
    Add decompressors based on hypervisor code.  This are used in mini-os by
    pv-grub.
    
    This enables pv-grub to boot kernels compressed with e.g. xz, which are
    becoming more common.
    
    Signed-off-by: Bastian Blank <waldi@debian.org>
    
    Adjusted to use terminology "unsafe" rather than "trusted" to indicate
    that the user had better sanitise the data (or not care, as in stub
    domains) as suggested by Tim Deegan. This was effectively a sed script.
    
    Minimise the changes to hypervisor code by moving the "compat layer" into the
    relevant libxc source files (which include the Xen ones).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 stubdom/Makefile                             |    2 +-
 tools/libxc/Makefile                         |    8 ++++
 tools/libxc/xc_dom_bzimageloader.c           |   11 +++++
 tools/libxc/xc_dom_decompress_unsafe.c       |   48 +++++++++++++++++++++
 tools/libxc/xc_dom_decompress_unsafe.h       |   20 +++++++++
 tools/libxc/xc_dom_decompress_unsafe_bzip2.c |   14 ++++++
 tools/libxc/xc_dom_decompress_unsafe_lzma.c  |   14 ++++++
 tools/libxc/xc_dom_decompress_unsafe_lzo1x.c |   49 ++++++++++++++++++++++
 tools/libxc/xc_dom_decompress_unsafe_xz.c    |   57 ++++++++++++++++++++++++++
 xen/common/decompress.h                      |   13 ++++++
 xen/common/lzo.c                             |    3 +
 xen/common/unlzma.c                          |    2 +
 xen/common/unlzo.c                           |    3 +
 xen/common/xz/private.h                      |    3 +
 14 files changed, 246 insertions(+), 1 deletions(-)

diff --git a/stubdom/Makefile b/stubdom/Makefile
index 427e4d6..a2ac044 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -331,7 +331,7 @@ $(TARGETS_MINIOS): mini-os-%:
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
 libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
-	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH)
+	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) DESTDIR= CONFIG_LIBXC_MINIOS=y -C libxc-$(XEN_TARGET_ARCH)
 
  libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index d44abf9..640e333 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -68,6 +68,14 @@ GUEST_SRCS-$(CONFIG_X86)     += xc_hvm_build_x86.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_dom_arm.c
 GUEST_SRCS-$(CONFIG_ARM)     += xc_hvm_build_arm.c
 
+ifeq ($(CONFIG_LIBXC_MINIOS),y)
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_bzip2.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzma.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_lzo1x.c
+GUEST_SRCS-y                 += xc_dom_decompress_unsafe_xz.c
+endif
+
 OSDEP_SRCS-y                 += xenctrl_osdep_ENOSYS.c
 
 -include $(XEN_TARGET_ARCH)/Makefile
diff --git a/tools/libxc/xc_dom_bzimageloader.c b/tools/libxc/xc_dom_bzimageloader.c
index 6daa78c..3870c6d 100644
--- a/tools/libxc/xc_dom_bzimageloader.c
+++ b/tools/libxc/xc_dom_bzimageloader.c
@@ -35,6 +35,8 @@
 #include "xg_private.h"
 #include "xc_dom.h"
 
+#ifndef __MINIOS__
+
 #if defined(HAVE_BZLIB)
 
 #include <bzlib.h>
@@ -562,6 +564,15 @@ static int xc_try_lzo1x_decode(
 
 #endif
 
+#else /* __MINIOS__ */
+
+int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+int xc_try_xz_decode(struct xc_dom_image *dom, void **blob, size_t *size);
+
+#endif /* !__MINIOS__ */
+
 struct setup_header {
     uint8_t  _pad0[0x1f1];  /* skip uninteresting stuff */
     uint8_t  setup_sects;
diff --git a/tools/libxc/xc_dom_decompress_unsafe.c b/tools/libxc/xc_dom_decompress_unsafe.c
new file mode 100644
index 0000000..164e355
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+static struct xc_dom_image *unsafe_dom;
+static unsigned char *output_blob;
+static unsigned int output_size;
+
+static void unsafe_error(const char *msg)
+{
+    xc_dom_panic(unsafe_dom->xch, XC_INVALID_KERNEL, "%s", msg);
+}
+
+static int unsafe_flush(void *src, unsigned int size)
+{
+    void *n = realloc(output_blob, output_size + size);
+    if (!n)
+        return -1;
+    output_blob = n;
+
+    memcpy(&output_blob[output_size], src, size);
+    output_size += size;
+    return size;
+}
+
+int xc_dom_decompress_unsafe(
+    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    int ret;
+
+    unsafe_dom = dom;
+    output_blob = NULL;
+    output_size = 0;
+
+    ret = fn(dom->kernel_blob, dom->kernel_size, NULL, unsafe_flush, NULL, NULL, unsafe_error);
+
+    if (ret)
+        free(output_blob);
+    else {
+        *blob = output_blob;
+        *size = output_size;
+    }
+
+    return ret;
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe.h b/tools/libxc/xc_dom_decompress_unsafe.h
new file mode 100644
index 0000000..64f6886
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe.h
@@ -0,0 +1,20 @@
+#include "xc_dom.h"
+
+typedef int decompress_fn(unsigned char *inbuf, unsigned int len,
+                          int (*fill)(void*, unsigned int),
+                          int (*flush)(void*, unsigned int),
+                          unsigned char *outbuf, unsigned int *posp,
+                          void (*error)(const char *x));
+
+int xc_dom_decompress_unsafe(
+    decompress_fn fn, struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+
+int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
+int xc_try_xz_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
diff --git a/tools/libxc/xc_dom_decompress_unsafe_bzip2.c b/tools/libxc/xc_dom_decompress_unsafe_bzip2.c
new file mode 100644
index 0000000..4dcabe4
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_bzip2.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+#include "../../xen/common/bunzip2.c"
+
+int xc_try_bzip2_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(bunzip2, dom, blob, size);
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzma.c b/tools/libxc/xc_dom_decompress_unsafe_lzma.c
new file mode 100644
index 0000000..4ee8cdb
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_lzma.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+#include "../../xen/common/unlzma.c"
+
+int xc_try_lzma_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlzma, dom, blob, size);
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c b/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c
new file mode 100644
index 0000000..57c73e3
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_lzo1x.c
@@ -0,0 +1,49 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <endian.h>
+#include <stdint.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+typedef uint8_t u8;
+typedef uint32_t u32;
+typedef uint16_t u16;
+
+#define likely(a) a
+#define noinline
+#define unlikely(a) a
+
+static inline u16 be16_to_cpup(const u16 *p)
+{
+	u16 v = *p;
+#if BYTE_ORDER == LITTLE_ENDIAN
+	return (((v & 0x00ffU) << 8) |
+                ((v & 0xff00U) >> 8));
+#else
+	return v;
+#endif
+}
+
+static inline u32 be32_to_cpup(const u32 *p)
+{
+	u32 v = *p;
+#if BYTE_ORDER == LITTLE_ENDIAN
+	return (((v & 0x000000ffUL) << 24) |
+                ((v & 0x0000ff00UL) <<  8) |
+                ((v & 0x00ff0000UL) >>  8) |
+                ((v & 0xff000000UL) >> 24));
+#else
+	return v;
+#endif
+}
+
+#include "../../xen/common/lzo.c"
+#include "../../xen/common/unlzo.c"
+
+int xc_try_lzo1x_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlzo, dom, blob, size);
+}
diff --git a/tools/libxc/xc_dom_decompress_unsafe_xz.c b/tools/libxc/xc_dom_decompress_unsafe_xz.c
new file mode 100644
index 0000000..2a32d40
--- /dev/null
+++ b/tools/libxc/xc_dom_decompress_unsafe_xz.c
@@ -0,0 +1,57 @@
+#include <stdio.h>
+#include <endian.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#include "xg_private.h"
+#include "xc_dom_decompress_unsafe.h"
+
+// TODO
+#define XZ_DEC_X86
+
+typedef char bool_t;
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint32_t __le32;
+
+static inline u32 cpu_to_le32(const u32 v)
+{
+#if BYTE_ORDER == BIG_ENDIAN
+	return (((v & 0x000000ffUL) << 24) |
+	        ((v & 0x0000ff00UL) <<  8) |
+	        ((v & 0x00ff0000UL) >>  8) |
+	        ((v & 0xff000000UL) >> 24));
+#else
+	return v;
+#endif
+}
+
+static inline u32 le32_to_cpup(const u32 *p)
+{
+	return cpu_to_le32(*p);
+}
+
+#define min(x,y) ({ \
+        const typeof(x) _x = (x);       \
+        const typeof(y) _y = (y);       \
+        (void) (&_x == &_y);            \
+        _x < _y ? _x : _y; })
+
+#define min_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
+#define max_t(type,x,y) \
+        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
+
+#define __force
+#define always_inline
+
+#include "../../xen/common/unxz.c"
+
+int xc_try_xz_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unxz, dom, blob, size);
+}
diff --git a/xen/common/decompress.h b/xen/common/decompress.h
index bd62b5d..61e83e5 100644
--- a/xen/common/decompress.h
+++ b/xen/common/decompress.h
@@ -1,3 +1,5 @@
+#ifdef __XEN__
+
 #include <xen/config.h>
 #include <xen/cache.h>
 #include <xen/decompress.h>
@@ -15,3 +17,14 @@
 
 #define large_malloc xmalloc_bytes
 #define large_free xfree
+
+#else
+
+#define STATIC static
+#define INIT
+#define INITDATA
+
+#define large_malloc malloc
+#define large_free free
+
+#endif
diff --git a/xen/common/lzo.c b/xen/common/lzo.c
index eeb200b..f1213d2 100644
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -68,7 +68,10 @@
  *  Richard Purdie <rpurdie@openedhand.com>
  */
 
+#ifdef __XEN__
 #include <xen/types.h>
+#endif
+
 #include <xen/lzo.h>
 #define get_unaligned(_p) (*(_p))
 #define put_unaligned(_val,_p) (*(_p)=_val)
diff --git a/xen/common/unlzma.c b/xen/common/unlzma.c
index 719fd0d..4d04330 100644
--- a/xen/common/unlzma.c
+++ b/xen/common/unlzma.c
@@ -54,7 +54,9 @@ static long long INIT read_int(unsigned char *ptr, int size)
  * Copyright (c) 1999-2005  Igor Pavlov
  */
 
+#ifdef __XEN__
 #include <xen/compiler.h>
+#endif
 
 #define LZMA_IOBUF_SIZE	0x10000
 
diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index 57d16f3..fc794b0 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -32,7 +32,10 @@
 
 #include "decompress.h"
 #include <xen/lzo.h>
+
+#ifdef __XEN__
 #include <asm/byteorder.h>
+#endif
 
 #if 1 /* ndef CONFIG_??? */
 static inline u16 INIT get_unaligned_be16(void *p)
diff --git a/xen/common/xz/private.h b/xen/common/xz/private.h
index 369bcb3..7ea2489 100644
--- a/xen/common/xz/private.h
+++ b/xen/common/xz/private.h
@@ -10,8 +10,11 @@
 #ifndef XZ_PRIVATE_H
 #define XZ_PRIVATE_H
 
+#ifdef __XEN__
 #include <xen/kernel.h>
 #include <asm/byteorder.h>
+#endif
+
 #define get_le32(p) le32_to_cpup((const uint32_t *)(p))
 
 #if 1 /* ndef CONFIG_??? */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:46:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:46:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMh2-00073g-QZ; Mon, 22 Apr 2013 19:46:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMh2-00073T-9D
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:28 +0000
Received: from [85.158.138.51:56588] by server-1.bemta-3.messagelabs.com id
	F5/61-13706-39395715; Mon, 22 Apr 2013 19:46:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1366659985!19590691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4233 invoked from network); 22 Apr 2013 19:46:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:46:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgz-0000ic-E5
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgz-0005pp-9v
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:25 +0000
Date: Mon, 22 Apr 2013 19:46:25 +0000
Message-Id: <E1UUMgz-0005pp-9v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mwait_idle: support Haswell
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 96ef6e88359910738905ac2e1969dc05d7d7e7dc
Author:     Len Brown <len.brown@intel.com>
AuthorDate: Mon Apr 22 14:04:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 14:04:07 2013 +0200

    x86/mwait_idle: support Haswell
    
    This patch enables intel_idle to run on the next-generation Intel(R)
    Microarchitecture code named "Haswell".
    
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 111c149..e0c9707 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -200,6 +200,34 @@ static const struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	}
 };
 
+static const struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-HSW",
+		.flags = MWAIT2flg(0x00),
+		.exit_latency = 2,
+		.target_residency = 2,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-HSW",
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 33,
+		.target_residency = 100,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-HSW",
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 133,
+		.target_residency = 400,
+	},
+	{ /* MWAIT C4 */
+		.name = "C7s-HSW",
+		.flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 166,
+		.target_residency = 500,
+	},
+};
+
 static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
@@ -348,6 +376,10 @@ static const struct idle_cpu idle_cpu_ivb = {
 	.state_table = ivb_cstates,
 };
 
+static const struct idle_cpu idle_cpu_hsw = {
+	.state_table = hsw_cstates,
+};
+
 #define ICPU(model, cpu) { 6, model, &idle_cpu_##cpu }
 
 static struct intel_idle_id {
@@ -367,6 +399,10 @@ static struct intel_idle_id {
 	ICPU(0x2d, snb),
 	ICPU(0x3a, ivb),
 	ICPU(0x3e, ivb),
+	ICPU(0x3c, hsw),
+	ICPU(0x3f, hsw),
+	ICPU(0x45, hsw),
+	ICPU(0x46, hsw),
 	{}
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:46:29 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:46:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMh2-00073g-QZ; Mon, 22 Apr 2013 19:46:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMh2-00073T-9D
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:28 +0000
Received: from [85.158.138.51:56588] by server-1.bemta-3.messagelabs.com id
	F5/61-13706-39395715; Mon, 22 Apr 2013 19:46:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1366659985!19590691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4233 invoked from network); 22 Apr 2013 19:46:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:46:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgz-0000ic-E5
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgz-0005pp-9v
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:25 +0000
Date: Mon, 22 Apr 2013 19:46:25 +0000
Message-Id: <E1UUMgz-0005pp-9v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mwait_idle: support Haswell
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 96ef6e88359910738905ac2e1969dc05d7d7e7dc
Author:     Len Brown <len.brown@intel.com>
AuthorDate: Mon Apr 22 14:04:07 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 14:04:07 2013 +0200

    x86/mwait_idle: support Haswell
    
    This patch enables intel_idle to run on the next-generation Intel(R)
    Microarchitecture code named "Haswell".
    
    Signed-off-by: Len Brown <len.brown@intel.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 111c149..e0c9707 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -200,6 +200,34 @@ static const struct cpuidle_state ivb_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	}
 };
 
+static const struct cpuidle_state hsw_cstates[MWAIT_MAX_NUM_CSTATES] = {
+	{ /* MWAIT C0 */ },
+	{ /* MWAIT C1 */
+		.name = "C1-HSW",
+		.flags = MWAIT2flg(0x00),
+		.exit_latency = 2,
+		.target_residency = 2,
+	},
+	{ /* MWAIT C2 */
+		.name = "C3-HSW",
+		.flags = MWAIT2flg(0x10) | CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 33,
+		.target_residency = 100,
+	},
+	{ /* MWAIT C3 */
+		.name = "C6-HSW",
+		.flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 133,
+		.target_residency = 400,
+	},
+	{ /* MWAIT C4 */
+		.name = "C7s-HSW",
+		.flags = MWAIT2flg(0x32) | CPUIDLE_FLAG_TLB_FLUSHED,
+		.exit_latency = 166,
+		.target_residency = 500,
+	},
+};
+
 static const struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
 	{ /* MWAIT C0 */ },
 	{ /* MWAIT C1 */
@@ -348,6 +376,10 @@ static const struct idle_cpu idle_cpu_ivb = {
 	.state_table = ivb_cstates,
 };
 
+static const struct idle_cpu idle_cpu_hsw = {
+	.state_table = hsw_cstates,
+};
+
 #define ICPU(model, cpu) { 6, model, &idle_cpu_##cpu }
 
 static struct intel_idle_id {
@@ -367,6 +399,10 @@ static struct intel_idle_id {
 	ICPU(0x2d, snb),
 	ICPU(0x3a, ivb),
 	ICPU(0x3e, ivb),
+	ICPU(0x3c, hsw),
+	ICPU(0x3f, hsw),
+	ICPU(0x45, hsw),
+	ICPU(0x46, hsw),
 	{}
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:47:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:47:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMhp-00078Q-VC; Mon, 22 Apr 2013 19:47:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMhp-00078H-DG
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:47:17 +0000
Received: from [85.158.139.211:53028] by server-8.bemta-5.messagelabs.com id
	27/D8-05790-4C395715; Mon, 22 Apr 2013 19:47:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1366660034!19983856!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21553 invoked from network); 22 Apr 2013 19:47:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:47:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgp-0000iW-5L
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgp-0005pT-3Z
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:15 +0000
Date: Mon, 22 Apr 2013 19:46:15 +0000
Message-Id: <E1UUMgp-0005pT-3Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	xenbits.xen.org:/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c7fa05f312d711370d396c597fdf7c13189cc4b
Merge: 4e96e50c36fe32aa3e5d5da370f58da89fd35cb3 beb0975bcfd49d0ddd89267af8860c520d2db251
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 22 14:02:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 14:02:16 2013 +0200

    Merge branch 'staging' of xenbits.xen.org:/home/xen/git/xen into staging

 extras/mini-os/arch/x86/x86_64.S             |  245 ++++++++++++++++----------
 stubdom/Makefile                             |    2 +-
 tools/libxc/Makefile                         |    8 +
 tools/libxc/xc_dom_bzimageloader.c           |   11 ++
 tools/libxc/xc_dom_decompress_unsafe.c       |   48 +++++
 tools/libxc/xc_dom_decompress_unsafe.h       |   20 ++
 tools/libxc/xc_dom_decompress_unsafe_bzip2.c |   14 ++
 tools/libxc/xc_dom_decompress_unsafe_lzma.c  |   14 ++
 tools/libxc/xc_dom_decompress_unsafe_lzo1x.c |   49 +++++
 tools/libxc/xc_dom_decompress_unsafe_xz.c    |   57 ++++++
 xen/arch/arm/domain.c                        |    5 +-
 xen/arch/arm/gic.c                           |    9 +-
 xen/common/decompress.h                      |   13 ++
 xen/common/lzo.c                             |    3 +
 xen/common/unlzma.c                          |    2 +
 xen/common/unlzo.c                           |    3 +
 xen/common/xz/private.h                      |    3 +
 17 files changed, 410 insertions(+), 96 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:47:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:47:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMhp-00078Q-VC; Mon, 22 Apr 2013 19:47:17 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMhp-00078H-DG
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:47:17 +0000
Received: from [85.158.139.211:53028] by server-8.bemta-5.messagelabs.com id
	27/D8-05790-4C395715; Mon, 22 Apr 2013 19:47:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1366660034!19983856!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21553 invoked from network); 22 Apr 2013 19:47:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:47:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgp-0000iW-5L
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMgp-0005pT-3Z
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:46:15 +0000
Date: Mon, 22 Apr 2013 19:46:15 +0000
Message-Id: <E1UUMgp-0005pT-3Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	xenbits.xen.org:/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6c7fa05f312d711370d396c597fdf7c13189cc4b
Merge: 4e96e50c36fe32aa3e5d5da370f58da89fd35cb3 beb0975bcfd49d0ddd89267af8860c520d2db251
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 22 14:02:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 22 14:02:16 2013 +0200

    Merge branch 'staging' of xenbits.xen.org:/home/xen/git/xen into staging

 extras/mini-os/arch/x86/x86_64.S             |  245 ++++++++++++++++----------
 stubdom/Makefile                             |    2 +-
 tools/libxc/Makefile                         |    8 +
 tools/libxc/xc_dom_bzimageloader.c           |   11 ++
 tools/libxc/xc_dom_decompress_unsafe.c       |   48 +++++
 tools/libxc/xc_dom_decompress_unsafe.h       |   20 ++
 tools/libxc/xc_dom_decompress_unsafe_bzip2.c |   14 ++
 tools/libxc/xc_dom_decompress_unsafe_lzma.c  |   14 ++
 tools/libxc/xc_dom_decompress_unsafe_lzo1x.c |   49 +++++
 tools/libxc/xc_dom_decompress_unsafe_xz.c    |   57 ++++++
 xen/arch/arm/domain.c                        |    5 +-
 xen/arch/arm/gic.c                           |    9 +-
 xen/common/decompress.h                      |   13 ++
 xen/common/lzo.c                             |    3 +
 xen/common/unlzma.c                          |    2 +
 xen/common/unlzo.c                           |    3 +
 xen/common/xz/private.h                      |    3 +
 17 files changed, 410 insertions(+), 96 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:50:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMkm-0007Mr-9m; Mon, 22 Apr 2013 19:50:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMkl-0007Mm-9n
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:50:19 +0000
Received: from [193.109.254.147:64922] by server-7.bemta-14.messagelabs.com id
	69/82-19255-A7495715; Mon, 22 Apr 2013 19:50:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1366659886!8831666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24621 invoked from network); 22 Apr 2013 19:44:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfO-0000gA-Gu
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfN-0005le-LI
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:45 +0000
Date: Mon, 22 Apr 2013 19:44:45 +0000
Message-Id: <E1UUMfN-0005le-LI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: define macros
	for registers partial save and restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7e84f54da55d7b59ee4469b6a2ee8fe62ea0bca2
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:56 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:11 2013 +0100

    mini-os/x86-64 entry: define macros for registers partial save and restore
    
    No functional changes.
    
    For saving and restoring registers rbx, rbp, and r12-r15,
    define and use macros SAVE_REST and RESTORE_REST respectively.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 79099f1..24f35cd 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -59,6 +59,25 @@ NMI_MASK = 0x80000000
 	addq $9*8+8,%rsp
 .endm	
 
+.macro RESTORE_REST
+	movq (%rsp),%r15
+	movq 1*8(%rsp),%r14
+	movq 2*8(%rsp),%r13
+	movq 3*8(%rsp),%r12
+	movq 4*8(%rsp),%rbp
+	movq 5*8(%rsp),%rbx
+	addq $6*8,%rsp
+.endm
+
+.macro SAVE_REST
+	subq $6*8,%rsp
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
+.endm
 
 .macro HYPERVISOR_IRET flag
 	testl $NMI_MASK,2*8(%rsp)
@@ -173,13 +192,7 @@ scrit:	/**** START OF CRITICAL REGION ****/
 
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
-	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp)
-	movq %rbp,4*8(%rsp)
-	movq %r12,3*8(%rsp)
-	movq %r13,2*8(%rsp)
-	movq %r14,1*8(%rsp)
-	movq %r15,(%rsp)
+	SAVE_REST
 	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
@@ -199,14 +212,8 @@ retint_restore_args:
 	HYPERVISOR_IRET 0
 
 
-error_exit:		
-	movq (%rsp),%r15
-	movq 1*8(%rsp),%r14
-	movq 2*8(%rsp),%r13
-	movq 3*8(%rsp),%r12
-	movq 4*8(%rsp),%rbp
-	movq 5*8(%rsp),%rbx
-	addq $6*8,%rsp
+error_exit:
+	RESTORE_REST
 	XEN_BLOCK_EVENTS(%rsi)		
 	jmp retint_kernel
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 22 19:50:21 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 22 Apr 2013 19:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUMkm-0007Mr-9m; Mon, 22 Apr 2013 19:50:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMkl-0007Mm-9n
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:50:19 +0000
Received: from [193.109.254.147:64922] by server-7.bemta-14.messagelabs.com id
	69/82-19255-A7495715; Mon, 22 Apr 2013 19:50:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1366659886!8831666!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24621 invoked from network); 22 Apr 2013 19:44:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Apr 2013 19:44:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfO-0000gA-Gu
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUMfN-0005le-LI
	for xen-changelog@lists.xensource.com; Mon, 22 Apr 2013 19:44:45 +0000
Date: Mon, 22 Apr 2013 19:44:45 +0000
Message-Id: <E1UUMfN-0005le-LI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os/x86-64 entry: define macros
	for registers partial save and restore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7e84f54da55d7b59ee4469b6a2ee8fe62ea0bca2
Author:     Xu Zhang <xzhang@cs.uic.edu>
AuthorDate: Wed Apr 10 23:46:56 2013 -0500
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Apr 22 12:32:11 2013 +0100

    mini-os/x86-64 entry: define macros for registers partial save and restore
    
    No functional changes.
    
    For saving and restoring registers rbx, rbp, and r12-r15,
    define and use macros SAVE_REST and RESTORE_REST respectively.
    
    Signed-off-by: Xu Zhang <xzhang@cs.uic.edu>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/x86_64.S |   37 ++++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/extras/mini-os/arch/x86/x86_64.S b/extras/mini-os/arch/x86/x86_64.S
index 79099f1..24f35cd 100644
--- a/extras/mini-os/arch/x86/x86_64.S
+++ b/extras/mini-os/arch/x86/x86_64.S
@@ -59,6 +59,25 @@ NMI_MASK = 0x80000000
 	addq $9*8+8,%rsp
 .endm	
 
+.macro RESTORE_REST
+	movq (%rsp),%r15
+	movq 1*8(%rsp),%r14
+	movq 2*8(%rsp),%r13
+	movq 3*8(%rsp),%r12
+	movq 4*8(%rsp),%rbp
+	movq 5*8(%rsp),%rbx
+	addq $6*8,%rsp
+.endm
+
+.macro SAVE_REST
+	subq $6*8,%rsp
+	movq %rbx,5*8(%rsp)
+	movq %rbp,4*8(%rsp)
+	movq %r12,3*8(%rsp)
+	movq %r13,2*8(%rsp)
+	movq %r14,1*8(%rsp)
+	movq %r15,(%rsp)
+.endm
 
 .macro HYPERVISOR_IRET flag
 	testl $NMI_MASK,2*8(%rsp)
@@ -173,13 +192,7 @@ scrit:	/**** START OF CRITICAL REGION ****/
 
 14:	XEN_LOCKED_BLOCK_EVENTS(%rsi)
 	XEN_PUT_VCPU_INFO(%rsi)
-	subq $6*8,%rsp
-	movq %rbx,5*8(%rsp)
-	movq %rbp,4*8(%rsp)
-	movq %r12,3*8(%rsp)
-	movq %r13,2*8(%rsp)
-	movq %r14,1*8(%rsp)
-	movq %r15,(%rsp)
+	SAVE_REST
 	movq %rsp,%rdi                  # set the argument again
 	jmp  11b
 ecrit:  /**** END OF CRITICAL REGION ****/
@@ -199,14 +212,8 @@ retint_restore_args:
 	HYPERVISOR_IRET 0
 
 
-error_exit:		
-	movq (%rsp),%r15
-	movq 1*8(%rsp),%r14
-	movq 2*8(%rsp),%r13
-	movq 3*8(%rsp),%r12
-	movq 4*8(%rsp),%rbp
-	movq 5*8(%rsp),%rbx
-	addq $6*8,%rsp
+error_exit:
+	RESTORE_REST
 	XEN_BLOCK_EVENTS(%rsi)		
 	jmp retint_kernel
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 19:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 19:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUicS-0007C1-2v; Tue, 23 Apr 2013 19:11:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicQ-0007Bw-WF
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:11 +0000
Received: from [85.158.138.51:47259] by server-7.bemta-3.messagelabs.com id
	1D/81-06591-ECCD6715; Tue, 23 Apr 2013 19:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1366744267!29594941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25894 invoked from network); 23 Apr 2013 19:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 19:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicN-0007aJ-Iq
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicM-00077r-Ie
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:06 +0000
Date: Tue, 23 Apr 2013 19:11:06 +0000
Message-Id: <E1UUicM-00077r-Ie@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpupool: prevent a domain from moving
	itself
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb812101db5117e07de1b557b355c3855850cc95
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Apr 23 11:48:11 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 11:48:11 2013 +0200

    cpupool: prevent a domain from moving itself
    
    In the XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN operation, the existing check
    for domid == 0 should be checking that a domain does not attempt to
    modify its own cpupool; fix this by using rcu_lock_remote_domain_by_id.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2aaa486..2164a9f 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -576,12 +576,8 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
     {
         struct domain *d;
 
-        ret = -EINVAL;
-        if ( op->domid == 0 )
-            break;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domid);
-        if ( d == NULL )
+        ret = rcu_lock_remote_domain_by_id(op->domid, &d);
+        if ( ret )
             break;
         if ( d->cpupool == NULL )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 19:11:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 19:11:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUicS-0007C1-2v; Tue, 23 Apr 2013 19:11:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicQ-0007Bw-WF
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:11 +0000
Received: from [85.158.138.51:47259] by server-7.bemta-3.messagelabs.com id
	1D/81-06591-ECCD6715; Tue, 23 Apr 2013 19:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-174.messagelabs.com!1366744267!29594941!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25894 invoked from network); 23 Apr 2013 19:11:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 19:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicN-0007aJ-Iq
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicM-00077r-Ie
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:06 +0000
Date: Tue, 23 Apr 2013 19:11:06 +0000
Message-Id: <E1UUicM-00077r-Ie@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpupool: prevent a domain from moving
	itself
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb812101db5117e07de1b557b355c3855850cc95
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Apr 23 11:48:11 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 11:48:11 2013 +0200

    cpupool: prevent a domain from moving itself
    
    In the XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN operation, the existing check
    for domid == 0 should be checking that a domain does not attempt to
    modify its own cpupool; fix this by using rcu_lock_remote_domain_by_id.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
---
 xen/common/cpupool.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index 2aaa486..2164a9f 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -576,12 +576,8 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op)
     {
         struct domain *d;
 
-        ret = -EINVAL;
-        if ( op->domid == 0 )
-            break;
-        ret = -ESRCH;
-        d = rcu_lock_domain_by_id(op->domid);
-        if ( d == NULL )
+        ret = rcu_lock_remote_domain_by_id(op->domid, &d);
+        if ( ret )
             break;
         if ( d->cpupool == NULL )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 19:11:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 19:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUicd-0007Cc-5x; Tue, 23 Apr 2013 19:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicc-0007CX-IG
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:22 +0000
Received: from [193.109.254.147:54974] by server-16.bemta-14.messagelabs.com
	id AD/64-29589-9DCD6715; Tue, 23 Apr 2013 19:11:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1366744278!6659602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22756 invoked from network); 23 Apr 2013 19:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 19:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicX-0007aP-T1
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicX-00078F-Pj
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:17 +0000
Date: Tue, 23 Apr 2013 19:11:17 +0000
Message-Id: <E1UUicX-00078F-Pj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: convert access check for
	nested HVM to XSM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4bc22a50ebc1fb1695d59f69105797e208021edb
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Apr 23 11:54:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 11:54:01 2013 +0200

    x86/hvm: convert access check for nested HVM to XSM
    
    This adds an XSM hook for enabling nested HVM support, replacing an
    IS_PRIV check.  This hook is a partial duplicate with the xsm_hvm_param
    hook, but using the existing hook would require adding the index to the
    hook and would require the use of a custom hook for the xsm-disabled
    case (using XSM_OTHER, which is less immediately readable) - whereas
    adding a new hook retains the clarity of the existing code.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (release perspective)
---
 tools/flask/policy/policy/modules/xen/xen.if |    3 ++-
 xen/arch/x86/hvm/hvm.c                       |    6 ++----
 xen/include/xsm/dummy.h                      |    6 ++++++
 xen/include/xsm/xsm.h                        |    6 ++++++
 xen/xsm/dummy.c                              |    1 +
 xen/xsm/flask/hooks.c                        |    6 ++++++
 xen/xsm/flask/policy/access_vectors          |    2 ++
 7 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 18647c9..3a59f38 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -54,7 +54,8 @@ define(`create_domain_common', `
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc
+			setparam pcilevel trackdirtyvram nested };
 ')
 
 # create_domain(priv, target)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 38e87ce..8522963 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3909,11 +3909,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                     rc = -EINVAL;
                 break;
             case HVM_PARAM_NESTEDHVM:
-                if ( !IS_PRIV(current->domain) )
-                {
-                    rc = -EPERM;
+                rc = xsm_hvm_param_nested(XSM_PRIV, d);
+                if ( rc )
                     break;
-                }
                 if ( a.value > 1 )
                     rc = -EINVAL;
                 /* Remove the check below once we have
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 025936a..191e493 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -473,6 +473,12 @@ static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned l
     return xsm_default_action(action, current->domain, d);
 }
 
+static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
 #ifdef CONFIG_X86
 static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index cba744c..fdc7a65 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -130,6 +130,7 @@ struct xsm_operations {
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
     int (*hvm_param) (struct domain *d, unsigned long op);
+    int (*hvm_param_nested) (struct domain *d);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -493,6 +494,11 @@ static inline int xsm_hvm_param (xsm_default_t def, struct domain *d, unsigned l
     return xsm_ops->hvm_param(d, op);
 }
 
+static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->hvm_param_nested(d);
+}
+
 #ifdef CONFIG_X86
 static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6f1e0b4..21aef2a 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -101,6 +101,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
     set_to_dummy_if_null(ops, hvm_param);
+    set_to_dummy_if_null(ops, hvm_param_nested);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 247c8a3..23c5233 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1092,6 +1092,11 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
+static int flask_hvm_param_nested(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
+}
+
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1506,6 +1511,7 @@ static struct xsm_operations flask_ops = {
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
     .hvm_param = flask_hvm_param,
+    .hvm_param_nested = flask_hvm_param_nested,
 
     .do_xsm_op = do_flask_op,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index fdfc502..36b8b2c 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -234,6 +234,8 @@ class hvm
 #  source = domain whose memory is being shared
 #  target = client domain
     share_mem
+# HVMOP_set_param setting HVM_PARAM_NESTEDHVM
+    nested
 }
 
 # Class event describes event channels.  Interdomain event channels have their
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 19:11:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 19:11:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUicd-0007Cc-5x; Tue, 23 Apr 2013 19:11:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicc-0007CX-IG
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:22 +0000
Received: from [193.109.254.147:54974] by server-16.bemta-14.messagelabs.com
	id AD/64-29589-9DCD6715; Tue, 23 Apr 2013 19:11:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1366744278!6659602!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22756 invoked from network); 23 Apr 2013 19:11:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 19:11:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicX-0007aP-T1
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUicX-00078F-Pj
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:17 +0000
Date: Tue, 23 Apr 2013 19:11:17 +0000
Message-Id: <E1UUicX-00078F-Pj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: convert access check for
	nested HVM to XSM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4bc22a50ebc1fb1695d59f69105797e208021edb
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Apr 23 11:54:01 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 11:54:01 2013 +0200

    x86/hvm: convert access check for nested HVM to XSM
    
    This adds an XSM hook for enabling nested HVM support, replacing an
    IS_PRIV check.  This hook is a partial duplicate with the xsm_hvm_param
    hook, but using the existing hook would require adding the index to the
    hook and would require the use of a custom hook for the xsm-disabled
    case (using XSM_OTHER, which is less immediately readable) - whereas
    adding a new hook retains the clarity of the existing code.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (release perspective)
---
 tools/flask/policy/policy/modules/xen/xen.if |    3 ++-
 xen/arch/x86/hvm/hvm.c                       |    6 ++----
 xen/include/xsm/dummy.h                      |    6 ++++++
 xen/include/xsm/xsm.h                        |    6 ++++++
 xen/xsm/dummy.c                              |    1 +
 xen/xsm/flask/hooks.c                        |    6 ++++++
 xen/xsm/flask/policy/access_vectors          |    2 ++
 7 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/tools/flask/policy/policy/modules/xen/xen.if b/tools/flask/policy/policy/modules/xen/xen.if
index 18647c9..3a59f38 100644
--- a/tools/flask/policy/policy/modules/xen/xen.if
+++ b/tools/flask/policy/policy/modules/xen/xen.if
@@ -54,7 +54,8 @@ define(`create_domain_common', `
 	allow $1 $2:shadow enable;
 	allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
 	allow $1 $2:grant setup;
-	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+	allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc
+			setparam pcilevel trackdirtyvram nested };
 ')
 
 # create_domain(priv, target)
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 38e87ce..8522963 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3909,11 +3909,9 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                     rc = -EINVAL;
                 break;
             case HVM_PARAM_NESTEDHVM:
-                if ( !IS_PRIV(current->domain) )
-                {
-                    rc = -EPERM;
+                rc = xsm_hvm_param_nested(XSM_PRIV, d);
+                if ( rc )
                     break;
-                }
                 if ( a.value > 1 )
                     rc = -EINVAL;
                 /* Remove the check below once we have
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 025936a..191e493 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -473,6 +473,12 @@ static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned l
     return xsm_default_action(action, current->domain, d);
 }
 
+static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
+{
+    XSM_ASSERT_ACTION(XSM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
 #ifdef CONFIG_X86
 static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
 {
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index cba744c..fdc7a65 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -130,6 +130,7 @@ struct xsm_operations {
     long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
 
     int (*hvm_param) (struct domain *d, unsigned long op);
+    int (*hvm_param_nested) (struct domain *d);
 
 #ifdef CONFIG_X86
     int (*shadow_control) (struct domain *d, uint32_t op);
@@ -493,6 +494,11 @@ static inline int xsm_hvm_param (xsm_default_t def, struct domain *d, unsigned l
     return xsm_ops->hvm_param(d, op);
 }
 
+static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
+{
+    return xsm_ops->hvm_param_nested(d);
+}
+
 #ifdef CONFIG_X86
 static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 6f1e0b4..21aef2a 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -101,6 +101,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, tmem_op);
     set_to_dummy_if_null(ops, tmem_control);
     set_to_dummy_if_null(ops, hvm_param);
+    set_to_dummy_if_null(ops, hvm_param_nested);
 
     set_to_dummy_if_null(ops, do_xsm_op);
 
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 247c8a3..23c5233 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1092,6 +1092,11 @@ static int flask_hvm_param(struct domain *d, unsigned long op)
     return current_has_perm(d, SECCLASS_HVM, perm);
 }
 
+static int flask_hvm_param_nested(struct domain *d)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
+}
+
 #ifdef CONFIG_X86
 static int flask_shadow_control(struct domain *d, uint32_t op)
 {
@@ -1506,6 +1511,7 @@ static struct xsm_operations flask_ops = {
     .tmem_op = flask_tmem_op,
     .tmem_control = flask_tmem_control,
     .hvm_param = flask_hvm_param,
+    .hvm_param_nested = flask_hvm_param_nested,
 
     .do_xsm_op = do_flask_op,
 
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index fdfc502..36b8b2c 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -234,6 +234,8 @@ class hvm
 #  source = domain whose memory is being shared
 #  target = client domain
     share_mem
+# HVMOP_set_param setting HVM_PARAM_NESTEDHVM
+    nested
 }
 
 # Class event describes event channels.  Interdomain event channels have their
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 19:12:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 19:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUidn-0007FB-BB; Tue, 23 Apr 2013 19:12:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUidm-0007F4-Km
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:12:34 +0000
Received: from [85.158.139.83:42368] by server-8.bemta-5.messagelabs.com id
	72/E3-05790-E1DD6715; Tue, 23 Apr 2013 19:12:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1366744348!29703263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29620 invoked from network); 23 Apr 2013 19:12:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 19:12:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUici-0007aX-VR
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUici-000797-3N
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:28 +0000
Date: Tue, 23 Apr 2013 19:11:28 +0000
Message-Id: <E1UUici-000797-3N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove IS_PRIV_FOR references
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f28d0077788e7f8cd3ee25b023a4225d7e26e87
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Apr 23 11:56:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 11:56:05 2013 +0200

    x86: remove IS_PRIV_FOR references
    
    The check in guest_physmap_mark_populate_on_demand is redundant, since
    its only caller is populate_physmap whose only caller checks the
    xsm_memory_adjust_reservation hook prior to calling.
    
    Add a new XSM hook for the other two checks since they allow privileged
    domains to arbitrarily map a guest's memory.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (release perspective)
---
 xen/arch/x86/mm.c                   |    2 +-
 xen/arch/x86/mm/p2m-pod.c           |    3 ---
 xen/arch/x86/mm/shadow/multi.c      |   17 ++++++++++-------
 xen/include/xsm/dummy.h             |    6 ++++++
 xen/include/xsm/xsm.h               |    6 ++++++
 xen/xsm/dummy.c                     |    1 +
 xen/xsm/flask/hooks.c               |    6 ++++++
 xen/xsm/flask/policy/access_vectors |    3 +++
 8 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 58e1402..0cd4203 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -815,7 +815,7 @@ get_page_from_l1e(
          * minor hack can go away.
          */
         if ( (real_pg_owner == NULL) || (pg_owner == l1e_owner) ||
-             !IS_PRIV_FOR(pg_owner, real_pg_owner) )
+             xsm_priv_mapping(XSM_TARGET, pg_owner, real_pg_owner) )
         {
             MEM_LOG("pg_owner %d l1e_owner %d, but real_pg_owner %d",
                     pg_owner->domain_id, l1e_owner->domain_id,
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 55936c6..04ffbcb 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -1117,9 +1117,6 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     mfn_t omfn;
     int rc = 0;
 
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index a593f76..a8ef75e 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -29,6 +29,7 @@
 #include <xen/perfc.h>
 #include <xen/domain_page.h>
 #include <xen/iocap.h>
+#include <xsm/xsm.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <asm/shadow.h>
@@ -849,14 +850,16 @@ shadow_get_page_from_l1e(shadow_l1e_t sl1e, struct domain *d, p2m_type_t type)
          !shadow_mode_translate(d) &&
          mfn_valid(mfn = shadow_l1e_get_mfn(sl1e)) &&
          (owner = page_get_owner(mfn_to_page(mfn))) &&
-         (d != owner) &&
-         IS_PRIV_FOR(d, owner))
-    {
-        res = get_page_from_l1e(sl1e, d, owner);
-        SHADOW_PRINTK("privileged domain %d installs map of mfn %05lx "
-                       "which is owned by domain %d: %s\n",
-                       d->domain_id, mfn_x(mfn), owner->domain_id,
-                       res >= 0 ? "success" : "failed");
+         (d != owner) )
+    {
+        res = xsm_priv_mapping(XSM_TARGET, d, owner);
+        if ( !res ) {
+            res = get_page_from_l1e(sl1e, d, owner);
+            SHADOW_PRINTK("privileged domain %d installs map of mfn %05lx "
+                           "which is owned by domain %d: %s\n",
+                           d->domain_id, mfn_x(mfn), owner->domain_id,
+                           res >= 0 ? "success" : "failed");
+        }
     }
 
     /* Okay, it might still be a grant mapping PTE.  Try it. */
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 191e493..9cae61c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -574,6 +574,12 @@ static XSM_INLINE int xsm_update_va_mapping(XSM_DEFAULT_ARG struct domain *d, st
     return xsm_default_action(action, d, f);
 }
 
+static XSM_INLINE int xsm_priv_mapping(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, t);
+}
+
 static XSM_INLINE int xsm_bind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index fdc7a65..5103070 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -154,6 +154,7 @@ struct xsm_operations {
                        struct domain *f, uint32_t flags);
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
+    int (*priv_mapping) (struct domain *d, struct domain *t);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
@@ -582,6 +583,11 @@ static inline int xsm_update_va_mapping(xsm_default_t def, struct domain *d, str
     return xsm_ops->update_va_mapping(d, f, pte);
 }
 
+static inline int xsm_priv_mapping(xsm_default_t def, struct domain *d, struct domain *t)
+{
+    return xsm_ops->priv_mapping(d, t);
+}
+
 static inline int xsm_bind_pt_irq(xsm_default_t def, struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 21aef2a..f7b0399 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -124,6 +124,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mmu_update);
     set_to_dummy_if_null(ops, mmuext_op);
     set_to_dummy_if_null(ops, update_va_mapping);
+    set_to_dummy_if_null(ops, priv_mapping);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
     set_to_dummy_if_null(ops, ioport_permission);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 23c5233..04c8a39 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1345,6 +1345,11 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
+static int flask_priv_mapping(struct domain *d, struct domain *t)
+{
+    return domain_has_perm(d, t, SECCLASS_MMU, MMU__TARGET_HACK);
+}
+
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1534,6 +1539,7 @@ static struct xsm_operations flask_ops = {
     .mmu_update = flask_mmu_update,
     .mmuext_op = flask_mmuext_op,
     .update_va_mapping = flask_update_va_mapping,
+    .priv_mapping = flask_priv_mapping,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 36b8b2c..c8ae806 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -330,6 +330,9 @@ class mmu
 #  source = domain making the hypercall
 #  target = domain whose pages are being exchanged
     exchange
+# Allow a privileged domain to install a map of a page it does not own.  Used
+# for stub domain device models with the PV framebuffer.
+    target_hack
 }
 
 # control of the paging_domctl split by subop
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 19:12:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 19:12:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUidn-0007FB-BB; Tue, 23 Apr 2013 19:12:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUidm-0007F4-Km
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:12:34 +0000
Received: from [85.158.139.83:42368] by server-8.bemta-5.messagelabs.com id
	72/E3-05790-E1DD6715; Tue, 23 Apr 2013 19:12:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-182.messagelabs.com!1366744348!29703263!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29620 invoked from network); 23 Apr 2013 19:12:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 19:12:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUici-0007aX-VR
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUici-000797-3N
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 19:11:28 +0000
Date: Tue, 23 Apr 2013 19:11:28 +0000
Message-Id: <E1UUici-000797-3N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: remove IS_PRIV_FOR references
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3f28d0077788e7f8cd3ee25b023a4225d7e26e87
Author:     Daniel De Graaf <dgdegra@tycho.nsa.gov>
AuthorDate: Tue Apr 23 11:56:05 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 11:56:05 2013 +0200

    x86: remove IS_PRIV_FOR references
    
    The check in guest_physmap_mark_populate_on_demand is redundant, since
    its only caller is populate_physmap whose only caller checks the
    xsm_memory_adjust_reservation hook prior to calling.
    
    Add a new XSM hook for the other two checks since they allow privileged
    domains to arbitrarily map a guest's memory.
    
    Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (release perspective)
---
 xen/arch/x86/mm.c                   |    2 +-
 xen/arch/x86/mm/p2m-pod.c           |    3 ---
 xen/arch/x86/mm/shadow/multi.c      |   17 ++++++++++-------
 xen/include/xsm/dummy.h             |    6 ++++++
 xen/include/xsm/xsm.h               |    6 ++++++
 xen/xsm/dummy.c                     |    1 +
 xen/xsm/flask/hooks.c               |    6 ++++++
 xen/xsm/flask/policy/access_vectors |    3 +++
 8 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 58e1402..0cd4203 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -815,7 +815,7 @@ get_page_from_l1e(
          * minor hack can go away.
          */
         if ( (real_pg_owner == NULL) || (pg_owner == l1e_owner) ||
-             !IS_PRIV_FOR(pg_owner, real_pg_owner) )
+             xsm_priv_mapping(XSM_TARGET, pg_owner, real_pg_owner) )
         {
             MEM_LOG("pg_owner %d l1e_owner %d, but real_pg_owner %d",
                     pg_owner->domain_id, l1e_owner->domain_id,
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 55936c6..04ffbcb 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -1117,9 +1117,6 @@ guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
     mfn_t omfn;
     int rc = 0;
 
-    if ( !IS_PRIV_FOR(current->domain, d) )
-        return -EPERM;
-
     if ( !paging_mode_translate(d) )
         return -EINVAL;
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index a593f76..a8ef75e 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -29,6 +29,7 @@
 #include <xen/perfc.h>
 #include <xen/domain_page.h>
 #include <xen/iocap.h>
+#include <xsm/xsm.h>
 #include <asm/page.h>
 #include <asm/current.h>
 #include <asm/shadow.h>
@@ -849,14 +850,16 @@ shadow_get_page_from_l1e(shadow_l1e_t sl1e, struct domain *d, p2m_type_t type)
          !shadow_mode_translate(d) &&
          mfn_valid(mfn = shadow_l1e_get_mfn(sl1e)) &&
          (owner = page_get_owner(mfn_to_page(mfn))) &&
-         (d != owner) &&
-         IS_PRIV_FOR(d, owner))
-    {
-        res = get_page_from_l1e(sl1e, d, owner);
-        SHADOW_PRINTK("privileged domain %d installs map of mfn %05lx "
-                       "which is owned by domain %d: %s\n",
-                       d->domain_id, mfn_x(mfn), owner->domain_id,
-                       res >= 0 ? "success" : "failed");
+         (d != owner) )
+    {
+        res = xsm_priv_mapping(XSM_TARGET, d, owner);
+        if ( !res ) {
+            res = get_page_from_l1e(sl1e, d, owner);
+            SHADOW_PRINTK("privileged domain %d installs map of mfn %05lx "
+                           "which is owned by domain %d: %s\n",
+                           d->domain_id, mfn_x(mfn), owner->domain_id,
+                           res >= 0 ? "success" : "failed");
+        }
     }
 
     /* Okay, it might still be a grant mapping PTE.  Try it. */
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 191e493..9cae61c 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -574,6 +574,12 @@ static XSM_INLINE int xsm_update_va_mapping(XSM_DEFAULT_ARG struct domain *d, st
     return xsm_default_action(action, d, f);
 }
 
+static XSM_INLINE int xsm_priv_mapping(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, t);
+}
+
 static XSM_INLINE int xsm_bind_pt_irq(XSM_DEFAULT_ARG struct domain *d, struct xen_domctl_bind_pt_irq *bind)
 {
     XSM_ASSERT_ACTION(XSM_HOOK);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index fdc7a65..5103070 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -154,6 +154,7 @@ struct xsm_operations {
                        struct domain *f, uint32_t flags);
     int (*mmuext_op) (struct domain *d, struct domain *f);
     int (*update_va_mapping) (struct domain *d, struct domain *f, l1_pgentry_t pte);
+    int (*priv_mapping) (struct domain *d, struct domain *t);
     int (*bind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*unbind_pt_irq) (struct domain *d, struct xen_domctl_bind_pt_irq *bind);
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
@@ -582,6 +583,11 @@ static inline int xsm_update_va_mapping(xsm_default_t def, struct domain *d, str
     return xsm_ops->update_va_mapping(d, f, pte);
 }
 
+static inline int xsm_priv_mapping(xsm_default_t def, struct domain *d, struct domain *t)
+{
+    return xsm_ops->priv_mapping(d, t);
+}
+
 static inline int xsm_bind_pt_irq(xsm_default_t def, struct domain *d,
                                                 struct xen_domctl_bind_pt_irq *bind)
 {
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 21aef2a..f7b0399 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -124,6 +124,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, mmu_update);
     set_to_dummy_if_null(ops, mmuext_op);
     set_to_dummy_if_null(ops, update_va_mapping);
+    set_to_dummy_if_null(ops, priv_mapping);
     set_to_dummy_if_null(ops, bind_pt_irq);
     set_to_dummy_if_null(ops, unbind_pt_irq);
     set_to_dummy_if_null(ops, ioport_permission);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 23c5233..04c8a39 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1345,6 +1345,11 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
     return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
 }
 
+static int flask_priv_mapping(struct domain *d, struct domain *t)
+{
+    return domain_has_perm(d, t, SECCLASS_MMU, MMU__TARGET_HACK);
+}
+
 static int flask_get_device_group(uint32_t machine_bdf)
 {
     u32 rsid;
@@ -1534,6 +1539,7 @@ static struct xsm_operations flask_ops = {
     .mmu_update = flask_mmu_update,
     .mmuext_op = flask_mmuext_op,
     .update_va_mapping = flask_update_va_mapping,
+    .priv_mapping = flask_priv_mapping,
     .get_device_group = flask_get_device_group,
     .test_assign_device = flask_test_assign_device,
     .assign_device = flask_assign_device,
diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors
index 36b8b2c..c8ae806 100644
--- a/xen/xsm/flask/policy/access_vectors
+++ b/xen/xsm/flask/policy/access_vectors
@@ -330,6 +330,9 @@ class mmu
 #  source = domain making the hypercall
 #  target = domain whose pages are being exchanged
     exchange
+# Allow a privileged domain to install a map of a page it does not own.  Used
+# for stub domain device models with the PV framebuffer.
+    target_hack
 }
 
 # control of the paging_domctl split by subop
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 22:22:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 22:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUlbK-0005al-Eu; Tue, 23 Apr 2013 22:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUlbJ-0005ag-0T
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 22:22:13 +0000
Received: from [85.158.139.211:45144] by server-7.bemta-5.messagelabs.com id
	93/7F-12441-49907715; Tue, 23 Apr 2013 22:22:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1366755729!19834531!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8675 invoked from network); 23 Apr 2013 22:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 22:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUlbA-0001Kz-FS
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 22:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUlb9-0002xN-6N
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 22:22:03 +0000
Date: Tue, 23 Apr 2013 22:22:03 +0000
Message-Id: <E1UUlb9-0002xN-6N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a125ec6a4a2f028f97f0bdd8946d347a36dbe76b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 23 18:42:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 18:42:55 2013 +0200

    update Xen version to 4.2.2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6aa0c43..ff1aea3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -203,7 +203,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2-rc2
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -215,7 +215,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.2-rc2
+QEMU_TAG ?= xen-4.2.2
 # Thu Jan 17 15:52:16 2013 +0000
 # e1000: fix compile warning introduced by security fix, and debugging
 
diff --git a/xen/Makefile b/xen/Makefile
index 4ccdcf2..8c97f0f 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .2-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 23 22:22:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 23 Apr 2013 22:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUlbK-0005al-Eu; Tue, 23 Apr 2013 22:22:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUlbJ-0005ag-0T
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 22:22:13 +0000
Received: from [85.158.139.211:45144] by server-7.bemta-5.messagelabs.com id
	93/7F-12441-49907715; Tue, 23 Apr 2013 22:22:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1366755729!19834531!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8675 invoked from network); 23 Apr 2013 22:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Apr 2013 22:22:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUlbA-0001Kz-FS
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 22:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUlb9-0002xN-6N
	for xen-changelog@lists.xensource.com; Tue, 23 Apr 2013 22:22:03 +0000
Date: Tue, 23 Apr 2013 22:22:03 +0000
Message-Id: <E1UUlb9-0002xN-6N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a125ec6a4a2f028f97f0bdd8946d347a36dbe76b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 23 18:42:55 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 18:42:55 2013 +0200

    update Xen version to 4.2.2
---
 Config.mk    |    4 ++--
 xen/Makefile |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6aa0c43..ff1aea3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -203,7 +203,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.2-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
-QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2-rc2
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.2.2
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
 # Update version to 1.6.3.2
@@ -215,7 +215,7 @@ ETHERBOOT_NICS ?= rtl8139 8086100e
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.2.2-rc2
+QEMU_TAG ?= xen-4.2.2
 # Thu Jan 17 15:52:16 2013 +0000
 # e1000: fix compile warning introduced by security fix, and debugging
 
diff --git a/xen/Makefile b/xen/Makefile
index 4ccdcf2..8c97f0f 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .2-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 24 09:44:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Apr 2013 09:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUwFg-00038r-Lp; Wed, 24 Apr 2013 09:44:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUwFf-00038m-Nh
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 09:44:35 +0000
Received: from [85.158.139.83:24978] by server-14.bemta-5.messagelabs.com id
	D7/82-13158-D79A7715; Wed, 24 Apr 2013 09:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1366796666!28623917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28274 invoked from network); 24 Apr 2013 09:44:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Apr 2013 09:44:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUwF9-0007pu-65
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 09:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUwF8-0002SQ-9W
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 09:44:02 +0000
Date: Wed, 24 Apr 2013 09:44:02 +0000
Message-Id: <E1UUwF8-0002SQ-9W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] update Xen version to 4.1.5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 919d84dd80a08d380dc0febf83e4af8933784de8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 23 18:44:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 18:44:20 2013 +0200

    update Xen version to 4.1.5
---
 Config.mk    |    2 +-
 xen/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9032185..7989a3f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -180,7 +180,7 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.1.5-rc1
+QEMU_TAG ?= xen-4.1.5
 # Thu Jan 17 15:52:16 2013 +0000
 # e1000: fix compile warning introduced by security fix, and debugging
 
diff --git a/xen/Makefile b/xen/Makefile
index 6e0ed76..a37c9f6 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .5-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 24 09:44:39 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Apr 2013 09:44:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UUwFg-00038r-Lp; Wed, 24 Apr 2013 09:44:36 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUwFf-00038m-Nh
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 09:44:35 +0000
Received: from [85.158.139.83:24978] by server-14.bemta-5.messagelabs.com id
	D7/82-13158-D79A7715; Wed, 24 Apr 2013 09:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1366796666!28623917!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28274 invoked from network); 24 Apr 2013 09:44:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Apr 2013 09:44:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUwF9-0007pu-65
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 09:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UUwF8-0002SQ-9W
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 09:44:02 +0000
Date: Wed, 24 Apr 2013 09:44:02 +0000
Message-Id: <E1UUwF8-0002SQ-9W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] update Xen version to 4.1.5
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 919d84dd80a08d380dc0febf83e4af8933784de8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 23 18:44:20 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 23 18:44:20 2013 +0200

    update Xen version to 4.1.5
---
 Config.mk    |    2 +-
 xen/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index 9032185..7989a3f 100644
--- a/Config.mk
+++ b/Config.mk
@@ -180,7 +180,7 @@ endif
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= xen-4.1.5-rc1
+QEMU_TAG ?= xen-4.1.5
 # Thu Jan 17 15:52:16 2013 +0000
 # e1000: fix compile warning introduced by security fix, and debugging
 
diff --git a/xen/Makefile b/xen/Makefile
index 6e0ed76..a37c9f6 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .5-rc2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .5$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 24 18:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Apr 2013 18:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UV4qT-0003Qc-QL; Wed, 24 Apr 2013 18:55:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UV4qR-0003QT-Va
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 18:55:08 +0000
Received: from [85.158.138.51:6291] by server-4.bemta-3.messagelabs.com id
	D0/92-21470-B8A28715; Wed, 24 Apr 2013 18:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1366829705!21739913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8449 invoked from network); 24 Apr 2013 18:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Apr 2013 18:55:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UV4qO-00060O-OG
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 18:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UV4qM-0007iW-Ph
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 18:55:02 +0000
Date: Wed, 24 Apr 2013 18:55:02 +0000
Message-Id: <E1UV4qM-0007iW-Ph@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: delay resume until dom0 ACPI
	has a chance to run
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e96c186d23873597896051b043cfeb119c4a7d5
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Wed Apr 24 11:41:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 24 11:41:53 2013 +0200

    ns16550: delay resume until dom0 ACPI has a chance to run
    
    Check for ioport access, before fully resuming operation, to avoid
    spinning in __ns16550_poll when reading the LSR register returns 0xFF
    on failing ioport access.
    
    On some systems (like Lenovo T410, and some HP machines of similar vintage)
    there is a SuperIO card that provides this legacy ioport on the LPC bus.
    
    In this case, we need to wait for dom0's ACPI processing to run the proper
    AML to re-initialize the chip, before we can use the card again.
    
    This may cause a small amount of garbage to be written to the serial log
    while we wait patiently for that AML to be executed.
    
    This implementation limits the number of retries, to avoid a situation
    where we keep trying over and over again, in the case of some other failure
    on the ioport.
    
    Signed-Off-By: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/drivers/char/ns16550.c |   55 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index a91743e..e0c87bb 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -45,6 +45,7 @@ static struct ns16550 {
     struct irqaction irqaction;
     /* UART with no IRQ line: periodically-polled I/O. */
     struct timer timer;
+    struct timer resume_timer;
     unsigned int timeout_ms;
     bool_t intr_works;
     /* PCI card parameters. */
@@ -123,6 +124,10 @@ static struct ns16550 {
 /* Frequency of external clock source. This definition assumes PC platform. */
 #define UART_CLOCK_HZ   1843200
 
+/* Resume retry settings */
+#define RESUME_DELAY    MILLISECS(10)
+#define RESUME_RETRIES  100
+
 static char ns_read_reg(struct ns16550 *uart, int reg)
 {
     if ( uart->remapped_io_base == NULL )
@@ -351,7 +356,7 @@ static void ns16550_suspend(struct serial_port *port)
                                   uart->ps_bdf[2], PCI_COMMAND);
 }
 
-static void ns16550_resume(struct serial_port *port)
+static void _ns16550_resume(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
 
@@ -367,6 +372,54 @@ static void ns16550_resume(struct serial_port *port)
     ns16550_setup_postirq(port->uart);
 }
 
+static int ns16550_ioport_invalid(struct ns16550 *uart)
+{
+    return ((((unsigned char)ns_read_reg(uart, LSR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, MCR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IER)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IIR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, LCR)) == 0xff));
+}
+
+static int delayed_resume_tries;
+static void ns16550_delayed_resume(void *data)
+{
+    struct serial_port *port = data;
+    struct ns16550 *uart = port->uart;
+
+    if ( ns16550_ioport_invalid(port->uart) && delayed_resume_tries-- )
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    else
+        _ns16550_resume(port);
+}
+
+static void ns16550_resume(struct serial_port *port)
+{
+    struct ns16550 *uart = port->uart;
+
+    /*
+     * Check for ioport access, before fully resuming operation.
+     * On some systems, there is a SuperIO card that provides
+     * this legacy ioport on the LPC bus.
+     *
+     * We need to wait for dom0's ACPI processing to run the proper
+     * AML to re-initialize the chip, before we can use the card again.
+     *
+     * This may cause a small amount of garbage to be written
+     * to the serial log while we wait patiently for that AML to
+     * be executed. However, this is preferable to spinning in an
+     * infinite loop, as seen on a Lenovo T430, when serial was enabled.
+     */
+    if ( ns16550_ioport_invalid(uart) )
+    {
+        delayed_resume_tries = RESUME_RETRIES;
+        init_timer(&uart->resume_timer, ns16550_delayed_resume, port, 0);
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    }
+    else
+        _ns16550_resume(port);
+}
+
 #ifdef CONFIG_X86
 static void __init ns16550_endboot(struct serial_port *port)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Apr 24 18:55:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 24 Apr 2013 18:55:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UV4qT-0003Qc-QL; Wed, 24 Apr 2013 18:55:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UV4qR-0003QT-Va
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 18:55:08 +0000
Received: from [85.158.138.51:6291] by server-4.bemta-3.messagelabs.com id
	D0/92-21470-B8A28715; Wed, 24 Apr 2013 18:55:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-174.messagelabs.com!1366829705!21739913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8449 invoked from network); 24 Apr 2013 18:55:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Apr 2013 18:55:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UV4qO-00060O-OG
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 18:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UV4qM-0007iW-Ph
	for xen-changelog@lists.xensource.com; Wed, 24 Apr 2013 18:55:02 +0000
Date: Wed, 24 Apr 2013 18:55:02 +0000
Message-Id: <E1UV4qM-0007iW-Ph@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ns16550: delay resume until dom0 ACPI
	has a chance to run
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e96c186d23873597896051b043cfeb119c4a7d5
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Wed Apr 24 11:41:53 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Apr 24 11:41:53 2013 +0200

    ns16550: delay resume until dom0 ACPI has a chance to run
    
    Check for ioport access, before fully resuming operation, to avoid
    spinning in __ns16550_poll when reading the LSR register returns 0xFF
    on failing ioport access.
    
    On some systems (like Lenovo T410, and some HP machines of similar vintage)
    there is a SuperIO card that provides this legacy ioport on the LPC bus.
    
    In this case, we need to wait for dom0's ACPI processing to run the proper
    AML to re-initialize the chip, before we can use the card again.
    
    This may cause a small amount of garbage to be written to the serial log
    while we wait patiently for that AML to be executed.
    
    This implementation limits the number of retries, to avoid a situation
    where we keep trying over and over again, in the case of some other failure
    on the ioport.
    
    Signed-Off-By: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/drivers/char/ns16550.c |   55 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index a91743e..e0c87bb 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -45,6 +45,7 @@ static struct ns16550 {
     struct irqaction irqaction;
     /* UART with no IRQ line: periodically-polled I/O. */
     struct timer timer;
+    struct timer resume_timer;
     unsigned int timeout_ms;
     bool_t intr_works;
     /* PCI card parameters. */
@@ -123,6 +124,10 @@ static struct ns16550 {
 /* Frequency of external clock source. This definition assumes PC platform. */
 #define UART_CLOCK_HZ   1843200
 
+/* Resume retry settings */
+#define RESUME_DELAY    MILLISECS(10)
+#define RESUME_RETRIES  100
+
 static char ns_read_reg(struct ns16550 *uart, int reg)
 {
     if ( uart->remapped_io_base == NULL )
@@ -351,7 +356,7 @@ static void ns16550_suspend(struct serial_port *port)
                                   uart->ps_bdf[2], PCI_COMMAND);
 }
 
-static void ns16550_resume(struct serial_port *port)
+static void _ns16550_resume(struct serial_port *port)
 {
     struct ns16550 *uart = port->uart;
 
@@ -367,6 +372,54 @@ static void ns16550_resume(struct serial_port *port)
     ns16550_setup_postirq(port->uart);
 }
 
+static int ns16550_ioport_invalid(struct ns16550 *uart)
+{
+    return ((((unsigned char)ns_read_reg(uart, LSR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, MCR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IER)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, IIR)) == 0xff) &&
+            (((unsigned char)ns_read_reg(uart, LCR)) == 0xff));
+}
+
+static int delayed_resume_tries;
+static void ns16550_delayed_resume(void *data)
+{
+    struct serial_port *port = data;
+    struct ns16550 *uart = port->uart;
+
+    if ( ns16550_ioport_invalid(port->uart) && delayed_resume_tries-- )
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    else
+        _ns16550_resume(port);
+}
+
+static void ns16550_resume(struct serial_port *port)
+{
+    struct ns16550 *uart = port->uart;
+
+    /*
+     * Check for ioport access, before fully resuming operation.
+     * On some systems, there is a SuperIO card that provides
+     * this legacy ioport on the LPC bus.
+     *
+     * We need to wait for dom0's ACPI processing to run the proper
+     * AML to re-initialize the chip, before we can use the card again.
+     *
+     * This may cause a small amount of garbage to be written
+     * to the serial log while we wait patiently for that AML to
+     * be executed. However, this is preferable to spinning in an
+     * infinite loop, as seen on a Lenovo T430, when serial was enabled.
+     */
+    if ( ns16550_ioport_invalid(uart) )
+    {
+        delayed_resume_tries = RESUME_RETRIES;
+        init_timer(&uart->resume_timer, ns16550_delayed_resume, port, 0);
+        set_timer(&uart->resume_timer, NOW() + RESUME_DELAY);
+    }
+    else
+        _ns16550_resume(port);
+}
+
 #ifdef CONFIG_X86
 static void __init ns16550_endboot(struct serial_port *port)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:11:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvXk-00059k-Kt; Sat, 27 Apr 2013 03:11:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXj-00059d-5Q
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:19 +0000
Received: from [85.158.139.211:51333] by server-2.bemta-5.messagelabs.com id
	CF/D4-23989-6D14B715; Sat, 27 Apr 2013 03:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032276!20616324!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27281 invoked from network); 27 Apr 2013 03:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXg-0007ei-Fo
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXf-0006NH-D3
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:15 +0000
Date: Sat, 27 Apr 2013 03:11:15 +0000
Message-Id: <E1UVvXf-0006NH-D3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Only call stat() when adding a
	disk if we expect a device to exist.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3978915743046127181=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3978915743046127181==
Content-Type: text/plain

commit a8a1f236a2964506a22d1779648d8e1c8668cb1a
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Apr 23 10:59:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:15:44 2013 +0100

    libxl: Only call stat() when adding a disk if we expect a device to exist.
    
    We consider calling stat() a helpful error check in the following
    circumstances only:
     1. the disk backend type must be PHYsical
     2. the disk backend domain must be the same as the running libxl
        code (ie LIBXL_TOOLSTACK_DOMID)
     3. there must not be a hotplug script because this would imply that
        the device won't be created until after the hotplug script has
        run.
    
    With this fix, it is possible to use qemu's built-in block drivers
    such as ceph/rbd, with a xl config disk spec like this:
    
    disk=[ 'backendtype=qdisk,format=raw,vdev=hda,access=rw,target=rbd:rbd/ubuntu1204.img' ]
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/libxl/libxl_device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index eeea9d9..eb60fd5 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -236,7 +236,9 @@ int libxl__device_disk_set_backend(libxl__gc *gc, libxl_device_disk *disk) {
             return ERROR_INVAL;
         }
         memset(&a.stab, 0, sizeof(a.stab));
-    } else if (!disk->script) {
+    } else if (disk->backend == LIBXL_DISK_BACKEND_PHY &&
+               disk->backend_domid == LIBXL_TOOLSTACK_DOMID &&
+               !disk->script) {
         if (stat(disk->pdev_path, &a.stab)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Disk vdev=%s "
                              "failed to stat: %s",
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3978915743046127181==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3978915743046127181==--

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:11:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvXk-00059k-Kt; Sat, 27 Apr 2013 03:11:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXj-00059d-5Q
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:19 +0000
Received: from [85.158.139.211:51333] by server-2.bemta-5.messagelabs.com id
	CF/D4-23989-6D14B715; Sat, 27 Apr 2013 03:11:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032276!20616324!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27281 invoked from network); 27 Apr 2013 03:11:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXg-0007ei-Fo
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXf-0006NH-D3
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:15 +0000
Date: Sat, 27 Apr 2013 03:11:15 +0000
Message-Id: <E1UVvXf-0006NH-D3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Only call stat() when adding a
	disk if we expect a device to exist.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3978915743046127181=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3978915743046127181==
Content-Type: text/plain

commit a8a1f236a2964506a22d1779648d8e1c8668cb1a
Author:     David Scott <dave.scott@eu.citrix.com>
AuthorDate: Tue Apr 23 10:59:26 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:15:44 2013 +0100

    libxl: Only call stat() when adding a disk if we expect a device to exist.
    
    We consider calling stat() a helpful error check in the following
    circumstances only:
     1. the disk backend type must be PHYsical
     2. the disk backend domain must be the same as the running libxl
        code (ie LIBXL_TOOLSTACK_DOMID)
     3. there must not be a hotplug script because this would imply that
        the device won't be created until after the hotplug script has
        run.
    
    With this fix, it is possible to use qemu's built-in block drivers
    such as ceph/rbd, with a xl config disk spec like this:
    
    disk=[ 'backendtype=qdisk,format=raw,vdev=hda,access=rw,target=rbd:rbd/ubuntu1204.img' ]
    
    Signed-off-by: David Scott <dave.scott@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/libxl/libxl_device.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index eeea9d9..eb60fd5 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -236,7 +236,9 @@ int libxl__device_disk_set_backend(libxl__gc *gc, libxl_device_disk *disk) {
             return ERROR_INVAL;
         }
         memset(&a.stab, 0, sizeof(a.stab));
-    } else if (!disk->script) {
+    } else if (disk->backend == LIBXL_DISK_BACKEND_PHY &&
+               disk->backend_domid == LIBXL_TOOLSTACK_DOMID &&
+               !disk->script) {
         if (stat(disk->pdev_path, &a.stab)) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Disk vdev=%s "
                              "failed to stat: %s",
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============3978915743046127181==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============3978915743046127181==--

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:11:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvY7-0005Ac-Ox; Sat, 27 Apr 2013 03:11:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvY6-0005AU-Rn
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:42 +0000
Received: from [85.158.143.99:31251] by server-1.bemta-4.messagelabs.com id
	E8/1F-06203-EE14B715; Sat, 27 Apr 2013 03:11:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1367032300!23475092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26237 invoked from network); 27 Apr 2013 03:11:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvY1-0007eq-Uj
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvY1-0006Oc-Rp
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:37 +0000
Date: Sat, 27 Apr 2013 03:11:37 +0000
Message-Id: <E1UVvY1-0006Oc-Rp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/pygrub: Fix install when
	$(BINDIR) and $(PRIVATE_BINDIR) are the same
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f5de6ffdff7ae3c1eed09fcd8c5f1d7c9229bafb
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Wed Apr 24 12:19:31 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:19:31 2013 +0100

    tools/pygrub: Fix install when $(BINDIR) and $(PRIVATE_BINDIR) are the same
    
    Do not override pygrub with a symbolic link in this case.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matt Wilson <msw@amazon.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reworded summary to fit on one line ]
---
 tools/pygrub/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 039f7f7..0191638 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -14,7 +14,8 @@ install: all
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
 		--install-scripts=$(PRIVATE_BINDIR) --force
 	$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
-	set -e; if [ "`readlink -f $(DESTDIR)/$(BINDIR)`" != \
+	set -e; if [ $(BINDIR) != $(PRIVATE_BINDIR) -a \
+	             "`readlink -f $(DESTDIR)/$(BINDIR)`" != \
 	             "`readlink -f $(PRIVATE_BINDIR)`" ]; then \
 	    ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR); \
 	fi
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:11:48 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:11:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvY7-0005Ac-Ox; Sat, 27 Apr 2013 03:11:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvY6-0005AU-Rn
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:42 +0000
Received: from [85.158.143.99:31251] by server-1.bemta-4.messagelabs.com id
	E8/1F-06203-EE14B715; Sat, 27 Apr 2013 03:11:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1367032300!23475092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26237 invoked from network); 27 Apr 2013 03:11:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvY1-0007eq-Uj
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvY1-0006Oc-Rp
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:37 +0000
Date: Sat, 27 Apr 2013 03:11:37 +0000
Message-Id: <E1UVvY1-0006Oc-Rp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/pygrub: Fix install when
	$(BINDIR) and $(PRIVATE_BINDIR) are the same
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f5de6ffdff7ae3c1eed09fcd8c5f1d7c9229bafb
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Wed Apr 24 12:19:31 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:19:31 2013 +0100

    tools/pygrub: Fix install when $(BINDIR) and $(PRIVATE_BINDIR) are the same
    
    Do not override pygrub with a symbolic link in this case.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matt Wilson <msw@amazon.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reworded summary to fit on one line ]
---
 tools/pygrub/Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/pygrub/Makefile b/tools/pygrub/Makefile
index 039f7f7..0191638 100644
--- a/tools/pygrub/Makefile
+++ b/tools/pygrub/Makefile
@@ -14,7 +14,8 @@ install: all
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
 		--install-scripts=$(PRIVATE_BINDIR) --force
 	$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
-	set -e; if [ "`readlink -f $(DESTDIR)/$(BINDIR)`" != \
+	set -e; if [ $(BINDIR) != $(PRIVATE_BINDIR) -a \
+	             "`readlink -f $(DESTDIR)/$(BINDIR)`" != \
 	             "`readlink -f $(PRIVATE_BINDIR)`" ]; then \
 	    ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR); \
 	fi
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYH-0005BX-Rp; Sat, 27 Apr 2013 03:11:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYG-0005BK-2Z
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:52 +0000
Received: from [85.158.138.51:5045] by server-16.bemta-3.messagelabs.com id
	80/7B-20692-6F14B715; Sat, 27 Apr 2013 03:11:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1367032308!29165773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25261 invoked from network); 27 Apr 2013 03:11:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYC-0007et-5o
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYC-0006P2-2n
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:48 +0000
Date: Sat, 27 Apr 2013 03:11:48 +0000
Message-Id: <E1UVvYC-0006P2-2n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] install qemu into the location
	specified via configure --prefix.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a97f6856d0594b7a95ffce4964d868bd93412dd
Author:     Egger Christoph <chegger@amazon.de>
AuthorDate: Mon Apr 22 13:47:42 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:44:53 2013 +0100

    install qemu into the location specified via configure --prefix.
    
    Install qemu into the location specified via configure --prefix.
    You will notice when you use something else than /usr/local.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 8a30c83..e44a3e9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -188,6 +188,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	fi; \
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
+		--prefix=$(PREFIX) \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:11:59 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:11:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYH-0005BX-Rp; Sat, 27 Apr 2013 03:11:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYG-0005BK-2Z
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:52 +0000
Received: from [85.158.138.51:5045] by server-16.bemta-3.messagelabs.com id
	80/7B-20692-6F14B715; Sat, 27 Apr 2013 03:11:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-174.messagelabs.com!1367032308!29165773!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25261 invoked from network); 27 Apr 2013 03:11:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYC-0007et-5o
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYC-0006P2-2n
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:48 +0000
Date: Sat, 27 Apr 2013 03:11:48 +0000
Message-Id: <E1UVvYC-0006P2-2n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] install qemu into the location
	specified via configure --prefix.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0a97f6856d0594b7a95ffce4964d868bd93412dd
Author:     Egger Christoph <chegger@amazon.de>
AuthorDate: Mon Apr 22 13:47:42 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:44:53 2013 +0100

    install qemu into the location specified via configure --prefix.
    
    Install qemu into the location specified via configure --prefix.
    You will notice when you use something else than /usr/local.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 8a30c83..e44a3e9 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -188,6 +188,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	fi; \
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
+		--prefix=$(PREFIX) \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYO-0005CL-Ug; Sat, 27 Apr 2013 03:12:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYN-0005Bp-9g
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:59 +0000
Received: from [85.158.139.83:5176] by server-1.bemta-5.messagelabs.com id
	AE/FB-14063-DF14B715; Sat, 27 Apr 2013 03:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1367032290!28069305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29199 invoked from network); 27 Apr 2013 03:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXr-0007el-JW
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXq-0006Ne-K5
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:26 +0000
Date: Sat, 27 Apr 2013 03:11:26 +0000
Message-Id: <E1UVvXq-0006Ne-K5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenbackendd: make 'gmake clean'
	properly cleaning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d6d33360662d87d3e456e4618a3eafd38db5b09c
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Mon Apr 22 13:59:14 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:18:11 2013 +0100

    tools/xenbackendd: make 'gmake clean' properly cleaning
    
    tools/xenbackendd: properly cleanup
    Do not leave builds on gmake clean.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matt Wilson <msw@amazon.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenbackendd/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenbackendd/Makefile b/tools/xenbackendd/Makefile
index 8374ad3..31e5c62 100644
--- a/tools/xenbackendd/Makefile
+++ b/tools/xenbackendd/Makefile
@@ -30,7 +30,7 @@ install: build
 
 .PHONY: clean
 clean:
-	rm -f $(DEPS)
+	$(RM) *.a *.so *.o $(DEPS) xenbackendd
 
 xenbackendd: xenbackendd.o
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:04 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYO-0005CL-Ug; Sat, 27 Apr 2013 03:12:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYN-0005Bp-9g
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:59 +0000
Received: from [85.158.139.83:5176] by server-1.bemta-5.messagelabs.com id
	AE/FB-14063-DF14B715; Sat, 27 Apr 2013 03:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-182.messagelabs.com!1367032290!28069305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29199 invoked from network); 27 Apr 2013 03:11:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:11:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXr-0007el-JW
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXq-0006Ne-K5
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:26 +0000
Date: Sat, 27 Apr 2013 03:11:26 +0000
Message-Id: <E1UVvXq-0006Ne-K5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenbackendd: make 'gmake clean'
	properly cleaning
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d6d33360662d87d3e456e4618a3eafd38db5b09c
Author:     Christoph Egger <chegger@amazon.de>
AuthorDate: Mon Apr 22 13:59:14 2013 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:18:11 2013 +0100

    tools/xenbackendd: make 'gmake clean' properly cleaning
    
    tools/xenbackendd: properly cleanup
    Do not leave builds on gmake clean.
    
    Signed-off-by: Christoph Egger <chegger@amazon.de>
    Reviewed-by: Matt Wilson <msw@amazon.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenbackendd/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/xenbackendd/Makefile b/tools/xenbackendd/Makefile
index 8374ad3..31e5c62 100644
--- a/tools/xenbackendd/Makefile
+++ b/tools/xenbackendd/Makefile
@@ -30,7 +30,7 @@ install: build
 
 .PHONY: clean
 clean:
-	rm -f $(DEPS)
+	$(RM) *.a *.so *.o $(DEPS) xenbackendd
 
 xenbackendd: xenbackendd.o
 	$(CC) $(LDFLAGS) $< -o $@ $(LDLIBS) $(APPEND_LDFLAGS)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYT-0005D6-1R; Sat, 27 Apr 2013 03:12:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYR-0005Cd-Gn
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:03 +0000
Received: from [85.158.139.83:61286] by server-6.bemta-5.messagelabs.com id
	D3/D5-21466-2024B715; Sat, 27 Apr 2013 03:12:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1367032319!26251963!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17199 invoked from network); 27 Apr 2013 03:12:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYN-0007f5-BP
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYM-0006PP-AQ
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:58 +0000
Date: Sat, 27 Apr 2013 03:11:58 +0000
Message-Id: <E1UVvYM-0006PP-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: rename xen_pgtable to
	boot_pgtable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4feab57f0e740df7f04cf71b334a5bdd5d52fbc
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:53:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:15 2013 +0100

    xen: arm: rename xen_pgtable to boot_pgtable
    
    The intention is that in a subsequent patch each PCPU will have its own
    pagetables and that xen_pgtable will become a per-cpu variable. The boot
    pagetables will become the boot cpu's pagetables.
    
    For now leave a #define in place for those places which semantically do mean
    xen_pgtable and not boot_pgtable.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/arm32/head.S |    2 +-
 xen/arch/arm/arm64/head.S |    4 ++--
 xen/arch/arm/mm.c         |   18 +++++++++++-------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index f2f581d..0b4cfde 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -206,7 +206,7 @@ skip_bss:
         mcr   CP32(r0, HSCTLR)
 
         /* Write Xen's PT's paddr into the HTTBR */
-        ldr   r4, =xen_pgtable
+        ldr   r4, =boot_pgtable
         add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
         mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
         mcrr  CP64(r4, r5, HTTBR)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index c18ef2b..f0d9066 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -190,14 +190,14 @@ skip_bss:
         msr   SCTLR_EL2, x0
 
         /* Write Xen's PT's paddr into the HTTBR */
-        ldr   x4, =xen_pgtable
+        ldr   x4, =boot_pgtable
         add   x4, x4, x20            /* x4 := paddr (xen_pagetable) */
         msr   TTBR0_EL2, x4
 
         /* Non-boot CPUs don't need to rebuild the pagetable */
         cbnz  x22, pt_ready
 
-        ldr   x1, =xen_first
+        ldr   x1, =boot_first
         add   x1, x1, x20            /* x1 := paddr (xen_first) */
         mov   x3, #PT_PT             /* x2 := table map of xen_first */
         orr   x2, x1, x3             /* (+ rights for linear PT) */
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index ba3140d..3cb852b 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -40,10 +40,10 @@
 struct domain *dom_xen, *dom_io, *dom_cow;
 
 /* Static start-of-day pagetables that we use before the allocators are up */
-/* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
-lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+/* boot_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+lpae_t boot_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #ifdef CONFIG_ARM_64
-lpae_t xen_first[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+lpae_t boot_first[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #endif
 /* N.B. The second-level table is 4 contiguous pages long, and covers
  * all addresses from 0 to 0xffffffff.  Offsets into it are calculated
@@ -52,6 +52,10 @@ lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4)));
 lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
+/* boot_pgtable becomes the boot processors pagetable, eventually this will
+ * become a per-cpu variable */
+#define xen_pgtable boot_pgtable
+
 /* Non-boot CPUs use this to find the correct pagetables. */
 uint64_t boot_ttbr;
 
@@ -284,11 +288,11 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     /* Beware!  Any state we modify between now and the PT switch may be
      * discarded when we switch over to the copy. */
 
-    /* Update the copy of xen_pgtable to use the new paddrs */
-    p = (void *) xen_pgtable + dest_va - (unsigned long) _start;
+    /* Update the copy of boot_pgtable to use the new paddrs */
+    p = (void *) boot_pgtable + dest_va - (unsigned long) _start;
 #ifdef CONFIG_ARM_64
     p[0].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
-    p = (void *) xen_first + dest_va - (unsigned long) _start;
+    p = (void *) boot_first + dest_va - (unsigned long) _start;
 #endif
     for ( i = 0; i < 4; i++)
         p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
@@ -305,7 +309,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
             p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
 
     /* Change pagetables to the copy in the relocated Xen */
-    boot_ttbr = (uintptr_t) xen_pgtable + phys_offset;
+    boot_ttbr = (uintptr_t) boot_pgtable + phys_offset;
     flush_xen_dcache(boot_ttbr);
     flush_xen_dcache_va_range((void*)dest_va, _end - _start);
     flush_xen_text_tlb();
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:08 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYT-0005D6-1R; Sat, 27 Apr 2013 03:12:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYR-0005Cd-Gn
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:03 +0000
Received: from [85.158.139.83:61286] by server-6.bemta-5.messagelabs.com id
	D3/D5-21466-2024B715; Sat, 27 Apr 2013 03:12:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-182.messagelabs.com!1367032319!26251963!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17199 invoked from network); 27 Apr 2013 03:12:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYN-0007f5-BP
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYM-0006PP-AQ
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:58 +0000
Date: Sat, 27 Apr 2013 03:11:58 +0000
Message-Id: <E1UVvYM-0006PP-AQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: rename xen_pgtable to
	boot_pgtable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b4feab57f0e740df7f04cf71b334a5bdd5d52fbc
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:53:58 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:15 2013 +0100

    xen: arm: rename xen_pgtable to boot_pgtable
    
    The intention is that in a subsequent patch each PCPU will have its own
    pagetables and that xen_pgtable will become a per-cpu variable. The boot
    pagetables will become the boot cpu's pagetables.
    
    For now leave a #define in place for those places which semantically do mean
    xen_pgtable and not boot_pgtable.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/arm32/head.S |    2 +-
 xen/arch/arm/arm64/head.S |    4 ++--
 xen/arch/arm/mm.c         |   18 +++++++++++-------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index f2f581d..0b4cfde 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -206,7 +206,7 @@ skip_bss:
         mcr   CP32(r0, HSCTLR)
 
         /* Write Xen's PT's paddr into the HTTBR */
-        ldr   r4, =xen_pgtable
+        ldr   r4, =boot_pgtable
         add   r4, r4, r10            /* r4 := paddr (xen_pagetable) */
         mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
         mcrr  CP64(r4, r5, HTTBR)
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index c18ef2b..f0d9066 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -190,14 +190,14 @@ skip_bss:
         msr   SCTLR_EL2, x0
 
         /* Write Xen's PT's paddr into the HTTBR */
-        ldr   x4, =xen_pgtable
+        ldr   x4, =boot_pgtable
         add   x4, x4, x20            /* x4 := paddr (xen_pagetable) */
         msr   TTBR0_EL2, x4
 
         /* Non-boot CPUs don't need to rebuild the pagetable */
         cbnz  x22, pt_ready
 
-        ldr   x1, =xen_first
+        ldr   x1, =boot_first
         add   x1, x1, x20            /* x1 := paddr (xen_first) */
         mov   x3, #PT_PT             /* x2 := table map of xen_first */
         orr   x2, x1, x3             /* (+ rights for linear PT) */
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index ba3140d..3cb852b 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -40,10 +40,10 @@
 struct domain *dom_xen, *dom_io, *dom_cow;
 
 /* Static start-of-day pagetables that we use before the allocators are up */
-/* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
-lpae_t xen_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+/* boot_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+lpae_t boot_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #ifdef CONFIG_ARM_64
-lpae_t xen_first[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+lpae_t boot_first[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #endif
 /* N.B. The second-level table is 4 contiguous pages long, and covers
  * all addresses from 0 to 0xffffffff.  Offsets into it are calculated
@@ -52,6 +52,10 @@ lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4)));
 lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
+/* boot_pgtable becomes the boot processors pagetable, eventually this will
+ * become a per-cpu variable */
+#define xen_pgtable boot_pgtable
+
 /* Non-boot CPUs use this to find the correct pagetables. */
 uint64_t boot_ttbr;
 
@@ -284,11 +288,11 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     /* Beware!  Any state we modify between now and the PT switch may be
      * discarded when we switch over to the copy. */
 
-    /* Update the copy of xen_pgtable to use the new paddrs */
-    p = (void *) xen_pgtable + dest_va - (unsigned long) _start;
+    /* Update the copy of boot_pgtable to use the new paddrs */
+    p = (void *) boot_pgtable + dest_va - (unsigned long) _start;
 #ifdef CONFIG_ARM_64
     p[0].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
-    p = (void *) xen_first + dest_va - (unsigned long) _start;
+    p = (void *) boot_first + dest_va - (unsigned long) _start;
 #endif
     for ( i = 0; i < 4; i++)
         p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
@@ -305,7 +309,7 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
             p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
 
     /* Change pagetables to the copy in the relocated Xen */
-    boot_ttbr = (uintptr_t) xen_pgtable + phys_offset;
+    boot_ttbr = (uintptr_t) boot_pgtable + phys_offset;
     flush_xen_dcache(boot_ttbr);
     flush_xen_dcache_va_range((void*)dest_va, _end - _start);
     flush_xen_text_tlb();
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYa-0005ET-4d; Sat, 27 Apr 2013 03:12:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYY-0005E4-6v
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:10 +0000
Received: from [85.158.139.83:5558] by server-16.bemta-5.messagelabs.com id
	58/15-02543-9024B715; Sat, 27 Apr 2013 03:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1367032327!22851672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16110 invoked from network); 27 Apr 2013 03:12:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXV-0007ef-83
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXU-0006Mr-3y
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:04 +0000
Date: Sat, 27 Apr 2013 03:11:04 +0000
Message-Id: <E1UVvXU-0006Mr-3y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug: add openvswitch script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5160208357946331940=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5160208357946331940==
Content-Type: text/plain

commit 3051bdedc3ef82eb5f14978823dec00784d69d0e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Apr 23 11:00:57 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:14:57 2013 +0100

    hotplug: add openvswitch script
    
    Based on Waldi's RFC at
    http://lists.xen.org/archives/html/xen-devel/2012-09/msg00943.html
    
    To use it set vif.default.script="vif-openvswitch" in /etc/xen/xl.conf or use
    script=vif-openvswitch in the vif configuration.
    
    Appears to do the right thing for PV and HVM guests (including tap devices)
    and with stubdomains.
    
    In order to support VLAN tagging and trunking the "bridge" specified in the
    configuration can have a special syntax, that is:
    
    	BRIDGE_NAME[.VLAN][:TRUNK:TRUNK]
    
    e.g.
    - xenbr0.99
         add the VIF to VLAN99 on xenbr0
    - xenbr0:99:100:101
         add the VIF to xenbr0 as a trunk port receiving VLANs 99, 100 & 101
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Bastian Blank <waldi@debian.org>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: dev@openvswitch.org
---
 tools/hotplug/Linux/Makefile        |    1 +
 tools/hotplug/Linux/vif-openvswitch |  113 +++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0605559..99bf87f 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -13,6 +13,7 @@ XENCOMMONS_SYSCONFIG = init.d/sysconfig.xencommons
 XEN_SCRIPTS = network-bridge vif-bridge
 XEN_SCRIPTS += network-route vif-route
 XEN_SCRIPTS += network-nat vif-nat
+XEN_SCRIPTS += vif-openvswitch
 XEN_SCRIPTS += vif2
 XEN_SCRIPTS += vif-setup
 XEN_SCRIPTS += block
diff --git a/tools/hotplug/Linux/vif-openvswitch b/tools/hotplug/Linux/vif-openvswitch
new file mode 100644
index 0000000..a8e4fc7
--- /dev/null
+++ b/tools/hotplug/Linux/vif-openvswitch
@@ -0,0 +1,113 @@
+#!/bin/bash
+#============================================================================
+# ${XEN_SCRIPT_DIR}/vif-openvswitch
+#
+# Script for configuring a vif in openvswitch mode.
+# The hotplugging system will call this script if it is specified either in
+# the device configuration given to Xend, or the default Xend configuration
+# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
+# neither of those places, then this script is the default.
+#
+# Usage:
+# vif-openvswitch (add|remove|online|offline)
+#
+# Environment vars:
+# vif         vif interface name (required).
+# XENBUS_PATH path to this device's details in the XenStore (required).
+#
+# Read from the store:
+# bridge  openvswitch to add the vif to (required).
+# ip      list of IP networks for the vif, space-separated (optional).
+#
+# up:
+# Enslaves the vif interface to the bridge and adds iptables rules
+# for its ip addresses (if any).
+#
+# down:
+# Removes the vif interface from the bridge and removes the iptables
+# rules for its ip addresses (if any).
+#============================================================================
+
+dir=$(dirname "$0")
+. "$dir/vif-common.sh"
+
+check_tools()
+{
+    if ! command -v ovs-vsctl > /dev/null 2>&1; then
+        fatal "Unable to find ovs-vsctl tool"
+    fi
+    if ! command -v ip > /dev/null 2>&1; then
+        fatal "Unable to find ip tool"
+    fi
+}
+openvswitch_external_id() {
+    local dev=$1
+    local key=$2
+    local value=$3
+
+    echo "-- set interface $dev external-ids:\"$key\"=\"$value\""
+}
+
+openvswitch_external_id_all() {
+    local dev=$1
+    local frontend_id=$(xenstore_read "$XENBUS_PATH/frontend-id")
+    local vm_path=$(xenstore_read "/local/domain/${frontend_id}/vm")
+    local name=$(xenstore_read "${vm_path}/name")
+    openvswitch_external_id $dev "xen-vm-name" "$name"
+    local uuid=$(xenstore_read "${vm_path}/uuid")
+    openvswitch_external_id $dev "xen-vm-uuid" "$uuid"
+    local mac=$(xenstore_read "$XENBUS_PATH/mac")
+    openvswitch_external_id $dev "attached-mac" "$mac"
+}
+
+add_to_openvswitch () {
+    local dev=$1
+    local bridge="$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge")"
+    local tag trunk
+
+    if [[ $bridge =~ ^([^.:]+)(\.([[:digit:]]+))?(:([[:digit:]]+(:[[:digit:]]+)*))?$ ]]; then
+        bridge="${BASH_REMATCH[1]}"
+        tag="${BASH_REMATCH[3]}"
+        trunk="${BASH_REMATCH[5]//:/,}"
+    else
+        fatal "No valid bridge was specified"
+    fi
+
+    if [ $trunk ]; then
+        local trunk_arg="trunk=$trunk"
+    fi
+
+    if [ $tag ]; then
+        local tag_arg="tag=$tag"
+    fi
+
+    local vif_details="$(openvswitch_external_id_all $dev)"
+
+    do_or_die ovs-vsctl --timeout=30 \
+        -- --if-exists del-port $dev \
+        -- add-port "$bridge" $dev $tag_arg $trunk_arg $vif_details
+    do_or_die ip link set $dev up
+}
+
+case "$command" in
+    add|online)
+        check_tools
+        setup_virtual_bridge_port $dev
+        add_to_openvswitch $dev
+        ;;
+
+    remove|offline)
+        do_without_error ovs-vsctl --timeout=30 \
+            -- --if-exists del-port $dev
+        do_without_error ip link set $dev down
+        ;;
+esac
+
+if [ "$type_if" = vif ]; then
+    handle_iptable
+fi
+
+log debug "Successful vif-openvswitch $command for $dev."
+if [ "$type_if" = vif -a "$command" = "online" ]; then
+    success
+fi
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============5160208357946331940==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============5160208357946331940==--

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYa-0005ET-4d; Sat, 27 Apr 2013 03:12:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYY-0005E4-6v
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:10 +0000
Received: from [85.158.139.83:5558] by server-16.bemta-5.messagelabs.com id
	58/15-02543-9024B715; Sat, 27 Apr 2013 03:12:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-182.messagelabs.com!1367032327!22851672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16110 invoked from network); 27 Apr 2013 03:12:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXV-0007ef-83
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvXU-0006Mr-3y
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:11:04 +0000
Date: Sat, 27 Apr 2013 03:11:04 +0000
Message-Id: <E1UVvXU-0006Mr-3y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug: add openvswitch script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5160208357946331940=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============5160208357946331940==
Content-Type: text/plain

commit 3051bdedc3ef82eb5f14978823dec00784d69d0e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Apr 23 11:00:57 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 12:14:57 2013 +0100

    hotplug: add openvswitch script
    
    Based on Waldi's RFC at
    http://lists.xen.org/archives/html/xen-devel/2012-09/msg00943.html
    
    To use it set vif.default.script="vif-openvswitch" in /etc/xen/xl.conf or use
    script=vif-openvswitch in the vif configuration.
    
    Appears to do the right thing for PV and HVM guests (including tap devices)
    and with stubdomains.
    
    In order to support VLAN tagging and trunking the "bridge" specified in the
    configuration can have a special syntax, that is:
    
    	BRIDGE_NAME[.VLAN][:TRUNK:TRUNK]
    
    e.g.
    - xenbr0.99
         add the VIF to VLAN99 on xenbr0
    - xenbr0:99:100:101
         add the VIF to xenbr0 as a trunk port receiving VLANs 99, 100 & 101
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Signed-off-by: Bastian Blank <waldi@debian.org>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: dev@openvswitch.org
---
 tools/hotplug/Linux/Makefile        |    1 +
 tools/hotplug/Linux/vif-openvswitch |  113 +++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 0605559..99bf87f 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -13,6 +13,7 @@ XENCOMMONS_SYSCONFIG = init.d/sysconfig.xencommons
 XEN_SCRIPTS = network-bridge vif-bridge
 XEN_SCRIPTS += network-route vif-route
 XEN_SCRIPTS += network-nat vif-nat
+XEN_SCRIPTS += vif-openvswitch
 XEN_SCRIPTS += vif2
 XEN_SCRIPTS += vif-setup
 XEN_SCRIPTS += block
diff --git a/tools/hotplug/Linux/vif-openvswitch b/tools/hotplug/Linux/vif-openvswitch
new file mode 100644
index 0000000..a8e4fc7
--- /dev/null
+++ b/tools/hotplug/Linux/vif-openvswitch
@@ -0,0 +1,113 @@
+#!/bin/bash
+#============================================================================
+# ${XEN_SCRIPT_DIR}/vif-openvswitch
+#
+# Script for configuring a vif in openvswitch mode.
+# The hotplugging system will call this script if it is specified either in
+# the device configuration given to Xend, or the default Xend configuration
+# in ${XEN_CONFIG_DIR}/xend-config.sxp.  If the script is specified in
+# neither of those places, then this script is the default.
+#
+# Usage:
+# vif-openvswitch (add|remove|online|offline)
+#
+# Environment vars:
+# vif         vif interface name (required).
+# XENBUS_PATH path to this device's details in the XenStore (required).
+#
+# Read from the store:
+# bridge  openvswitch to add the vif to (required).
+# ip      list of IP networks for the vif, space-separated (optional).
+#
+# up:
+# Enslaves the vif interface to the bridge and adds iptables rules
+# for its ip addresses (if any).
+#
+# down:
+# Removes the vif interface from the bridge and removes the iptables
+# rules for its ip addresses (if any).
+#============================================================================
+
+dir=$(dirname "$0")
+. "$dir/vif-common.sh"
+
+check_tools()
+{
+    if ! command -v ovs-vsctl > /dev/null 2>&1; then
+        fatal "Unable to find ovs-vsctl tool"
+    fi
+    if ! command -v ip > /dev/null 2>&1; then
+        fatal "Unable to find ip tool"
+    fi
+}
+openvswitch_external_id() {
+    local dev=$1
+    local key=$2
+    local value=$3
+
+    echo "-- set interface $dev external-ids:\"$key\"=\"$value\""
+}
+
+openvswitch_external_id_all() {
+    local dev=$1
+    local frontend_id=$(xenstore_read "$XENBUS_PATH/frontend-id")
+    local vm_path=$(xenstore_read "/local/domain/${frontend_id}/vm")
+    local name=$(xenstore_read "${vm_path}/name")
+    openvswitch_external_id $dev "xen-vm-name" "$name"
+    local uuid=$(xenstore_read "${vm_path}/uuid")
+    openvswitch_external_id $dev "xen-vm-uuid" "$uuid"
+    local mac=$(xenstore_read "$XENBUS_PATH/mac")
+    openvswitch_external_id $dev "attached-mac" "$mac"
+}
+
+add_to_openvswitch () {
+    local dev=$1
+    local bridge="$(xenstore_read_default "$XENBUS_PATH/bridge" "$bridge")"
+    local tag trunk
+
+    if [[ $bridge =~ ^([^.:]+)(\.([[:digit:]]+))?(:([[:digit:]]+(:[[:digit:]]+)*))?$ ]]; then
+        bridge="${BASH_REMATCH[1]}"
+        tag="${BASH_REMATCH[3]}"
+        trunk="${BASH_REMATCH[5]//:/,}"
+    else
+        fatal "No valid bridge was specified"
+    fi
+
+    if [ $trunk ]; then
+        local trunk_arg="trunk=$trunk"
+    fi
+
+    if [ $tag ]; then
+        local tag_arg="tag=$tag"
+    fi
+
+    local vif_details="$(openvswitch_external_id_all $dev)"
+
+    do_or_die ovs-vsctl --timeout=30 \
+        -- --if-exists del-port $dev \
+        -- add-port "$bridge" $dev $tag_arg $trunk_arg $vif_details
+    do_or_die ip link set $dev up
+}
+
+case "$command" in
+    add|online)
+        check_tools
+        setup_virtual_bridge_port $dev
+        add_to_openvswitch $dev
+        ;;
+
+    remove|offline)
+        do_without_error ovs-vsctl --timeout=30 \
+            -- --if-exists del-port $dev
+        do_without_error ip link set $dev down
+        ;;
+esac
+
+if [ "$type_if" = vif ]; then
+    handle_iptable
+fi
+
+log debug "Successful vif-openvswitch $command for $dev."
+if [ "$type_if" = vif -a "$command" = "online" ]; then
+    success
+fi
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============5160208357946331940==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============5160208357946331940==--

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYd-0005FJ-AO; Sat, 27 Apr 2013 03:12:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYa-0005EQ-Ic
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:12 +0000
Received: from [85.158.139.211:58149] by server-7.bemta-5.messagelabs.com id
	F5/02-12441-B024B715; Sat, 27 Apr 2013 03:12:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1367032330!20655473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 511 invoked from network); 27 Apr 2013 03:12:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYX-0007fe-P9
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYX-0006Pp-Iw
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:09 +0000
Date: Sat, 27 Apr 2013 03:12:09 +0000
Message-Id: <E1UVvYX-0006Pp-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: parenthesise argument to
	*_linear_offset macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 683425823cf8c610127dffeaa7cd44bc700e1ff4
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:53:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:16 2013 +0100

    arm: parenthesise argument to *_linear_offset macros
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-arm/page.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 14e63eb..a6a312f 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -323,9 +323,9 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr)
 #define FIRST_MASK   (~(FIRST_SIZE - 1))
 
 /* Calculate the offsets into the pagetables for a given VA */
-#define first_linear_offset(va) (va >> FIRST_SHIFT)
-#define second_linear_offset(va) (va >> SECOND_SHIFT)
-#define third_linear_offset(va) (va >> THIRD_SHIFT)
+#define first_linear_offset(va) ((va) >> FIRST_SHIFT)
+#define second_linear_offset(va) ((va) >> SECOND_SHIFT)
+#define third_linear_offset(va) ((va) >> THIRD_SHIFT)
 
 #define TABLE_OFFSET(offs) ((unsigned int)(offs) & LPAE_ENTRY_MASK)
 #define first_table_offset(va)  TABLE_OFFSET(first_linear_offset(va))
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:17 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYd-0005FJ-AO; Sat, 27 Apr 2013 03:12:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYa-0005EQ-Ic
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:12 +0000
Received: from [85.158.139.211:58149] by server-7.bemta-5.messagelabs.com id
	F5/02-12441-B024B715; Sat, 27 Apr 2013 03:12:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1367032330!20655473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 511 invoked from network); 27 Apr 2013 03:12:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYX-0007fe-P9
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYX-0006Pp-Iw
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:09 +0000
Date: Sat, 27 Apr 2013 03:12:09 +0000
Message-Id: <E1UVvYX-0006Pp-Iw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: parenthesise argument to
	*_linear_offset macros
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 683425823cf8c610127dffeaa7cd44bc700e1ff4
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:53:59 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:16 2013 +0100

    arm: parenthesise argument to *_linear_offset macros
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/include/asm-arm/page.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 14e63eb..a6a312f 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -323,9 +323,9 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr)
 #define FIRST_MASK   (~(FIRST_SIZE - 1))
 
 /* Calculate the offsets into the pagetables for a given VA */
-#define first_linear_offset(va) (va >> FIRST_SHIFT)
-#define second_linear_offset(va) (va >> SECOND_SHIFT)
-#define third_linear_offset(va) (va >> THIRD_SHIFT)
+#define first_linear_offset(va) ((va) >> FIRST_SHIFT)
+#define second_linear_offset(va) ((va) >> SECOND_SHIFT)
+#define third_linear_offset(va) ((va) >> THIRD_SHIFT)
 
 #define TABLE_OFFSET(offs) ((unsigned int)(offs) & LPAE_ENTRY_MASK)
 #define first_table_offset(va)  TABLE_OFFSET(first_linear_offset(va))
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYl-0005HQ-Fc; Sat, 27 Apr 2013 03:12:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYk-0005H3-CR
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:22 +0000
Received: from [85.158.143.99:34176] by server-1.bemta-4.messagelabs.com id
	E6/3F-06203-5124B715; Sat, 27 Apr 2013 03:12:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367032340!26910530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13843 invoked from network); 27 Apr 2013 03:12:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYh-0007fr-UO
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYh-0006QD-Sp
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:19 +0000
Date: Sat, 27 Apr 2013 03:12:19 +0000
Message-Id: <E1UVvYh-0006QD-Sp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: add build time asserts for
	various virtual address aligment constraints
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 865aa5dbe739a36af7b543fbe332cb94fc57343b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:54:00 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:16 2013 +0100

    arm: add build time asserts for various virtual address aligment constraints
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/mm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 3cb852b..656aa82 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -74,6 +74,17 @@ unsigned long total_pages;
 
 extern char __init_begin[], __init_end[];
 
+/* Checking VA memory layout alignment. */
+static inline void check_memory_layout_alignment_constraints(void) {
+    /* 2MB aligned regions */
+    BUILD_BUG_ON(XEN_VIRT_START & ~SECOND_MASK);
+    BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK);
+    BUILD_BUG_ON(BOOT_MISC_VIRT_START & ~SECOND_MASK);
+    /* 1GB aligned regions */
+    BUILD_BUG_ON(XENHEAP_VIRT_START & ~FIRST_MASK);
+    BUILD_BUG_ON(DOMHEAP_VIRT_START & ~FIRST_MASK);
+}
+
 void dump_pt_walk(lpae_t *first, paddr_t addr)
 {
     lpae_t *second = NULL, *third = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:25 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYl-0005HQ-Fc; Sat, 27 Apr 2013 03:12:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYk-0005H3-CR
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:22 +0000
Received: from [85.158.143.99:34176] by server-1.bemta-4.messagelabs.com id
	E6/3F-06203-5124B715; Sat, 27 Apr 2013 03:12:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-216.messagelabs.com!1367032340!26910530!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13843 invoked from network); 27 Apr 2013 03:12:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYh-0007fr-UO
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYh-0006QD-Sp
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:19 +0000
Date: Sat, 27 Apr 2013 03:12:19 +0000
Message-Id: <E1UVvYh-0006QD-Sp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: add build time asserts for
	various virtual address aligment constraints
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 865aa5dbe739a36af7b543fbe332cb94fc57343b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:54:00 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:16 2013 +0100

    arm: add build time asserts for various virtual address aligment constraints
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/arm/mm.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 3cb852b..656aa82 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -74,6 +74,17 @@ unsigned long total_pages;
 
 extern char __init_begin[], __init_end[];
 
+/* Checking VA memory layout alignment. */
+static inline void check_memory_layout_alignment_constraints(void) {
+    /* 2MB aligned regions */
+    BUILD_BUG_ON(XEN_VIRT_START & ~SECOND_MASK);
+    BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK);
+    BUILD_BUG_ON(BOOT_MISC_VIRT_START & ~SECOND_MASK);
+    /* 1GB aligned regions */
+    BUILD_BUG_ON(XENHEAP_VIRT_START & ~FIRST_MASK);
+    BUILD_BUG_ON(DOMHEAP_VIRT_START & ~FIRST_MASK);
+}
+
 void dump_pt_walk(lpae_t *first, paddr_t addr)
 {
     lpae_t *second = NULL, *third = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYw-0005Jk-Ip; Sat, 27 Apr 2013 03:12:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYv-0005JO-Er
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:33 +0000
Received: from [85.158.137.99:43125] by server-8.bemta-3.messagelabs.com id
	20/2B-20604-0224B715; Sat, 27 Apr 2013 03:12:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1367032350!909542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14346 invoked from network); 27 Apr 2013 03:12:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYs-0007fy-3k
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYs-0006RJ-2Z
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:30 +0000
Date: Sat, 27 Apr 2013 03:12:30 +0000
Message-Id: <E1UVvYs-0006RJ-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: allocate per-PCPU domheap
	pagetable pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85ef8aebdecad8e5d211bb012595d5a89b172585
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:54:01 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:16 2013 +0100

    arm: allocate per-PCPU domheap pagetable pages
    
    the domheap mappings are supposed to be per-PCPU. Therefore xen_pgtable
    becomes a per-PCPU variable and we allocate and setup the page tables for each
    secondary PCPU just before we tell it to come up.
    
    Each secondary PCPU starts out on the boot page table but switches to its own
    page tables ASAP.
    
    The boot PCPU uses the boot pagetables as its own.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: TIm Deegan <tim@xen.org>
---
 xen/arch/arm/mm.c            |  152 ++++++++++++++++++++++++++++++++++++-----
 xen/arch/arm/smpboot.c       |    6 ++
 xen/include/asm-arm/config.h |    4 +
 xen/include/asm-arm/mm.h     |    4 +-
 4 files changed, 146 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 656aa82..03492df 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -39,22 +39,48 @@
 
 struct domain *dom_xen, *dom_io, *dom_cow;
 
-/* Static start-of-day pagetables that we use before the allocators are up */
-/* boot_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+/* Static start-of-day pagetables that we use before the
+ * allocators are up. These go on to become the boot CPU's real pagetables.
+ */
 lpae_t boot_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #ifdef CONFIG_ARM_64
 lpae_t boot_first[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #endif
-/* N.B. The second-level table is 4 contiguous pages long, and covers
- * all addresses from 0 to 0xffffffff.  Offsets into it are calculated
- * with second_linear_offset(), not second_table_offset(). */
+
+/*
+ * xen_pgtable and xen_dommap are per-PCPU and are allocated before
+ * bringing up each CPU. On 64-bit a first level table is also allocated.
+ *
+ * xen_second, xen_fixmap and xen_xenmap are shared between all PCPUs.
+ */
+
+/* Per-CPU pagetable pages */
+/* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+static DEFINE_PER_CPU(lpae_t *, xen_pgtable);
+/* xen_dommap == pages used by map_domain_page, these pages contain
+ * the second level pagetables which mapp the domheap region
+ * DOMHEAP_VIRT_START...DOMHEAP_VIRT_END in 2MB chunks. */
+static DEFINE_PER_CPU(lpae_t *, xen_dommap);
+
+/* Common pagetable leaves */
+/* Second level page tables.
+ *
+ * The second-level table is 2 contiguous pages long, and covers all
+ * addresses from 0 to 0x7fffffff. Offsets into it are calculated
+ * with second_linear_offset(), not second_table_offset().
+ *
+ * Addresses 0x80000000 to 0xffffffff are covered by the per-cpu
+ * xen_domheap mappings described above. However we allocate 4 pages
+ * here for use in the boot page tables and the second two pages
+ * become the boot CPUs xen_dommap pages.
+ */
 lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4)));
+/* First level page table used for fixmap */
 lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+/* First level page table used to map Xen itself with the XN bit set
+ * as appropriate. */
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
-/* boot_pgtable becomes the boot processors pagetable, eventually this will
- * become a per-cpu variable */
-#define xen_pgtable boot_pgtable
 
 /* Non-boot CPUs use this to find the correct pagetables. */
 uint64_t boot_ttbr;
@@ -118,12 +144,17 @@ done:
 void dump_hyp_walk(vaddr_t addr)
 {
     uint64_t ttbr = READ_SYSREG64(TTBR0_EL2);
+    lpae_t *pgtable = this_cpu(xen_pgtable);
 
-    printk("Walking Hypervisor VA 0x%"PRIvaddr" via TTBR 0x%016"PRIx64"\n",
-           addr, ttbr);
+    printk("Walking Hypervisor VA 0x%"PRIvaddr" "
+           "on CPU%d via TTBR 0x%016"PRIx64"\n",
+           addr, smp_processor_id(), ttbr);
 
-    BUG_ON( (lpae_t *)(unsigned long)(ttbr - phys_offset) != xen_pgtable );
-    dump_pt_walk(xen_pgtable, addr);
+    if ( smp_processor_id() == 0 )
+        BUG_ON( (lpae_t *)(unsigned long)(ttbr - phys_offset) != pgtable );
+    else
+        BUG_ON( virt_to_maddr(pgtable) != ttbr );
+    dump_pt_walk(pgtable, addr);
 }
 
 /* Map a 4k page in a fixmap entry */
@@ -149,7 +180,7 @@ void clear_fixmap(unsigned map)
 void *map_domain_page(unsigned long mfn)
 {
     unsigned long flags;
-    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    lpae_t *map = this_cpu(xen_dommap);
     unsigned long slot_mfn = mfn & ~LPAE_ENTRY_MASK;
     vaddr_t va;
     lpae_t pte;
@@ -215,7 +246,7 @@ void *map_domain_page(unsigned long mfn)
 void unmap_domain_page(const void *va)
 {
     unsigned long flags;
-    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    lpae_t *map = this_cpu(xen_dommap);
     int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
 
     local_irq_save(flags);
@@ -230,7 +261,7 @@ void unmap_domain_page(const void *va)
 
 unsigned long domain_page_map_to_mfn(const void *va)
 {
-    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    lpae_t *map = this_cpu(xen_dommap);
     int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
     unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
 
@@ -276,6 +307,16 @@ void __cpuinit setup_virt_paging(void)
     WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
 }
 
+/* This needs to be a macro to stop the compiler spilling to the stack
+ * which will change when we change pagetables */
+#define WRITE_TTBR(ttbr)                                                \
+    flush_xen_text_tlb();                                               \
+    WRITE_SYSREG64(ttbr, TTBR0_EL2);                                    \
+    dsb(); /* ensure memory accesses do not cross over the TTBR0 write */ \
+    /* flush_xen_text_tlb contains an initial isb which ensures the     \
+     * write to TTBR0 has completed. */                                 \
+    flush_xen_text_tlb()
+
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
 void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
@@ -323,11 +364,8 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     boot_ttbr = (uintptr_t) boot_pgtable + phys_offset;
     flush_xen_dcache(boot_ttbr);
     flush_xen_dcache_va_range((void*)dest_va, _end - _start);
-    flush_xen_text_tlb();
 
-    WRITE_SYSREG64(boot_ttbr, TTBR0_EL2);
-    dsb();                         /* Ensure visibility of HTTBR update */
-    flush_xen_text_tlb();
+    WRITE_TTBR(boot_ttbr);
 
     /* Undo the temporary map */
     pte.bits = 0;
@@ -373,11 +411,87 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     WRITE_SYSREG32(READ_SYSREG32(SCTLR_EL2) | SCTLR_WXN, SCTLR_EL2);
     /* Flush everything after setting WXN bit. */
     flush_xen_text_tlb();
+
+    per_cpu(xen_pgtable, 0) = boot_pgtable;
+    per_cpu(xen_dommap, 0) = xen_second +
+        second_linear_offset(DOMHEAP_VIRT_START);
+
+    /* Some of these slots may have been used during start of day and/or
+     * relocation. Make sure they are clear now. */
+    memset(this_cpu(xen_dommap), 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+    flush_xen_dcache_va_range(this_cpu(xen_dommap),
+                              DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+}
+
+int init_secondary_pagetables(int cpu)
+{
+    lpae_t *root, *first, *domheap, pte;
+    int i;
+
+    root = alloc_xenheap_page();
+#ifdef CONFIG_ARM_64
+    first = alloc_xenheap_page();
+#else
+    first = root; /* root == first level on 32-bit 3-level trie */
+#endif
+    domheap = alloc_xenheap_pages(get_order_from_pages(DOMHEAP_SECOND_PAGES), 0);
+
+    if ( root == NULL || domheap == NULL || first == NULL )
+    {
+        printk("Not enough free memory for secondary CPU%d pagetables\n", cpu);
+        free_xenheap_pages(domheap, get_order_from_pages(DOMHEAP_SECOND_PAGES));
+#ifdef CONFIG_ARM_64
+        free_xenheap_page(first);
+#endif
+        free_xenheap_page(root);
+        return -ENOMEM;
+    }
+
+    /* Initialise root pagetable from root of boot tables */
+    memcpy(root, boot_pgtable, PAGE_SIZE);
+
+#ifdef CONFIG_ARM_64
+    /* Initialise first pagetable from first level of boot tables, and
+     * hook into the new root. */
+    memcpy(first, boot_first, PAGE_SIZE);
+    pte = mfn_to_xen_entry(virt_to_mfn(first));
+    pte.pt.table = 1;
+    write_pte(root, pte);
+#endif
+
+    /* Ensure the domheap has no stray mappings */
+    memset(domheap, 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+
+    /* Update the first level mapping to reference the local CPUs
+     * domheap mapping pages. */
+    for ( i = 0; i < DOMHEAP_SECOND_PAGES; i++ )
+    {
+        pte = mfn_to_xen_entry(virt_to_mfn(domheap+i*LPAE_ENTRIES));
+        pte.pt.table = 1;
+        write_pte(&first[first_table_offset(DOMHEAP_VIRT_START+i*FIRST_SIZE)], pte);
+    }
+
+    flush_xen_dcache_va_range(root, PAGE_SIZE);
+#ifdef CONFIG_ARM_64
+    flush_xen_dcache_va_range(first, PAGE_SIZE);
+#endif
+    flush_xen_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+
+    per_cpu(xen_pgtable, cpu) = root;
+    per_cpu(xen_dommap, cpu) = domheap;
+
+    return 0;
 }
 
 /* MMU setup for secondary CPUS (which already have paging enabled) */
 void __cpuinit mmu_init_secondary_cpu(void)
 {
+    uint64_t ttbr;
+
+    /* Change to this CPU's pagetables */
+    ttbr = (uintptr_t)virt_to_maddr(this_cpu(xen_pgtable));
+    WRITE_TTBR(ttbr);
+
     /* From now on, no mapping may be both writable and executable. */
     WRITE_SYSREG32(READ_SYSREG32(SCTLR_EL2) | SCTLR_WXN, SCTLR_EL2);
     flush_xen_text_tlb();
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index bd353c8..8011987 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -220,6 +220,12 @@ void stop_cpu(void)
 /* Bring up a remote CPU */
 int __cpu_up(unsigned int cpu)
 {
+    int rc;
+
+    rc = init_secondary_pagetables(cpu);
+    if ( rc < 0 )
+        return rc;
+
     /* Tell the remote CPU which stack to boot on. */
     init_stack = idle_vcpu[cpu]->arch.stack;
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 8be8563..e49aac1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -98,12 +98,16 @@
 #define EARLY_VMAP_VIRT_START  mk_unsigned_long(0x10000000)
 #define XENHEAP_VIRT_START     mk_unsigned_long(0x40000000)
 #define DOMHEAP_VIRT_START     mk_unsigned_long(0x80000000)
+#define DOMHEAP_VIRT_END       mk_unsigned_long(0xffffffff)
 
 #define EARLY_VMAP_VIRT_END    XENHEAP_VIRT_START
 #define HYPERVISOR_VIRT_START  XEN_VIRT_START
 
 #define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
 
+/* Number of domheap pagetable pages required at the second level (2MB mappings) */
+#define DOMHEAP_SECOND_PAGES ((DOMHEAP_VIRT_END - DOMHEAP_VIRT_START + 1) >> FIRST_SHIFT)
+
 /* Fixmap slots */
 #define FIXMAP_CONSOLE  0  /* The primary UART */
 #define FIXMAP_PT       1  /* Temporary mappings of pagetable pages */
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 4be383e..26c271e 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -138,7 +138,9 @@ extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
-/* MMU setup for secondary CPUS (which already have paging enabled) */
+/* Allocate and initialise pagetables for a secondary CPU */
+extern int __cpuinit init_secondary_pagetables(int cpu);
+/* Switch secondary CPUS to its own pagetables and finalise MMU setup */
 extern void __cpuinit mmu_init_secondary_cpu(void);
 /* Second stage paging setup, to be called on all CPUs */
 extern void __cpuinit setup_virt_paging(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:36 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvYw-0005Jk-Ip; Sat, 27 Apr 2013 03:12:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYv-0005JO-Er
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:33 +0000
Received: from [85.158.137.99:43125] by server-8.bemta-3.messagelabs.com id
	20/2B-20604-0224B715; Sat, 27 Apr 2013 03:12:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-217.messagelabs.com!1367032350!909542!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14346 invoked from network); 27 Apr 2013 03:12:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYs-0007fy-3k
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvYs-0006RJ-2Z
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:30 +0000
Date: Sat, 27 Apr 2013 03:12:30 +0000
Message-Id: <E1UVvYs-0006RJ-2Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: allocate per-PCPU domheap
	pagetable pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85ef8aebdecad8e5d211bb012595d5a89b172585
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Apr 24 11:54:01 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:55:16 2013 +0100

    arm: allocate per-PCPU domheap pagetable pages
    
    the domheap mappings are supposed to be per-PCPU. Therefore xen_pgtable
    becomes a per-PCPU variable and we allocate and setup the page tables for each
    secondary PCPU just before we tell it to come up.
    
    Each secondary PCPU starts out on the boot page table but switches to its own
    page tables ASAP.
    
    The boot PCPU uses the boot pagetables as its own.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: TIm Deegan <tim@xen.org>
---
 xen/arch/arm/mm.c            |  152 ++++++++++++++++++++++++++++++++++++-----
 xen/arch/arm/smpboot.c       |    6 ++
 xen/include/asm-arm/config.h |    4 +
 xen/include/asm-arm/mm.h     |    4 +-
 4 files changed, 146 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 656aa82..03492df 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -39,22 +39,48 @@
 
 struct domain *dom_xen, *dom_io, *dom_cow;
 
-/* Static start-of-day pagetables that we use before the allocators are up */
-/* boot_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+/* Static start-of-day pagetables that we use before the
+ * allocators are up. These go on to become the boot CPU's real pagetables.
+ */
 lpae_t boot_pgtable[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #ifdef CONFIG_ARM_64
 lpae_t boot_first[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 #endif
-/* N.B. The second-level table is 4 contiguous pages long, and covers
- * all addresses from 0 to 0xffffffff.  Offsets into it are calculated
- * with second_linear_offset(), not second_table_offset(). */
+
+/*
+ * xen_pgtable and xen_dommap are per-PCPU and are allocated before
+ * bringing up each CPU. On 64-bit a first level table is also allocated.
+ *
+ * xen_second, xen_fixmap and xen_xenmap are shared between all PCPUs.
+ */
+
+/* Per-CPU pagetable pages */
+/* xen_pgtable == root of the trie (zeroeth level on 64-bit, first on 32-bit) */
+static DEFINE_PER_CPU(lpae_t *, xen_pgtable);
+/* xen_dommap == pages used by map_domain_page, these pages contain
+ * the second level pagetables which mapp the domheap region
+ * DOMHEAP_VIRT_START...DOMHEAP_VIRT_END in 2MB chunks. */
+static DEFINE_PER_CPU(lpae_t *, xen_dommap);
+
+/* Common pagetable leaves */
+/* Second level page tables.
+ *
+ * The second-level table is 2 contiguous pages long, and covers all
+ * addresses from 0 to 0x7fffffff. Offsets into it are calculated
+ * with second_linear_offset(), not second_table_offset().
+ *
+ * Addresses 0x80000000 to 0xffffffff are covered by the per-cpu
+ * xen_domheap mappings described above. However we allocate 4 pages
+ * here for use in the boot page tables and the second two pages
+ * become the boot CPUs xen_dommap pages.
+ */
 lpae_t xen_second[LPAE_ENTRIES*4] __attribute__((__aligned__(4096*4)));
+/* First level page table used for fixmap */
 lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
+/* First level page table used to map Xen itself with the XN bit set
+ * as appropriate. */
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
-/* boot_pgtable becomes the boot processors pagetable, eventually this will
- * become a per-cpu variable */
-#define xen_pgtable boot_pgtable
 
 /* Non-boot CPUs use this to find the correct pagetables. */
 uint64_t boot_ttbr;
@@ -118,12 +144,17 @@ done:
 void dump_hyp_walk(vaddr_t addr)
 {
     uint64_t ttbr = READ_SYSREG64(TTBR0_EL2);
+    lpae_t *pgtable = this_cpu(xen_pgtable);
 
-    printk("Walking Hypervisor VA 0x%"PRIvaddr" via TTBR 0x%016"PRIx64"\n",
-           addr, ttbr);
+    printk("Walking Hypervisor VA 0x%"PRIvaddr" "
+           "on CPU%d via TTBR 0x%016"PRIx64"\n",
+           addr, smp_processor_id(), ttbr);
 
-    BUG_ON( (lpae_t *)(unsigned long)(ttbr - phys_offset) != xen_pgtable );
-    dump_pt_walk(xen_pgtable, addr);
+    if ( smp_processor_id() == 0 )
+        BUG_ON( (lpae_t *)(unsigned long)(ttbr - phys_offset) != pgtable );
+    else
+        BUG_ON( virt_to_maddr(pgtable) != ttbr );
+    dump_pt_walk(pgtable, addr);
 }
 
 /* Map a 4k page in a fixmap entry */
@@ -149,7 +180,7 @@ void clear_fixmap(unsigned map)
 void *map_domain_page(unsigned long mfn)
 {
     unsigned long flags;
-    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    lpae_t *map = this_cpu(xen_dommap);
     unsigned long slot_mfn = mfn & ~LPAE_ENTRY_MASK;
     vaddr_t va;
     lpae_t pte;
@@ -215,7 +246,7 @@ void *map_domain_page(unsigned long mfn)
 void unmap_domain_page(const void *va)
 {
     unsigned long flags;
-    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    lpae_t *map = this_cpu(xen_dommap);
     int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
 
     local_irq_save(flags);
@@ -230,7 +261,7 @@ void unmap_domain_page(const void *va)
 
 unsigned long domain_page_map_to_mfn(const void *va)
 {
-    lpae_t *map = xen_second + second_linear_offset(DOMHEAP_VIRT_START);
+    lpae_t *map = this_cpu(xen_dommap);
     int slot = ((unsigned long) va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
     unsigned long offset = ((unsigned long)va>>THIRD_SHIFT) & LPAE_ENTRY_MASK;
 
@@ -276,6 +307,16 @@ void __cpuinit setup_virt_paging(void)
     WRITE_SYSREG32(0x80002558, VTCR_EL2); isb();
 }
 
+/* This needs to be a macro to stop the compiler spilling to the stack
+ * which will change when we change pagetables */
+#define WRITE_TTBR(ttbr)                                                \
+    flush_xen_text_tlb();                                               \
+    WRITE_SYSREG64(ttbr, TTBR0_EL2);                                    \
+    dsb(); /* ensure memory accesses do not cross over the TTBR0 write */ \
+    /* flush_xen_text_tlb contains an initial isb which ensures the     \
+     * write to TTBR0 has completed. */                                 \
+    flush_xen_text_tlb()
+
 /* Boot-time pagetable setup.
  * Changes here may need matching changes in head.S */
 void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
@@ -323,11 +364,8 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     boot_ttbr = (uintptr_t) boot_pgtable + phys_offset;
     flush_xen_dcache(boot_ttbr);
     flush_xen_dcache_va_range((void*)dest_va, _end - _start);
-    flush_xen_text_tlb();
 
-    WRITE_SYSREG64(boot_ttbr, TTBR0_EL2);
-    dsb();                         /* Ensure visibility of HTTBR update */
-    flush_xen_text_tlb();
+    WRITE_TTBR(boot_ttbr);
 
     /* Undo the temporary map */
     pte.bits = 0;
@@ -373,11 +411,87 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr)
     WRITE_SYSREG32(READ_SYSREG32(SCTLR_EL2) | SCTLR_WXN, SCTLR_EL2);
     /* Flush everything after setting WXN bit. */
     flush_xen_text_tlb();
+
+    per_cpu(xen_pgtable, 0) = boot_pgtable;
+    per_cpu(xen_dommap, 0) = xen_second +
+        second_linear_offset(DOMHEAP_VIRT_START);
+
+    /* Some of these slots may have been used during start of day and/or
+     * relocation. Make sure they are clear now. */
+    memset(this_cpu(xen_dommap), 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+    flush_xen_dcache_va_range(this_cpu(xen_dommap),
+                              DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+}
+
+int init_secondary_pagetables(int cpu)
+{
+    lpae_t *root, *first, *domheap, pte;
+    int i;
+
+    root = alloc_xenheap_page();
+#ifdef CONFIG_ARM_64
+    first = alloc_xenheap_page();
+#else
+    first = root; /* root == first level on 32-bit 3-level trie */
+#endif
+    domheap = alloc_xenheap_pages(get_order_from_pages(DOMHEAP_SECOND_PAGES), 0);
+
+    if ( root == NULL || domheap == NULL || first == NULL )
+    {
+        printk("Not enough free memory for secondary CPU%d pagetables\n", cpu);
+        free_xenheap_pages(domheap, get_order_from_pages(DOMHEAP_SECOND_PAGES));
+#ifdef CONFIG_ARM_64
+        free_xenheap_page(first);
+#endif
+        free_xenheap_page(root);
+        return -ENOMEM;
+    }
+
+    /* Initialise root pagetable from root of boot tables */
+    memcpy(root, boot_pgtable, PAGE_SIZE);
+
+#ifdef CONFIG_ARM_64
+    /* Initialise first pagetable from first level of boot tables, and
+     * hook into the new root. */
+    memcpy(first, boot_first, PAGE_SIZE);
+    pte = mfn_to_xen_entry(virt_to_mfn(first));
+    pte.pt.table = 1;
+    write_pte(root, pte);
+#endif
+
+    /* Ensure the domheap has no stray mappings */
+    memset(domheap, 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+
+    /* Update the first level mapping to reference the local CPUs
+     * domheap mapping pages. */
+    for ( i = 0; i < DOMHEAP_SECOND_PAGES; i++ )
+    {
+        pte = mfn_to_xen_entry(virt_to_mfn(domheap+i*LPAE_ENTRIES));
+        pte.pt.table = 1;
+        write_pte(&first[first_table_offset(DOMHEAP_VIRT_START+i*FIRST_SIZE)], pte);
+    }
+
+    flush_xen_dcache_va_range(root, PAGE_SIZE);
+#ifdef CONFIG_ARM_64
+    flush_xen_dcache_va_range(first, PAGE_SIZE);
+#endif
+    flush_xen_dcache_va_range(domheap, DOMHEAP_SECOND_PAGES*PAGE_SIZE);
+
+    per_cpu(xen_pgtable, cpu) = root;
+    per_cpu(xen_dommap, cpu) = domheap;
+
+    return 0;
 }
 
 /* MMU setup for secondary CPUS (which already have paging enabled) */
 void __cpuinit mmu_init_secondary_cpu(void)
 {
+    uint64_t ttbr;
+
+    /* Change to this CPU's pagetables */
+    ttbr = (uintptr_t)virt_to_maddr(this_cpu(xen_pgtable));
+    WRITE_TTBR(ttbr);
+
     /* From now on, no mapping may be both writable and executable. */
     WRITE_SYSREG32(READ_SYSREG32(SCTLR_EL2) | SCTLR_WXN, SCTLR_EL2);
     flush_xen_text_tlb();
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index bd353c8..8011987 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -220,6 +220,12 @@ void stop_cpu(void)
 /* Bring up a remote CPU */
 int __cpu_up(unsigned int cpu)
 {
+    int rc;
+
+    rc = init_secondary_pagetables(cpu);
+    if ( rc < 0 )
+        return rc;
+
     /* Tell the remote CPU which stack to boot on. */
     init_stack = idle_vcpu[cpu]->arch.stack;
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index 8be8563..e49aac1 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -98,12 +98,16 @@
 #define EARLY_VMAP_VIRT_START  mk_unsigned_long(0x10000000)
 #define XENHEAP_VIRT_START     mk_unsigned_long(0x40000000)
 #define DOMHEAP_VIRT_START     mk_unsigned_long(0x80000000)
+#define DOMHEAP_VIRT_END       mk_unsigned_long(0xffffffff)
 
 #define EARLY_VMAP_VIRT_END    XENHEAP_VIRT_START
 #define HYPERVISOR_VIRT_START  XEN_VIRT_START
 
 #define DOMHEAP_ENTRIES        1024  /* 1024 2MB mapping slots */
 
+/* Number of domheap pagetable pages required at the second level (2MB mappings) */
+#define DOMHEAP_SECOND_PAGES ((DOMHEAP_VIRT_END - DOMHEAP_VIRT_START + 1) >> FIRST_SHIFT)
+
 /* Fixmap slots */
 #define FIXMAP_CONSOLE  0  /* The primary UART */
 #define FIXMAP_PT       1  /* Temporary mappings of pagetable pages */
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 4be383e..26c271e 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -138,7 +138,9 @@ extern unsigned long total_pages;
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr);
-/* MMU setup for secondary CPUS (which already have paging enabled) */
+/* Allocate and initialise pagetables for a secondary CPU */
+extern int __cpuinit init_secondary_pagetables(int cpu);
+/* Switch secondary CPUS to its own pagetables and finalise MMU setup */
 extern void __cpuinit mmu_init_secondary_cpu(void);
 /* Second stage paging setup, to be called on all CPUs */
 extern void __cpuinit setup_virt_paging(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZ6-0005Lc-M5; Sat, 27 Apr 2013 03:12:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZ6-0005LD-1B
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:44 +0000
Received: from [85.158.139.83:64422] by server-11.bemta-5.messagelabs.com id
	08/B2-27486-A224B715; Sat, 27 Apr 2013 03:12:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1367032360!27005922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19604 invoked from network); 27 Apr 2013 03:12:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZ2-0007g7-Cb
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZ2-0006Rm-8N
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:40 +0000
Date: Sat, 27 Apr 2013 03:12:40 +0000
Message-Id: <E1UVvZ2-0006Rm-8N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: mark vcpus as initialised when
	they have been
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a07cc93810b74d0c5e5c52df795da2ff044dc83
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:23 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:56:14 2013 +0100

    arm: mark vcpus as initialised when they have been
    
    I noticed this because XEN_DOMCTL_getvcpucontext won't return anything for a
    VCPU which isn't initialised.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain.c       |    2 ++
 xen/arch/arm/domain_build.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index eae42af..a28275e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -556,6 +556,8 @@ int arch_set_info_guest(
     v->arch.ttbr1 = ctxt->ttbr1;
     v->arch.ttbcr = ctxt->ttbcr;
 
+    v->is_initialised = 1;
+
     if ( ctxt->flags & VGCF_online )
         clear_bit(_VPF_down, &v->pause_flags);
     else
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a6d8e9d..17aadcf 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -412,6 +412,7 @@ int construct_dom0(struct domain *d)
 
     discard_initial_modules();
 
+    v->is_initialised = 1;
     clear_bit(_VPF_down, &v->pause_flags);
 
     memset(regs, 0, sizeof(*regs));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:12:47 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:12:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZ6-0005Lc-M5; Sat, 27 Apr 2013 03:12:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZ6-0005LD-1B
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:44 +0000
Received: from [85.158.139.83:64422] by server-11.bemta-5.messagelabs.com id
	08/B2-27486-A224B715; Sat, 27 Apr 2013 03:12:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-182.messagelabs.com!1367032360!27005922!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19604 invoked from network); 27 Apr 2013 03:12:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZ2-0007g7-Cb
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZ2-0006Rm-8N
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:40 +0000
Date: Sat, 27 Apr 2013 03:12:40 +0000
Message-Id: <E1UVvZ2-0006Rm-8N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm: mark vcpus as initialised when
	they have been
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a07cc93810b74d0c5e5c52df795da2ff044dc83
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:23 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 16:56:14 2013 +0100

    arm: mark vcpus as initialised when they have been
    
    I noticed this because XEN_DOMCTL_getvcpucontext won't return anything for a
    VCPU which isn't initialised.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/domain.c       |    2 ++
 xen/arch/arm/domain_build.c |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index eae42af..a28275e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -556,6 +556,8 @@ int arch_set_info_guest(
     v->arch.ttbr1 = ctxt->ttbr1;
     v->arch.ttbcr = ctxt->ttbcr;
 
+    v->is_initialised = 1;
+
     if ( ctxt->flags & VGCF_online )
         clear_bit(_VPF_down, &v->pause_flags);
     else
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a6d8e9d..17aadcf 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -412,6 +412,7 @@ int construct_dom0(struct domain *d)
 
     discard_initial_modules();
 
+    v->is_initialised = 1;
     clear_bit(_VPF_down, &v->pause_flags);
 
     memset(regs, 0, sizeof(*regs));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZL-0005PA-Pb; Sat, 27 Apr 2013 03:12:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZK-0005Ok-Cx
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:58 +0000
Received: from [85.158.139.211:44151] by server-16.bemta-5.messagelabs.com id
	DA/55-02543-9324B715; Sat, 27 Apr 2013 03:12:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032371!20616404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29426 invoked from network); 27 Apr 2013 03:12:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZD-0007gD-Hh
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZC-0006S9-Kl
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:51 +0000
Date: Sat, 27 Apr 2013 03:12:50 +0000
Message-Id: <E1UVvZC-0006S9-Kl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: remove remnants of ia64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91610ea67499168514b906616a7b7dacbcff4416
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:24 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 17:34:05 2013 +0100

    xenctx: remove remnants of ia64 support
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |  302 +----------------------------------------------
 1 files changed, 1 insertions(+), 301 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 62327f7..70a5455 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -49,18 +49,6 @@ int guest_word_size = sizeof (unsigned long);
 /* Word-length of the context record we get from xen */
 int ctxt_word_size = sizeof (unsigned long);
 int guest_protected_mode = 1;
-#elif defined (__ia64__)
-/* On ia64, we can't translate virtual address to physical address.  */
-#define NO_TRANSLATION
-typedef size_t guest_word_t;
-
-/* Which registers should be displayed.  */
-int disp_cr_regs;
-int disp_ar_regs;
-int disp_br_regs;
-int disp_bank_regs;
-int disp_tlb;
-
 #elif defined(__arm__)
 #define NO_TRANSLATION
 typedef uint64_t guest_word_t;
@@ -442,248 +430,6 @@ static guest_word_t frame_pointer(vcpu_guest_context_any_t *ctx)
         return ctx->x64.user_regs.rbp;
 }
 
-#elif defined(__ia64__)
-
-#define PTE_ED_SHIFT              52
-#define PTE_ED_MASK                1
-#define PTE_PPN_SHIFT             12
-#define PTE_PPN_MASK    0x3fffffffff
-#define PTE_AR_SHIFT               9
-#define PTE_AR_MASK                7
-#define PTE_PL_SHIFT               7
-#define PTE_PL_MASK                3
-#define PTE_D_SHIFT                6
-#define PTE_D_MASK                 1
-#define PTE_A_SHIFT                5
-#define PTE_A_MASK                 1
-#define PTE_MA_SHIFT               2
-#define PTE_MA_MASK                7
-#define PTE_P_SHIFT                0
-#define PTE_P_MASK                 1
-#define ITIR_KEY_SHIFT             8
-#define ITIR_KEY_MASK       0xffffff
-#define ITIR_PS_SHIFT              2
-#define ITIR_PS_MASK            0x3f
-#define ITIR_PS_MIN               12
-#define ITIR_PS_MAX               28
-#define RR_RID_SHIFT               8
-#define RR_RID_MASK         0xffffff
-#define PSR_BN           (1UL << 44)
-#define CFM_SOF_MASK            0x3f
-
-static void print_tr(int i, const struct ia64_tr_entry *tr)
-{
-    int ps_val, ma_val;
-    unsigned long pa;
-
-    static const char ps[][5] = {"  4K", "  8K", " 16K", "    ",
-                                 " 64K", "    ", "256K", "    ",
-                                 "  1M", "    ", "  4M", "    ",
-                                 " 16M", "    ", " 64M", "    ",
-                                 "256M"};
-    static const char ma[][4] = {"WB ", "   ", "   ", "   ",
-                                 "UC ", "UCE", "WC ", "Nat"};
-
-    ps_val =  tr->itir >> ITIR_PS_SHIFT & ITIR_PS_MASK;
-    ma_val =  tr->pte  >> PTE_MA_SHIFT  & PTE_MA_MASK;
-    pa     = (tr->pte  >> PTE_PPN_SHIFT & PTE_PPN_MASK) << PTE_PPN_SHIFT;
-    pa     = (pa >> ps_val) << ps_val;
-    printf(" [%d]  %ld %06lx %016lx %013lx %02x %s %ld  %ld  %ld  %ld "
-           "%ld %d %s %06lx\n", i,
-           tr->pte  >> PTE_P_SHIFT    & PTE_P_MASK,
-           tr->rid  >> RR_RID_SHIFT   & RR_RID_MASK,
-           tr->vadr, pa, ps_val,
-           ((ps_val >= ITIR_PS_MIN && ps_val <= ITIR_PS_MAX) ?
-            ps[ps_val - ITIR_PS_MIN] : "    "),
-           tr->pte  >> PTE_ED_SHIFT   & PTE_ED_MASK,
-           tr->pte  >> PTE_PL_SHIFT   & PTE_PL_MASK,
-           tr->pte  >> PTE_AR_SHIFT   & PTE_AR_MASK,
-           tr->pte  >> PTE_A_SHIFT    & PTE_A_MASK,
-           tr->pte  >> PTE_D_SHIFT    & PTE_D_MASK,
-           ma_val, ma[ma_val],
-           tr->itir >> ITIR_KEY_SHIFT & ITIR_KEY_MASK);
-}
-
-void print_ctx(vcpu_guest_context_any_t *ctx)
-{
-    struct vcpu_guest_context_regs *regs = &ctx->c.regs;
-    struct vcpu_tr_regs *tr = &ctx->c.regs.tr;
-    int i;
-    unsigned int rbs_size, cfm_sof;
-
-    printf(" ip:  %016lx  ", regs->ip);
-    print_symbol(regs->ip);
-    printf("\n");
-    printf(" psr:  %016lx  ", regs->psr);
-    printf(" cfm:  %016lx  ", regs->cfm);
-    printf(" pr:   %016lx\n", regs->pr);
-
-    if (disp_br_regs) {
-        printf(" b0:   %016lx  ", regs->b[0]);
-        printf(" b1:   %016lx  ", regs->b[1]);
-        printf(" b2:   %016lx\n", regs->b[2]);
-        printf(" b3:   %016lx  ", regs->b[3]);
-        printf(" b4:   %016lx  ", regs->b[4]);
-        printf(" b5:   %016lx\n", regs->b[5]);
-        printf(" b6:   %016lx  ", regs->b[6]);
-        printf(" b7:   %016lx\n", regs->b[7]);
-    } else {
-        printf(" b0:   %016lx\n", regs->b[0]);
-    }
-
-    if (disp_cr_regs) {
-        printf ("\n"
-                "                                CR:\n");
-        printf(" dcr:  %016lx  ", regs->cr.dcr);
-        printf(" itm:  %016lx  ", regs->cr.itm);
-        printf(" iva:  %016lx\n", regs->cr.iva);
-        printf(" pta:  %016lx  ", regs->cr.pta);
-        printf(" ipsr: %016lx  ", regs->cr.ipsr);
-        printf(" isr:  %016lx\n", regs->cr.isr);
-        printf(" iip:  %016lx  ", regs->cr.iip);
-        printf(" ifa:  %016lx  ", regs->cr.ifa);
-        printf(" itir: %016lx\n", regs->cr.itir);
-        printf(" iipa: %016lx  ", regs->cr.iipa);
-        printf(" ifs:  %016lx  ", regs->cr.ifs);
-        printf(" iim:  %016lx\n", regs->cr.iim);
-        printf(" iha:  %016lx  ", regs->cr.iha);
-        printf(" lid:  %016lx  ", regs->cr.lid);
-        printf(" ivr:  %016lx\n", regs->cr.ivr);
-        printf(" tpr:  %016lx  ", regs->cr.tpr);
-        printf(" eoi:  %016lx  ", regs->cr.eoi);
-        printf(" irr0: %016lx\n", regs->cr.irr[0]);
-        printf(" irr1: %016lx  ", regs->cr.irr[1]);
-        printf(" irr2: %016lx  ", regs->cr.irr[2]);
-        printf(" irr3: %016lx\n", regs->cr.irr[3]);
-        printf(" itv:  %016lx  ", regs->cr.itv);
-        printf(" pmv:  %016lx  ", regs->cr.pmv);
-        printf(" cmcv: %016lx\n", regs->cr.cmcv);
-        printf(" lrr0: %016lx  ", regs->cr.lrr0);
-        printf(" lrr1: %016lx  ", regs->cr.lrr1);
-        printf(" ev_cb:%016lx\n", ctx->c.event_callback_ip);
-
-    }
-    if (disp_ar_regs) {
-        printf ("\n"
-                "                                AR:\n");
-        printf(" kr0:  %016lx  ", regs->ar.kr[0]);
-        printf(" kr1:  %016lx  ", regs->ar.kr[1]);
-        printf(" kr2:  %016lx\n", regs->ar.kr[2]);
-        printf(" kr3:  %016lx  ", regs->ar.kr[3]);
-        printf(" kr4:  %016lx  ", regs->ar.kr[4]);
-        printf(" kr5:  %016lx\n", regs->ar.kr[5]);
-        printf(" kr6:  %016lx  ", regs->ar.kr[6]);
-        printf(" kr7:  %016lx  ", regs->ar.kr[7]);
-        printf(" rsc:  %016lx\n", regs->ar.rsc);
-        printf(" bsp:  %016lx  ", regs->ar.bsp);
-        printf(" bsps: %016lx  ", regs->ar.bspstore);
-        printf(" rnat: %016lx\n", regs->ar.rnat);
-        printf(" csd:  %016lx  ", regs->ar.csd);
-        printf(" ccv:  %016lx  ", regs->ar.ccv);
-        printf(" unat: %016lx\n", regs->ar.unat);
-        printf(" fpsr: %016lx  ", regs->ar.fpsr);
-        printf(" itc:  %016lx\n", regs->ar.itc);
-        printf(" pfs:  %016lx  ", regs->ar.pfs);
-        printf(" lc:   %016lx  ", regs->ar.lc);
-        printf(" ec:   %016lx\n", regs->ar.ec);
-    }
-    printf("\n");
-    printf(" r1:  %016lx  ", regs->r[1]);
-    printf(" r2:  %016lx  ", regs->r[2]);
-    printf(" r3:  %016lx\n", regs->r[3]);
-    printf(" r4:  %016lx  ", regs->r[4]);
-    printf(" r5:  %016lx  ", regs->r[5]);
-    printf(" r6:  %016lx\n", regs->r[6]);
-    printf(" r7:  %016lx  ", regs->r[7]);
-    printf(" r8:  %016lx  ", regs->r[8]);
-    printf(" r9:  %016lx\n", regs->r[9]);
-    printf(" r10: %016lx  ", regs->r[10]);
-    printf(" r11: %016lx  ", regs->r[11]);
-    printf(" sp:  %016lx\n", regs->r[12]);
-    printf(" tp:  %016lx  ", regs->r[13]);
-    printf(" r14: %016lx  ", regs->r[14]);
-    printf(" r15: %016lx\n", regs->r[15]);
-    if (disp_bank_regs) {
-        printf("      Bank %d (current)                         Bank %d\n",
-               (regs->psr & PSR_BN) ? 1 : 0, (regs->psr & PSR_BN) ? 0 : 1);
-        printf ("16:%016lx ", regs->r[16]);
-        printf ("17:%016lx ", regs->r[17]);
-        printf ("16:%016lx ", regs->bank[0]);
-        printf ("17:%016lx\n", regs->bank[1]);
-        printf ("18:%016lx ", regs->r[18]);
-        printf ("19:%016lx ", regs->r[19]);
-        printf ("18:%016lx ", regs->bank[2]);
-        printf ("19:%016lx\n", regs->bank[3]);
-        printf ("20:%016lx ", regs->r[20]);
-        printf ("21:%016lx ", regs->r[21]);
-        printf ("20:%016lx ", regs->bank[4]);
-        printf ("21:%016lx\n", regs->bank[5]);
-        printf ("22:%016lx ", regs->r[22]);
-        printf ("23:%016lx ", regs->r[23]);
-        printf ("22:%016lx ", regs->bank[6]);
-        printf ("23:%016lx\n", regs->bank[7]);
-        printf ("24:%016lx ", regs->r[24]);
-        printf ("25:%016lx ", regs->r[25]);
-        printf ("24:%016lx ", regs->bank[8]);
-        printf ("25:%016lx\n", regs->bank[9]);
-        printf ("26:%016lx ", regs->r[26]);
-        printf ("27:%016lx ", regs->r[27]);
-        printf ("26:%016lx ", regs->bank[10]);
-        printf ("27:%016lx\n", regs->bank[11]);
-        printf ("28:%016lx ", regs->r[28]);
-        printf ("29:%016lx ", regs->r[29]);
-        printf ("28:%016lx ", regs->bank[12]);
-        printf ("29:%016lx\n", regs->bank[13]);
-        printf ("30:%016lx ", regs->r[30]);
-        printf ("31:%016lx ", regs->r[31]);
-        printf ("30:%016lx ", regs->bank[14]);
-        printf ("31:%016lx\n", regs->bank[15]);
-    } else {
-        printf(" r16: %016lx  ", regs->r[16]);
-        printf(" r17: %016lx  ", regs->r[17]);
-        printf(" r18: %016lx\n", regs->r[18]);
-        printf(" r19: %016lx  ", regs->r[19]);
-        printf(" r20: %016lx  ", regs->r[20]);
-        printf(" r21: %016lx\n", regs->r[21]);
-        printf(" r22: %016lx  ", regs->r[22]);
-        printf(" r23: %016lx  ", regs->r[23]);
-        printf(" r24: %016lx\n", regs->r[24]);
-        printf(" r25: %016lx  ", regs->r[25]);
-        printf(" r26: %016lx  ", regs->r[26]);
-        printf(" r27: %016lx\n", regs->r[27]);
-        printf(" r28: %016lx  ", regs->r[28]);
-        printf(" r29: %016lx  ", regs->r[29]);
-        printf(" r30: %016lx\n", regs->r[30]);
-        printf(" r31: %016lx\n", regs->r[31]);
-    }
-
-    printf("\n");
-    rbs_size = (regs->ar.bsp - regs->ar.bspstore) / 8;
-    cfm_sof = (regs->cfm & CFM_SOF_MASK);
-    for (i = 0; i < cfm_sof; i++) {
-        int off = cfm_sof - i;
-        unsigned int rbs_off =
-            (((62 - ((rbs_size + regs->rbs_voff) % 63) + off)) / 63) + off;
-        if (rbs_off > rbs_size)
-            break;
-        printf(" r%02d: %016lx%s", 32 + i,
-               regs->rbs[rbs_size - rbs_off],
-               (i % 3) != 2 ? "  " : "\n");
-    }
-    if ((i % 3) != 0)
-        printf ("\n");
-
-    if (disp_tlb) {
-        printf("\n itr: P rid    va               pa            ps      ed pl "
-               "ar a d ma    key\n");
-        for (i = 0; i < 8; i++)
-            print_tr(i, &tr->itrs[i]);
-        printf("\n dtr: P rid    va               pa            ps      ed pl "
-               "ar a d ma    key\n");
-        for (i = 0; i < 8; i++)
-            print_tr(i, &tr->dtrs[i]);
-    }
-}
 #elif defined(__arm__)
 static void print_ctx(vcpu_guest_context_any_t *ctx)
 {
@@ -940,12 +686,7 @@ static void usage(void)
     printf("  -S --stack-trace  print a complete stack trace.\n");
     printf("  -k, --kernel-start\n");
     printf("                    set user/kernel split. (default 0xc0000000)\n");
-#ifdef __ia64__
-    printf("  -r LIST, --regs=LIST  display more registers.\n");
-    printf("  -a --all          same as --regs=tlb,cr,ar,br,bk\n");
-#else
     printf("  -a --all          display more registers\n");
-#endif
     printf("  -C --all-vcpus    print info for all vcpus\n");
 }
 
@@ -953,19 +694,12 @@ int main(int argc, char **argv)
 {
     int ch;
     int ret;
-    static const char *sopts = "fs:hak:SC"
-#ifdef __ia64__
-        "r:"
-#endif
-        ;
+    static const char *sopts = "fs:hak:SC";
     static const struct option lopts[] = {
         {"stack-trace", 0, NULL, 'S'},
         {"symbol-table", 1, NULL, 's'},
         {"frame-pointers", 0, NULL, 'f'},
         {"kernel-start", 1, NULL, 'k'},
-#ifdef __ia64__
-        {"regs", 1, NULL, 'r'},
-#endif
         {"all", 0, NULL, 'a'},
         {"all-vcpus", 0, NULL, 'C'},
         {"help", 0, NULL, 'h'},
@@ -986,43 +720,9 @@ int main(int argc, char **argv)
         case 'S':
             xenctx.stack_trace = 1;
             break;
-#ifdef __ia64__
-        case 'r':
-            {
-                char *r;
-
-                r = strtok(optarg, ",");
-                while (r) {
-                    if (strcmp (r, "cr") == 0)
-                        disp_cr_regs = 1;
-                    else if (strcmp (r, "ar") == 0)
-                        disp_ar_regs = 1;
-                    else if (strcmp (r, "br") == 0)
-                        disp_br_regs = 1;
-                    else if (strcmp (r, "bk") == 0)
-                        disp_bank_regs = 1;
-                    else if (strcmp (r, "tlb") == 0)
-                        disp_tlb = 1;
-                    else {
-                        fprintf(stderr,"unknown register set %s\n", r);
-                        exit(-1);
-                    }
-                    r = strtok(NULL, "'");
-                }
-            }
-            break;
-        case 'a':
-            disp_cr_regs = 1;
-            disp_ar_regs = 1;
-            disp_br_regs = 1;
-            disp_bank_regs = 1;
-            disp_tlb = 1;
-            break;
-#else
         case 'a':
             xenctx.disp_all = 1;
             break;
-#endif
         case 'C':
             xenctx.all_vcpus = 1;
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZL-0005PA-Pb; Sat, 27 Apr 2013 03:12:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZK-0005Ok-Cx
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:58 +0000
Received: from [85.158.139.211:44151] by server-16.bemta-5.messagelabs.com id
	DA/55-02543-9324B715; Sat, 27 Apr 2013 03:12:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032371!20616404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29426 invoked from network); 27 Apr 2013 03:12:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:12:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZD-0007gD-Hh
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZC-0006S9-Kl
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:12:51 +0000
Date: Sat, 27 Apr 2013 03:12:50 +0000
Message-Id: <E1UVvZC-0006S9-Kl@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: remove remnants of ia64 support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91610ea67499168514b906616a7b7dacbcff4416
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:24 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 17:34:05 2013 +0100

    xenctx: remove remnants of ia64 support
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |  302 +----------------------------------------------
 1 files changed, 1 insertions(+), 301 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 62327f7..70a5455 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -49,18 +49,6 @@ int guest_word_size = sizeof (unsigned long);
 /* Word-length of the context record we get from xen */
 int ctxt_word_size = sizeof (unsigned long);
 int guest_protected_mode = 1;
-#elif defined (__ia64__)
-/* On ia64, we can't translate virtual address to physical address.  */
-#define NO_TRANSLATION
-typedef size_t guest_word_t;
-
-/* Which registers should be displayed.  */
-int disp_cr_regs;
-int disp_ar_regs;
-int disp_br_regs;
-int disp_bank_regs;
-int disp_tlb;
-
 #elif defined(__arm__)
 #define NO_TRANSLATION
 typedef uint64_t guest_word_t;
@@ -442,248 +430,6 @@ static guest_word_t frame_pointer(vcpu_guest_context_any_t *ctx)
         return ctx->x64.user_regs.rbp;
 }
 
-#elif defined(__ia64__)
-
-#define PTE_ED_SHIFT              52
-#define PTE_ED_MASK                1
-#define PTE_PPN_SHIFT             12
-#define PTE_PPN_MASK    0x3fffffffff
-#define PTE_AR_SHIFT               9
-#define PTE_AR_MASK                7
-#define PTE_PL_SHIFT               7
-#define PTE_PL_MASK                3
-#define PTE_D_SHIFT                6
-#define PTE_D_MASK                 1
-#define PTE_A_SHIFT                5
-#define PTE_A_MASK                 1
-#define PTE_MA_SHIFT               2
-#define PTE_MA_MASK                7
-#define PTE_P_SHIFT                0
-#define PTE_P_MASK                 1
-#define ITIR_KEY_SHIFT             8
-#define ITIR_KEY_MASK       0xffffff
-#define ITIR_PS_SHIFT              2
-#define ITIR_PS_MASK            0x3f
-#define ITIR_PS_MIN               12
-#define ITIR_PS_MAX               28
-#define RR_RID_SHIFT               8
-#define RR_RID_MASK         0xffffff
-#define PSR_BN           (1UL << 44)
-#define CFM_SOF_MASK            0x3f
-
-static void print_tr(int i, const struct ia64_tr_entry *tr)
-{
-    int ps_val, ma_val;
-    unsigned long pa;
-
-    static const char ps[][5] = {"  4K", "  8K", " 16K", "    ",
-                                 " 64K", "    ", "256K", "    ",
-                                 "  1M", "    ", "  4M", "    ",
-                                 " 16M", "    ", " 64M", "    ",
-                                 "256M"};
-    static const char ma[][4] = {"WB ", "   ", "   ", "   ",
-                                 "UC ", "UCE", "WC ", "Nat"};
-
-    ps_val =  tr->itir >> ITIR_PS_SHIFT & ITIR_PS_MASK;
-    ma_val =  tr->pte  >> PTE_MA_SHIFT  & PTE_MA_MASK;
-    pa     = (tr->pte  >> PTE_PPN_SHIFT & PTE_PPN_MASK) << PTE_PPN_SHIFT;
-    pa     = (pa >> ps_val) << ps_val;
-    printf(" [%d]  %ld %06lx %016lx %013lx %02x %s %ld  %ld  %ld  %ld "
-           "%ld %d %s %06lx\n", i,
-           tr->pte  >> PTE_P_SHIFT    & PTE_P_MASK,
-           tr->rid  >> RR_RID_SHIFT   & RR_RID_MASK,
-           tr->vadr, pa, ps_val,
-           ((ps_val >= ITIR_PS_MIN && ps_val <= ITIR_PS_MAX) ?
-            ps[ps_val - ITIR_PS_MIN] : "    "),
-           tr->pte  >> PTE_ED_SHIFT   & PTE_ED_MASK,
-           tr->pte  >> PTE_PL_SHIFT   & PTE_PL_MASK,
-           tr->pte  >> PTE_AR_SHIFT   & PTE_AR_MASK,
-           tr->pte  >> PTE_A_SHIFT    & PTE_A_MASK,
-           tr->pte  >> PTE_D_SHIFT    & PTE_D_MASK,
-           ma_val, ma[ma_val],
-           tr->itir >> ITIR_KEY_SHIFT & ITIR_KEY_MASK);
-}
-
-void print_ctx(vcpu_guest_context_any_t *ctx)
-{
-    struct vcpu_guest_context_regs *regs = &ctx->c.regs;
-    struct vcpu_tr_regs *tr = &ctx->c.regs.tr;
-    int i;
-    unsigned int rbs_size, cfm_sof;
-
-    printf(" ip:  %016lx  ", regs->ip);
-    print_symbol(regs->ip);
-    printf("\n");
-    printf(" psr:  %016lx  ", regs->psr);
-    printf(" cfm:  %016lx  ", regs->cfm);
-    printf(" pr:   %016lx\n", regs->pr);
-
-    if (disp_br_regs) {
-        printf(" b0:   %016lx  ", regs->b[0]);
-        printf(" b1:   %016lx  ", regs->b[1]);
-        printf(" b2:   %016lx\n", regs->b[2]);
-        printf(" b3:   %016lx  ", regs->b[3]);
-        printf(" b4:   %016lx  ", regs->b[4]);
-        printf(" b5:   %016lx\n", regs->b[5]);
-        printf(" b6:   %016lx  ", regs->b[6]);
-        printf(" b7:   %016lx\n", regs->b[7]);
-    } else {
-        printf(" b0:   %016lx\n", regs->b[0]);
-    }
-
-    if (disp_cr_regs) {
-        printf ("\n"
-                "                                CR:\n");
-        printf(" dcr:  %016lx  ", regs->cr.dcr);
-        printf(" itm:  %016lx  ", regs->cr.itm);
-        printf(" iva:  %016lx\n", regs->cr.iva);
-        printf(" pta:  %016lx  ", regs->cr.pta);
-        printf(" ipsr: %016lx  ", regs->cr.ipsr);
-        printf(" isr:  %016lx\n", regs->cr.isr);
-        printf(" iip:  %016lx  ", regs->cr.iip);
-        printf(" ifa:  %016lx  ", regs->cr.ifa);
-        printf(" itir: %016lx\n", regs->cr.itir);
-        printf(" iipa: %016lx  ", regs->cr.iipa);
-        printf(" ifs:  %016lx  ", regs->cr.ifs);
-        printf(" iim:  %016lx\n", regs->cr.iim);
-        printf(" iha:  %016lx  ", regs->cr.iha);
-        printf(" lid:  %016lx  ", regs->cr.lid);
-        printf(" ivr:  %016lx\n", regs->cr.ivr);
-        printf(" tpr:  %016lx  ", regs->cr.tpr);
-        printf(" eoi:  %016lx  ", regs->cr.eoi);
-        printf(" irr0: %016lx\n", regs->cr.irr[0]);
-        printf(" irr1: %016lx  ", regs->cr.irr[1]);
-        printf(" irr2: %016lx  ", regs->cr.irr[2]);
-        printf(" irr3: %016lx\n", regs->cr.irr[3]);
-        printf(" itv:  %016lx  ", regs->cr.itv);
-        printf(" pmv:  %016lx  ", regs->cr.pmv);
-        printf(" cmcv: %016lx\n", regs->cr.cmcv);
-        printf(" lrr0: %016lx  ", regs->cr.lrr0);
-        printf(" lrr1: %016lx  ", regs->cr.lrr1);
-        printf(" ev_cb:%016lx\n", ctx->c.event_callback_ip);
-
-    }
-    if (disp_ar_regs) {
-        printf ("\n"
-                "                                AR:\n");
-        printf(" kr0:  %016lx  ", regs->ar.kr[0]);
-        printf(" kr1:  %016lx  ", regs->ar.kr[1]);
-        printf(" kr2:  %016lx\n", regs->ar.kr[2]);
-        printf(" kr3:  %016lx  ", regs->ar.kr[3]);
-        printf(" kr4:  %016lx  ", regs->ar.kr[4]);
-        printf(" kr5:  %016lx\n", regs->ar.kr[5]);
-        printf(" kr6:  %016lx  ", regs->ar.kr[6]);
-        printf(" kr7:  %016lx  ", regs->ar.kr[7]);
-        printf(" rsc:  %016lx\n", regs->ar.rsc);
-        printf(" bsp:  %016lx  ", regs->ar.bsp);
-        printf(" bsps: %016lx  ", regs->ar.bspstore);
-        printf(" rnat: %016lx\n", regs->ar.rnat);
-        printf(" csd:  %016lx  ", regs->ar.csd);
-        printf(" ccv:  %016lx  ", regs->ar.ccv);
-        printf(" unat: %016lx\n", regs->ar.unat);
-        printf(" fpsr: %016lx  ", regs->ar.fpsr);
-        printf(" itc:  %016lx\n", regs->ar.itc);
-        printf(" pfs:  %016lx  ", regs->ar.pfs);
-        printf(" lc:   %016lx  ", regs->ar.lc);
-        printf(" ec:   %016lx\n", regs->ar.ec);
-    }
-    printf("\n");
-    printf(" r1:  %016lx  ", regs->r[1]);
-    printf(" r2:  %016lx  ", regs->r[2]);
-    printf(" r3:  %016lx\n", regs->r[3]);
-    printf(" r4:  %016lx  ", regs->r[4]);
-    printf(" r5:  %016lx  ", regs->r[5]);
-    printf(" r6:  %016lx\n", regs->r[6]);
-    printf(" r7:  %016lx  ", regs->r[7]);
-    printf(" r8:  %016lx  ", regs->r[8]);
-    printf(" r9:  %016lx\n", regs->r[9]);
-    printf(" r10: %016lx  ", regs->r[10]);
-    printf(" r11: %016lx  ", regs->r[11]);
-    printf(" sp:  %016lx\n", regs->r[12]);
-    printf(" tp:  %016lx  ", regs->r[13]);
-    printf(" r14: %016lx  ", regs->r[14]);
-    printf(" r15: %016lx\n", regs->r[15]);
-    if (disp_bank_regs) {
-        printf("      Bank %d (current)                         Bank %d\n",
-               (regs->psr & PSR_BN) ? 1 : 0, (regs->psr & PSR_BN) ? 0 : 1);
-        printf ("16:%016lx ", regs->r[16]);
-        printf ("17:%016lx ", regs->r[17]);
-        printf ("16:%016lx ", regs->bank[0]);
-        printf ("17:%016lx\n", regs->bank[1]);
-        printf ("18:%016lx ", regs->r[18]);
-        printf ("19:%016lx ", regs->r[19]);
-        printf ("18:%016lx ", regs->bank[2]);
-        printf ("19:%016lx\n", regs->bank[3]);
-        printf ("20:%016lx ", regs->r[20]);
-        printf ("21:%016lx ", regs->r[21]);
-        printf ("20:%016lx ", regs->bank[4]);
-        printf ("21:%016lx\n", regs->bank[5]);
-        printf ("22:%016lx ", regs->r[22]);
-        printf ("23:%016lx ", regs->r[23]);
-        printf ("22:%016lx ", regs->bank[6]);
-        printf ("23:%016lx\n", regs->bank[7]);
-        printf ("24:%016lx ", regs->r[24]);
-        printf ("25:%016lx ", regs->r[25]);
-        printf ("24:%016lx ", regs->bank[8]);
-        printf ("25:%016lx\n", regs->bank[9]);
-        printf ("26:%016lx ", regs->r[26]);
-        printf ("27:%016lx ", regs->r[27]);
-        printf ("26:%016lx ", regs->bank[10]);
-        printf ("27:%016lx\n", regs->bank[11]);
-        printf ("28:%016lx ", regs->r[28]);
-        printf ("29:%016lx ", regs->r[29]);
-        printf ("28:%016lx ", regs->bank[12]);
-        printf ("29:%016lx\n", regs->bank[13]);
-        printf ("30:%016lx ", regs->r[30]);
-        printf ("31:%016lx ", regs->r[31]);
-        printf ("30:%016lx ", regs->bank[14]);
-        printf ("31:%016lx\n", regs->bank[15]);
-    } else {
-        printf(" r16: %016lx  ", regs->r[16]);
-        printf(" r17: %016lx  ", regs->r[17]);
-        printf(" r18: %016lx\n", regs->r[18]);
-        printf(" r19: %016lx  ", regs->r[19]);
-        printf(" r20: %016lx  ", regs->r[20]);
-        printf(" r21: %016lx\n", regs->r[21]);
-        printf(" r22: %016lx  ", regs->r[22]);
-        printf(" r23: %016lx  ", regs->r[23]);
-        printf(" r24: %016lx\n", regs->r[24]);
-        printf(" r25: %016lx  ", regs->r[25]);
-        printf(" r26: %016lx  ", regs->r[26]);
-        printf(" r27: %016lx\n", regs->r[27]);
-        printf(" r28: %016lx  ", regs->r[28]);
-        printf(" r29: %016lx  ", regs->r[29]);
-        printf(" r30: %016lx\n", regs->r[30]);
-        printf(" r31: %016lx\n", regs->r[31]);
-    }
-
-    printf("\n");
-    rbs_size = (regs->ar.bsp - regs->ar.bspstore) / 8;
-    cfm_sof = (regs->cfm & CFM_SOF_MASK);
-    for (i = 0; i < cfm_sof; i++) {
-        int off = cfm_sof - i;
-        unsigned int rbs_off =
-            (((62 - ((rbs_size + regs->rbs_voff) % 63) + off)) / 63) + off;
-        if (rbs_off > rbs_size)
-            break;
-        printf(" r%02d: %016lx%s", 32 + i,
-               regs->rbs[rbs_size - rbs_off],
-               (i % 3) != 2 ? "  " : "\n");
-    }
-    if ((i % 3) != 0)
-        printf ("\n");
-
-    if (disp_tlb) {
-        printf("\n itr: P rid    va               pa            ps      ed pl "
-               "ar a d ma    key\n");
-        for (i = 0; i < 8; i++)
-            print_tr(i, &tr->itrs[i]);
-        printf("\n dtr: P rid    va               pa            ps      ed pl "
-               "ar a d ma    key\n");
-        for (i = 0; i < 8; i++)
-            print_tr(i, &tr->dtrs[i]);
-    }
-}
 #elif defined(__arm__)
 static void print_ctx(vcpu_guest_context_any_t *ctx)
 {
@@ -940,12 +686,7 @@ static void usage(void)
     printf("  -S --stack-trace  print a complete stack trace.\n");
     printf("  -k, --kernel-start\n");
     printf("                    set user/kernel split. (default 0xc0000000)\n");
-#ifdef __ia64__
-    printf("  -r LIST, --regs=LIST  display more registers.\n");
-    printf("  -a --all          same as --regs=tlb,cr,ar,br,bk\n");
-#else
     printf("  -a --all          display more registers\n");
-#endif
     printf("  -C --all-vcpus    print info for all vcpus\n");
 }
 
@@ -953,19 +694,12 @@ int main(int argc, char **argv)
 {
     int ch;
     int ret;
-    static const char *sopts = "fs:hak:SC"
-#ifdef __ia64__
-        "r:"
-#endif
-        ;
+    static const char *sopts = "fs:hak:SC";
     static const struct option lopts[] = {
         {"stack-trace", 0, NULL, 'S'},
         {"symbol-table", 1, NULL, 's'},
         {"frame-pointers", 0, NULL, 'f'},
         {"kernel-start", 1, NULL, 'k'},
-#ifdef __ia64__
-        {"regs", 1, NULL, 'r'},
-#endif
         {"all", 0, NULL, 'a'},
         {"all-vcpus", 0, NULL, 'C'},
         {"help", 0, NULL, 'h'},
@@ -986,43 +720,9 @@ int main(int argc, char **argv)
         case 'S':
             xenctx.stack_trace = 1;
             break;
-#ifdef __ia64__
-        case 'r':
-            {
-                char *r;
-
-                r = strtok(optarg, ",");
-                while (r) {
-                    if (strcmp (r, "cr") == 0)
-                        disp_cr_regs = 1;
-                    else if (strcmp (r, "ar") == 0)
-                        disp_ar_regs = 1;
-                    else if (strcmp (r, "br") == 0)
-                        disp_br_regs = 1;
-                    else if (strcmp (r, "bk") == 0)
-                        disp_bank_regs = 1;
-                    else if (strcmp (r, "tlb") == 0)
-                        disp_tlb = 1;
-                    else {
-                        fprintf(stderr,"unknown register set %s\n", r);
-                        exit(-1);
-                    }
-                    r = strtok(NULL, "'");
-                }
-            }
-            break;
-        case 'a':
-            disp_cr_regs = 1;
-            disp_ar_regs = 1;
-            disp_br_regs = 1;
-            disp_bank_regs = 1;
-            disp_tlb = 1;
-            break;
-#else
         case 'a':
             xenctx.disp_all = 1;
             break;
-#endif
         case 'C':
             xenctx.all_vcpus = 1;
             break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZY-0005Rn-VA; Sat, 27 Apr 2013 03:13:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZX-0005RR-Pd
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:12 +0000
Received: from [85.158.137.99:12375] by server-2.bemta-3.messagelabs.com id
	28/29-05208-2424B715; Sat, 27 Apr 2013 03:13:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1367032385!18288966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17050 invoked from network); 27 Apr 2013 03:13:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZN-0007gm-Rb
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZN-0006Se-MD
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:01 +0000
Date: Sat, 27 Apr 2013 03:13:01 +0000
Message-Id: <E1UVvZN-0006Se-MD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: remove trailing whitespace
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d6e3147026e5864d297d19ca1725d81d9d18bc35
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:25 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 17:34:29 2013 +0100

    xenctx: remove trailing whitespace
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 70a5455..1984a31 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -64,7 +64,7 @@ struct symbol {
 
 guest_word_t kernel_stext, kernel_etext, kernel_sinittext, kernel_einittext, kernel_hypercallpage;
 
-#if defined (__i386__) 
+#if defined (__i386__)
 unsigned long long kernel_start = 0xc0000000;
 #else
 unsigned long long kernel_start = 0xffffffff80000000UL;
@@ -380,11 +380,11 @@ static void print_ctx_64(vcpu_guest_context_x86_64_t *ctx)
 
 static void print_ctx(vcpu_guest_context_any_t *ctx)
 {
-    if (ctxt_word_size == 4) 
+    if (ctxt_word_size == 4)
         print_ctx_32(&ctx->x32);
     else if (guest_word_size == 4)
         print_ctx_32on64(&ctx->x64);
-    else 
+    else
         print_ctx_64(&ctx->x64);
 }
 
@@ -400,7 +400,7 @@ static guest_word_t instr_pointer(vcpu_guest_context_any_t *ctx)
         if ( !guest_protected_mode )
             r += ctx->x32.user_regs.cs << NONPROT_MODE_SEGMENT_SHIFT;
     }
-    else 
+    else
         r = ctx->x64.user_regs.rip;
 
     return r;
@@ -416,17 +416,17 @@ static guest_word_t stack_pointer(vcpu_guest_context_any_t *ctx)
         if ( !guest_protected_mode )
             r += ctx->x32.user_regs.ss << NONPROT_MODE_SEGMENT_SHIFT;
     }
-    else 
+    else
         r = ctx->x64.user_regs.rsp;
-    
+
     return r;
 }
 
 static guest_word_t frame_pointer(vcpu_guest_context_any_t *ctx)
 {
-    if (ctxt_word_size == 4) 
+    if (ctxt_word_size == 4)
         return ctx->x32.user_regs.ebp;
-    else 
+    else
         return ctx->x64.user_regs.rbp;
 }
 
@@ -515,7 +515,7 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
     int i;
 
     stack_limit = ((stack_pointer(ctx) + XC_PAGE_SIZE)
-                   & ~((guest_word_t) XC_PAGE_SIZE - 1)); 
+                   & ~((guest_word_t) XC_PAGE_SIZE - 1));
     printf("\n");
     printf("Stack:\n");
     for (i=1; i<5 && stack < stack_limit; i++) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:15 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZY-0005Rn-VA; Sat, 27 Apr 2013 03:13:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZX-0005RR-Pd
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:12 +0000
Received: from [85.158.137.99:12375] by server-2.bemta-3.messagelabs.com id
	28/29-05208-2424B715; Sat, 27 Apr 2013 03:13:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-217.messagelabs.com!1367032385!18288966!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17050 invoked from network); 27 Apr 2013 03:13:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZN-0007gm-Rb
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZN-0006Se-MD
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:01 +0000
Date: Sat, 27 Apr 2013 03:13:01 +0000
Message-Id: <E1UVvZN-0006Se-MD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: remove trailing whitespace
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d6e3147026e5864d297d19ca1725d81d9d18bc35
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:25 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 17:34:29 2013 +0100

    xenctx: remove trailing whitespace
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 70a5455..1984a31 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -64,7 +64,7 @@ struct symbol {
 
 guest_word_t kernel_stext, kernel_etext, kernel_sinittext, kernel_einittext, kernel_hypercallpage;
 
-#if defined (__i386__) 
+#if defined (__i386__)
 unsigned long long kernel_start = 0xc0000000;
 #else
 unsigned long long kernel_start = 0xffffffff80000000UL;
@@ -380,11 +380,11 @@ static void print_ctx_64(vcpu_guest_context_x86_64_t *ctx)
 
 static void print_ctx(vcpu_guest_context_any_t *ctx)
 {
-    if (ctxt_word_size == 4) 
+    if (ctxt_word_size == 4)
         print_ctx_32(&ctx->x32);
     else if (guest_word_size == 4)
         print_ctx_32on64(&ctx->x64);
-    else 
+    else
         print_ctx_64(&ctx->x64);
 }
 
@@ -400,7 +400,7 @@ static guest_word_t instr_pointer(vcpu_guest_context_any_t *ctx)
         if ( !guest_protected_mode )
             r += ctx->x32.user_regs.cs << NONPROT_MODE_SEGMENT_SHIFT;
     }
-    else 
+    else
         r = ctx->x64.user_regs.rip;
 
     return r;
@@ -416,17 +416,17 @@ static guest_word_t stack_pointer(vcpu_guest_context_any_t *ctx)
         if ( !guest_protected_mode )
             r += ctx->x32.user_regs.ss << NONPROT_MODE_SEGMENT_SHIFT;
     }
-    else 
+    else
         r = ctx->x64.user_regs.rsp;
-    
+
     return r;
 }
 
 static guest_word_t frame_pointer(vcpu_guest_context_any_t *ctx)
 {
-    if (ctxt_word_size == 4) 
+    if (ctxt_word_size == 4)
         return ctx->x32.user_regs.ebp;
-    else 
+    else
         return ctx->x64.user_regs.rbp;
 }
 
@@ -515,7 +515,7 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
     int i;
 
     stack_limit = ((stack_pointer(ctx) + XC_PAGE_SIZE)
-                   & ~((guest_word_t) XC_PAGE_SIZE - 1)); 
+                   & ~((guest_word_t) XC_PAGE_SIZE - 1));
     printf("\n");
     printf("Stack:\n");
     for (i=1; i<5 && stack < stack_limit; i++) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZk-0005TT-2Q; Sat, 27 Apr 2013 03:13:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZi-0005TF-MX
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:23 +0000
Received: from [85.158.138.51:8506] by server-11.bemta-3.messagelabs.com id
	42/23-01263-D424B715; Sat, 27 Apr 2013 03:13:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1367032395!21925652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15265 invoked from network); 27 Apr 2013 03:13:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZb-0007gs-4D
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZb-0006TD-2J
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:15 +0000
Date: Sat, 27 Apr 2013 03:13:15 +0000
Message-Id: <E1UVvZb-0006TD-2J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: Support arm64 and actually
	implement output for 32 and 64 bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66425df7ce61865f94506ba57b2ab47a2ba18e41
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:26 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 17:34:37 2013 +0100

    xenctx: Support arm64 and actually implement output for 32 and 64 bit
    
    A bit basic and fuggly but a start.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |  141 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 137 insertions(+), 4 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 1984a31..060e480 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -54,6 +54,11 @@ int guest_protected_mode = 1;
 typedef uint64_t guest_word_t;
 #define FMT_32B_WORD "%08llx"
 #define FMT_64B_WORD "%016llx"
+#elif defined(__aarch64__)
+#define NO_TRANSLATION
+typedef uint64_t guest_word_t;
+#define FMT_32B_WORD "%08lx"
+#define FMT_64B_WORD "%016lx"
 #endif
 
 struct symbol {
@@ -430,12 +435,140 @@ static guest_word_t frame_pointer(vcpu_guest_context_any_t *ctx)
         return ctx->x64.user_regs.rbp;
 }
 
-#elif defined(__arm__)
-static void print_ctx(vcpu_guest_context_any_t *ctx)
+#elif defined(__arm__) || defined(__aarch64__)
+
+static void print_ctx_32(vcpu_guest_context_t *ctx)
 {
-    /* XXX: properly implement this */
-    print_symbol(0);
+    vcpu_guest_core_regs_t *regs = &ctx->user_regs;
+
+    printf("PC:       %08"PRIx32" ", regs->pc32);
+    print_symbol(regs->pc32);
+    printf("\n");
+    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
+    printf("USR:               SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->sp_usr, regs->lr_usr);
+    printf("SVC: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_svc, regs->sp_svc, regs->lr_svc);
+    printf("FIQ: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_fiq, regs->sp_fiq, regs->lr_fiq);
+    printf("IRQ: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_irq, regs->sp_irq, regs->lr_irq);
+    printf("ABT: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_abt, regs->sp_abt, regs->lr_abt);
+    printf("UND: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_und, regs->sp_und, regs->lr_und);
+
+    printf("\n");
+    printf(" r0_usr: %08"PRIx32"\t", regs->r0_usr);
+    printf(" r1_usr: %08"PRIx32"\t", regs->r1_usr);
+    printf(" r2_usr: %08"PRIx32"\n", regs->r2_usr);
+
+    printf(" r3_usr: %08"PRIx32"\t", regs->r3_usr);
+    printf(" r4_usr: %08"PRIx32"\t", regs->r4_usr);
+    printf(" r5_usr: %08"PRIx32"\n", regs->r5_usr);
+
+    printf(" r6_usr: %08"PRIx32"\t", regs->r6_usr);
+    printf(" r7_usr: %08"PRIx32"\t", regs->r7_usr);
+    printf(" r8_usr: %08"PRIx32"\n", regs->r8_usr);
+
+    printf(" r9_usr: %08"PRIx32"\t", regs->r9_usr);
+    printf("r10_usr: %08"PRIx32"\t", regs->r10_usr);
+    printf("r11_usr: %08"PRIx32"\n", regs->r11_usr);
+
+    printf("r12_usr: %08"PRIx32"\n", regs->r12_usr);
+    printf("\n");
+
+    printf(" r8_fiq: %08"PRIx32"\n", regs->r8_fiq);
+
+    printf(" r9_fiq: %08"PRIx32"\t", regs->r9_fiq);
+    printf("r10_fiq: %08"PRIx32"\t", regs->r10_fiq);
+    printf("r11_fiq: %08"PRIx32"\n", regs->r11_fiq);
+
+    printf("r12_fiq: %08"PRIx32"\n", regs->r12_fiq);
+    printf("\n");
 }
+
+#ifdef __aarch64__
+static void print_ctx_64(vcpu_guest_context_t *ctx)
+{
+    vcpu_guest_core_regs_t *regs = &ctx->user_regs;
+
+    printf("PC:       %016"PRIx64" ", regs->pc64);
+    print_symbol(regs->pc64);
+    printf("\n");
+
+    printf("LR:       %016"PRIx64"zn", regs->x30);
+    printf("ELR_EL1:  %016"PRIx64"\n", regs->elr_el1);
+
+    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
+    printf("SPSR_EL1: %08"PRIx32"\n", regs->spsr_el1);
+
+    printf("SP_EL0:   %016"PRIx64"\n", regs->sp_el0);
+    printf("SP_EL1:   %016"PRIx64"\n", regs->sp_el1);
+
+    printf("\n");
+    printf(" x0: %016"PRIx64"\t", regs->x0);
+    printf(" x1: %016"PRIx64"\t", regs->x1);
+    printf(" x2: %016"PRIx64"\n", regs->x2);
+
+    printf(" x3: %016"PRIx64"\t", regs->x3);
+    printf(" x4: %016"PRIx64"\t", regs->x4);
+    printf(" x5: %016"PRIx64"\n", regs->x5);
+
+    printf(" x6: %016"PRIx64"\t", regs->x6);
+    printf(" x7: %016"PRIx64"\t", regs->x7);
+    printf(" x8: %016"PRIx64"\n", regs->x8);
+
+    printf(" x9: %016"PRIx64"\t", regs->x9);
+    printf("x10: %016"PRIx64"\t", regs->x10);
+    printf("x11: %016"PRIx64"\n", regs->x11);
+
+    printf("x12: %016"PRIx64"\t", regs->x12);
+    printf("x13: %016"PRIx64"\t", regs->x13);
+    printf("x14: %016"PRIx64"\n", regs->x14);
+
+    printf("x15: %016"PRIx64"\t", regs->x15);
+    printf("x16: %016"PRIx64"\t", regs->x16);
+    printf("x17: %016"PRIx64"\n", regs->x17);
+
+    printf("x18: %016"PRIx64"\t", regs->x18);
+    printf("x19: %016"PRIx64"\t", regs->x19);
+    printf("x20: %016"PRIx64"\n", regs->x20);
+
+    printf("x21: %016"PRIx64"\t", regs->x21);
+    printf("x22: %016"PRIx64"\t", regs->x22);
+    printf("x23: %016"PRIx64"\n", regs->x23);
+
+    printf("x24: %016"PRIx64"\t", regs->x24);
+    printf("x25: %016"PRIx64"\t", regs->x25);
+    printf("x26: %016"PRIx64"\n", regs->x26);
+
+    printf("x27: %016"PRIx64"\t", regs->x27);
+    printf("x28: %016"PRIx64"\t", regs->x28);
+    printf("x29: %016"PRIx64"\n", regs->x29);
+    printf("\n");
+}
+#endif /* __aarch64__ */
+
+static void print_ctx(vcpu_guest_context_any_t *ctx_any)
+{
+    vcpu_guest_context_t *ctx = &ctx_any->c;
+
+#ifdef __aarch64__
+    if (ctx->user_regs.cpsr & PSR_MODE_BIT)
+        print_ctx_32(ctx);
+    else
+        print_ctx_64(ctx);
+#else
+    print_ctx_32(ctx);
+#endif
+
+    printf("SCTLR: %08"PRIx32"\n", ctx->sctlr);
+    printf("TTBCR: %08"PRIx32"\n", ctx->ttbcr);
+    printf("TTBR0: %016"PRIx64"\n", ctx->ttbr0);
+    printf("TTBR1: %016"PRIx64"\n", ctx->ttbr1);
+}
+
 #endif
 
 #ifndef NO_TRANSLATION
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:27 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZk-0005TT-2Q; Sat, 27 Apr 2013 03:13:24 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZi-0005TF-MX
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:23 +0000
Received: from [85.158.138.51:8506] by server-11.bemta-3.messagelabs.com id
	42/23-01263-D424B715; Sat, 27 Apr 2013 03:13:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-174.messagelabs.com!1367032395!21925652!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15265 invoked from network); 27 Apr 2013 03:13:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZb-0007gs-4D
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZb-0006TD-2J
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:15 +0000
Date: Sat, 27 Apr 2013 03:13:15 +0000
Message-Id: <E1UVvZb-0006TD-2J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenctx: Support arm64 and actually
	implement output for 32 and 64 bit
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66425df7ce61865f94506ba57b2ab47a2ba18e41
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 12 13:13:26 2013 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Apr 24 17:34:37 2013 +0100

    xenctx: Support arm64 and actually implement output for 32 and 64 bit
    
    A bit basic and fuggly but a start.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xentrace/xenctx.c |  141 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 137 insertions(+), 4 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index 1984a31..060e480 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -54,6 +54,11 @@ int guest_protected_mode = 1;
 typedef uint64_t guest_word_t;
 #define FMT_32B_WORD "%08llx"
 #define FMT_64B_WORD "%016llx"
+#elif defined(__aarch64__)
+#define NO_TRANSLATION
+typedef uint64_t guest_word_t;
+#define FMT_32B_WORD "%08lx"
+#define FMT_64B_WORD "%016lx"
 #endif
 
 struct symbol {
@@ -430,12 +435,140 @@ static guest_word_t frame_pointer(vcpu_guest_context_any_t *ctx)
         return ctx->x64.user_regs.rbp;
 }
 
-#elif defined(__arm__)
-static void print_ctx(vcpu_guest_context_any_t *ctx)
+#elif defined(__arm__) || defined(__aarch64__)
+
+static void print_ctx_32(vcpu_guest_context_t *ctx)
 {
-    /* XXX: properly implement this */
-    print_symbol(0);
+    vcpu_guest_core_regs_t *regs = &ctx->user_regs;
+
+    printf("PC:       %08"PRIx32" ", regs->pc32);
+    print_symbol(regs->pc32);
+    printf("\n");
+    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
+    printf("USR:               SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->sp_usr, regs->lr_usr);
+    printf("SVC: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_svc, regs->sp_svc, regs->lr_svc);
+    printf("FIQ: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_fiq, regs->sp_fiq, regs->lr_fiq);
+    printf("IRQ: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_irq, regs->sp_irq, regs->lr_irq);
+    printf("ABT: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_abt, regs->sp_abt, regs->lr_abt);
+    printf("UND: SPSR:%08"PRIx32" SP:%08"PRIx32" LR:%08"PRIx32"\n",
+           regs->spsr_und, regs->sp_und, regs->lr_und);
+
+    printf("\n");
+    printf(" r0_usr: %08"PRIx32"\t", regs->r0_usr);
+    printf(" r1_usr: %08"PRIx32"\t", regs->r1_usr);
+    printf(" r2_usr: %08"PRIx32"\n", regs->r2_usr);
+
+    printf(" r3_usr: %08"PRIx32"\t", regs->r3_usr);
+    printf(" r4_usr: %08"PRIx32"\t", regs->r4_usr);
+    printf(" r5_usr: %08"PRIx32"\n", regs->r5_usr);
+
+    printf(" r6_usr: %08"PRIx32"\t", regs->r6_usr);
+    printf(" r7_usr: %08"PRIx32"\t", regs->r7_usr);
+    printf(" r8_usr: %08"PRIx32"\n", regs->r8_usr);
+
+    printf(" r9_usr: %08"PRIx32"\t", regs->r9_usr);
+    printf("r10_usr: %08"PRIx32"\t", regs->r10_usr);
+    printf("r11_usr: %08"PRIx32"\n", regs->r11_usr);
+
+    printf("r12_usr: %08"PRIx32"\n", regs->r12_usr);
+    printf("\n");
+
+    printf(" r8_fiq: %08"PRIx32"\n", regs->r8_fiq);
+
+    printf(" r9_fiq: %08"PRIx32"\t", regs->r9_fiq);
+    printf("r10_fiq: %08"PRIx32"\t", regs->r10_fiq);
+    printf("r11_fiq: %08"PRIx32"\n", regs->r11_fiq);
+
+    printf("r12_fiq: %08"PRIx32"\n", regs->r12_fiq);
+    printf("\n");
 }
+
+#ifdef __aarch64__
+static void print_ctx_64(vcpu_guest_context_t *ctx)
+{
+    vcpu_guest_core_regs_t *regs = &ctx->user_regs;
+
+    printf("PC:       %016"PRIx64" ", regs->pc64);
+    print_symbol(regs->pc64);
+    printf("\n");
+
+    printf("LR:       %016"PRIx64"zn", regs->x30);
+    printf("ELR_EL1:  %016"PRIx64"\n", regs->elr_el1);
+
+    printf("CPSR:     %08"PRIx32"\n", regs->cpsr);
+    printf("SPSR_EL1: %08"PRIx32"\n", regs->spsr_el1);
+
+    printf("SP_EL0:   %016"PRIx64"\n", regs->sp_el0);
+    printf("SP_EL1:   %016"PRIx64"\n", regs->sp_el1);
+
+    printf("\n");
+    printf(" x0: %016"PRIx64"\t", regs->x0);
+    printf(" x1: %016"PRIx64"\t", regs->x1);
+    printf(" x2: %016"PRIx64"\n", regs->x2);
+
+    printf(" x3: %016"PRIx64"\t", regs->x3);
+    printf(" x4: %016"PRIx64"\t", regs->x4);
+    printf(" x5: %016"PRIx64"\n", regs->x5);
+
+    printf(" x6: %016"PRIx64"\t", regs->x6);
+    printf(" x7: %016"PRIx64"\t", regs->x7);
+    printf(" x8: %016"PRIx64"\n", regs->x8);
+
+    printf(" x9: %016"PRIx64"\t", regs->x9);
+    printf("x10: %016"PRIx64"\t", regs->x10);
+    printf("x11: %016"PRIx64"\n", regs->x11);
+
+    printf("x12: %016"PRIx64"\t", regs->x12);
+    printf("x13: %016"PRIx64"\t", regs->x13);
+    printf("x14: %016"PRIx64"\n", regs->x14);
+
+    printf("x15: %016"PRIx64"\t", regs->x15);
+    printf("x16: %016"PRIx64"\t", regs->x16);
+    printf("x17: %016"PRIx64"\n", regs->x17);
+
+    printf("x18: %016"PRIx64"\t", regs->x18);
+    printf("x19: %016"PRIx64"\t", regs->x19);
+    printf("x20: %016"PRIx64"\n", regs->x20);
+
+    printf("x21: %016"PRIx64"\t", regs->x21);
+    printf("x22: %016"PRIx64"\t", regs->x22);
+    printf("x23: %016"PRIx64"\n", regs->x23);
+
+    printf("x24: %016"PRIx64"\t", regs->x24);
+    printf("x25: %016"PRIx64"\t", regs->x25);
+    printf("x26: %016"PRIx64"\n", regs->x26);
+
+    printf("x27: %016"PRIx64"\t", regs->x27);
+    printf("x28: %016"PRIx64"\t", regs->x28);
+    printf("x29: %016"PRIx64"\n", regs->x29);
+    printf("\n");
+}
+#endif /* __aarch64__ */
+
+static void print_ctx(vcpu_guest_context_any_t *ctx_any)
+{
+    vcpu_guest_context_t *ctx = &ctx_any->c;
+
+#ifdef __aarch64__
+    if (ctx->user_regs.cpsr & PSR_MODE_BIT)
+        print_ctx_32(ctx);
+    else
+        print_ctx_64(ctx);
+#else
+    print_ctx_32(ctx);
+#endif
+
+    printf("SCTLR: %08"PRIx32"\n", ctx->sctlr);
+    printf("TTBCR: %08"PRIx32"\n", ctx->ttbcr);
+    printf("TTBR0: %016"PRIx64"\n", ctx->ttbr0);
+    printf("TTBR1: %016"PRIx64"\n", ctx->ttbr1);
+}
+
 #endif
 
 #ifndef NO_TRANSLATION
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZp-0005UW-56; Sat, 27 Apr 2013 03:13:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZn-0005UD-W4
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:28 +0000
Received: from [85.158.138.51:46048] by server-3.bemta-3.messagelabs.com id
	09/1D-26934-7524B715; Sat, 27 Apr 2013 03:13:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1367032405!30185979!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14756 invoked from network); 27 Apr 2013 03:13:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZl-0007gy-BL
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZl-0006TZ-8R
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:25 +0000
Date: Sat, 27 Apr 2013 03:13:25 +0000
Message-Id: <E1UVvZl-0006TZ-8R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: Fix compilation error with
	EARLY_PRINTK disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7259d4d3df40d273725b8c074f169b98846dec97
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Apr 25 19:39:49 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:54:13 2013 +0100

    arm64: Fix compilation error with EARLY_PRINTK disabled
    
    arm64/head.S: Assembler messages:
    arm64/head.S:391: Error: operand 1 should be an integer register -- `mov pc,lr'
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/head.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index f0d9066..ef02899 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -388,6 +388,6 @@ init_uart:
 .global early_puts
 early_puts:
 puts:
-putn:   mov   pc, lr
+putn:   ret
 
 #endif /* EARLY_UART_ADDRESS */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:30 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZp-0005UW-56; Sat, 27 Apr 2013 03:13:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZn-0005UD-W4
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:28 +0000
Received: from [85.158.138.51:46048] by server-3.bemta-3.messagelabs.com id
	09/1D-26934-7524B715; Sat, 27 Apr 2013 03:13:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-174.messagelabs.com!1367032405!30185979!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14756 invoked from network); 27 Apr 2013 03:13:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZl-0007gy-BL
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZl-0006TZ-8R
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:25 +0000
Date: Sat, 27 Apr 2013 03:13:25 +0000
Message-Id: <E1UVvZl-0006TZ-8R@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arm64: Fix compilation error with
	EARLY_PRINTK disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7259d4d3df40d273725b8c074f169b98846dec97
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Apr 25 19:39:49 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:54:13 2013 +0100

    arm64: Fix compilation error with EARLY_PRINTK disabled
    
    arm64/head.S: Assembler messages:
    arm64/head.S:391: Error: operand 1 should be an integer register -- `mov pc,lr'
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/arm64/head.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index f0d9066..ef02899 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -388,6 +388,6 @@ init_uart:
 .global early_puts
 early_puts:
 puts:
-putn:   mov   pc, lr
+putn:   ret
 
 #endif /* EARLY_UART_ADDRESS */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZz-0005WN-83; Sat, 27 Apr 2013 03:13:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZy-0005W2-4s
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:38 +0000
Received: from [85.158.139.211:53782] by server-1.bemta-5.messagelabs.com id
	D4/8C-14063-1624B715; Sat, 27 Apr 2013 03:13:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032415!20616455!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31172 invoked from network); 27 Apr 2013 03:13:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZv-0007h9-It
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZv-0006UV-Gv
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:35 +0000
Date: Sat, 27 Apr 2013 03:13:35 +0000
Message-Id: <E1UVvZv-0006UV-Gv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: write IO ABI for disk frontends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0114d259ebcd1f87966e2849f6ac1af8d9dd89c5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Apr 26 11:11:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:55:10 2013 +0100

    libxl: write IO ABI for disk frontends
    
    This is a patch to forward-port a Xend behaviour. Xend writes IO ABI used for
    all frontends. Blkfront before 2.6.26 relies on this behaviour otherwise guest
    cannot boot when running in 32-on-64 mode. Blkfront after 2.6.26 writes that
    node itself, in which case it's just an overwrite to an existing node which
    should be OK.
    
    In fact Xend writes the ABI for all frontends including console and vif. But
    nowadays only old disk frontends rely on that behaviour so that we only write
    the ABI for disk frontends in libxl, minimizing the impact.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_arm.c |    7 +++++++
 tools/libxc/xc_dom_x86.c |   34 ++++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h    |   10 ++++++++++
 tools/libxl/libxl.c      |   23 +++++++++++++++++++++++
 4 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 041832e..aaf35ca 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -29,6 +29,13 @@
 #define CONSOLE_PFN_OFFSET 0
 #define XENSTORE_PFN_OFFSET 1
 
+/* get guest IO ABI protocol */
+const char *xc_domain_get_native_protocol(xc_interface *xch,
+                                          uint32_t domid)
+{
+    return XEN_IO_PROTO_ABI_ARM;
+}
+
 /* ------------------------------------------------------------------------ */
 /*
  * arm guests are hybrid and start off with paging disabled, therefore no
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index d89526d..f1be43b 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -47,6 +47,40 @@
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
 
+/* get guest IO ABI protocol */
+const char *xc_domain_get_native_protocol(xc_interface *xch,
+                                          uint32_t domid)
+{
+    int ret;
+    uint32_t guest_width;
+    const char *protocol;
+    DECLARE_DOMCTL;
+
+    memset(&domctl, 0, sizeof(domctl));
+    domctl.domain = domid;
+    domctl.cmd = XEN_DOMCTL_get_address_size;
+
+    ret = do_domctl(xch, &domctl);
+
+    if ( ret )
+        return NULL;
+
+    guest_width = domctl.u.address_size.size;
+
+    switch (guest_width) {
+    case 32: /* 32 bit guest */
+        protocol = XEN_IO_PROTO_ABI_X86_32;
+        break;
+    case 64: /* 64 bit guest */
+        protocol = XEN_IO_PROTO_ABI_X86_64;
+        break;
+    default:
+        protocol = NULL;
+    }
+
+    return protocol;
+}
+
 static unsigned long
 nr_page_tables(struct xc_dom_image *dom,
                xen_vaddr_t start, xen_vaddr_t end, unsigned long bits)
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 54a2d5a..c024af4 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -672,6 +672,16 @@ int xc_domain_hvm_setcontext(xc_interface *xch,
                              uint32_t size);
 
 /**
+ * This function will return guest IO ABI protocol
+ *
+ * @parm xch a handle to an open hypervisor interface
+ * @parm domid the domain to get IO ABI protocol for
+ * @return guest protocol on success, NULL on failure
+ */
+const char *xc_domain_get_native_protocol(xc_interface *xch,
+                                          uint32_t domid);
+
+/**
  * This function returns information about the execution context of a
  * particular vcpu of a domain.
  *
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 0f936c0..30302c7 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2052,6 +2052,12 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
     libxl_ctx *ctx = gc->owner;
     xs_transaction_t t = XBT_NULL;
 
+    libxl_domain_type type = libxl__domain_type(gc, domid);
+    if (type == LIBXL_DOMAIN_TYPE_INVALID) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
     for (;;) {
         rc = libxl__xs_transaction_start(gc, &t);
         if (rc) goto out;
@@ -2170,6 +2176,23 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         flexarray_append(front, "device-type");
         flexarray_append(front, disk->is_cdrom ? "cdrom" : "disk");
 
+        /*
+         * Old PV kernel disk frontends before 2.6.26 rely on tool stack to
+         * write disk native protocol to frontend node. Xend does this, port
+         * this behaviour to xl.
+         *
+         * New kernels write this node themselves. In that case it just
+         * overwrites an existing node which is OK.
+         */
+        if (type == LIBXL_DOMAIN_TYPE_PV) {
+            const char *protocol =
+                xc_domain_get_native_protocol(ctx->xch, domid);
+            if (protocol) {
+                flexarray_append(front, "protocol");
+                flexarray_append(front, libxl__strdup(gc, protocol));
+            }
+        }
+
         libxl__device_generic_add(gc, t, device,
                             libxl__xs_kvs_of_flexarray(gc, back, back->count),
                             libxl__xs_kvs_of_flexarray(gc, front, front->count));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:40 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvZz-0005WN-83; Sat, 27 Apr 2013 03:13:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZy-0005W2-4s
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:38 +0000
Received: from [85.158.139.211:53782] by server-1.bemta-5.messagelabs.com id
	D4/8C-14063-1624B715; Sat, 27 Apr 2013 03:13:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032415!20616455!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31172 invoked from network); 27 Apr 2013 03:13:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZv-0007h9-It
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvZv-0006UV-Gv
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:35 +0000
Date: Sat, 27 Apr 2013 03:13:35 +0000
Message-Id: <E1UVvZv-0006UV-Gv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: write IO ABI for disk frontends
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0114d259ebcd1f87966e2849f6ac1af8d9dd89c5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Fri Apr 26 11:11:37 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:55:10 2013 +0100

    libxl: write IO ABI for disk frontends
    
    This is a patch to forward-port a Xend behaviour. Xend writes IO ABI used for
    all frontends. Blkfront before 2.6.26 relies on this behaviour otherwise guest
    cannot boot when running in 32-on-64 mode. Blkfront after 2.6.26 writes that
    node itself, in which case it's just an overwrite to an existing node which
    should be OK.
    
    In fact Xend writes the ABI for all frontends including console and vif. But
    nowadays only old disk frontends rely on that behaviour so that we only write
    the ABI for disk frontends in libxl, minimizing the impact.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_arm.c |    7 +++++++
 tools/libxc/xc_dom_x86.c |   34 ++++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h    |   10 ++++++++++
 tools/libxl/libxl.c      |   23 +++++++++++++++++++++++
 4 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 041832e..aaf35ca 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -29,6 +29,13 @@
 #define CONSOLE_PFN_OFFSET 0
 #define XENSTORE_PFN_OFFSET 1
 
+/* get guest IO ABI protocol */
+const char *xc_domain_get_native_protocol(xc_interface *xch,
+                                          uint32_t domid)
+{
+    return XEN_IO_PROTO_ABI_ARM;
+}
+
 /* ------------------------------------------------------------------------ */
 /*
  * arm guests are hybrid and start off with paging disabled, therefore no
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index d89526d..f1be43b 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -47,6 +47,40 @@
 #define round_down(addr, mask)   ((addr) & ~(mask))
 #define round_up(addr, mask)     ((addr) | (mask))
 
+/* get guest IO ABI protocol */
+const char *xc_domain_get_native_protocol(xc_interface *xch,
+                                          uint32_t domid)
+{
+    int ret;
+    uint32_t guest_width;
+    const char *protocol;
+    DECLARE_DOMCTL;
+
+    memset(&domctl, 0, sizeof(domctl));
+    domctl.domain = domid;
+    domctl.cmd = XEN_DOMCTL_get_address_size;
+
+    ret = do_domctl(xch, &domctl);
+
+    if ( ret )
+        return NULL;
+
+    guest_width = domctl.u.address_size.size;
+
+    switch (guest_width) {
+    case 32: /* 32 bit guest */
+        protocol = XEN_IO_PROTO_ABI_X86_32;
+        break;
+    case 64: /* 64 bit guest */
+        protocol = XEN_IO_PROTO_ABI_X86_64;
+        break;
+    default:
+        protocol = NULL;
+    }
+
+    return protocol;
+}
+
 static unsigned long
 nr_page_tables(struct xc_dom_image *dom,
                xen_vaddr_t start, xen_vaddr_t end, unsigned long bits)
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 54a2d5a..c024af4 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -672,6 +672,16 @@ int xc_domain_hvm_setcontext(xc_interface *xch,
                              uint32_t size);
 
 /**
+ * This function will return guest IO ABI protocol
+ *
+ * @parm xch a handle to an open hypervisor interface
+ * @parm domid the domain to get IO ABI protocol for
+ * @return guest protocol on success, NULL on failure
+ */
+const char *xc_domain_get_native_protocol(xc_interface *xch,
+                                          uint32_t domid);
+
+/**
  * This function returns information about the execution context of a
  * particular vcpu of a domain.
  *
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 0f936c0..30302c7 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2052,6 +2052,12 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
     libxl_ctx *ctx = gc->owner;
     xs_transaction_t t = XBT_NULL;
 
+    libxl_domain_type type = libxl__domain_type(gc, domid);
+    if (type == LIBXL_DOMAIN_TYPE_INVALID) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
     for (;;) {
         rc = libxl__xs_transaction_start(gc, &t);
         if (rc) goto out;
@@ -2170,6 +2176,23 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
         flexarray_append(front, "device-type");
         flexarray_append(front, disk->is_cdrom ? "cdrom" : "disk");
 
+        /*
+         * Old PV kernel disk frontends before 2.6.26 rely on tool stack to
+         * write disk native protocol to frontend node. Xend does this, port
+         * this behaviour to xl.
+         *
+         * New kernels write this node themselves. In that case it just
+         * overwrites an existing node which is OK.
+         */
+        if (type == LIBXL_DOMAIN_TYPE_PV) {
+            const char *protocol =
+                xc_domain_get_native_protocol(ctx->xch, domid);
+            if (protocol) {
+                flexarray_append(front, "protocol");
+                flexarray_append(front, libxl__strdup(gc, protocol));
+            }
+        }
+
         libxl__device_generic_add(gc, t, device,
                             libxl__xs_kvs_of_flexarray(gc, back, back->count),
                             libxl__xs_kvs_of_flexarray(gc, front, front->count));
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVva9-0005YI-B9; Sat, 27 Apr 2013 03:13:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVva8-0005Y4-As
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:48 +0000
Received: from [85.158.139.211:54046] by server-1.bemta-5.messagelabs.com id
	03/9C-14063-B624B715; Sat, 27 Apr 2013 03:13:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1367032425!16682055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6174 invoked from network); 27 Apr 2013 03:13:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVva5-0007hF-Nl
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVva5-0006Ur-Mj
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:45 +0000
Date: Sat, 27 Apr 2013 03:13:45 +0000
Message-Id: <E1UVva5-0006Ur-Mj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix return value when write
	is ignored in VGIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f2f34db831d33e9121535b00c46633e8d4664758
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Apr 26 14:16:31 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:56:32 2013 +0100

    xen/arm: Fix return value when write is ignored in VGIC
    
    If a write is ignored, the function should return success.
    
    Currently Xen will throw a data abort exception if the write in VGIC is
    ignored.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 4d8da02..a984621 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -550,7 +550,7 @@ bad_width:
 
 write_ignore:
     if ( dabt.size != 2 ) goto bad_width;
-    return 0;
+    return 1;
 }
 
 static int vgic_distr_mmio_check(struct vcpu *v, paddr_t addr)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:13:50 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:13:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVva9-0005YI-B9; Sat, 27 Apr 2013 03:13:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVva8-0005Y4-As
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:48 +0000
Received: from [85.158.139.211:54046] by server-1.bemta-5.messagelabs.com id
	03/9C-14063-B624B715; Sat, 27 Apr 2013 03:13:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1367032425!16682055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6174 invoked from network); 27 Apr 2013 03:13:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVva5-0007hF-Nl
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVva5-0006Ur-Mj
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:45 +0000
Date: Sat, 27 Apr 2013 03:13:45 +0000
Message-Id: <E1UVva5-0006Ur-Mj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Fix return value when write
	is ignored in VGIC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f2f34db831d33e9121535b00c46633e8d4664758
Author:     Anthony PERARD <anthony.perard@citrix.com>
AuthorDate: Fri Apr 26 14:16:31 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:56:32 2013 +0100

    xen/arm: Fix return value when write is ignored in VGIC
    
    If a write is ignored, the function should return success.
    
    Currently Xen will throw a data abort exception if the write in VGIC is
    ignored.
    
    Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 4d8da02..a984621 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -550,7 +550,7 @@ bad_width:
 
 write_ignore:
     if ( dabt.size != 2 ) goto bad_width;
-    return 0;
+    return 1;
 }
 
 static int vgic_distr_mmio_check(struct vcpu *v, paddr_t addr)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:14:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:14:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvaJ-0005Zx-Dz; Sat, 27 Apr 2013 03:13:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaI-0005Zm-D3
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:58 +0000
Received: from [85.158.139.211:45559] by server-5.bemta-5.messagelabs.com id
	E9/FE-02762-5724B715; Sat, 27 Apr 2013 03:13:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1367032436!20655574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2741 invoked from network); 27 Apr 2013 03:13:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaF-0007hO-Tn
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaF-0006VE-RG
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:55 +0000
Date: Sat, 27 Apr 2013 03:13:55 +0000
Message-Id: <E1UVvaF-0006VE-RG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: nr_lrs should be static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b26d570c93a162c2b8f7a9ea336b1935b01af0b2
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 15:20:53 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:57:56 2013 +0100

    xen/arm: nr_lrs should be static
    
    nr_lrs is only used in gic.c
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index c3887a9..8e591fa 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -53,7 +53,7 @@ static irq_desc_t irq_desc[NR_IRQS];
 static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
 static DEFINE_PER_CPU(uint64_t, lr_mask);
 
-unsigned nr_lrs;
+static unsigned nr_lrs;
 
 irq_desc_t *__irq_to_desc(int irq)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:14:00 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:14:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvaJ-0005Zx-Dz; Sat, 27 Apr 2013 03:13:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaI-0005Zm-D3
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:58 +0000
Received: from [85.158.139.211:45559] by server-5.bemta-5.messagelabs.com id
	E9/FE-02762-5724B715; Sat, 27 Apr 2013 03:13:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1367032436!20655574!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2741 invoked from network); 27 Apr 2013 03:13:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:13:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaF-0007hO-Tn
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaF-0006VE-RG
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:13:55 +0000
Date: Sat, 27 Apr 2013 03:13:55 +0000
Message-Id: <E1UVvaF-0006VE-RG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: nr_lrs should be static
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b26d570c93a162c2b8f7a9ea336b1935b01af0b2
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 26 15:20:53 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:57:56 2013 +0100

    xen/arm: nr_lrs should be static
    
    nr_lrs is only used in gic.c
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen/arch/arm/gic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index c3887a9..8e591fa 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -53,7 +53,7 @@ static irq_desc_t irq_desc[NR_IRQS];
 static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
 static DEFINE_PER_CPU(uint64_t, lr_mask);
 
-unsigned nr_lrs;
+static unsigned nr_lrs;
 
 irq_desc_t *__irq_to_desc(int irq)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:14:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:14:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvaV-0005bz-HP; Sat, 27 Apr 2013 03:14:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaU-0005bn-An
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:14:10 +0000
Received: from [85.158.139.211:2809] by server-7.bemta-5.messagelabs.com id
	35/A2-12441-1824B715; Sat, 27 Apr 2013 03:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032448!20616484!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32294 invoked from network); 27 Apr 2013 03:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaQ-0007hx-3f
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:14:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaQ-0006Vb-1n
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:14:06 +0000
Date: Sat, 27 Apr 2013 03:14:06 +0000
Message-Id: <E1UVvaQ-0006Vb-1n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: stat the path for all non-qdisk
	backends (including unknown)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6287345374174890999=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6287345374174890999==
Content-Type: text/plain

commit 3ed6d71247b6ef3c701654824f5b4c961eacfd61
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 12:41:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:59:41 2013 +0100

    libxl: stat the path for all non-qdisk backends (including unknown)
    
    The commit a8a1f236a296 "libxl: Only call stat() when adding a disk if we
    expect a device to exist." changed things to only stat the file when the phy
    backend was explicitly requested. This broke the case where we are probing and
    would normally be able to decide on the phy option.
    
    Since the intention of that commit was to allow for backends with no explicit
    file in dom0 (i.e. network remote backend such as ceph) the lowest impact fix
    appears to be to make that explicit. It turns out that tap disk can also
    potentially handle such paths.
    
    The only backend which requires a local file/device is PHY but we need to
    handle UNKNOWN too in order for subsequent probing to work. Note that it is
    not possible to autoprobe the backend if the path is not a local object, so we
    don't need to worry about autoprobing ceph etc.
    
    This should probably be revisited to rationalize the probing.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/libxl/libxl_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index eb60fd5..a826ece 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -236,7 +236,8 @@ int libxl__device_disk_set_backend(libxl__gc *gc, libxl_device_disk *disk) {
             return ERROR_INVAL;
         }
         memset(&a.stab, 0, sizeof(a.stab));
-    } else if (disk->backend == LIBXL_DISK_BACKEND_PHY &&
+    } else if ((disk->backend == LIBXL_DISK_BACKEND_UNKNOWN ||
+                disk->backend == LIBXL_DISK_BACKEND_PHY) &&
                disk->backend_domid == LIBXL_TOOLSTACK_DOMID &&
                !disk->script) {
         if (stat(disk->pdev_path, &a.stab)) {
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============6287345374174890999==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============6287345374174890999==--

From xen-changelog-bounces@lists.xen.org Sat Apr 27 03:14:12 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 27 Apr 2013 03:14:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UVvaV-0005bz-HP; Sat, 27 Apr 2013 03:14:11 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaU-0005bn-An
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:14:10 +0000
Received: from [85.158.139.211:2809] by server-7.bemta-5.messagelabs.com id
	35/A2-12441-1824B715; Sat, 27 Apr 2013 03:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1367032448!20616484!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32294 invoked from network); 27 Apr 2013 03:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Apr 2013 03:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaQ-0007hx-3f
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:14:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UVvaQ-0006Vb-1n
	for xen-changelog@lists.xensource.com; Sat, 27 Apr 2013 03:14:06 +0000
Date: Sat, 27 Apr 2013 03:14:06 +0000
Message-Id: <E1UVvaQ-0006Vb-1n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: stat the path for all non-qdisk
	backends (including unknown)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6287345374174890999=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6287345374174890999==
Content-Type: text/plain

commit 3ed6d71247b6ef3c701654824f5b4c961eacfd61
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Fri Apr 26 12:41:43 2013 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Apr 26 15:59:41 2013 +0100

    libxl: stat the path for all non-qdisk backends (including unknown)
    
    The commit a8a1f236a296 "libxl: Only call stat() when adding a disk if we
    expect a device to exist." changed things to only stat the file when the phy
    backend was explicitly requested. This broke the case where we are probing and
    would normally be able to decide on the phy option.
    
    Since the intention of that commit was to allow for backends with no explicit
    file in dom0 (i.e. network remote backend such as ceph) the lowest impact fix
    appears to be to make that explicit. It turns out that tap disk can also
    potentially handle such paths.
    
    The only backend which requires a local file/device is PHY but we need to
    handle UNKNOWN too in order for subsequent probing to work. Note that it is
    not possible to autoprobe the backend if the path is not a local object, so we
    don't need to worry about autoprobing ceph etc.
    
    This should probably be revisited to rationalize the probing.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/libxl/libxl_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index eb60fd5..a826ece 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -236,7 +236,8 @@ int libxl__device_disk_set_backend(libxl__gc *gc, libxl_device_disk *disk) {
             return ERROR_INVAL;
         }
         memset(&a.stab, 0, sizeof(a.stab));
-    } else if (disk->backend == LIBXL_DISK_BACKEND_PHY &&
+    } else if ((disk->backend == LIBXL_DISK_BACKEND_UNKNOWN ||
+                disk->backend == LIBXL_DISK_BACKEND_PHY) &&
                disk->backend_domid == LIBXL_TOOLSTACK_DOMID &&
                !disk->script) {
         if (stat(disk->pdev_path, &a.stab)) {
--
generated by git-patchbot for /home/xen/git/xen.git#master


--===============6287345374174890999==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog
--===============6287345374174890999==--

From xen-changelog-bounces@lists.xen.org Mon Apr 29 18:55:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 18:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWtEK-00035w-NK; Mon, 29 Apr 2013 18:55:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtEK-00035q-3q
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:16 +0000
Received: from [85.158.143.99:28685] by server-3.bemta-4.messagelabs.com id
	EC/35-02015-312CE715; Mon, 29 Apr 2013 18:55:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1367261713!19112117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25595 invoked from network); 29 Apr 2013 18:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 18:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtE9-0006nE-LS
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtE8-0003TE-Fy
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:04 +0000
Date: Mon, 29 Apr 2013 18:55:04 +0000
Message-Id: <E1UWtE8-0003TE-Fy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vMCE: bugfix of vmce injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d9d046ae7d0b0374ebbef987ef66819aa33983b
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Apr 29 11:27:11 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 11:27:11 2013 +0200

    x86/vMCE: bugfix of vmce injection
    
    uint16_t is not suitable to store VMCE_INJECT_BROADCAST (which is
    defined as -1).
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 xen/arch/x86/cpu/mcheck/mcaction.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index 5627192..0ac5b45 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -45,7 +45,7 @@ mc_memerr_dhandler(struct mca_binfo *binfo,
     struct domain *d;
     unsigned long mfn, gfn;
     uint32_t status;
-    uint16_t vmce_vcpuid;
+    int vmce_vcpuid;
 
     if (!mc_check_addr(bank->mc_status, bank->mc_misc, MC_ADDR_PHYSICAL)) {
         dprintk(XENLOG_WARNING,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 18:55:23 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 18:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWtEK-00035w-NK; Mon, 29 Apr 2013 18:55:16 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtEK-00035q-3q
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:16 +0000
Received: from [85.158.143.99:28685] by server-3.bemta-4.messagelabs.com id
	EC/35-02015-312CE715; Mon, 29 Apr 2013 18:55:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-216.messagelabs.com!1367261713!19112117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25595 invoked from network); 29 Apr 2013 18:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 18:55:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtE9-0006nE-LS
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtE8-0003TE-Fy
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:04 +0000
Date: Mon, 29 Apr 2013 18:55:04 +0000
Message-Id: <E1UWtE8-0003TE-Fy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/vMCE: bugfix of vmce injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4d9d046ae7d0b0374ebbef987ef66819aa33983b
Author:     Liu Jinsong <jinsong.liu@intel.com>
AuthorDate: Mon Apr 29 11:27:11 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 11:27:11 2013 +0200

    x86/vMCE: bugfix of vmce injection
    
    uint16_t is not suitable to store VMCE_INJECT_BROADCAST (which is
    defined as -1).
    
    Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 xen/arch/x86/cpu/mcheck/mcaction.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index 5627192..0ac5b45 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -45,7 +45,7 @@ mc_memerr_dhandler(struct mca_binfo *binfo,
     struct domain *d;
     unsigned long mfn, gfn;
     uint32_t status;
-    uint16_t vmce_vcpuid;
+    int vmce_vcpuid;
 
     if (!mc_check_addr(bank->mc_status, bank->mc_misc, MC_ADDR_PHYSICAL)) {
         dprintk(XENLOG_WARNING,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 18:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 18:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWtEW-00036a-Qh; Mon, 29 Apr 2013 18:55:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtEV-00036T-Uw
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:28 +0000
Received: from [85.158.137.99:23700] by server-14.bemta-3.messagelabs.com id
	72/11-27076-F12CE715; Mon, 29 Apr 2013 18:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1367261723!19598239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10755 invoked from network); 29 Apr 2013 18:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 18:55:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtER-0006nH-It
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtER-0003Tc-DR
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:23 +0000
Date: Mon, 29 Apr 2013 18:55:23 +0000
Message-Id: <E1UWtER-0003Tc-DR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: fix runtime call status for
	compat mode Dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a7ac9597a7fc6ca934957eb78b41e26638281953
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 11:27:54 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 11:27:54 2013 +0200

    x86/EFI: fix runtime call status for compat mode Dom0
    
    The top two bits (indicating error/warning classification) need to
    remain the top two bits.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/efi/runtime.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index be3f537..37bb535 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -531,7 +531,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 #ifndef COMPAT
     op->status = status;
 #else
-    op->status = (status & 0x3fffffff) | (status >> 62);
+    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
 #endif
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 18:55:34 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 18:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWtEW-00036a-Qh; Mon, 29 Apr 2013 18:55:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtEV-00036T-Uw
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:28 +0000
Received: from [85.158.137.99:23700] by server-14.bemta-3.messagelabs.com id
	72/11-27076-F12CE715; Mon, 29 Apr 2013 18:55:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-217.messagelabs.com!1367261723!19598239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10755 invoked from network); 29 Apr 2013 18:55:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-217.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 18:55:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtER-0006nH-It
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWtER-0003Tc-DR
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 18:55:23 +0000
Date: Mon, 29 Apr 2013 18:55:23 +0000
Message-Id: <E1UWtER-0003Tc-DR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: fix runtime call status for
	compat mode Dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a7ac9597a7fc6ca934957eb78b41e26638281953
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 11:27:54 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 11:27:54 2013 +0200

    x86/EFI: fix runtime call status for compat mode Dom0
    
    The top two bits (indicating error/warning classification) need to
    remain the top two bits.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/arch/x86/efi/runtime.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index be3f537..37bb535 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -531,7 +531,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 #ifndef COMPAT
     op->status = status;
 #else
-    op->status = (status & 0x3fffffff) | (status >> 62);
+    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
 #endif
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 22:33:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWwdC-0008FO-Ej; Mon, 29 Apr 2013 22:33:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdB-0008FH-5R
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:09 +0000
Received: from [85.158.139.83:14721] by server-16.bemta-5.messagelabs.com id
	E4/2F-02543-425FE715; Mon, 29 Apr 2013 22:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1367274786!26348425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17254 invoked from network); 29 Apr 2013 22:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 22:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwd4-0000oZ-W3
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwd4-0000CX-Si
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:02 +0000
Date: Mon, 29 Apr 2013 22:33:02 +0000
Message-Id: <E1UWwd4-0000CX-Si@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.3-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33c9aa46e2a1cb94fdd5e14374060b8c2bd7e5a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 16:07:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 16:07:13 2013 +0200

    update Xen version to 4.2.3-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 8c97f0f..a18d582 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 22:33:20 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 22:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWwdC-0008FO-Ej; Mon, 29 Apr 2013 22:33:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdB-0008FH-5R
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:09 +0000
Received: from [85.158.139.83:14721] by server-16.bemta-5.messagelabs.com id
	E4/2F-02543-425FE715; Mon, 29 Apr 2013 22:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-182.messagelabs.com!1367274786!26348425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17254 invoked from network); 29 Apr 2013 22:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 22:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwd4-0000oZ-W3
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwd4-0000CX-Si
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:02 +0000
Date: Mon, 29 Apr 2013 22:33:02 +0000
Message-Id: <E1UWwd4-0000CX-Si@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.3-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33c9aa46e2a1cb94fdd5e14374060b8c2bd7e5a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 16:07:13 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 16:07:13 2013 +0200

    update Xen version to 4.2.3-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 8c97f0f..a18d582 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 2
-export XEN_EXTRAVERSION ?= .2$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .3-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 22:33:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 22:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWwdb-0008GU-IH; Mon, 29 Apr 2013 22:33:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdb-0008GN-1q
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:35 +0000
Received: from [85.158.143.99:3673] by server-1.bemta-4.messagelabs.com id
	10/AE-06122-E35FE715; Mon, 29 Apr 2013 22:33:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1367274812!24852010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30803 invoked from network); 29 Apr 2013 22:33:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 22:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdI-0000oc-AT
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdI-0000Cv-7e
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:16 +0000
Date: Mon, 29 Apr 2013 22:33:16 +0000
Message-Id: <E1UWwdI-0000Cv-7e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/S3: Fix cpu pool scheduling
	after suspend/resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7fe762b3f06f0e81ce5b3456dc61fc004562ef21
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Mon Apr 29 16:08:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 16:08:16 2013 +0200

    x86/S3: Fix cpu pool scheduling after suspend/resume
    
    This review is another S3 scheduler problem with the system_state
    variable introduced with the following changeset:
    http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=269f543ea750ed567d18f2e819e5d5ce58eda5c5
    
    Specifically, the cpu_callback function that takes the CPU down during
    suspend, and back up during resume. We were seeing situations where,
    after S3, only CPU0 was in cpupool0. Guest performance suffered
    greatly, since all vcpus were only on a single pcpu. Guests under high
    CPU load showed the problem much more quickly than an idle guest.
    
    Removing this if condition forces the CPUs to go through the expected
    online/offline state, and be properly scheduled after S3.
    
    This also includes a necessary partial change proposed earlier by
    Tomasz Wroblewski here:
    http://lists.xen.org/archives/html/xen-devel/2013-01/msg02206.html
    
    It should also resolve the issues discussed in this thread:
    http://lists.xen.org/archives/html/xen-devel/2012-11/msg01801.html
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    master commit: 9aa356bc9f7533c3cb7f02c823f532532876d444
    master date: 2013-04-19 12:29:01 +0200
---
 xen/common/cpupool.c       |   56 +++++++++++++++++++++++++++++++++++--------
 xen/include/xen/sched-if.h |    1 +
 2 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index c036c2c..637f56c 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -41,16 +41,28 @@ static struct cpupool *alloc_cpupool_struct(void)
 {
     struct cpupool *c = xzalloc(struct cpupool);
 
-    if ( c && zalloc_cpumask_var(&c->cpu_valid) )
-        return c;
-    xfree(c);
-    return NULL;
+    if ( !c || !zalloc_cpumask_var(&c->cpu_valid) )
+    {
+        xfree(c);
+        c = NULL;
+    }
+    else if ( !zalloc_cpumask_var(&c->cpu_suspended) )
+    {
+        free_cpumask_var(c->cpu_valid);
+        xfree(c);
+        c = NULL;
+    }
+
+    return c;
 }
 
 static void free_cpupool_struct(struct cpupool *c)
 {
     if ( c )
+    {
+        free_cpumask_var(c->cpu_suspended);
         free_cpumask_var(c->cpu_valid);
+    }
     xfree(c);
 }
 
@@ -417,14 +429,32 @@ void cpupool_rm_domain(struct domain *d)
 
 /*
  * called to add a new cpu to pool admin
- * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0
+ * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0,
+ * unless we are resuming from S3, in which case we put the cpu back
+ * in the cpupool it was in prior to suspend.
  */
 static void cpupool_cpu_add(unsigned int cpu)
 {
     spin_lock(&cpupool_lock);
     cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
-    cpupool_assign_cpu_locked(cpupool0, cpu);
+
+    if ( system_state == SYS_STATE_resume )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+        {
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_suspended ) )
+            {
+                cpupool_assign_cpu_locked(*c, cpu);
+                cpumask_clear_cpu(cpu, (*c)->cpu_suspended);
+            }
+        }
+    }
+
+    if ( cpumask_test_cpu(cpu, &cpupool_free_cpus) )
+        cpupool_assign_cpu_locked(cpupool0, cpu);
     spin_unlock(&cpupool_lock);
 }
 
@@ -436,7 +466,7 @@ static void cpupool_cpu_add(unsigned int cpu)
 static int cpupool_cpu_remove(unsigned int cpu)
 {
     int ret = 0;
-	
+
     spin_lock(&cpupool_lock);
     if ( !cpumask_test_cpu(cpu, cpupool0->cpu_valid))
         ret = -EBUSY;
@@ -633,9 +663,14 @@ static int cpu_callback(
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
-    if ( (system_state == SYS_STATE_suspend) ||
-         (system_state == SYS_STATE_resume) )
-        goto out;
+    if ( system_state == SYS_STATE_suspend )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
+                cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+    }
 
     switch ( action )
     {
@@ -650,7 +685,6 @@ static int cpu_callback(
         break;
     }
 
-out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index bd6186a..c3be9dc 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -199,6 +199,7 @@ struct cpupool
 {
     int              cpupool_id;
     cpumask_var_t    cpu_valid;      /* all cpus assigned to pool */
+    cpumask_var_t    cpu_suspended;  /* cpus in S3 that should be in this pool */
     struct cpupool   *next;
     unsigned int     n_dom;
     struct scheduler *sched;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Mon Apr 29 22:33:42 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 29 Apr 2013 22:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UWwdb-0008GU-IH; Mon, 29 Apr 2013 22:33:35 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdb-0008GN-1q
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:35 +0000
Received: from [85.158.143.99:3673] by server-1.bemta-4.messagelabs.com id
	10/AE-06122-E35FE715; Mon, 29 Apr 2013 22:33:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-216.messagelabs.com!1367274812!24852010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30803 invoked from network); 29 Apr 2013 22:33:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Apr 2013 22:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdI-0000oc-AT
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UWwdI-0000Cv-7e
	for xen-changelog@lists.xensource.com; Mon, 29 Apr 2013 22:33:16 +0000
Date: Mon, 29 Apr 2013 22:33:16 +0000
Message-Id: <E1UWwdI-0000Cv-7e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/S3: Fix cpu pool scheduling
	after suspend/resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7fe762b3f06f0e81ce5b3456dc61fc004562ef21
Author:     Ben Guthro <benjamin.guthro@citrix.com>
AuthorDate: Mon Apr 29 16:08:16 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 16:08:16 2013 +0200

    x86/S3: Fix cpu pool scheduling after suspend/resume
    
    This review is another S3 scheduler problem with the system_state
    variable introduced with the following changeset:
    http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=269f543ea750ed567d18f2e819e5d5ce58eda5c5
    
    Specifically, the cpu_callback function that takes the CPU down during
    suspend, and back up during resume. We were seeing situations where,
    after S3, only CPU0 was in cpupool0. Guest performance suffered
    greatly, since all vcpus were only on a single pcpu. Guests under high
    CPU load showed the problem much more quickly than an idle guest.
    
    Removing this if condition forces the CPUs to go through the expected
    online/offline state, and be properly scheduled after S3.
    
    This also includes a necessary partial change proposed earlier by
    Tomasz Wroblewski here:
    http://lists.xen.org/archives/html/xen-devel/2013-01/msg02206.html
    
    It should also resolve the issues discussed in this thread:
    http://lists.xen.org/archives/html/xen-devel/2012-11/msg01801.html
    
    Signed-off-by: Ben Guthro <benjamin.guthro@citrix.com>
    Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    master commit: 9aa356bc9f7533c3cb7f02c823f532532876d444
    master date: 2013-04-19 12:29:01 +0200
---
 xen/common/cpupool.c       |   56 +++++++++++++++++++++++++++++++++++--------
 xen/include/xen/sched-if.h |    1 +
 2 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c
index c036c2c..637f56c 100644
--- a/xen/common/cpupool.c
+++ b/xen/common/cpupool.c
@@ -41,16 +41,28 @@ static struct cpupool *alloc_cpupool_struct(void)
 {
     struct cpupool *c = xzalloc(struct cpupool);
 
-    if ( c && zalloc_cpumask_var(&c->cpu_valid) )
-        return c;
-    xfree(c);
-    return NULL;
+    if ( !c || !zalloc_cpumask_var(&c->cpu_valid) )
+    {
+        xfree(c);
+        c = NULL;
+    }
+    else if ( !zalloc_cpumask_var(&c->cpu_suspended) )
+    {
+        free_cpumask_var(c->cpu_valid);
+        xfree(c);
+        c = NULL;
+    }
+
+    return c;
 }
 
 static void free_cpupool_struct(struct cpupool *c)
 {
     if ( c )
+    {
+        free_cpumask_var(c->cpu_suspended);
         free_cpumask_var(c->cpu_valid);
+    }
     xfree(c);
 }
 
@@ -417,14 +429,32 @@ void cpupool_rm_domain(struct domain *d)
 
 /*
  * called to add a new cpu to pool admin
- * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0
+ * we add a hotplugged cpu to the cpupool0 to be able to add it to dom0,
+ * unless we are resuming from S3, in which case we put the cpu back
+ * in the cpupool it was in prior to suspend.
  */
 static void cpupool_cpu_add(unsigned int cpu)
 {
     spin_lock(&cpupool_lock);
     cpumask_clear_cpu(cpu, &cpupool_locked_cpus);
     cpumask_set_cpu(cpu, &cpupool_free_cpus);
-    cpupool_assign_cpu_locked(cpupool0, cpu);
+
+    if ( system_state == SYS_STATE_resume )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+        {
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_suspended ) )
+            {
+                cpupool_assign_cpu_locked(*c, cpu);
+                cpumask_clear_cpu(cpu, (*c)->cpu_suspended);
+            }
+        }
+    }
+
+    if ( cpumask_test_cpu(cpu, &cpupool_free_cpus) )
+        cpupool_assign_cpu_locked(cpupool0, cpu);
     spin_unlock(&cpupool_lock);
 }
 
@@ -436,7 +466,7 @@ static void cpupool_cpu_add(unsigned int cpu)
 static int cpupool_cpu_remove(unsigned int cpu)
 {
     int ret = 0;
-	
+
     spin_lock(&cpupool_lock);
     if ( !cpumask_test_cpu(cpu, cpupool0->cpu_valid))
         ret = -EBUSY;
@@ -633,9 +663,14 @@ static int cpu_callback(
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
-    if ( (system_state == SYS_STATE_suspend) ||
-         (system_state == SYS_STATE_resume) )
-        goto out;
+    if ( system_state == SYS_STATE_suspend )
+    {
+        struct cpupool **c;
+
+        for_each_cpupool(c)
+            if ( cpumask_test_cpu(cpu, (*c)->cpu_valid ) )
+                cpumask_set_cpu(cpu, (*c)->cpu_suspended);
+    }
 
     switch ( action )
     {
@@ -650,7 +685,6 @@ static int cpu_callback(
         break;
     }
 
-out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index bd6186a..c3be9dc 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -199,6 +199,7 @@ struct cpupool
 {
     int              cpupool_id;
     cpumask_var_t    cpu_valid;      /* all cpus assigned to pool */
+    cpumask_var_t    cpu_suspended;  /* cpus in S3 that should be in this pool */
     struct cpupool   *next;
     unsigned int     n_dom;
     struct scheduler *sched;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 03:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 03:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UX1et-0008FG-Gf; Tue, 30 Apr 2013 03:55:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX1es-0008FB-BQ
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 03:55:14 +0000
Received: from [85.158.138.51:6153] by server-10.bemta-3.messagelabs.com id
	D1/56-19664-1A04F715; Tue, 30 Apr 2013 03:55:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1367294104!20735141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32018 invoked from network); 30 Apr 2013 03:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 03:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX1ei-0002qs-6R
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 03:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX1eh-0007wY-0H
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 03:55:03 +0000
Date: Tue, 30 Apr 2013 03:55:03 +0000
Message-Id: <E1UX1eh-0007wY-0H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: move per-vendor function
	tables into .init.data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0352856935590a6b740306f2559fe204908472c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 15:46:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 15:46:15 2013 +0200

    x86/HVM: move per-vendor function tables into .init.data
    
    hvm_enable() copies the table contents rather than storing the pointer,
    so there's no need to keep these tables post-boot.
    
    Also constify the return values of the per-vendor initialization
    functions, making clear that once the per-vendor initialization is
    complete, the vendor specific tables won't get modified anymore.
    
    Finally, in hvm_enable(), use the returned pointer for all read
    accesses as being more efficient than global variable accesses. Writes
    of course still need to go to the global variable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |   10 +++++-----
 xen/arch/x86/hvm/svm/svm.c    |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c    |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |    4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8522963..c8487b8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -113,7 +113,7 @@ static struct notifier_block cpu_nfb = {
 
 static int __init hvm_enable(void)
 {
-    struct hvm_function_table *fns = NULL;
+    const struct hvm_function_table *fns = NULL;
 
     if ( cpu_has_vmx )
         fns = start_vmx();
@@ -126,8 +126,8 @@ static int __init hvm_enable(void)
     hvm_funcs = *fns;
     hvm_enabled = 1;
 
-    printk("HVM: %s enabled\n", hvm_funcs.name);
-    if ( !hvm_funcs.hap_supported )
+    printk("HVM: %s enabled\n", fns->name);
+    if ( !fns->hap_supported )
         printk("HVM: Hardware Assisted Paging (HAP) not detected\n");
     else if ( !opt_hap_enabled )
     {
@@ -138,9 +138,9 @@ static int __init hvm_enable(void)
     {
         printk("HVM: Hardware Assisted Paging (HAP) detected\n");
         printk("HVM: HAP page sizes: 4kB");
-        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+        if ( fns->hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
             printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
-        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+        if ( fns->hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
             printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
         printk("\n");
     }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8123f37..bc1fe62 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1233,7 +1233,7 @@ static int svm_cpu_up(void)
     return 0;
 }
 
-struct hvm_function_table * __init start_svm(void)
+const struct hvm_function_table * __init start_svm(void)
 {
     bool_t printed = 0;
 
@@ -1958,7 +1958,7 @@ static void svm_invlpg_intercept(unsigned long vaddr)
     svm_asid_g_invlpg(curr, vaddr);
 }
 
-static struct hvm_function_table __read_mostly svm_function_table = {
+static struct hvm_function_table __initdata svm_function_table = {
     .name                 = "SVM",
     .cpu_up_prepare       = svm_cpu_up_prepare,
     .cpu_dead             = svm_cpu_dead,
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 6866cd0..51187a9 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1502,7 +1502,7 @@ static void vmx_sync_pir_to_irr(struct vcpu *v)
         vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
 }
 
-static struct hvm_function_table __read_mostly vmx_function_table = {
+static struct hvm_function_table __initdata vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
     .cpu_dead             = vmx_cpu_dead,
@@ -1557,7 +1557,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
 };
 
-struct hvm_function_table * __init start_vmx(void)
+const struct hvm_function_table * __init start_vmx(void)
 {
     set_in_cr4(X86_CR4_VMXE);
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 85dc85b..8408420 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -199,8 +199,8 @@ extern bool_t hvm_enabled;
 extern bool_t cpu_has_lmsl;
 extern s8 hvm_port80_allowed;
 
-extern struct hvm_function_table *start_svm(void);
-extern struct hvm_function_table *start_vmx(void);
+extern const struct hvm_function_table *start_svm(void);
+extern const struct hvm_function_table *start_vmx(void);
 
 int hvm_domain_initialise(struct domain *d);
 void hvm_domain_relinquish_resources(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 03:55:22 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 03:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UX1et-0008FG-Gf; Tue, 30 Apr 2013 03:55:15 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX1es-0008FB-BQ
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 03:55:14 +0000
Received: from [85.158.138.51:6153] by server-10.bemta-3.messagelabs.com id
	D1/56-19664-1A04F715; Tue, 30 Apr 2013 03:55:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-174.messagelabs.com!1367294104!20735141!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32018 invoked from network); 30 Apr 2013 03:55:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 03:55:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX1ei-0002qs-6R
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 03:55:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX1eh-0007wY-0H
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 03:55:03 +0000
Date: Tue, 30 Apr 2013 03:55:03 +0000
Message-Id: <E1UX1eh-0007wY-0H@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: move per-vendor function
	tables into .init.data
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0352856935590a6b740306f2559fe204908472c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 15:46:15 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 15:46:15 2013 +0200

    x86/HVM: move per-vendor function tables into .init.data
    
    hvm_enable() copies the table contents rather than storing the pointer,
    so there's no need to keep these tables post-boot.
    
    Also constify the return values of the per-vendor initialization
    functions, making clear that once the per-vendor initialization is
    complete, the vendor specific tables won't get modified anymore.
    
    Finally, in hvm_enable(), use the returned pointer for all read
    accesses as being more efficient than global variable accesses. Writes
    of course still need to go to the global variable.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c        |   10 +++++-----
 xen/arch/x86/hvm/svm/svm.c    |    4 ++--
 xen/arch/x86/hvm/vmx/vmx.c    |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |    4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 8522963..c8487b8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -113,7 +113,7 @@ static struct notifier_block cpu_nfb = {
 
 static int __init hvm_enable(void)
 {
-    struct hvm_function_table *fns = NULL;
+    const struct hvm_function_table *fns = NULL;
 
     if ( cpu_has_vmx )
         fns = start_vmx();
@@ -126,8 +126,8 @@ static int __init hvm_enable(void)
     hvm_funcs = *fns;
     hvm_enabled = 1;
 
-    printk("HVM: %s enabled\n", hvm_funcs.name);
-    if ( !hvm_funcs.hap_supported )
+    printk("HVM: %s enabled\n", fns->name);
+    if ( !fns->hap_supported )
         printk("HVM: Hardware Assisted Paging (HAP) not detected\n");
     else if ( !opt_hap_enabled )
     {
@@ -138,9 +138,9 @@ static int __init hvm_enable(void)
     {
         printk("HVM: Hardware Assisted Paging (HAP) detected\n");
         printk("HVM: HAP page sizes: 4kB");
-        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+        if ( fns->hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
             printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
-        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+        if ( fns->hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
             printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
         printk("\n");
     }
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 8123f37..bc1fe62 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1233,7 +1233,7 @@ static int svm_cpu_up(void)
     return 0;
 }
 
-struct hvm_function_table * __init start_svm(void)
+const struct hvm_function_table * __init start_svm(void)
 {
     bool_t printed = 0;
 
@@ -1958,7 +1958,7 @@ static void svm_invlpg_intercept(unsigned long vaddr)
     svm_asid_g_invlpg(curr, vaddr);
 }
 
-static struct hvm_function_table __read_mostly svm_function_table = {
+static struct hvm_function_table __initdata svm_function_table = {
     .name                 = "SVM",
     .cpu_up_prepare       = svm_cpu_up_prepare,
     .cpu_dead             = svm_cpu_dead,
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 6866cd0..51187a9 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1502,7 +1502,7 @@ static void vmx_sync_pir_to_irr(struct vcpu *v)
         vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
 }
 
-static struct hvm_function_table __read_mostly vmx_function_table = {
+static struct hvm_function_table __initdata vmx_function_table = {
     .name                 = "VMX",
     .cpu_up_prepare       = vmx_cpu_up_prepare,
     .cpu_dead             = vmx_cpu_dead,
@@ -1557,7 +1557,7 @@ static struct hvm_function_table __read_mostly vmx_function_table = {
     .nhvm_hap_walk_L1_p2m = nvmx_hap_walk_L1_p2m,
 };
 
-struct hvm_function_table * __init start_vmx(void)
+const struct hvm_function_table * __init start_vmx(void)
 {
     set_in_cr4(X86_CR4_VMXE);
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 85dc85b..8408420 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -199,8 +199,8 @@ extern bool_t hvm_enabled;
 extern bool_t cpu_has_lmsl;
 extern s8 hvm_port80_allowed;
 
-extern struct hvm_function_table *start_svm(void);
-extern struct hvm_function_table *start_vmx(void);
+extern const struct hvm_function_table *start_svm(void);
+extern const struct hvm_function_table *start_vmx(void);
 
 int hvm_domain_initialise(struct domain *d);
 void hvm_domain_relinquish_resources(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 08:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 08:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UX5eV-0005ML-Ga; Tue, 30 Apr 2013 08:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX5eU-0005MD-DR
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 08:11:06 +0000
Received: from [85.158.143.99:37010] by server-1.bemta-4.messagelabs.com id
	DA/CE-06122-99C7F715; Tue, 30 Apr 2013 08:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1367309463!23882409!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11055 invoked from network); 30 Apr 2013 08:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 08:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX5eQ-00067u-UI
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 08:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX5eQ-0005nf-PG
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 08:11:02 +0000
Date: Tue, 30 Apr 2013 08:11:02 +0000
Message-Id: <E1UX5eQ-0005nf-PG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] update Xen version to 4.1.6-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 438c2064e3403b5d392db34f447f94c702d28f19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 16:10:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 16:10:28 2013 +0200

    update Xen version to 4.1.6-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index a37c9f6..2acb3a0 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .5$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .6-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 08:11:16 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 08:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UX5eV-0005ML-Ga; Tue, 30 Apr 2013 08:11:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX5eU-0005MD-DR
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 08:11:06 +0000
Received: from [85.158.143.99:37010] by server-1.bemta-4.messagelabs.com id
	DA/CE-06122-99C7F715; Tue, 30 Apr 2013 08:11:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-216.messagelabs.com!1367309463!23882409!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11055 invoked from network); 30 Apr 2013 08:11:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 08:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX5eQ-00067u-UI
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 08:11:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UX5eQ-0005nf-PG
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 08:11:02 +0000
Date: Tue, 30 Apr 2013 08:11:02 +0000
Message-Id: <E1UX5eQ-0005nf-PG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] update Xen version to 4.1.6-pre
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 438c2064e3403b5d392db34f447f94c702d28f19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Apr 29 16:10:28 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Apr 29 16:10:28 2013 +0200

    update Xen version to 4.1.6-pre
---
 xen/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index a37c9f6..2acb3a0 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 1
-export XEN_EXTRAVERSION ?= .5$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .6-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 14:44:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXBmu-0001F3-Fm; Tue, 30 Apr 2013 14:44:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBmt-0001El-Ab
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:11 +0000
Received: from [85.158.143.99:22450] by server-2.bemta-4.messagelabs.com id
	98/F7-27124-AB8DF715; Tue, 30 Apr 2013 14:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1367333045!30015164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19802 invoked from network); 30 Apr 2013 14:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 14:44:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBmm-0001yH-GM
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBml-0006rG-Kb
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:03 +0000
Message-Id: <E1UXBml-0006rG-Kb@xenbits.xen.org>
Date: Tue, 30 Apr 2013 14:44:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: reduce gso_max_size to
	account for max TCP header
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1367332425 -7200
# Node ID 5e80033562fa444531ba87e51c7d8cc45c93715b
# Parent  03152e80954136f7eb4ea37c7dc358024a45888f
netfront: reduce gso_max_size to account for max TCP header

The maximum packet including header that can be handled by netfront / netback
wire format is 65535. Reduce gso_max_size accordingly.

Drop skb and print warning when skb->len > 65535. This can 1) save the effort
to send malformed packet to netback, 2) help spotting misconfiguration of
netfront in the future.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 03152e809541 -r 5e80033562fa drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Tue Apr 30 16:30:31 2013 +0200
+++ b/drivers/xen/netfront/netfront.c	Tue Apr 30 16:33:45 2013 +0200
@@ -52,6 +52,7 @@
 #include <net/pkt_sched.h>
 #include <net/arp.h>
 #include <net/route.h>
+#include <net/tcp.h>
 #include <asm/uaccess.h>
 #include <xen/evtchn.h>
 #include <xen/xenbus.h>
@@ -960,6 +961,16 @@ static int network_start_xmit(struct sk_
  		return 0; 
  	} 
 
+	/*
+	 * If skb->len is too big for wire format, drop skb and alert
+	 * user about misconfiguration.
+	 */
+	if (unlikely(skb->len > XEN_NETIF_MAX_TX_SIZE)) {
+		printk(KERN_ALERT "xennet: length %u too big for interface\n",
+		       skb->len);
+		goto drop;
+	}
+
 	frags += (offset + len + PAGE_SIZE - 1) / PAGE_SIZE;
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
 		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
@@ -1709,7 +1720,8 @@ static int xennet_set_mac_address(struct
 
 static int xennet_change_mtu(struct net_device *dev, int mtu)
 {
-	int max = xennet_can_sg(dev) ? 65535 - ETH_HLEN : ETH_DATA_LEN;
+	int max = xennet_can_sg(dev) ? XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER
+				     : ETH_DATA_LEN;
 
 	if (mtu > max)
 		return -EINVAL;
@@ -2111,6 +2123,10 @@ static struct net_device * __devinit cre
 	SET_MODULE_OWNER(netdev);
 	SET_NETDEV_DEV(netdev, &dev->dev);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+	netif_set_gso_max_size(netdev, XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER);
+#endif
+
 	np->netdev = netdev;
 
 	netfront_carrier_off(np);
diff -r 03152e809541 -r 5e80033562fa include/xen/interface/io/netif.h
--- a/include/xen/interface/io/netif.h	Tue Apr 30 16:30:31 2013 +0200
+++ b/include/xen/interface/io/netif.h	Tue Apr 30 16:33:45 2013 +0200
@@ -71,6 +71,7 @@ struct netif_tx_request {
     uint16_t flags;        /* NETTXF_* */
     uint16_t id;           /* Echoed in response message. */
     uint16_t size;         /* Packet size in bytes.       */
+#define XEN_NETIF_MAX_TX_SIZE 0xFFFF
 };
 typedef struct netif_tx_request netif_tx_request_t;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 14:44:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXBmu-0001F3-Fm; Tue, 30 Apr 2013 14:44:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBmt-0001El-Ab
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:11 +0000
Received: from [85.158.143.99:22450] by server-2.bemta-4.messagelabs.com id
	98/F7-27124-AB8DF715; Tue, 30 Apr 2013 14:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1367333045!30015164!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19802 invoked from network); 30 Apr 2013 14:44:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 14:44:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBmm-0001yH-GM
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBml-0006rG-Kb
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:03 +0000
Message-Id: <E1UXBml-0006rG-Kb@xenbits.xen.org>
Date: Tue, 30 Apr 2013 14:44:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront: reduce gso_max_size to
	account for max TCP header
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Wei Liu <wei.liu2@citrix.com>
# Date 1367332425 -7200
# Node ID 5e80033562fa444531ba87e51c7d8cc45c93715b
# Parent  03152e80954136f7eb4ea37c7dc358024a45888f
netfront: reduce gso_max_size to account for max TCP header

The maximum packet including header that can be handled by netfront / netback
wire format is 65535. Reduce gso_max_size accordingly.

Drop skb and print warning when skb->len > 65535. This can 1) save the effort
to send malformed packet to netback, 2) help spotting misconfiguration of
netfront in the future.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 03152e809541 -r 5e80033562fa drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Tue Apr 30 16:30:31 2013 +0200
+++ b/drivers/xen/netfront/netfront.c	Tue Apr 30 16:33:45 2013 +0200
@@ -52,6 +52,7 @@
 #include <net/pkt_sched.h>
 #include <net/arp.h>
 #include <net/route.h>
+#include <net/tcp.h>
 #include <asm/uaccess.h>
 #include <xen/evtchn.h>
 #include <xen/xenbus.h>
@@ -960,6 +961,16 @@ static int network_start_xmit(struct sk_
  		return 0; 
  	} 
 
+	/*
+	 * If skb->len is too big for wire format, drop skb and alert
+	 * user about misconfiguration.
+	 */
+	if (unlikely(skb->len > XEN_NETIF_MAX_TX_SIZE)) {
+		printk(KERN_ALERT "xennet: length %u too big for interface\n",
+		       skb->len);
+		goto drop;
+	}
+
 	frags += (offset + len + PAGE_SIZE - 1) / PAGE_SIZE;
 	if (unlikely(frags > MAX_SKB_FRAGS + 1)) {
 		printk(KERN_ALERT "xennet: skb rides the rocket: %d frags\n",
@@ -1709,7 +1720,8 @@ static int xennet_set_mac_address(struct
 
 static int xennet_change_mtu(struct net_device *dev, int mtu)
 {
-	int max = xennet_can_sg(dev) ? 65535 - ETH_HLEN : ETH_DATA_LEN;
+	int max = xennet_can_sg(dev) ? XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER
+				     : ETH_DATA_LEN;
 
 	if (mtu > max)
 		return -EINVAL;
@@ -2111,6 +2123,10 @@ static struct net_device * __devinit cre
 	SET_MODULE_OWNER(netdev);
 	SET_NETDEV_DEV(netdev, &dev->dev);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
+	netif_set_gso_max_size(netdev, XEN_NETIF_MAX_TX_SIZE - MAX_TCP_HEADER);
+#endif
+
 	np->netdev = netdev;
 
 	netfront_carrier_off(np);
diff -r 03152e809541 -r 5e80033562fa include/xen/interface/io/netif.h
--- a/include/xen/interface/io/netif.h	Tue Apr 30 16:30:31 2013 +0200
+++ b/include/xen/interface/io/netif.h	Tue Apr 30 16:33:45 2013 +0200
@@ -71,6 +71,7 @@ struct netif_tx_request {
     uint16_t flags;        /* NETTXF_* */
     uint16_t id;           /* Echoed in response message. */
     uint16_t size;         /* Packet size in bytes.       */
+#define XEN_NETIF_MAX_TX_SIZE 0xFFFF
 };
 typedef struct netif_tx_request netif_tx_request_t;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 14:44:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXBmu-0001Ey-DR; Tue, 30 Apr 2013 14:44:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBms-0001El-S3
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:11 +0000
Received: from [85.158.143.99:22363] by server-2.bemta-4.messagelabs.com id
	55/F7-27124-AB8DF715; Tue, 30 Apr 2013 14:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1367333044!30275353!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6431 invoked from network); 30 Apr 2013 14:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 14:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBmm-0001yE-6J
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBml-0006r2-48
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:03 +0000
Message-Id: <E1UXBml-0006r2-48@xenbits.xen.org>
Date: Tue, 30 Apr 2013 14:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] netback: don't disconnect
	frontend when seeing oversize packet
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1367332231 -7200
# Node ID 03152e80954136f7eb4ea37c7dc358024a45888f
# Parent  874725c5afa10717a5307f5f1c6bdc4baa655c9d
netback: don't disconnect frontend when seeing oversize packet

Some frontend drivers are sending packets > 64 KiB in length. This length
overflows the length field in the first slot making the following slots have
an invalid length.

Turn this error back into a non-fatal error by dropping the packet. To avoid
having the following slots having fatal errors, consume all slots in the
packet.

This does not reopen the security hole in XSA-39 as if the packet as an
invalid number of slots it will still hit fatal error case.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 874725c5afa1 -r 03152e809541 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c	Mon Apr 15 10:37:23 2013 +0200
+++ b/drivers/xen/netback/netback.c	Tue Apr 30 16:30:31 2013 +0200
@@ -1034,7 +1034,7 @@ static int netbk_count_requests(netif_t 
 				netif_tx_request_t *txp, int work_to_do)
 {
 	RING_IDX cons = netif->tx.req_cons;
-	int frags = 0;
+	int frags = 0, drop_err = 0;
 
 	if (!(first->flags & NETTXF_more_data))
 		return 0;
@@ -1056,11 +1056,22 @@ static int netbk_count_requests(netif_t 
 
 		memcpy(txp, RING_GET_REQUEST(&netif->tx, cons + frags),
 		       sizeof(*txp));
-		if (txp->size > first->size) {
-			printk(KERN_ERR "%s: Frag is bigger than frame.\n",
-			       netif->dev->name);
-			netbk_fatal_tx_err(netif);
-			return -EIO;
+
+		/*
+		 * If the guest submitted a frame >= 64 KiB then first->size
+		 * overflowed and following slots will appear to be larger
+		 * than the frame. This cannot be fatal error as there are
+		 * buggy frontends that do this.
+		 *
+		 * Consume all slots and drop the packet.
+		 */
+		if (!drop_err && txp->size > first->size) {
+			if (net_ratelimit())
+				DPRINTK("%s: Invalid tx request"
+					" (slot size %u > remaining size %u)\n",
+					netif->dev->name,
+					txp->size, first->size);
+			drop_err = -EIO;
 		}
 
 		first->size -= txp->size;
@@ -1074,6 +1085,11 @@ static int netbk_count_requests(netif_t 
 		}
 	} while ((txp++)->flags & NETTXF_more_data);
 
+	if (drop_err) {
+		netbk_tx_err(netif, first, cons + frags);
+		return drop_err;
+	}
+
 	return frags;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 14:44:19 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 14:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXBmu-0001Ey-DR; Tue, 30 Apr 2013 14:44:12 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBms-0001El-S3
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:11 +0000
Received: from [85.158.143.99:22363] by server-2.bemta-4.messagelabs.com id
	55/F7-27124-AB8DF715; Tue, 30 Apr 2013 14:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1367333044!30275353!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6431 invoked from network); 30 Apr 2013 14:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 14:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBmm-0001yE-6J
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1UXBml-0006r2-48
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 14:44:03 +0000
Message-Id: <E1UXBml-0006r2-48@xenbits.xen.org>
Date: Tue, 30 Apr 2013 14:44:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] netback: don't disconnect
	frontend when seeing oversize packet
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User David Vrabel <david.vrabel@citrix.com>
# Date 1367332231 -7200
# Node ID 03152e80954136f7eb4ea37c7dc358024a45888f
# Parent  874725c5afa10717a5307f5f1c6bdc4baa655c9d
netback: don't disconnect frontend when seeing oversize packet

Some frontend drivers are sending packets > 64 KiB in length. This length
overflows the length field in the first slot making the following slots have
an invalid length.

Turn this error back into a non-fatal error by dropping the packet. To avoid
having the following slots having fatal errors, consume all slots in the
packet.

This does not reopen the security hole in XSA-39 as if the packet as an
invalid number of slots it will still hit fatal error case.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 874725c5afa1 -r 03152e809541 drivers/xen/netback/netback.c
--- a/drivers/xen/netback/netback.c	Mon Apr 15 10:37:23 2013 +0200
+++ b/drivers/xen/netback/netback.c	Tue Apr 30 16:30:31 2013 +0200
@@ -1034,7 +1034,7 @@ static int netbk_count_requests(netif_t 
 				netif_tx_request_t *txp, int work_to_do)
 {
 	RING_IDX cons = netif->tx.req_cons;
-	int frags = 0;
+	int frags = 0, drop_err = 0;
 
 	if (!(first->flags & NETTXF_more_data))
 		return 0;
@@ -1056,11 +1056,22 @@ static int netbk_count_requests(netif_t 
 
 		memcpy(txp, RING_GET_REQUEST(&netif->tx, cons + frags),
 		       sizeof(*txp));
-		if (txp->size > first->size) {
-			printk(KERN_ERR "%s: Frag is bigger than frame.\n",
-			       netif->dev->name);
-			netbk_fatal_tx_err(netif);
-			return -EIO;
+
+		/*
+		 * If the guest submitted a frame >= 64 KiB then first->size
+		 * overflowed and following slots will appear to be larger
+		 * than the frame. This cannot be fatal error as there are
+		 * buggy frontends that do this.
+		 *
+		 * Consume all slots and drop the packet.
+		 */
+		if (!drop_err && txp->size > first->size) {
+			if (net_ratelimit())
+				DPRINTK("%s: Invalid tx request"
+					" (slot size %u > remaining size %u)\n",
+					netif->dev->name,
+					txp->size, first->size);
+			drop_err = -EIO;
 		}
 
 		first->size -= txp->size;
@@ -1074,6 +1085,11 @@ static int netbk_count_requests(netif_t 
 		}
 	} while ((txp++)->flags & NETTXF_more_data);
 
+	if (drop_err) {
+		netbk_tx_err(netif, first, cons + frags);
+		return drop_err;
+	}
+
 	return frags;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 18:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 18:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXFBm-0006oF-28; Tue, 30 Apr 2013 18:22:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXFBl-0006o8-Ct
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 18:22:05 +0000
Received: from [85.158.138.51:56204] by server-2.bemta-3.messagelabs.com id
	FD/50-05208-CCB00815; Tue, 30 Apr 2013 18:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1367346123!30499681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27781 invoked from network); 30 Apr 2013 18:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 18:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXFBi-0004q3-SP
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 18:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXFBi-0003We-Mg
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 18:22:02 +0000
Date: Tue, 30 Apr 2013 18:22:02 +0000
Message-Id: <E1UXFBi-0003We-Mg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/EFI: fix runtime call status
	for compat mode Dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3432d58eaad518612a30cfcd0a6f15447ca87c00
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 30 11:05:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 30 11:05:51 2013 +0200

    x86/EFI: fix runtime call status for compat mode Dom0
    
    The top two bits (indicating error/warning classification) need to
    remain the top two bits.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: a7ac9597a7fc6ca934957eb78b41e26638281953
    master date: 2013-04-29 11:27:54 +0200
---
 xen/arch/x86/efi/runtime.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index 9fbf5b7..b8847dd 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -477,7 +477,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 #ifndef COMPAT
     op->status = status;
 #else
-    op->status = (status & 0x3fffffff) | (status >> 62);
+    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
 #endif
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Tue Apr 30 18:22:14 2013
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 30 Apr 2013 18:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1UXFBm-0006oF-28; Tue, 30 Apr 2013 18:22:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXFBl-0006o8-Ct
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 18:22:05 +0000
Received: from [85.158.138.51:56204] by server-2.bemta-3.messagelabs.com id
	FD/50-05208-CCB00815; Tue, 30 Apr 2013 18:22:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-174.messagelabs.com!1367346123!30499681!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.8.6.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27781 invoked from network); 30 Apr 2013 18:22:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Apr 2013 18:22:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXFBi-0004q3-SP
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 18:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1UXFBi-0003We-Mg
	for xen-changelog@lists.xensource.com; Tue, 30 Apr 2013 18:22:02 +0000
Date: Tue, 30 Apr 2013 18:22:02 +0000
Message-Id: <E1UXFBi-0003We-Mg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/EFI: fix runtime call status
	for compat mode Dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3432d58eaad518612a30cfcd0a6f15447ca87c00
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Apr 30 11:05:51 2013 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Apr 30 11:05:51 2013 +0200

    x86/EFI: fix runtime call status for compat mode Dom0
    
    The top two bits (indicating error/warning classification) need to
    remain the top two bits.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: a7ac9597a7fc6ca934957eb78b41e26638281953
    master date: 2013-04-29 11:27:54 +0200
---
 xen/arch/x86/efi/runtime.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index 9fbf5b7..b8847dd 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -477,7 +477,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
 #ifndef COMPAT
     op->status = status;
 #else
-    op->status = (status & 0x3fffffff) | (status >> 62);
+    op->status = (status & 0x3fffffff) | ((status >> 32) & 0xc0000000);
 #endif
 
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

