[Skiboot] [PATCH 47/60] xive: Add chip_id to get_vp_info

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 22 14:16:55 AEDT 2016


---
 doc/xive.txt | 5 ++++-
 hw/xive.c    | 9 +++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/xive.txt b/doc/xive.txt
index c38dce0..b977414 100644
--- a/doc/xive.txt
+++ b/doc/xive.txt
@@ -573,7 +573,8 @@ int64_t opal_xive_free_vp_block(uint64_t vp);
  int64_t opal_xive_get_vp_info(uint64_t vp,
                                uint64_t *flags,
                                uint64_t *cam_value,
-                               uint64_t *report_cl_pair);
+                               uint64_t *report_cl_pair,
+			       uint32_t *chip_id);
 
     This call returns information about an allocated VP:
 
@@ -589,6 +590,8 @@ int64_t opal_xive_free_vp_block(uint64_t vp);
     * report_cl_pair:  This is the real address of the reporting cache line
       pair for that VP (defaults to 0)
 
+    * chip_id : The chip that VCPU was allocated on
+
  int64_t opal_xive_set_vp_info(uint64_t vp,
                                uint64_t flags,
                                uint64_t report_cl_pair);
diff --git a/hw/xive.c b/hw/xive.c
index 597ef82..b9956ca 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -3398,7 +3398,8 @@ static int64_t opal_xive_donate_page(uint32_t chip_id, uint64_t addr)
 static int64_t opal_xive_get_vp_info(uint64_t vp_id,
 				     uint64_t *out_flags,
 				     uint64_t *out_cam_value,
-				     uint64_t *out_report_cl_pair)
+				     uint64_t *out_report_cl_pair,
+				     uint32_t *out_chip_id)
 {
 	struct xive *x;
 	struct xive_vp *vp;
@@ -3430,6 +3431,10 @@ static int64_t opal_xive_get_vp_info(uint64_t vp_id,
 		*out_report_cl_pair = ((uint64_t)(vp->w6 & 0x0fffffff)) << 32;
 		*out_report_cl_pair |= vp->w7 & 0xffffff00;
 	}
+
+	if (out_chip_id)
+		*out_chip_id = xive_block_to_chip[blk];
+
 	return OPAL_SUCCESS;
 }
 
@@ -3938,7 +3943,7 @@ void init_xive(void)
 	opal_register(OPAL_XIVE_FREE_IRQ, opal_xive_free_irq, 1);
 	opal_register(OPAL_XIVE_ALLOCATE_VP_BLOCK, opal_xive_alloc_vp_block, 1);
 	opal_register(OPAL_XIVE_FREE_VP_BLOCK, opal_xive_free_vp_block, 1);
-	opal_register(OPAL_XIVE_GET_VP_INFO, opal_xive_get_vp_info, 4);
+	opal_register(OPAL_XIVE_GET_VP_INFO, opal_xive_get_vp_info, 5);
 	opal_register(OPAL_XIVE_SET_VP_INFO, opal_xive_set_vp_info, 3);
 }
 
-- 
2.9.3



More information about the Skiboot mailing list