WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] merge with linux-2.6.18-xen.hg

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] merge with linux-2.6.18-xen.hg
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 May 2008 08:30:52 -0700
Delivery-date: Tue, 20 May 2008 08:32:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1210836376 -32400
# Node ID 2d858799d109f2225882257c029c84ae10538972
# Parent  e5933404dadad1fb144b8cc29caad044cc54a491
# Parent  d59a4aaf8615aea0ff42349f0d0367be641c36b0
merge with linux-2.6.18-xen.hg
---
 arch/i386/kernel/acpi/processor_extcntl_xen.c   |   95 +++++++++++++++++++-
 drivers/acpi/dispatcher/dsobject.c              |   91 ++++++++++++++++++-
 drivers/acpi/processor_extcntl.c                |  113 +++++++++++++++++++++++-
 drivers/acpi/processor_perflib.c                |    8 +
 drivers/pci/msi-xen.c                           |   22 +---
 drivers/xen/blkback/blkback.c                   |    3 
 drivers/xen/blktap/blktap.c                     |    3 
 drivers/xen/pciback/conf_space_capability_msi.c |    5 -
 include/acpi/processor.h                        |    2 
 include/xen/blkif.h                             |   10 +-
 include/xen/interface/hvm/hvm_op.h              |    5 +
 include/xen/interface/io/pciif.h                |   14 ++
 include/xen/interface/platform.h                |   51 ++++++++++
 13 files changed, 391 insertions(+), 31 deletions(-)

diff -r e5933404dada -r 2d858799d109 
arch/i386/kernel/acpi/processor_extcntl_xen.c
--- a/arch/i386/kernel/acpi/processor_extcntl_xen.c     Tue May 13 10:42:09 
2008 +0900
+++ b/arch/i386/kernel/acpi/processor_extcntl_xen.c     Thu May 15 16:26:16 
2008 +0900
@@ -28,6 +28,7 @@
 #include <linux/pm.h>
 #include <linux/cpu.h>
 
+#include <linux/cpufreq.h>
 #include <acpi/processor.h>
 #include <asm/hypercall.h>
 
@@ -110,9 +111,101 @@ static int xen_cx_notifier(struct acpi_p
        return ret;
 }
 
+static void convert_pct_reg(struct xen_pct_register *xpct,
+       struct acpi_pct_register *apct)
+{
+       xpct->descriptor = apct->descriptor;
+       xpct->length     = apct->length;
+       xpct->space_id   = apct->space_id;
+       xpct->bit_width  = apct->bit_width;
+       xpct->bit_offset = apct->bit_offset;
+       xpct->reserved   = apct->reserved;
+       xpct->address    = apct->address;
+}
+
+static void convert_pss_states(struct xen_processor_px *xpss, 
+       struct acpi_processor_px *apss, int state_count)
+{
+       int i;
+       for(i=0; i<state_count; i++) {
+               xpss->core_frequency     = apss->core_frequency;
+               xpss->power              = apss->power;
+               xpss->transition_latency = apss->transition_latency;
+               xpss->bus_master_latency = apss->bus_master_latency;
+               xpss->control            = apss->control;
+               xpss->status             = apss->status;
+               xpss++;
+               apss++;
+       }
+}
+
+static void convert_psd_pack(struct xen_psd_package *xpsd,
+       struct acpi_psd_package *apsd)
+{
+       xpsd->num_entries    = apsd->num_entries;
+       xpsd->revision       = apsd->revision;
+       xpsd->domain         = apsd->domain;
+       xpsd->coord_type     = apsd->coord_type;
+       xpsd->num_processors = apsd->num_processors;
+}
+
 static int xen_px_notifier(struct acpi_processor *pr, int action)
 {
-       return -EINVAL;
+       int ret;
+       xen_platform_op_t op = {
+               .cmd                    = XENPF_set_processor_pminfo,
+               .interface_version      = XENPF_INTERFACE_VERSION,
+               .u.set_pminfo.id        = pr->acpi_id,
+               .u.set_pminfo.type      = XEN_PM_PX,
+       };
+       struct xen_processor_performance *perf;
+       struct xen_processor_px *states = NULL;
+       struct acpi_processor_performance *px;
+       struct acpi_psd_package *pdomain;
+
+       /* leave dynamic ppc handle in the future */
+       if (action == PROCESSOR_PM_CHANGE)
+               return 0;
+
+       perf = &op.u.set_pminfo.perf;
+       px = pr->performance;
+
+       perf->flags = XEN_PX_PPC | 
+                     XEN_PX_PCT | 
+                     XEN_PX_PSS | 
+                     XEN_PX_PSD;
+
+       /* ppc */
+       perf->ppc = pr->performance_platform_limit;
+
+       /* pct */
+       convert_pct_reg(&perf->control_register, &px->control_register);
+       convert_pct_reg(&perf->status_register, &px->status_register);
+
+       /* pss */
+       perf->state_count = px->state_count;
+       states = kzalloc(px->state_count*sizeof(xen_processor_px_t),GFP_KERNEL);
+       if (!states)
+               return -ENOMEM;
+       convert_pss_states(states, px->states, px->state_count);
+       set_xen_guest_handle(perf->states, states);
+
+       /* psd */
+       pdomain = &px->domain_info;
+       convert_psd_pack(&perf->domain_info, pdomain);
+       if (perf->domain_info.num_processors) {
+               if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL)
+                       perf->shared_type = CPUFREQ_SHARED_TYPE_ALL;
+               else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
+                       perf->shared_type = CPUFREQ_SHARED_TYPE_ANY;
+               else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL)
+                       perf->shared_type = CPUFREQ_SHARED_TYPE_HW;
+       } else
+               perf->shared_type = CPUFREQ_SHARED_TYPE_NONE;
+
+       ret = HYPERVISOR_platform_op(&op);
+       kfree(states);
+       return ret;
 }
 
 static int xen_tx_notifier(struct acpi_processor *pr, int action)
diff -r e5933404dada -r 2d858799d109 drivers/acpi/dispatcher/dsobject.c
--- a/drivers/acpi/dispatcher/dsobject.c        Tue May 13 10:42:09 2008 +0900
+++ b/drivers/acpi/dispatcher/dsobject.c        Thu May 15 16:26:16 2008 +0900
@@ -137,6 +137,71 @@ acpi_ds_build_internal_object(struct acp
                                return_ACPI_STATUS(status);
                        }
                }
+
+               /* Special object resolution for elements of a package */
+
+               if ((op->common.parent->common.aml_opcode == AML_PACKAGE_OP) ||
+                   (op->common.parent->common.aml_opcode ==
+                    AML_VAR_PACKAGE_OP)) {
+                       /*
+                        * Attempt to resolve the node to a value before we 
insert it into
+                        * the package. If this is a reference to a common data 
type,
+                        * resolve it immediately. According to the ACPI spec, 
package
+                        * elements can only be "data objects" or method 
references.
+                        * Attempt to resolve to an Integer, Buffer, String or 
Package.
+                        * If cannot, return the named reference (for things 
like Devices,
+                        * Methods, etc.) Buffer Fields and Fields will resolve 
to simple
+                        * objects (int/buf/str/pkg).
+                        *
+                        * NOTE: References to things like Devices, Methods, 
Mutexes, etc.
+                        * will remain as named references. This behavior is 
not described
+                        * in the ACPI spec, but it appears to be an oversight.
+                        */
+                       obj_desc = (union acpi_operand_object *)op->common.node;
+
+                       status =
+                           acpi_ex_resolve_node_to_value(ACPI_CAST_INDIRECT_PTR
+                                                         (struct
+                                                          acpi_namespace_node,
+                                                          &obj_desc),
+                                                         walk_state);
+                       if (ACPI_FAILURE(status)) {
+                               return_ACPI_STATUS(status);
+                       }
+
+                       switch (op->common.node->type) {
+                               /*
+                                * For these types, we need the actual node, 
not the subobject.
+                                * However, the subobject got an extra 
reference count above.
+                                */
+                       case ACPI_TYPE_MUTEX:
+                       case ACPI_TYPE_METHOD:
+                       case ACPI_TYPE_POWER:
+                       case ACPI_TYPE_PROCESSOR:
+                       case ACPI_TYPE_EVENT:
+                       case ACPI_TYPE_REGION:
+                       case ACPI_TYPE_DEVICE:
+                       case ACPI_TYPE_THERMAL:
+
+                               obj_desc =
+                                   (union acpi_operand_object *)op->common.
+                                   node;
+                               break;
+
+                       default:
+                               break;
+                       }
+
+                       /*
+                        * If above resolved to an operand object, we are done. 
Otherwise,
+                        * we have a NS node, we must create the package entry 
as a named
+                        * reference.
+                        */
+                       if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) !=
+                           ACPI_DESC_TYPE_NAMED) {
+                               goto exit;
+                       }
+               }
        }
 
        /* Create and init a new internal ACPI object */
@@ -156,6 +221,7 @@ acpi_ds_build_internal_object(struct acp
                return_ACPI_STATUS(status);
        }
 
+      exit:
        *obj_desc_ptr = obj_desc;
        return_ACPI_STATUS(AE_OK);
 }
@@ -358,12 +424,25 @@ acpi_ds_build_internal_package_obj(struc
        arg = arg->common.next;
        for (i = 0; arg; i++) {
                if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) {
-
-                       /* Object (package or buffer) is already built */
-
-                       obj_desc->package.elements[i] =
-                           ACPI_CAST_PTR(union acpi_operand_object,
-                                         arg->common.node);
+                       if (arg->common.node->type == ACPI_TYPE_METHOD) {
+                               /*
+                                * A method reference "looks" to the parser to 
be a method
+                                * invocation, so we special case it here
+                                */
+                               arg->common.aml_opcode = AML_INT_NAMEPATH_OP;
+                               status =
+                                   acpi_ds_build_internal_object(walk_state,
+                                                                 arg,
+                                                                 &obj_desc->
+                                                                 package.
+                                                                 elements[i]);
+                       } else {
+                               /* This package element is already built, just 
get it */
+
+                               obj_desc->package.elements[i] =
+                                   ACPI_CAST_PTR(union acpi_operand_object,
+                                                 arg->common.node);
+                       }
                } else {
                        status = acpi_ds_build_internal_object(walk_state, arg,
                                                               &obj_desc->
diff -r e5933404dada -r 2d858799d109 drivers/acpi/processor_extcntl.c
--- a/drivers/acpi/processor_extcntl.c  Tue May 13 10:42:09 2008 +0900
+++ b/drivers/acpi/processor_extcntl.c  Thu May 15 16:26:16 2008 +0900
@@ -31,11 +31,49 @@
 #include <acpi/processor.h>
 
 static int processor_extcntl_parse_csd(struct acpi_processor *pr);
+static int processor_extcntl_get_performance(struct acpi_processor *pr);
 /*
  * External processor control logic may register with its own set of
  * ops to get ACPI related notification. One example is like VMM.
  */
 struct processor_extcntl_ops *processor_extcntl_ops;
+
+static int processor_notify_smm(void)
+{
+       acpi_status status;
+       static int is_done = 0;
+
+       /* only need successfully notify BIOS once */
+       /* avoid double notification which may lead to unexpected result */
+       if (is_done)
+               return 0;
+
+       /* Can't write pstate_cnt to smi_cmd if either value is zero */
+       if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,"No SMI port or pstate_cnt\n"));
+               return 0;
+       }
+
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+               "Writing pstate_cnt [0x%x] to smi_cmd [0x%x]\n",
+               acpi_fadt.pstate_cnt, acpi_fadt.smi_cmd));
+
+       /* FADT v1 doesn't support pstate_cnt, many BIOS vendors use
+        * it anyway, so we need to support it... */
+       if (acpi_fadt_is_v1) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                       "Using v1.0 FADT reserved value for pstate_cnt\n"));
+       }
+
+       status = acpi_os_write_port(acpi_fadt.smi_cmd,
+                                   (u32) acpi_fadt.pstate_cnt, 8);
+       if (ACPI_FAILURE(status)) 
+               return status;
+
+       is_done = 1;
+
+       return 0;
+}
 
 int processor_notify_external(struct acpi_processor *pr, int event, int type)
 {
@@ -109,7 +147,12 @@ int processor_extcntl_init(struct acpi_p
 int processor_extcntl_init(struct acpi_processor *pr)
 {
        /* parse cstate dependency information */
-       processor_extcntl_parse_csd(pr);
+       if (processor_pm_external())
+               processor_extcntl_parse_csd(pr);
+
+       /* Initialize performance states */
+       if (processor_pmperf_external())
+               processor_extcntl_get_performance(pr);
 
        return 0;
 }
@@ -135,3 +178,71 @@ static int processor_extcntl_parse_csd(s
 
        return 0;
 }
+
+/*
+ * Existing ACPI module does parse performance states at some point,
+ * when acpi-cpufreq driver is loaded which however is something
+ * we'd like to disable to avoid confliction with external control
+ * logic. So we have to collect raw performance information here 
+ * when ACPI processor object is found and started.
+ */
+#ifdef CONFIG_CPU_FREQ
+static int processor_extcntl_get_performance(struct acpi_processor *pr)
+{
+       int ret;
+       struct acpi_processor_performance *perf;
+       struct acpi_psd_package *pdomain;
+
+       if (pr->performance)
+               return -EBUSY;
+
+       perf = kzalloc(sizeof(struct acpi_processor_performance), GFP_KERNEL);
+       if (!perf)
+               return -ENOMEM;
+
+       pr->performance = perf;
+       /* Get basic performance state information */
+       ret = acpi_processor_get_performance_info(pr);
+       if (ret < 0)
+               goto err_out;
+
+       /*
+        * Well, here we need retrieve performance dependency information
+        * from _PSD object. The reason why existing interface is not used
+        * is due to the reason that existing interface sticks to Linux cpu
+        * id to construct some bitmap, however we want to split ACPI 
+        * processor objects from Linux cpu id logic. For example, even
+        * when Linux is configured as UP, we still want to parse all ACPI
+        * processor objects to external logic. In this case, it's preferred
+        * to use ACPI ID instead.
+        */
+       pr->performance->domain_info.num_processors = 0;
+       ret = acpi_processor_get_psd(pr);
+       if (ret < 0)
+               goto err_out;
+
+       /* Some sanity check */
+       pdomain = &pr->performance->domain_info;
+       if ((pdomain->revision != ACPI_PSD_REV0_REVISION) ||
+           (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) ||
+           ((pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL) &&
+            (pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ANY) &&
+            (pdomain->coord_type != DOMAIN_COORD_TYPE_HW_ALL))) {
+               ret = -EINVAL;
+               goto err_out;
+       }
+
+       /* Last step is to notify BIOS that external logic exists */
+       processor_notify_smm();
+
+       processor_notify_external(pr, PROCESSOR_PM_INIT, PM_TYPE_PERF);
+
+       return 0;
+err_out:
+       pr->performance = NULL;
+       kfree(perf);
+       return ret;
+}
+#else
+static int processor_extcntl_get_performance(struct acpi_processor *pr) { 
return 0; }
+#endif
diff -r e5933404dada -r 2d858799d109 drivers/acpi/processor_perflib.c
--- a/drivers/acpi/processor_perflib.c  Tue May 13 10:42:09 2008 +0900
+++ b/drivers/acpi/processor_perflib.c  Thu May 15 16:26:16 2008 +0900
@@ -304,7 +304,11 @@ static int acpi_processor_get_performanc
        return result;
 }
 
+#ifndef CONFIG_PROCESSOR_EXTERNAL_CONTROL
 static int acpi_processor_get_performance_info(struct acpi_processor *pr)
+#else
+int acpi_processor_get_performance_info(struct acpi_processor *pr)
+#endif
 {
        int result = 0;
        acpi_status status = AE_OK;
@@ -543,7 +547,11 @@ static void acpi_cpufreq_remove_file(str
 }
 #endif                         /* CONFIG_X86_ACPI_CPUFREQ_PROC_INTF */
 
+#ifndef CONFIG_PROCESSOR_EXTERNAL_CONTROL
 static int acpi_processor_get_psd(struct acpi_processor        *pr)
+#else
+int acpi_processor_get_psd(struct acpi_processor *pr)
+#endif
 {
        int result = 0;
        acpi_status status = AE_OK;
diff -r e5933404dada -r 2d858799d109 drivers/pci/msi-xen.c
--- a/drivers/pci/msi-xen.c     Tue May 13 10:42:09 2008 +0900
+++ b/drivers/pci/msi-xen.c     Thu May 15 16:26:16 2008 +0900
@@ -32,7 +32,7 @@ int msi_register(struct msi_ops *ops)
        return 0;
 }
 
-static struct list_head msi_dev_head;
+static LIST_HEAD(msi_dev_head);
 static int msi_dev_head_inited = 0;
 DEFINE_SPINLOCK(msi_dev_lock);
 
@@ -54,11 +54,6 @@ static struct msi_dev_list *get_msi_dev_
        struct msi_dev_list *msi_dev_list, *ret = NULL;
        unsigned long flags;
 
-       if (!msi_dev_head_inited) {
-               INIT_LIST_HEAD(&msi_dev_head);
-               msi_dev_head_inited = 1;
-       }
-
        spin_lock_irqsave(&msi_dev_lock, flags);
 
        list_for_each_entry(msi_dev_list, &msi_dev_head, list)
@@ -79,10 +74,10 @@ static struct msi_dev_list *get_msi_dev_
                return NULL;
        }
 
+       spin_lock_init(&ret->pirq_list_lock);
+       INIT_LIST_HEAD(&ret->pirq_list_head);
        list_add_tail(&ret->list, &msi_dev_head);
        spin_unlock_irqrestore(&msi_dev_lock, flags);
-       spin_lock_init(&ret->pirq_list_lock);
-       INIT_LIST_HEAD(&ret->pirq_list_head);
        return ret;
 }
 
@@ -304,10 +299,9 @@ int pci_save_msix_state(struct pci_dev *
        msi_dev_entry = get_msi_dev_pirq_list(dev);
 
        spin_lock_irqsave(&msi_dev_entry->pirq_list_lock, flags);
-       if (!list_empty_careful(&msi_dev_entry->pirq_list_head))
-               list_for_each_entry_safe(pirq_entry, tmp,
-                                        &msi_dev_entry->pirq_list_head, list)
-                       msi_unmap_pirq(dev, pirq_entry->pirq);
+        list_for_each_entry_safe(pirq_entry, tmp,
+                                 &msi_dev_entry->pirq_list_head, list)
+               msi_unmap_pirq(dev, pirq_entry->pirq);
        spin_unlock_irqrestore(&msi_dev_entry->pirq_list_lock, flags);
 
        disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
@@ -394,7 +388,7 @@ static int msix_capability_init(struct p
                return -ENOMEM;
 
        spin_lock_irqsave(&msi_dev_entry->pirq_list_lock, flags);
-       if (!list_empty_careful(&msi_dev_entry->pirq_list_head))
+       if (!list_empty(&msi_dev_entry->pirq_list_head))
        {
                printk(KERN_WARNING "msix pirqs for dev %02x:%02x:%01x are not 
freed \
                       before acquire again.\n", dev->bus->number, 
PCI_SLOT(dev->devfn),
@@ -677,7 +671,7 @@ void msi_remove_pci_irq_vectors(struct p
        msi_dev_entry = get_msi_dev_pirq_list(dev);
 
        spin_lock_irqsave(&msi_dev_entry->pirq_list_lock, flags);
-       if (!list_empty_careful(&msi_dev_entry->pirq_list_head))
+       if (!list_empty(&msi_dev_entry->pirq_list_head))
        {
                printk(KERN_WARNING "msix pirqs for dev %02x:%02x:%01x are not 
freed \
                       before acquire again.\n", dev->bus->number, 
PCI_SLOT(dev->devfn),
diff -r e5933404dada -r 2d858799d109 drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c     Tue May 13 10:42:09 2008 +0900
+++ b/drivers/xen/blkback/blkback.c     Thu May 15 16:26:16 2008 +0900
@@ -343,6 +343,9 @@ static int do_block_io_op(blkif_t *blkif
                        BUG();
                }
                blk_rings->common.req_cons = ++rc; /* before make_response() */
+
+               /* Apply all sanity checks to /private copy/ of request. */
+               barrier();
 
                switch (req.operation) {
                case BLKIF_OP_READ:
diff -r e5933404dada -r 2d858799d109 drivers/xen/blktap/blktap.c
--- a/drivers/xen/blktap/blktap.c       Tue May 13 10:42:09 2008 +0900
+++ b/drivers/xen/blktap/blktap.c       Thu May 15 16:26:16 2008 +0900
@@ -1264,6 +1264,9 @@ static int do_block_io_op(blkif_t *blkif
                }
                blk_rings->common.req_cons = ++rc; /* before make_response() */
 
+               /* Apply all sanity checks to /private copy/ of request. */
+               barrier();
+
                switch (req.operation) {
                case BLKIF_OP_READ:
                        blkif->st_rd_req++;
diff -r e5933404dada -r 2d858799d109 
drivers/xen/pciback/conf_space_capability_msi.c
--- a/drivers/xen/pciback/conf_space_capability_msi.c   Tue May 13 10:42:09 
2008 +0900
+++ b/drivers/xen/pciback/conf_space_capability_msi.c   Thu May 15 16:26:16 
2008 +0900
@@ -11,7 +11,6 @@ int pciback_enable_msi(struct pciback_de
                struct pci_dev *dev, struct xen_pci_op *op)
 {
        int otherend = pdev->xdev->otherend_id;
-       int irq;
        int status;
 
        status = pci_enable_msi(dev);
@@ -29,8 +28,6 @@ int pciback_disable_msi(struct pciback_d
 int pciback_disable_msi(struct pciback_device *pdev,
                struct pci_dev *dev, struct xen_pci_op *op)
 {
-       int old_irq = dev->irq;
-
        pci_disable_msi(dev);
 
        op->value = dev->irq;
@@ -40,7 +37,7 @@ int pciback_enable_msix(struct pciback_d
 int pciback_enable_msix(struct pciback_device *pdev,
                struct pci_dev *dev, struct xen_pci_op *op)
 {
-       int otherend = pdev->xdev->otherend_id, result, i;
+       int result;
 
        result = pci_enable_msix(dev, op->msix_entries, op->value);
 
diff -r e5933404dada -r 2d858799d109 include/acpi/processor.h
--- a/include/acpi/processor.h  Tue May 13 10:42:09 2008 +0900
+++ b/include/acpi/processor.h  Thu May 15 16:26:16 2008 +0900
@@ -353,6 +353,8 @@ extern int processor_register_extcntl(st
 extern int processor_register_extcntl(struct processor_extcntl_ops *ops);
 extern int processor_unregister_extcntl(struct processor_extcntl_ops *ops);
 extern int processor_extcntl_init(struct acpi_processor *pr);
+extern int acpi_processor_get_performance_info(struct acpi_processor *pr);
+extern int acpi_processor_get_psd(struct acpi_processor *pr);
 #else
 static inline int processor_cntl_external(void) {return 0;}
 static inline int processor_pm_external(void) {return 0;}
diff -r e5933404dada -r 2d858799d109 include/xen/blkif.h
--- a/include/xen/blkif.h       Tue May 13 10:42:09 2008 +0900
+++ b/include/xen/blkif.h       Thu May 15 16:26:16 2008 +0900
@@ -98,8 +98,9 @@ static void inline blkif_get_x86_32_req(
        dst->handle = src->handle;
        dst->id = src->id;
        dst->sector_number = src->sector_number;
-       if (n > src->nr_segments)
-               n = src->nr_segments;
+       barrier();
+       if (n > dst->nr_segments)
+               n = dst->nr_segments;
        for (i = 0; i < n; i++)
                dst->seg[i] = src->seg[i];
 }
@@ -112,8 +113,9 @@ static void inline blkif_get_x86_64_req(
        dst->handle = src->handle;
        dst->id = src->id;
        dst->sector_number = src->sector_number;
-       if (n > src->nr_segments)
-               n = src->nr_segments;
+       barrier();
+       if (n > dst->nr_segments)
+               n = dst->nr_segments;
        for (i = 0; i < n; i++)
                dst->seg[i] = src->seg[i];
 }
diff -r e5933404dada -r 2d858799d109 include/xen/interface/hvm/hvm_op.h
--- a/include/xen/interface/hvm/hvm_op.h        Tue May 13 10:42:09 2008 +0900
+++ b/include/xen/interface/hvm/hvm_op.h        Thu May 15 16:26:16 2008 +0900
@@ -73,6 +73,9 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_pci_
 /* Flushes all VCPU TLBs: @arg must be NULL. */
 #define HVMOP_flush_tlbs          5
 
+/* Following tools-only interfaces may change in future. */
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
 /* Track dirty VRAM. */
 #define HVMOP_track_dirty_vram    6
 struct xen_hvm_track_dirty_vram {
@@ -89,4 +92,6 @@ typedef struct xen_hvm_track_dirty_vram 
 typedef struct xen_hvm_track_dirty_vram xen_hvm_track_dirty_vram_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_track_dirty_vram_t);
 
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
diff -r e5933404dada -r 2d858799d109 include/xen/interface/io/pciif.h
--- a/include/xen/interface/io/pciif.h  Tue May 13 10:42:09 2008 +0900
+++ b/include/xen/interface/io/pciif.h  Thu May 15 16:26:16 2008 +0900
@@ -34,6 +34,10 @@
 /* xen_pci_op commands */
 #define XEN_PCI_OP_conf_read    (0)
 #define XEN_PCI_OP_conf_write   (1)
+#define XEN_PCI_OP_enable_msi   (2)
+#define XEN_PCI_OP_disable_msi  (3)
+#define XEN_PCI_OP_enable_msix  (4)
+#define XEN_PCI_OP_disable_msix (5)
 
 /* xen_pci_op error numbers */
 #define XEN_PCI_ERR_success          (0)
@@ -43,6 +47,12 @@
 #define XEN_PCI_ERR_not_implemented (-4)
 /* XEN_PCI_ERR_op_failed - backend failed to complete the operation */
 #define XEN_PCI_ERR_op_failed       (-5)
+
+/*
+ * it should be PAGE_SIZE-sizeof(struct xen_pci_op))/sizeof(struct msix_entry))
+ * Should not exceed 128
+ */
+#define SH_INFO_MAX_VEC     128
 
 struct xen_pci_op {
     /* IN: what action to perform: XEN_PCI_OP_* */
@@ -62,6 +72,10 @@ struct xen_pci_op {
 
     /* IN/OUT: Contains the result after a READ or the value to WRITE */
     uint32_t value;
+    /* IN: Contains extra infor for this operation */
+    uint32_t info;
+    /*IN:  param for msi-x */
+    struct msix_entry msix_entries[SH_INFO_MAX_VEC];
 };
 
 struct xen_pci_sharedinfo {
diff -r e5933404dada -r 2d858799d109 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h  Tue May 13 10:42:09 2008 +0900
+++ b/include/xen/interface/platform.h  Thu May 15 16:26:16 2008 +0900
@@ -211,6 +211,12 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_getidletim
 #define XEN_PM_PX   1
 #define XEN_PM_TX   2
 
+/* Px sub info type */
+#define XEN_PX_PCT   1
+#define XEN_PX_PSS   2
+#define XEN_PX_PPC   4
+#define XEN_PX_PSD   8
+
 struct xen_power_register {
     uint32_t     space_id;
     uint32_t     bit_width;
@@ -252,12 +258,55 @@ struct xen_processor_power {
     XEN_GUEST_HANDLE(xen_processor_cx_t) states; /* supported c states */
 };
 
+struct xen_pct_register {
+    uint8_t  descriptor;
+    uint16_t length;
+    uint8_t  space_id;
+    uint8_t  bit_width;
+    uint8_t  bit_offset;
+    uint8_t  reserved;
+    uint64_t address;
+};
+
+struct xen_processor_px {
+    uint64_t core_frequency; /* megahertz */
+    uint64_t power;      /* milliWatts */
+    uint64_t transition_latency; /* microseconds */
+    uint64_t bus_master_latency; /* microseconds */
+    uint64_t control;        /* control value */
+    uint64_t status;     /* success indicator */
+};
+typedef struct xen_processor_px xen_processor_px_t;
+DEFINE_XEN_GUEST_HANDLE(xen_processor_px_t);
+
+struct xen_psd_package {
+    uint64_t num_entries;
+    uint64_t revision;
+    uint64_t domain;
+    uint64_t coord_type;
+    uint64_t num_processors;
+};
+
+struct xen_processor_performance {
+    uint32_t flags;     /* flag for Px sub info type */
+    uint32_t ppc;       /* Platform limitation on freq usage */
+    struct xen_pct_register control_register;
+    struct xen_pct_register status_register;
+    uint32_t state_count;     /* total available performance states */
+    XEN_GUEST_HANDLE(xen_processor_px_t) states;
+    struct xen_psd_package domain_info;
+    uint32_t shared_type;     /* coordination type of this processor */
+};
+typedef struct xen_processor_performance xen_processor_performance_t;
+DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
+
 struct xenpf_set_processor_pminfo {
     /* IN variables */
     uint32_t id;    /* ACPI CPU ID */
-    uint32_t type;  /* {XEN_PM_CX, ...} */
+    uint32_t type;  /* {XEN_PM_CX, XEN_PM_PX} */
     union {
         struct xen_processor_power          power;/* Cx: _CST/_CSD */
+        struct xen_processor_performance    perf; /* Px: _PPC/_PCT/_PSS/_PSD */
     };
 };
 typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;

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

<Prev in Thread] Current Thread [Next in Thread>