Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811506/?format=api
{ "id": 811506, "url": "http://patchwork.ozlabs.org/api/patches/811506/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170908103558.31632-16-david@gibson.dropbear.id.au/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170908103558.31632-16-david@gibson.dropbear.id.au>", "list_archive_url": null, "date": "2017-09-08T10:35:33", "name": "[PULL,15/40] ppc: spapr: Rename cpu_dt_id to vcpu_id", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "1f2b1a64d8c0fa3573f85378c4732c1547ff9954", "submitter": { "id": 47, "url": "http://patchwork.ozlabs.org/api/people/47/?format=api", "name": "David Gibson", "email": "david@gibson.dropbear.id.au" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170908103558.31632-16-david@gibson.dropbear.id.au/mbox/", "series": [ { "id": 2179, "url": "http://patchwork.ozlabs.org/api/series/2179/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2179", "date": "2017-09-08T10:35:20", "name": "[PULL,01/40] hw/ppc/spapr_drc.c: change spapr_drc_needed to use drc->dev", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2179/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811506/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811506/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"cUFJytGa\"; \n\tdkim-atps=neutral" ], "Received": [ "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpYrt4DRqz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 8 Sep 2017 20:46:06 +1000 (AEST)", "from localhost ([::1]:44493 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dqGnU-0002W7-GN\n\tfor incoming@patchwork.ozlabs.org; Fri, 08 Sep 2017 06:46:04 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:58730)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dqGe7-0002B0-IE\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 06:36:32 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dqGe1-0003Fy-L7\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 06:36:23 -0400", "from ozlabs.org ([2401:3900:2:1::2]:49989)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dqGe1-0003Ck-1t; Fri, 08 Sep 2017 06:36:17 -0400", "by ozlabs.org (Postfix, from userid 1007)\n\tid 3xpYdM5B2Zz9t45; Fri, 8 Sep 2017 20:36:04 +1000 (AEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1504866967;\n\tbh=p7GfymY4dj1GLXZHH1ie7GRcQwz8RyhoKRYf2JB+9DE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=cUFJytGaUS1L95M6vjtWRbP0Ew/XipFs5mFrBe8IiKBM7nTY3/akYsrxljpHaTGIN\n\tKTztKKBb8wUn/WZOa+sX4RoRQZIJIFQoVKkf29JHOsQH4B5mEtxLo4JHamOpYaUFRa\n\tqQyjWBZzJkASa1KKErCiRl3jzRjhFmfH7aYBB25I=", "From": "David Gibson <david@gibson.dropbear.id.au>", "To": "peter.maydell@linaro.org", "Date": "Fri, 8 Sep 2017 20:35:33 +1000", "Message-Id": "<20170908103558.31632-16-david@gibson.dropbear.id.au>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170908103558.31632-1-david@gibson.dropbear.id.au>", "References": "<20170908103558.31632-1-david@gibson.dropbear.id.au>", "X-detected-operating-system": "by eggs.gnu.org: Genre and OS details not\n\trecognized.", "X-Received-From": "2401:3900:2:1::2", "Subject": "[Qemu-devel] [PULL 15/40] ppc: spapr: Rename cpu_dt_id to vcpu_id", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "qemu-devel@nongnu.org, aik@ozlabs.ru, agraf@suse.de,\n\tmdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org,\n\timammedo@redhat.com, sam.bobroff@au1.ibm.com,\n\tDavid Gibson <david@gibson.dropbear.id.au>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "From: Sam Bobroff <sam.bobroff@au1.ibm.com>\n\nThis field actually records the VCPU ID used by KVM and, although the\nvalue is also used in the device tree it is primarily the VCPU ID so\nrename it as such.\n\nSigned-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>\n[dwg: Updated comment missed in cpu.h]\nReviewed-by: Greg Kurz <groug@kaod.org>\nSigned-off-by: David Gibson <david@gibson.dropbear.id.au>\n---\n hw/ppc/ppc.c | 8 ++++----\n hw/ppc/spapr.c | 16 ++++++++--------\n hw/ppc/spapr_hcall.c | 4 ++--\n hw/ppc/spapr_rtas.c | 4 ++--\n target/ppc/cpu.h | 16 ++++++++--------\n target/ppc/kvm.c | 2 +-\n target/ppc/translate_init.c | 8 ++++----\n 7 files changed, 29 insertions(+), 29 deletions(-)", "diff": "diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c\nindex 224184d66d..4477d4ad89 100644\n--- a/hw/ppc/ppc.c\n+++ b/hw/ppc/ppc.c\n@@ -1359,19 +1359,19 @@ void PPC_debug_write (void *opaque, uint32_t addr, uint32_t val)\n }\n \n /* CPU device-tree ID helpers */\n-int ppc_get_vcpu_dt_id(PowerPCCPU *cpu)\n+int ppc_get_vcpu_id(PowerPCCPU *cpu)\n {\n- return cpu->cpu_dt_id;\n+ return cpu->vcpu_id;\n }\n \n-PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id)\n+PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id)\n {\n CPUState *cs;\n \n CPU_FOREACH(cs) {\n PowerPCCPU *cpu = POWERPC_CPU(cs);\n \n- if (cpu->cpu_dt_id == cpu_dt_id) {\n+ if (cpu->vcpu_id == vcpu_id) {\n return cpu;\n }\n }\ndiff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\nindex a0c5923776..f7a4c73e08 100644\n--- a/hw/ppc/spapr.c\n+++ b/hw/ppc/spapr.c\n@@ -208,7 +208,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,\n int i, ret = 0;\n uint32_t servers_prop[smt_threads];\n uint32_t gservers_prop[smt_threads * 2];\n- int index = ppc_get_vcpu_dt_id(cpu);\n+ int index = ppc_get_vcpu_id(cpu);\n \n if (cpu->compat_pvr) {\n ret = fdt_setprop_cell(fdt, offset, \"cpu-version\", cpu->compat_pvr);\n@@ -237,7 +237,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,\n \n static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, PowerPCCPU *cpu)\n {\n- int index = ppc_get_vcpu_dt_id(cpu);\n+ int index = ppc_get_vcpu_id(cpu);\n uint32_t associativity[] = {cpu_to_be32(0x5),\n cpu_to_be32(0x0),\n cpu_to_be32(0x0),\n@@ -341,7 +341,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr)\n PowerPCCPU *cpu = POWERPC_CPU(cs);\n CPUPPCState *env = &cpu->env;\n DeviceClass *dc = DEVICE_GET_CLASS(cs);\n- int index = ppc_get_vcpu_dt_id(cpu);\n+ int index = ppc_get_vcpu_id(cpu);\n int compat_smt = MIN(smp_threads, ppc_compat_max_threads(cpu));\n \n if ((index % smt) != 0) {\n@@ -493,7 +493,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset,\n PowerPCCPU *cpu = POWERPC_CPU(cs);\n CPUPPCState *env = &cpu->env;\n PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs);\n- int index = ppc_get_vcpu_dt_id(cpu);\n+ int index = ppc_get_vcpu_id(cpu);\n uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40),\n 0xffffffff, 0xffffffff};\n uint32_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq()\n@@ -626,7 +626,7 @@ static void spapr_populate_cpus_dt_node(void *fdt, sPAPRMachineState *spapr)\n */\n CPU_FOREACH_REVERSE(cs) {\n PowerPCCPU *cpu = POWERPC_CPU(cs);\n- int index = ppc_get_vcpu_dt_id(cpu);\n+ int index = ppc_get_vcpu_id(cpu);\n DeviceClass *dc = DEVICE_GET_CLASS(cs);\n int offset;\n \n@@ -3025,7 +3025,7 @@ static void *spapr_populate_hotplug_cpu_dt(CPUState *cs, int *fdt_offset,\n {\n PowerPCCPU *cpu = POWERPC_CPU(cs);\n DeviceClass *dc = DEVICE_GET_CLASS(cs);\n- int id = ppc_get_vcpu_dt_id(cpu);\n+ int id = ppc_get_vcpu_id(cpu);\n void *fdt;\n int offset, fdt_size;\n char *nodename;\n@@ -3433,9 +3433,9 @@ static void spapr_ics_resend(XICSFabric *dev)\n ics_resend(spapr->ics);\n }\n \n-static ICPState *spapr_icp_get(XICSFabric *xi, int cpu_dt_id)\n+static ICPState *spapr_icp_get(XICSFabric *xi, int vcpu_id)\n {\n- PowerPCCPU *cpu = ppc_get_vcpu_by_dt_id(cpu_dt_id);\n+ PowerPCCPU *cpu = ppc_get_cpu_by_vcpu_id(vcpu_id);\n \n return cpu ? ICP(cpu->intc) : NULL;\n }\ndiff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c\nindex 07b3da8dc4..4ca233854a 100644\n--- a/hw/ppc/spapr_hcall.c\n+++ b/hw/ppc/spapr_hcall.c\n@@ -999,7 +999,7 @@ static target_ulong h_register_vpa(PowerPCCPU *cpu, sPAPRMachineState *spapr,\n CPUPPCState *tenv;\n PowerPCCPU *tcpu;\n \n- tcpu = ppc_get_vcpu_by_dt_id(procno);\n+ tcpu = ppc_get_cpu_by_vcpu_id(procno);\n if (!tcpu) {\n return H_PARAMETER;\n }\n@@ -1431,7 +1431,7 @@ static target_ulong h_signal_sys_reset(PowerPCCPU *cpu,\n \n } else {\n /* Unicast */\n- cs = CPU(ppc_get_vcpu_by_dt_id(target));\n+ cs = CPU(ppc_get_cpu_by_vcpu_id(target));\n if (cs) {\n run_on_cpu(cs, spapr_do_system_reset_on_cpu, RUN_ON_CPU_NULL);\n return H_SUCCESS;\ndiff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c\nindex 94a2799b99..626c06b375 100644\n--- a/hw/ppc/spapr_rtas.c\n+++ b/hw/ppc/spapr_rtas.c\n@@ -104,7 +104,7 @@ static void rtas_query_cpu_stopped_state(PowerPCCPU *cpu_,\n }\n \n id = rtas_ld(args, 0);\n- cpu = ppc_get_vcpu_by_dt_id(id);\n+ cpu = ppc_get_cpu_by_vcpu_id(id);\n if (cpu != NULL) {\n if (CPU(cpu)->halted) {\n rtas_st(rets, 1, 0);\n@@ -158,7 +158,7 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPRMachineState *spapr,\n start = rtas_ld(args, 1);\n r3 = rtas_ld(args, 2);\n \n- cpu = ppc_get_vcpu_by_dt_id(id);\n+ cpu = ppc_get_cpu_by_vcpu_id(id);\n if (cpu != NULL) {\n CPUState *cs = CPU(cpu);\n CPUPPCState *env = &cpu->env;\ndiff --git a/target/ppc/cpu.h b/target/ppc/cpu.h\nindex 12f09492fb..687e66acde 100644\n--- a/target/ppc/cpu.h\n+++ b/target/ppc/cpu.h\n@@ -1188,7 +1188,7 @@ typedef struct PPCVirtualHypervisorClass PPCVirtualHypervisorClass;\n /**\n * PowerPCCPU:\n * @env: #CPUPPCState\n- * @cpu_dt_id: CPU index used in the device tree. KVM uses this index too\n+ * @vcpu_id: vCPU identifier given to KVM\n * @compat_pvr: Current logical PVR, zero if in \"raw\" mode\n *\n * A PowerPC CPU.\n@@ -1199,7 +1199,7 @@ struct PowerPCCPU {\n /*< public >*/\n \n CPUPPCState env;\n- int cpu_dt_id;\n+ int vcpu_id;\n uint32_t compat_pvr;\n PPCVirtualHypervisor *vhyp;\n Object *intc;\n@@ -2515,22 +2515,22 @@ static inline bool lsw_reg_in_range(int start, int nregs, int rx)\n void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUPPCState *env);\n \n /**\n- * ppc_get_vcpu_dt_id:\n+ * ppc_get_vcpu_id:\n * @cs: a PowerPCCPU struct.\n *\n * Returns a device-tree ID for a CPU.\n */\n-int ppc_get_vcpu_dt_id(PowerPCCPU *cpu);\n+int ppc_get_vcpu_id(PowerPCCPU *cpu);\n \n /**\n- * ppc_get_vcpu_by_dt_id:\n- * @cpu_dt_id: a device tree id\n+ * ppc_get_cpu_by_vcpu_id:\n+ * @vcpu_id: a VCPU ID\n *\n- * Searches for a CPU by @cpu_dt_id.\n+ * Searches for a CPU by @vcpu_id.\n *\n * Returns: a PowerPCCPU struct\n */\n-PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id);\n+PowerPCCPU *ppc_get_cpu_by_vcpu_id(int vcpu_id);\n \n void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len);\n #endif /* PPC_CPU_H */\ndiff --git a/target/ppc/kvm.c b/target/ppc/kvm.c\nindex f31c67e1b1..1142d5c970 100644\n--- a/target/ppc/kvm.c\n+++ b/target/ppc/kvm.c\n@@ -520,7 +520,7 @@ bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path)\n \n unsigned long kvm_arch_vcpu_id(CPUState *cpu)\n {\n- return ppc_get_vcpu_dt_id(POWERPC_CPU(cpu));\n+ return ppc_get_vcpu_id(POWERPC_CPU(cpu));\n }\n \n /* e500 supports 2 h/w breakpoint and 2 watchpoint.\ndiff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c\nindex 43be9a8331..1586e28055 100644\n--- a/target/ppc/translate_init.c\n+++ b/target/ppc/translate_init.c\n@@ -9838,14 +9838,14 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)\n }\n \n #if !defined(CONFIG_USER_ONLY)\n- cpu->cpu_dt_id = (cs->cpu_index / smp_threads) * max_smt\n+ cpu->vcpu_id = (cs->cpu_index / smp_threads) * max_smt\n + (cs->cpu_index % smp_threads);\n \n- if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->cpu_dt_id)) {\n- error_setg(errp, \"Can't create CPU with id %d in KVM\", cpu->cpu_dt_id);\n+ if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->vcpu_id)) {\n+ error_setg(errp, \"Can't create CPU with id %d in KVM\", cpu->vcpu_id);\n error_append_hint(errp, \"Adjust the number of cpus to %d \"\n \"or try to raise the number of threads per core\\n\",\n- cpu->cpu_dt_id * smp_threads / max_smt);\n+ cpu->vcpu_id * smp_threads / max_smt);\n goto unrealize;\n }\n #endif\n", "prefixes": [ "PULL", "15/40" ] }