From nobody Fri May 10 16:56:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561747013; cv=none; d=zoho.com; s=zohoarc; b=IdIvVA3n1ixSGnEZgMJjXL76Bhf/5S79zCO1SOdRwzgFd9FDBz4KbNWEGBsdl5w7WMKFeObPUieyhtF1TbOvi5y3VtajXoqJbCfw+BRVf3ng9EL7GG8HapxW127TO24oSSJn9k6pdbpfc2Bi0yasJMT8FXtC9nGi8p4VTi6l4Rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561747013; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uwn/39JKB3jiKHW/32YD1603o6AcCDiow8bZWY/wCX4=; b=oGNOKEhXuNMKFC87bvL9M/WJdOwP/BiXrmjHLmObi91PIJQ0z4ylJIlHW40AOMjA+bcB3rwbjCxQNYwv2Kh7cPlLAVrCFpRnsJSRsH/pE8mBGaKGx+tR2DTz41BHpKcgZjGrbclqPwO06AlCcPokKIwsTjDQFbEyZRSscDOVdqY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561747013943730.2644395490229; Fri, 28 Jun 2019 11:36:53 -0700 (PDT) Received: from localhost ([::1]:35386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgvjn-0002UQ-5m for importer@patchew.org; Fri, 28 Jun 2019 14:36:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37361) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgvgs-0000nv-0r for qemu-devel@nongnu.org; Fri, 28 Jun 2019 14:33:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgvgp-0005ZV-Ja for qemu-devel@nongnu.org; Fri, 28 Jun 2019 14:33:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35814) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgvgp-0005X2-7o; Fri, 28 Jun 2019 14:33:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CEA83007E6A; Fri, 28 Jun 2019 18:33:28 +0000 (UTC) Received: from localhost (ovpn-116-7.gru2.redhat.com [10.97.116.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9441760920; Fri, 28 Jun 2019 18:33:23 +0000 (UTC) Date: Fri, 28 Jun 2019 15:33:21 -0300 From: Eduardo Habkost To: Like Xu Message-ID: <20190628183321.GE1862@habkost.net> References: <20190518205428.90532-1-like.xu@linux.intel.com> <20190518205428.90532-7-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190518205428.90532-7-like.xu@linux.intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 28 Jun 2019 18:33:28 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] fixup! hw/s390x: Replace global smp variables with machine smp properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , David Hildenbrand , qemu-trivial@nongnu.org, Cornelia Huck , qemu-devel@nongnu.org, "Dr . David Alan Gilbert" , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Alistair Francis , Igor Mammedov , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Sun, May 19, 2019 at 04:54:24AM +0800, Like Xu wrote: > The global smp variables in s390x are replaced with smp machine propertie= s. >=20 > A local variable of the same name would be introduced in the declaration > phase if it's used widely in the context OR replace it on the spot if it's > only used once. No semantic changes. >=20 > Signed-off-by: Like Xu I'm applying the following fixup to address s390x build failures on machine-next. Signed-off-by: Eduardo Habkost --- target/s390x/kvm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 0267c6c2f6..6e814c230b 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -119,8 +119,8 @@ * Needs to be big enough to contain max_cpus emergency signals * and in addition NR_LOCAL_IRQS interrupts */ -#define VCPU_IRQ_BUF_SIZE (sizeof(struct kvm_s390_irq) * \ - (max_cpus + NR_LOCAL_IRQS)) +#define VCPU_IRQ_BUF_SIZE(max_cpus) (sizeof(struct kvm_s390_irq) * \ + (max_cpus + NR_LOCAL_IRQS)) =20 static CPUWatchpoint hw_watchpoint; /* @@ -362,9 +362,10 @@ unsigned long kvm_arch_vcpu_id(CPUState *cpu) =20 int kvm_arch_init_vcpu(CPUState *cs) { + unsigned int max_cpus =3D MACHINE(qdev_get_machine())->smp.max_cpus; S390CPU *cpu =3D S390_CPU(cs); kvm_s390_set_cpu_state(cpu, cpu->env.cpu_state); - cpu->irqstate =3D g_malloc0(VCPU_IRQ_BUF_SIZE); + cpu->irqstate =3D g_malloc0(VCPU_IRQ_BUF_SIZE(max_cpus)); return 0; } =20 @@ -1950,9 +1951,10 @@ int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu= _state) =20 void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu) { + unsigned int max_cpus =3D MACHINE(qdev_get_machine())->smp.max_cpus; struct kvm_s390_irq_state irq_state =3D { .buf =3D (uint64_t) cpu->irqstate, - .len =3D VCPU_IRQ_BUF_SIZE, + .len =3D VCPU_IRQ_BUF_SIZE(max_cpus), }; CPUState *cs =3D CPU(cpu); int32_t bytes; --=20 2.18.0.rc1.1.g3f1ff2140 --=20 Eduardo