qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes
@ 2015-07-03  3:42 Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 1/4] spapr: Add /ibm,partition-name Sam Bobroff
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Sam Bobroff @ 2015-07-03  3:42 UTC (permalink / raw)
  To: qemu-devel, alexey; +Cc: qemu-ppc


This patch set contains several small fixes to make QEMU more PAPR
compliant.


Sam Bobroff (4):
  spapr: Add /ibm,partition-name
  spapr: Add /rtas/ibm,change-msix-capable
  spapr: Make ibm,change-msi respect 3 return values
  spapr: SPLPAR Characteristics

 hw/ppc/spapr.c      |  9 +++++++++
 hw/ppc/spapr_pci.c  |  4 +++-
 hw/ppc/spapr_rtas.c | 11 +++++++++--
 3 files changed, 21 insertions(+), 3 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 1/4] spapr: Add /ibm,partition-name
  2015-07-03  3:42 [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes Sam Bobroff
@ 2015-07-03  3:42 ` Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 2/4] spapr: Add /rtas/ibm,change-msix-capable Sam Bobroff
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sam Bobroff @ 2015-07-03  3:42 UTC (permalink / raw)
  To: qemu-devel, alexey; +Cc: qemu-ppc

QEMU has a notion of the guest name, so if it's present we might as
well put that into the device tree as /ibm,partition-name.

This is specificed by PAPR.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
 hw/ppc/spapr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 0487f52..603f517 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -384,6 +384,11 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
     _FDT((fdt_property_string(fdt, "vm,uuid", buf)));
     g_free(buf);
 
+    if (qemu_get_vm_name()) {
+        _FDT((fdt_property_string(fdt, "ibm,partition-name",
+                                  qemu_get_vm_name())));
+    }
+
     _FDT((fdt_property_cell(fdt, "#address-cells", 0x2)));
     _FDT((fdt_property_cell(fdt, "#size-cells", 0x2)));
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 2/4] spapr: Add /rtas/ibm,change-msix-capable
  2015-07-03  3:42 [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 1/4] spapr: Add /ibm,partition-name Sam Bobroff
@ 2015-07-03  3:42 ` Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 3/4] spapr: Make ibm, change-msi respect 3 return values Sam Bobroff
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sam Bobroff @ 2015-07-03  3:42 UTC (permalink / raw)
  To: qemu-devel, alexey; +Cc: qemu-ppc

QEMU is MSI-X capable and makes it available via ibm,change-msi, so
we should indicate this by adding /rtas/ibm,change-msix-capable to the
device tree.

This is specificed by PAPR.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
 hw/ppc/spapr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 603f517..6801724 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -543,6 +543,10 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
 
     _FDT((fdt_property_cell(fdt, "rtas-error-log-max", RTAS_ERROR_LOG_MAX)));
 
+    if (msi_supported) {
+        _FDT((fdt_property(fdt, "ibm,change-msix-capable", NULL, 0)));
+    }
+
     /*
      * According to PAPR, rtas ibm,os-term does not guarantee a return
      * back to the guest cpu.
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 3/4] spapr: Make ibm, change-msi respect 3 return values
  2015-07-03  3:42 [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 1/4] spapr: Add /ibm,partition-name Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 2/4] spapr: Add /rtas/ibm,change-msix-capable Sam Bobroff
@ 2015-07-03  3:42 ` Sam Bobroff
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 4/4] spapr: SPLPAR Characteristics Sam Bobroff
  2015-07-07  7:26 ` [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes David Gibson
  4 siblings, 0 replies; 8+ messages in thread
From: Sam Bobroff @ 2015-07-03  3:42 UTC (permalink / raw)
  To: qemu-devel, alexey; +Cc: qemu-ppc

Currently, rtas_ibm_change_msi() always returns four values even if
less are specified.

Correct this by only returning the fourth parameter if it was
requested.

This is specified by PAPR.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
 hw/ppc/spapr_pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 05f4fac..f422e3b 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -360,7 +360,9 @@ out:
     rtas_st(rets, 0, RTAS_OUT_SUCCESS);
     rtas_st(rets, 1, req_num);
     rtas_st(rets, 2, ++seq_num);
-    rtas_st(rets, 3, ret_intr_type);
+    if (nret > 3) {
+        rtas_st(rets, 3, ret_intr_type);
+    }
 
     trace_spapr_pci_rtas_ibm_change_msi(config_addr, func, req_num, irq);
 }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PATCH 4/4] spapr: SPLPAR Characteristics
  2015-07-03  3:42 [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes Sam Bobroff
                   ` (2 preceding siblings ...)
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 3/4] spapr: Make ibm, change-msi respect 3 return values Sam Bobroff
@ 2015-07-03  3:42 ` Sam Bobroff
  2015-07-03  6:10   ` Bharata B Rao
  2015-07-07  7:26 ` [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes David Gibson
  4 siblings, 1 reply; 8+ messages in thread
From: Sam Bobroff @ 2015-07-03  3:42 UTC (permalink / raw)
  To: qemu-devel, alexey; +Cc: qemu-ppc

Improve the SPLPAR Characteristics information:

    Add MaxPlatProcs: set to max_cpus, the maximum CPUs that could be
    addded to the system.
    Add DesMem: set to the initial memory of the system.
    Add DesProcs: set to smp_cpus, the inital number of CPUs in the
    system.

These tokens and values are specified by PAPR.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---
 hw/ppc/spapr_rtas.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index 0f1ae55..a08254b 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -33,6 +33,7 @@
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_vio.h"
 #include "qapi-event.h"
+#include "hw/boards.h"
 
 #include <libfdt.h>
 
@@ -190,8 +191,14 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
 
     switch (parameter) {
     case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: {
-        char *param_val = g_strdup_printf("MaxEntCap=%d,MaxPlatProcs=%d",
-                                          max_cpus, smp_cpus);
+        char *param_val = g_strdup_printf("MaxEntCap=%d,"
+                                          "DesMem=%lu,"
+                                          "DesProcs=%d,"
+                                          "MaxPlatProcs=%d",
+                                          max_cpus,
+                                          current_machine->ram_size / 1024 / 1024,
+                                          smp_cpus,
+                                          max_cpus);
         rtas_st_buffer(buffer, length, (uint8_t *)param_val, strlen(param_val));
         g_free(param_val);
         break;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 4/4] spapr: SPLPAR Characteristics
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 4/4] spapr: SPLPAR Characteristics Sam Bobroff
@ 2015-07-03  6:10   ` Bharata B Rao
  0 siblings, 0 replies; 8+ messages in thread
From: Bharata B Rao @ 2015-07-03  6:10 UTC (permalink / raw)
  To: Sam Bobroff; +Cc: alexey, qemu-ppc@nongnu.org, qemu-devel@nongnu.org

On Fri, Jul 3, 2015 at 9:12 AM, Sam Bobroff <sam.bobroff@au1.ibm.com> wrote:
> Improve the SPLPAR Characteristics information:
>
>     Add MaxPlatProcs: set to max_cpus, the maximum CPUs that could be
>     addded to the system.
>     Add DesMem: set to the initial memory of the system.
>     Add DesProcs: set to smp_cpus, the inital number of CPUs in the
>     system.
>
> These tokens and values are specified by PAPR.
>
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
>  hw/ppc/spapr_rtas.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 0f1ae55..a08254b 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -33,6 +33,7 @@
>  #include "hw/ppc/spapr.h"
>  #include "hw/ppc/spapr_vio.h"
>  #include "qapi-event.h"
> +#include "hw/boards.h"
>
>  #include <libfdt.h>
>
> @@ -190,8 +191,14 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
>
>      switch (parameter) {
>      case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: {
> -        char *param_val = g_strdup_printf("MaxEntCap=%d,MaxPlatProcs=%d",
> -                                          max_cpus, smp_cpus);
> +        char *param_val = g_strdup_printf("MaxEntCap=%d,"
> +                                          "DesMem=%lu,"
> +                                          "DesProcs=%d,"
> +                                          "MaxPlatProcs=%d",
> +                                          max_cpus,
> +                                          current_machine->ram_size / 1024 / 1024,

May be you could use M_BYTE definition from qemu-common.h ?

Regards,
Bharata.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes
  2015-07-03  3:42 [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes Sam Bobroff
                   ` (3 preceding siblings ...)
  2015-07-03  3:42 ` [Qemu-devel] [PATCH 4/4] spapr: SPLPAR Characteristics Sam Bobroff
@ 2015-07-07  7:26 ` David Gibson
  2015-07-20  3:34   ` Sam Bobroff
  4 siblings, 1 reply; 8+ messages in thread
From: David Gibson @ 2015-07-07  7:26 UTC (permalink / raw)
  To: Sam Bobroff; +Cc: alexey, qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

On Fri, Jul 03, 2015 at 01:42:16PM +1000, Sam Bobroff wrote:
> 
> This patch set contains several small fixes to make QEMU more PAPR
> compliant.

Applied to spapr-next, thanks.

In future, please CC me on PAPR related patches - otherwise I'm likely
to lose them in the flood of qemu-devel.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes
  2015-07-07  7:26 ` [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes David Gibson
@ 2015-07-20  3:34   ` Sam Bobroff
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Bobroff @ 2015-07-20  3:34 UTC (permalink / raw)
  To: David Gibson; +Cc: alexey, qemu-ppc, qemu-devel

On Tue, Jul 07, 2015 at 05:26:49PM +1000, David Gibson wrote:
> On Fri, Jul 03, 2015 at 01:42:16PM +1000, Sam Bobroff wrote:
> > 
> > This patch set contains several small fixes to make QEMU more PAPR
> > compliant.
> 
> Applied to spapr-next, thanks.
> 
> In future, please CC me on PAPR related patches - otherwise I'm likely
> to lose them in the flood of qemu-devel.

Thanks!

And regarding the CC: yes, will do.

Cheers,
Sam.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-20  3:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-03  3:42 [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes Sam Bobroff
2015-07-03  3:42 ` [Qemu-devel] [PATCH 1/4] spapr: Add /ibm,partition-name Sam Bobroff
2015-07-03  3:42 ` [Qemu-devel] [PATCH 2/4] spapr: Add /rtas/ibm,change-msix-capable Sam Bobroff
2015-07-03  3:42 ` [Qemu-devel] [PATCH 3/4] spapr: Make ibm, change-msi respect 3 return values Sam Bobroff
2015-07-03  3:42 ` [Qemu-devel] [PATCH 4/4] spapr: SPLPAR Characteristics Sam Bobroff
2015-07-03  6:10   ` Bharata B Rao
2015-07-07  7:26 ` [Qemu-devel] [PATCH 0/4] spapr: Small PAPR compliance fixes David Gibson
2015-07-20  3:34   ` Sam Bobroff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).