From patchwork Tue Jun 19 01:41:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 10472841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ACEC76032A for ; Tue, 19 Jun 2018 01:58:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98B1328747 for ; Tue, 19 Jun 2018 01:58:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D9CD287A4; Tue, 19 Jun 2018 01:58:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0B9CA28747 for ; Tue, 19 Jun 2018 01:58:54 +0000 (UTC) Received: from localhost ([::1]:38432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV5v3-0002X2-5w for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Jun 2018 21:58:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44959) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV5h7-0000g6-HG for qemu-devel@nongnu.org; Mon, 18 Jun 2018 21:44:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV5h6-0007th-Ep for qemu-devel@nongnu.org; Mon, 18 Jun 2018 21:44:29 -0400 Received: from mail-ot0-x242.google.com ([2607:f8b0:4003:c0f::242]:40769) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fV5h6-0007tZ-A0; Mon, 18 Jun 2018 21:44:28 -0400 Received: by mail-ot0-x242.google.com with SMTP id w9-v6so20743732otj.7; Mon, 18 Jun 2018 18:44:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=TAcX12DFcO/HBUJ37nxdU99y5mawzSYvl/Llw6IPiPE=; b=X6zzK0DRV/GmwVCx0lm+XF/b2SB+G/Jgu/HEkehuOa+oibPN8GzkOU8Osfo0hEefcE F6RY8rINb+gX1nyTgCGQttxag3dH/m3edoKnRLuY/CPJCAPW9zGe8RW/H86mBWutYa4g 29i3K7C8k2BieId5yJ3GhRX7P7ridnCnOIxYxJf0OeyFtnMo5jANgZdEjnh5j+jicacn FACpTrX/GgQbXoPNRYplcgV48VJvrpU8i/uAVYSLp//nyc4oI2rw8hpNyd/szhf0pGOk dUqxFjvtiuu2/JGOL310Y5e72SaytHENwWyGC4Q8c1J1SfL1E1G/YNPGIBptGH27MnrQ h1ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=TAcX12DFcO/HBUJ37nxdU99y5mawzSYvl/Llw6IPiPE=; b=Rci8SZuyPdSuqjFRs3B+so0x6ZNXuRetzmd1ZbD5erwQwfgFLJ5LLeK/lLJPYOB24o g4yr18eXscR6GW8Ge63Tso1d7c66+IiIBnNyJ0XKVt25Fr+hXk4b0KCE43u960kzFkIB F8xVRjcBXMLRNd/BKKn6MAZF3r5cqeJMzWdmnGS6xRhWdSp4UQc24RqBsC6T4sC06GvX COXOr1ewiy/eZSfYVhy2t3vIf1X5AD2yw6O+p27ZAhEgx36HlkYPgQ+MzUCxFxQlOvKl 81Xs5gjjI6KGt1clxO6PFA2zbYPY5ZLbceMkRs121DQTrsvCoDHxN/e/UM+cjxf30kNx /y6w== X-Gm-Message-State: APt69E3fDOgN8pP4aOL6duinolNkemimQ8uje6EO/TMQ8uhKKUVmxI5u YWhZ7xXXWZs5b/ALnoM05W50FRkl X-Google-Smtp-Source: ADUXVKKslmQhQ3N0GVtVbU/dQgcqyihKoO/r5z9Fu8LcK3LA1T5BowC4eFylpBJQ7WX2VTxMR66JSw== X-Received: by 2002:a9d:6283:: with SMTP id x3-v6mr8434632otk.111.1529372667080; Mon, 18 Jun 2018 18:44:27 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id v13-v6sm7344457otk.73.2018.06.18.18.44.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 18:44:26 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 18 Jun 2018 20:41:38 -0500 Message-Id: <20180619014319.28272-13-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180619014319.28272-1-mdroth@linux.vnet.ibm.com> References: <20180619014319.28272-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::242 Subject: [Qemu-devel] [PATCH 012/113] spapr: rename spapr_vcpu_id() to spapr_get_vcpu_id() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gibson , qemu-stable@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Greg Kurz The spapr_vcpu_id() function is an accessor actually. Let's rename it for symmetry with the recently added spapr_set_vcpu_id() helper. The motivation behind this is that a later patch will consolidate the VCPU id formula in a function and spapr_vcpu_id looks like an appropriate name. Signed-off-by: Greg Kurz Signed-off-by: David Gibson (cherry picked from commit 14bb4486c819ea797a151b3e0fe53d6f5c7b3fc5) Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 16 ++++++++-------- include/hw/ppc/spapr.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index fc6ebe1b3a..0be60fb044 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -210,7 +210,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu, int i, ret = 0; uint32_t servers_prop[smt_threads]; uint32_t gservers_prop[smt_threads * 2]; - int index = spapr_vcpu_id(cpu); + int index = spapr_get_vcpu_id(cpu); if (cpu->compat_pvr) { ret = fdt_setprop_cell(fdt, offset, "cpu-version", cpu->compat_pvr); @@ -239,7 +239,7 @@ static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu, static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, PowerPCCPU *cpu) { - int index = spapr_vcpu_id(cpu); + int index = spapr_get_vcpu_id(cpu); uint32_t associativity[] = {cpu_to_be32(0x5), cpu_to_be32(0x0), cpu_to_be32(0x0), @@ -343,7 +343,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr) CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); DeviceClass *dc = DEVICE_GET_CLASS(cs); - int index = spapr_vcpu_id(cpu); + int index = spapr_get_vcpu_id(cpu); int compat_smt = MIN(smp_threads, ppc_compat_max_vthreads(cpu)); if (index % spapr->vsmt != 0) { @@ -492,7 +492,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cs); - int index = spapr_vcpu_id(cpu); + int index = spapr_get_vcpu_id(cpu); uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40), 0xffffffff, 0xffffffff}; uint32_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() @@ -626,7 +626,7 @@ static void spapr_populate_cpus_dt_node(void *fdt, sPAPRMachineState *spapr) */ CPU_FOREACH_REVERSE(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - int index = spapr_vcpu_id(cpu); + int index = spapr_get_vcpu_id(cpu); DeviceClass *dc = DEVICE_GET_CLASS(cs); int offset; @@ -3213,7 +3213,7 @@ static void *spapr_populate_hotplug_cpu_dt(CPUState *cs, int *fdt_offset, { PowerPCCPU *cpu = POWERPC_CPU(cs); DeviceClass *dc = DEVICE_GET_CLASS(cs); - int id = spapr_vcpu_id(cpu); + int id = spapr_get_vcpu_id(cpu); void *fdt; int offset, fdt_size; char *nodename; @@ -3636,7 +3636,7 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj, ics_pic_print_info(spapr->ics, mon); } -int spapr_vcpu_id(PowerPCCPU *cpu) +int spapr_get_vcpu_id(PowerPCCPU *cpu) { CPUState *cs = CPU(cpu); @@ -3673,7 +3673,7 @@ PowerPCCPU *spapr_find_cpu(int vcpu_id) CPU_FOREACH(cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); - if (spapr_vcpu_id(cpu) == vcpu_id) { + if (spapr_get_vcpu_id(cpu) == vcpu_id) { return cpu; } } diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 38a657426a..fa02539b07 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -756,7 +756,7 @@ void spapr_do_system_reset_on_cpu(CPUState *cs, run_on_cpu_data arg); #define HTAB_SIZE(spapr) (1ULL << ((spapr)->htab_shift)) -int spapr_vcpu_id(PowerPCCPU *cpu); +int spapr_get_vcpu_id(PowerPCCPU *cpu); void spapr_set_vcpu_id(PowerPCCPU *cpu, int cpu_index, Error **errp); PowerPCCPU *spapr_find_cpu(int vcpu_id);