From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, qiudayu@linux.vnet.ibm.com, agraf@suse.de,
Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH v1 3/3] sPAPR: Export RTAS property <ibm, errinjct-tokens>
Date: Mon, 23 Jun 2014 12:22:03 +1000 [thread overview]
Message-ID: <1403490123-15969-4-git-send-email-gwshan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1403490123-15969-1-git-send-email-gwshan@linux.vnet.ibm.com>
The patch exports RTAS property "ibm,errinjct-tokens", which is
defined in PAPR spec and used to indicate various error types
we can inject.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
hw/ppc/spapr.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a61af85..1d52229 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -443,6 +443,23 @@ static void spapr_create_drc_dt_entries(void *fdt)
} while (0)
+static void add_errinjct_token(GString *s, uint32_t token, const gchar *desc)
+{
+ g_string_append_len(s, desc, strlen(desc) + 1);
+ g_string_append_len(s, (gchar *)&token, sizeof(token));
+}
+
+static void add_errinjct_token_prop(void *fdt)
+{
+ GString *s = g_string_sized_new(256);
+
+ add_errinjct_token(s, RTAS_ERRINJCT_TYPE_IOA_BUS_ERROR, "ioa-bus-error");
+ add_errinjct_token(s, RTAS_ERRINJCT_TYPE_IOA_BUS_ERROR64, "ioa-bus-error-64");
+
+ _FDT((fdt_property(fdt, "ibm,errinjct-tokens", s->str, s->len)));
+ g_string_free(s, true);
+}
+
static void *spapr_create_fdt_skel(hwaddr initrd_base,
hwaddr initrd_size,
hwaddr kernel_size,
@@ -664,6 +681,8 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
_FDT((fdt_property(fdt, "qemu,hypertas-functions", qemu_hypertas_prop,
sizeof(qemu_hypertas_prop))));
+ add_errinjct_token_prop(fdt);
+
_FDT((fdt_property(fdt, "ibm,associativity-reference-points",
refpoints, sizeof(refpoints))));
--
1.8.3.2
prev parent reply other threads:[~2014-06-23 2:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 2:22 [Qemu-devel] [PATCH v1 0/3] Support PCI Error Injection Gavin Shan
2014-06-23 2:22 ` [Qemu-devel] [PATCH v1 1/3] sPAPR: Implement PCI error injection RTAS calls Gavin Shan
2014-06-23 16:18 ` Alexander Graf
2014-06-23 21:03 ` Benjamin Herrenschmidt
2014-06-23 21:13 ` Alexander Graf
2014-06-24 0:14 ` Gavin Shan
2014-06-24 0:58 ` Gavin Shan
2014-06-23 2:22 ` [Qemu-devel] [PATCH v1 2/3] sPAPR: Implement sPAPRPHBClass::format_errinjct_cmd Gavin Shan
2014-06-23 2:22 ` Gavin Shan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403490123-15969-4-git-send-email-gwshan@linux.vnet.ibm.com \
--to=gwshan@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=qemu-devel@nongnu.org \
--cc=qiudayu@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).