From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786085537570.536495198083; Mon, 11 Jun 2018 23:48:05 -0700 (PDT) Received: from localhost ([::1]:53213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd5u-000466-S9 for importer@patchew.org; Tue, 12 Jun 2018 02:47:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3d-0002bv-RS for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3d-0001fS-6I for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:33 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:39735) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3c-0001Yv-9V; Tue, 12 Jun 2018 02:45:32 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPM1S3kz9s1b; Tue, 12 Jun 2018 16:45:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785927; bh=MjyZ2FmSOpb4qjipQQ6rhL+Lrn1RpvzOAtZoMWsN/YA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z4gqKzCA7asIZviQWc0F9vaic6Ko51sSyNfIxOuMwNXnq6SLiMffXW9BqfqKafWMb SfD1LxPgFwToSaii1RS3Ep8fVNkz7kgSf7ADY9xegO3cEVZNPav4+4Xq2ElrXHp5en 8rGijbm9wFgXWaTV156BAsQxfjPD07gqnAVVKUb4= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:31 +1000 Message-Id: <20180612064503.14282-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 01/33] ppc440_pcix: Fix a typo in setting a register (Coverity CID1390577) 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Signed-off-by: BALATON Zoltan Signed-off-by: David Gibson --- hw/ppc/ppc440_pcix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_pcix.c b/hw/ppc/ppc440_pcix.c index b1307e6477..d8af04b70f 100644 --- a/hw/ppc/ppc440_pcix.c +++ b/hw/ppc/ppc440_pcix.c @@ -257,7 +257,7 @@ static void ppc440_pcix_reg_write4(void *opaque, hwaddr= addr, break; case PCIX0_PIM2SAL: s->pim[2].sa &=3D 0xffffffff00000000ULL; - s->pim[2].sa =3D val; + s->pim[2].sa |=3D val; ppc440_pcix_update_pim(s, 2); break; case PCIX0_PIM2LAL: --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152878608718930.009276046930722; Mon, 11 Jun 2018 23:48:07 -0700 (PDT) Received: from localhost ([::1]:53214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd5w-00046d-7v for importer@patchew.org; Tue, 12 Jun 2018 02:47:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3e-0002bw-3V for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3d-0001g8-AZ for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:34 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:58567) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3c-0001Yi-J9; Tue, 12 Jun 2018 02:45:33 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPM0Kc5z9ryk; Tue, 12 Jun 2018 16:45:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785927; bh=xv1LNg7ZzKFZuvVZS6/46u7X7XjTJQuIntnDGSCzEmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LXPrBbw0zX9hQ2UQSwkZl+6nfL/ioWMilQ1DOBb3A4b3920V2R6xbmYIi+PmHSLDp 4hj0JGV2YDX8NOxttT/inlmOVjvl0t0lMxMVqU0AOGPeR0tEdPexihijpBVDy3aPXb UNKZbynkCFdvLAhNaPfIMxr3yowXfJlNkWUi8MCE= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:32 +1000 Message-Id: <20180612064503.14282-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 02/33] macio: add trace-events to timer device 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/misc/macio/macio.c | 3 +++ hw/misc/macio/trace-events | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 79621eb879..f9a40eea81 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -32,6 +32,7 @@ #include "hw/char/escc.h" #include "hw/misc/macio/macio.h" #include "hw/intc/heathrow_pic.h" +#include "trace.h" =20 /* Note: this code is strongly inspirated from the corresponding code * in PearPC */ @@ -246,6 +247,7 @@ static void macio_oldworld_init(Object *obj) static void timer_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { + trace_macio_timer_write(addr, size, value); } =20 static uint64_t timer_read(void *opaque, hwaddr addr, unsigned size) @@ -266,6 +268,7 @@ static uint64_t timer_read(void *opaque, hwaddr addr, u= nsigned size) break; } =20 + trace_macio_timer_read(addr, size, value); return value; } =20 diff --git a/hw/misc/macio/trace-events b/hw/misc/macio/trace-events index 24c0a36824..d499d78c99 100644 --- a/hw/misc/macio/trace-events +++ b/hw/misc/macio/trace-events @@ -9,3 +9,7 @@ cuda_packet_receive(int len) "length %d" cuda_packet_receive_data(int i, const uint8_t data) "[%d] 0x%02x" cuda_packet_send(int len) "length %d" cuda_packet_send_data(int i, const uint8_t data) "[%d] 0x%02x" + +# hw/misc/macio/macio.c +macio_timer_write(uint64_t addr, unsigned len, uint64_t val) "write addr 0= x%"PRIx64 " len %d val 0x%"PRIx64 +macio_timer_read(uint64_t addr, unsigned len, uint32_t val) "read addr 0x%= "PRIx64 " len %d val 0x%"PRIx32 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786262968862.480718218156; Mon, 11 Jun 2018 23:51:02 -0700 (PDT) Received: from localhost ([::1]:53233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd8w-0006jg-7s for importer@patchew.org; Tue, 12 Jun 2018 02:51:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3f-0002c5-6c for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3e-0001hz-4k for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:35 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:37871) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3d-0001c5-NR; Tue, 12 Jun 2018 02:45:34 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPM41Vdz9s4Y; Tue, 12 Jun 2018 16:45:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785927; bh=ooYq32JtnLU7NiGzIJesAPaJ4CJHQnQ0LSF91LCpHFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGT5BTSko9ibS/kjzF/7t88Kk9w75ZnOWF+I9Bt+7oR0ZWsfaaiD8PiV7E2IMMvf8 ZRIieNtg8PG5f/hBp5jGr8tdEiS+Q1pVd3SBKA5MIHEVId7gbAj9MC/cS7WvURDDxL LrYr6cDlA2CwDphH5yCNlz4QRdVxmMl0HtrqprlA= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:33 +1000 Message-Id: <20180612064503.14282-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 03/33] uninorth: remove token register from uninorth device 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland >From observation of various OS sources it can be seen that the token regis= ter introduced in 4e46dcdbd3 "PPC: Newworld: Add uninorth token register" is not required, since the only register currently implemented is the uninorth har= dware version which is read-only. Remove the token register implementation and instead return the uninorth version corresponding to the hardware. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/pci-host/uninorth.c | 11 +++++------ include/hw/pci-host/uninorth.h | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index ba76b84dbc..a843aa7b36 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -524,19 +524,18 @@ static void unin_write(void *opaque, hwaddr addr, uin= t64_t value, unsigned size) { trace_unin_write(addr, value); - if (addr =3D=3D 0x0) { - *(int *)opaque =3D value; - } } =20 static uint64_t unin_read(void *opaque, hwaddr addr, unsigned size) { uint32_t value; =20 - value =3D 0; switch (addr) { case 0: - value =3D *(int *)opaque; + value =3D UNINORTH_VERSION_10A; + break; + default: + value =3D 0; } =20 trace_unin_read(addr, value); @@ -555,7 +554,7 @@ static void unin_init(Object *obj) UNINState *s =3D UNI_NORTH(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 - memory_region_init_io(&s->mem, obj, &unin_ops, &s->token, "unin", 0x10= 00); + memory_region_init_io(&s->mem, obj, &unin_ops, s, "unin", 0x1000); =20 sysbus_init_mmio(sbd, &s->mem); } diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h index f6654bad9b..2a1cf9f284 100644 --- a/include/hw/pci-host/uninorth.h +++ b/include/hw/pci-host/uninorth.h @@ -29,6 +29,9 @@ =20 #include "hw/ppc/openpic.h" =20 +/* UniNorth version */ +#define UNINORTH_VERSION_10A 0x7 + #define TYPE_UNI_NORTH_PCI_HOST_BRIDGE "uni-north-pci-pcihost" #define TYPE_UNI_NORTH_AGP_HOST_BRIDGE "uni-north-agp-pcihost" #define TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE "uni-north-internal-pci-pc= ihost" @@ -57,7 +60,6 @@ typedef struct UNINState { SysBusDevice parent_obj; =20 MemoryRegion mem; - int token[1]; } UNINState; =20 #define TYPE_UNI_NORTH "uni-north" --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786281668194.43629344854685; Mon, 11 Jun 2018 23:51:21 -0700 (PDT) Received: from localhost ([::1]:53235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd9F-0006zJ-0C for importer@patchew.org; Tue, 12 Jun 2018 02:51:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3g-0002cZ-Pd for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3d-0001fR-5S for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:36 -0400 Received: from ozlabs.org ([203.11.71.1]:49089) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3c-0001Z2-46; Tue, 12 Jun 2018 02:45:32 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPM2yZtz9s1R; Tue, 12 Jun 2018 16:45:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785927; bh=+nVNr0ayMUbITDv8d+gMrMxghilBI3rCJ8iuoSQHjcA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5aLDNuBBFFh81XaBW+IAjO1SeruBNFJlGbH9QDqmSwDwFztM2qEBb17VijAZxG2p VQbaaLBv3Oa+jJcvKEhrvX7kIbpkM6+atEXvbZLQQi6DZi5hpvvfG+yBROiG9ttUnQ H+TVziyAoAIPnMoibAxV/mVx9mMvc+epZTI+pEs0= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:34 +1000 Message-Id: <20180612064503.14282-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 04/33] hw/ppc/spapr_drc: Replace error_setg(&error_abort) by error_report() + abort() 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: lvivier@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Use error_report() + abort() instead of error_setg(&error_abort), as suggested by the "qapi/error.h" documentation: Please don't error_setg(&error_fatal, ...), use error_report() and exit(), because that's more obvious. Likewise, don't error_setg(&error_abort, ...), use assert(). Use abort() instead of the suggested assert() because the error message already got displayed. Suggested-by: Eric Blake Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Signed-off-by: David Gibson --- hw/ppc/spapr_drc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 8a045d6b93..2edb7d1e9c 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -366,7 +366,8 @@ static void prop_get_fdt(Object *obj, Visitor *v, const= char *name, break; } default: - error_setg(&error_abort, "device FDT in unexpected state: %d",= tag); + error_report("device FDT in unexpected state: %d", tag); + abort(); } fdt_offset =3D fdt_offset_next; } while (fdt_depth !=3D 0); --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786452954566.0230735831424; Mon, 11 Jun 2018 23:54:12 -0700 (PDT) Received: from localhost ([::1]:53248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdBl-0000l8-4w for importer@patchew.org; Tue, 12 Jun 2018 02:53:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3i-0002eE-9f for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3g-0001mq-Vc for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:38 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:48851) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3g-0001gk-16; Tue, 12 Jun 2018 02:45:36 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPN2Fncz9s2g; Tue, 12 Jun 2018 16:45:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785928; bh=jprKaXT2PMjjPEW5fbDYVlV4GGuLvJykXztnU5/Wgto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KrjE4zc/Y8Ogd77Ga6RoVBx0S05ZzdGbp90oDdzlvIUyrfRTqN2YmcchOE6ayQ11n iRwbzwOfPT95GA2855jrctXFoufKbM6h8CTeSNHelpjK7dsrK6Z5w0urymFTs33WVu yzDkgP+yUOAr4Ww/P16V7rtaU9KKED/QTSiD4MAg= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:35 +1000 Message-Id: <20180612064503.14282-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 05/33] target/ppc: Use proper logging function for possible guest errors 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: lvivier@redhat.com, Thomas Huth , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth fprintf() and qemu_log_separate() are frowned upon these days for printing logging information in QEMU. Accessing the wrong SPRs indicates wrong guest behaviour in most cases, and we've got a proper way to log such situations, which is the qemu_log_mask(LOG_GUEST_ERROR, ...) function. So use this function now for logging the bad SPR accesses instead. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Greg Kurz Reviewed-by: Alistair Francis Signed-off-by: David Gibson --- target/ppc/translate.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index b28e8b91d3..8ba8f67dc5 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -3933,13 +3933,9 @@ static inline void gen_op_mfspr(DisasContext *ctx) * allowing userland application to read the PVR */ if (sprn !=3D SPR_PVR) { - fprintf(stderr, "Trying to read privileged spr %d (0x%03x)= at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next = - 4); - if (qemu_log_separate()) { - qemu_log("Trying to read privileged spr %d (0x%03x) at= " - TARGET_FMT_lx "\n", sprn, sprn, - ctx->base.pc_next - 4); - } + qemu_log_mask(LOG_GUEST_ERROR, "Trying to read privileged = spr " + "%d (0x%03x) at " TARGET_FMT_lx "\n", sprn, = sprn, + ctx->base.pc_next - 4); } gen_priv_exception(ctx, POWERPC_EXCP_PRIV_REG); } @@ -3951,12 +3947,9 @@ static inline void gen_op_mfspr(DisasContext *ctx) return; } /* Not defined */ - fprintf(stderr, "Trying to read invalid spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - 4); - if (qemu_log_separate()) { - qemu_log("Trying to read invalid spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - 4= ); - } + qemu_log_mask(LOG_GUEST_ERROR, + "Trying to read invalid spr %d (0x%03x) at " + TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - = 4); =20 /* The behaviour depends on MSR:PR and SPR# bit 0x10, * it can generate a priv, a hv emu or a no-op @@ -4097,12 +4090,9 @@ static void gen_mtspr(DisasContext *ctx) (*write_cb)(ctx, sprn, rS(ctx->opcode)); } else { /* Privilege exception */ - fprintf(stderr, "Trying to write privileged spr %d (0x%03x) at= " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - 4); - if (qemu_log_separate()) { - qemu_log("Trying to write privileged spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next= - 4); - } + qemu_log_mask(LOG_GUEST_ERROR, "Trying to write privileged spr= " + "%d (0x%03x) at " TARGET_FMT_lx "\n", sprn, sprn, + ctx->base.pc_next - 4); gen_priv_exception(ctx, POWERPC_EXCP_PRIV_REG); } } else { @@ -4114,12 +4104,9 @@ static void gen_mtspr(DisasContext *ctx) } =20 /* Not defined */ - if (qemu_log_separate()) { - qemu_log("Trying to write invalid spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - 4= ); - } - fprintf(stderr, "Trying to write invalid spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - 4); + qemu_log_mask(LOG_GUEST_ERROR, + "Trying to write invalid spr %d (0x%03x) at " + TARGET_FMT_lx "\n", sprn, sprn, ctx->base.pc_next - = 4); =20 =20 /* The behaviour depends on MSR:PR and SPR# bit 0x10, --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786275041553.3998210575719; Mon, 11 Jun 2018 23:51:15 -0700 (PDT) Received: from localhost ([::1]:53234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd98-0006tc-8l for importer@patchew.org; Tue, 12 Jun 2018 02:51:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3j-0002fI-83 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3i-0001o9-6L for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:39809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3h-0001hV-H7; Tue, 12 Jun 2018 02:45:37 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPQ4F8lz9s5N; Tue, 12 Jun 2018 16:45:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785930; bh=IPzTyJkx0zpENrz/T2lIbE5NSEvSGALO6ATtotrgaw8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bT4dY/aUtHjmPx6FUcatq3rupazb6iPBBwLcErzkZWo0ifiibTH0qSGpgxN/FLX4J nH3JJtFOsRdKmJk06grhm/iJxOJ1g5sOu28ivha6ri2UlccVyhUhKCigYc/kRC0uB1 trBTaCdZwGeGF0JR+zORH8eDAiToseRUCNlNkPOE= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:36 +1000 Message-Id: <20180612064503.14282-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 06/33] 40p: remove pci_allow_0_address = true from 40p machine class 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The Linux sandalfoot zImage has an initialisation process which resets the VGA controller by setting all the BAR addresses to zero to access the VGA ioports at their legacy addresses. Unfortunately setting the framebuffer BAR to address 0 makes the framebuffer memory overlap the internal VGA memory causing accesses to fail, and so prevents the kernel from switching successfully to text mode. Since OpenHackWare configures the framebuffer BAR address outside of the le= gacy VGA internal memory space, remove pci_allow_0_address from the 40p machine = class which causes the BAR reprogramming to zero to fail and so the VGA internal memory can be accessed correctly again. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/ppc/prep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index a1e7219db6..dbbe749bde 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -885,7 +885,6 @@ static void ibm_40p_machine_init(MachineClass *mc) mc->desc =3D "IBM RS/6000 7020 (40p)", mc->init =3D ibm_40p_init; mc->max_cpus =3D 1; - mc->pci_allow_0_address =3D true; mc->default_ram_size =3D 128 * M_BYTE; mc->block_default_type =3D IF_SCSI; mc->default_boot_order =3D "c"; --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786303786782.7420245768949; Mon, 11 Jun 2018 23:51:43 -0700 (PDT) Received: from localhost ([::1]:53236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd9Z-0007Ia-3z for importer@patchew.org; Tue, 12 Jun 2018 02:51:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3i-0002eD-8s for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3h-0001mw-1N for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:38 -0400 Received: from ozlabs.org ([203.11.71.1]:51477) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3g-0001gw-Iu; Tue, 12 Jun 2018 02:45:36 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPP3ZZYz9s5c; Tue, 12 Jun 2018 16:45:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785929; bh=mZ8GPji+EWwExDwjvslFZQFPOJyY+kyCjPIDYnBPihg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N+LPbslMctDPITAIZvarmvg4V6NMl8oICIc3L/lB97dmTskhtjC5eSA7T8JErTu+q 50d0wz31iI9IqA7olXbUiR+iFGRF9aYgseWTX4YurXir0itBB5Ylmg3WmFEpjWiXZx uLz0l2qF5ct5b1AdEiqVcEk87fA46Xx32Jz8SghQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:37 +1000 Message-Id: <20180612064503.14282-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 07/33] prep: fix keyboard for the 40p machine 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Commit 72d3d8f052 "hw/isa/superio: Add a keyboard/mouse controller (8042)" added an 8042 keyboard device to the PC87312 superio device to replace that being used by the prep machine. Unfortunately this commit didn't do the same for the 40p machine which broke the keyboard by registering two 8042 keyboard devices at the same address. Resolve this by similarly removing the 8042 keyboard from the 40p machine as done for the prep machine in commit 72d3d8f052. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Herv=C3=A9 Poussineau Signed-off-by: David Gibson --- hw/ppc/prep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index dbbe749bde..5ed0bcd862 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -770,7 +770,6 @@ static void ibm_40p_init(MachineState *machine) =20 /* add some more devices */ if (defaults_enabled()) { - isa_create_simple(isa_bus, TYPE_I8042); m48t59 =3D NVRAM(isa_create_simple(isa_bus, "isa-m48t59")); =20 dev =3D DEVICE(isa_create(isa_bus, "cs4231a")); --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786614144133.60926435767817; Mon, 11 Jun 2018 23:56:54 -0700 (PDT) Received: from localhost ([::1]:53271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdEb-0003QG-Ap for importer@patchew.org; Tue, 12 Jun 2018 02:56:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3j-0002f5-32 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3h-0001nv-W4 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:42239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3h-0001gu-5v; Tue, 12 Jun 2018 02:45:37 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPP1L2Cz9s4n; Tue, 12 Jun 2018 16:45:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785929; bh=kECzBmxokdjWyv4yKMvqz0BuZuvhtfPGGI6EVjLBlKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C9fcX13Goyu+O+YYvxSjnKagJ6SjDpjBoCMedmL2Mr7ZXw181U/EAKaI11ptGGTEI KjXD6KbpOBbS8k1Brg6YjQLgBMhddA3koZZCNF8MFLnMH2sx64R25ZvwT+9OhYyVw0 KBam0BeY52NyhUwy+oko8OOVFWrh6DbYTXh1vits= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:38 +1000 Message-Id: <20180612064503.14282-9-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 08/33] target/ppc: Factor out the parsing in kvmppc_get_cpu_characteristics() 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, Suraj Jitindar Singh , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Suraj Jitindar Singh Factor out the parsing of struct kvm_ppc_cpu_char in kvmppc_get_cpu_characteristics() into a separate function for each cap for simplicity. Signed-off-by: Suraj Jitindar Singh Signed-off-by: David Gibson --- target/ppc/kvm.c | 59 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index cbe13b18d1..2c0c34e125 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2412,6 +2412,41 @@ bool kvmppc_has_cap_mmu_hash_v3(void) return cap_mmu_hash_v3; } =20 +static int parse_cap_ppc_safe_cache(struct kvm_ppc_cpu_char c) +{ + if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_L1D_FLUSH_PR) { + return 2; + } else if ((c.character & c.character_mask & H_CPU_CHAR_L1D_THREAD_PRI= V) && + (c.character & c.character_mask + & (H_CPU_CHAR_L1D_FLUSH_ORI30 | H_CPU_CHAR_L1D_FLUSH_TRIG2= ))) { + return 1; + } + + return 0; +} + +static int parse_cap_ppc_safe_bounds_check(struct kvm_ppc_cpu_char c) +{ + if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR) { + return 2; + } else if (c.character & c.character_mask & H_CPU_CHAR_SPEC_BAR_ORI31)= { + return 1; + } + + return 0; +} + +static int parse_cap_ppc_safe_indirect_branch(struct kvm_ppc_cpu_char c) +{ + if (c.character & c.character_mask & H_CPU_CHAR_CACHE_COUNT_DIS) { + return SPAPR_CAP_FIXED_CCD; + } else if (c.character & c.character_mask & H_CPU_CHAR_BCCTRL_SERIALIS= ED) { + return SPAPR_CAP_FIXED_IBS; + } + + return 0; +} + static void kvmppc_get_cpu_characteristics(KVMState *s) { struct kvm_ppc_cpu_char c; @@ -2430,26 +2465,10 @@ static void kvmppc_get_cpu_characteristics(KVMState= *s) if (ret < 0) { return; } - /* Parse and set cap_ppc_safe_cache */ - if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_L1D_FLUSH_PR) { - cap_ppc_safe_cache =3D 2; - } else if ((c.character & c.character_mask & H_CPU_CHAR_L1D_THREAD_PRI= V) && - (c.character & c.character_mask - & (H_CPU_CHAR_L1D_FLUSH_ORI30 | H_CPU_CHAR_L1D_FLUSH_TRIG2= ))) { - cap_ppc_safe_cache =3D 1; - } - /* Parse and set cap_ppc_safe_bounds_check */ - if (~c.behaviour & c.behaviour_mask & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR) { - cap_ppc_safe_bounds_check =3D 2; - } else if (c.character & c.character_mask & H_CPU_CHAR_SPEC_BAR_ORI31)= { - cap_ppc_safe_bounds_check =3D 1; - } - /* Parse and set cap_ppc_safe_indirect_branch */ - if (c.character & c.character_mask & H_CPU_CHAR_CACHE_COUNT_DIS) { - cap_ppc_safe_indirect_branch =3D SPAPR_CAP_FIXED_CCD; - } else if (c.character & c.character_mask & H_CPU_CHAR_BCCTRL_SERIALIS= ED) { - cap_ppc_safe_indirect_branch =3D SPAPR_CAP_FIXED_IBS; - } + + cap_ppc_safe_cache =3D parse_cap_ppc_safe_cache(c); + cap_ppc_safe_bounds_check =3D parse_cap_ppc_safe_bounds_check(c); + cap_ppc_safe_indirect_branch =3D parse_cap_ppc_safe_indirect_branch(c); } =20 int kvmppc_get_cap_safe_cache(void) --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15287867878321014.6598751440656; Mon, 11 Jun 2018 23:59:47 -0700 (PDT) Received: from localhost ([::1]:53282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdHN-0005vA-7I for importer@patchew.org; Tue, 12 Jun 2018 02:59:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3j-0002g1-Pt for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3i-0001p2-NJ for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:58823) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3h-0001he-Ux; Tue, 12 Jun 2018 02:45:38 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPS21cwz9s78; Tue, 12 Jun 2018 16:45:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785932; bh=HUOADF0y/Dn6TlNRonquviUeBp50v9azq0IHWvRVJh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPcNOoid0fK4Of9j6dDY/bKvaRfXsMmy/LDCDV/mE+5HvyMBAxEf4alXoIYRkma7s SNciQgHSoRqUnd4iTdbUYGYHddcbVVP/sQycAlStgn2wSDReuB6aOLDQzUYez/oOTO 6wPyZ5sg1rkkHtdrnPCAqBPRZ89DQOphjvRZnAbo= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:39 +1000 Message-Id: <20180612064503.14282-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 09/33] target/ppc: Allow privileged access to SPR_PCR 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson , Joel Stanley Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Joel Stanley The powerpc Linux kernel[1] and skiboot firmware[2] recently gained changes that cause the Processor Compatibility Register (PCR) SPR to be cleared. These changes cause Linux to fail to boot on the Qemu powernv machine with an error: Trying to write privileged spr 338 (0x152) at 0000000030017f0c With this patch Qemu makes this register available as a hypervisor privileged register. Note that bits set in this register disable features of the processor. Currently the only register state that is supported is when the register is zeroed (enable all features). This is sufficient for guests to once again boot. [1] https://lkml.kernel.org/r/20180518013742.24095-1-mikey@neuling.org [2] https://patchwork.ozlabs.org/patch/915932/ Signed-off-by: Joel Stanley Signed-off-by: David Gibson --- target/ppc/helper.h | 1 + target/ppc/misc_helper.c | 9 +++++++++ target/ppc/translate_init.inc.c | 9 +++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 19453c6813..d751f0e219 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -17,6 +17,7 @@ DEF_HELPER_2(pminsn, void, env, i32) DEF_HELPER_1(rfid, void, env) DEF_HELPER_1(hrfid, void, env) DEF_HELPER_2(store_lpcr, void, env, tl) +DEF_HELPER_2(store_pcr, void, env, tl) #endif DEF_HELPER_1(check_tlb_flush_local, void, env) DEF_HELPER_1(check_tlb_flush_global, void, env) diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c index 8c8cba5cc6..b884930096 100644 --- a/target/ppc/misc_helper.c +++ b/target/ppc/misc_helper.c @@ -20,6 +20,7 @@ #include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" +#include "qemu/error-report.h" =20 #include "helper_regs.h" =20 @@ -98,6 +99,14 @@ void helper_store_ptcr(CPUPPCState *env, target_ulong va= l) tlb_flush(CPU(cpu)); } } + +void helper_store_pcr(CPUPPCState *env, target_ulong value) +{ + PowerPCCPU *cpu =3D ppc_env_get_cpu(env); + PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(cpu); + + env->spr[SPR_PCR] =3D value & pcc->pcr_mask; +} #endif /* defined(TARGET_PPC64) */ =20 void helper_store_pidr(CPUPPCState *env, target_ulong val) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index ab782cb32a..1a89017dde 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -424,6 +424,10 @@ static void spr_write_ptcr(DisasContext *ctx, int sprn= , int gprn) gen_helper_store_ptcr(cpu_env, cpu_gpr[gprn]); } =20 +static void spr_write_pcr(DisasContext *ctx, int sprn, int gprn) +{ + gen_helper_store_pcr(cpu_env, cpu_gpr[gprn]); +} #endif #endif =20 @@ -7957,11 +7961,12 @@ static void gen_spr_power6_common(CPUPPCState *env) #endif /* * Register PCR to report POWERPC_EXCP_PRIV_REG instead of - * POWERPC_EXCP_INVAL_SPR. + * POWERPC_EXCP_INVAL_SPR in userspace. Permit hypervisor access. */ - spr_register(env, SPR_PCR, "PCR", + spr_register_hv(env, SPR_PCR, "PCR", SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_pcr, 0x00000000); } =20 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786458577658.3693960105719; Mon, 11 Jun 2018 23:54:18 -0700 (PDT) Received: from localhost ([::1]:53250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdC5-00011R-Fj for importer@patchew.org; Tue, 12 Jun 2018 02:54:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3i-0002eg-PO for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3h-0001na-Ko for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:38 -0400 Received: from ozlabs.org ([203.11.71.1]:55643) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3g-0001hb-OZ; Tue, 12 Jun 2018 02:45:37 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPS3Y55z9s6w; Tue, 12 Jun 2018 16:45:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785932; bh=5wolkx41MfWk1+URHKm5VH9yz6sAUl9Gr54h1kf7shI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IUbsnLuKsz3ebfTOX2D2NlGEViL3/P6rOWWzKpi7ZHheSG8PRTO71G/W+h7I2z3ad ZXalPfQ7f8uE+Ok7lV4aGx3ioAHMDHgOAKz9biiJyE1y+mJhq1f5eWGOIKAuuf1FDn BVZ9oXtzpoPiDHfIb6PWD4nJhuEJvVEs/Z1mIW0Q= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:40 +1000 Message-Id: <20180612064503.14282-11-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 10/33] spapr/vio: deprecate the "irq" property 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater VIO devices have an "irq" property that can be used by the sPAPR IRQ allocator as an IRQ number hint. But it is not set in QEMU nor in libvirt. It brings unnecessary complexity to the underlying layers managing the IRQ number space and it is in full opposition with the new static IRQ allocator we want to introduce in sPAPR. Let's deprecate it to simplify the spapr_irq_alloc routine in the future. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Thomas Huth Reviewed-by: Greg Kurz [dwg: Check qtest_enabled() to suppress bogus warnings from make check] Signed-off-by: David Gibson --- hw/ppc/spapr_vio.c | 22 +++++++++++++++++++++- qemu-doc.texi | 12 ++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 472dd6f33a..4555c648a8 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -22,6 +22,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/visitor.h" #include "hw/hw.h" #include "qemu/log.h" #include "sysemu/sysemu.h" @@ -32,6 +33,7 @@ #include "sysemu/kvm.h" #include "sysemu/device_tree.h" #include "kvm_ppc.h" +#include "sysemu/qtest.h" =20 #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h" @@ -41,8 +43,26 @@ =20 #include =20 +static void spapr_vio_getset_irq(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + Property *prop =3D opaque; + uint32_t *ptr =3D qdev_get_prop_ptr(DEVICE(obj), prop); + + if (!qtest_enabled()) { + warn_report(TYPE_VIO_SPAPR_DEVICE " '%s' property is deprecated", = name); + } + visit_type_uint32(v, name, ptr, errp); +} + +static const PropertyInfo spapr_vio_irq_propinfo =3D { + .name =3D "irq", + .get =3D spapr_vio_getset_irq, + .set =3D spapr_vio_getset_irq, +}; + static Property spapr_vio_props[] =3D { - DEFINE_PROP_UINT32("irq", VIOsPAPRDevice, irq, 0), \ + DEFINE_PROP("irq", VIOsPAPRDevice, irq, spapr_vio_irq_propinfo, uint32= _t), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/qemu-doc.texi b/qemu-doc.texi index 9aff6b4ea9..cd05760cac 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2958,13 +2958,21 @@ support page sizes < 4096 any longer. =20 @section System emulator machines =20 -@section Block device options +@section Device options =20 -@subsection "backing": "" (since 2.12.0) +@subsection Block device options + +@subsubsection "backing": "" (since 2.12.0) =20 In order to prevent QEMU from automatically opening an image's backing chain, use ``"backing": null'' instead. =20 +@subsection vio-spapr-device device options + +@subsubsection "irq": "" (since 3.0.0) + +The ``irq'' property is obsoleted. + @node Supported build platforms @appendix Supported build platforms =20 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152878608725780.2186495659771; Mon, 11 Jun 2018 23:48:07 -0700 (PDT) Received: from localhost ([::1]:53215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd63-0004Ak-94 for importer@patchew.org; Tue, 12 Jun 2018 02:48:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3i-0002ec-Nj for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3h-0001nc-LB for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:38 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:42849) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3h-0001hU-0H; Tue, 12 Jun 2018 02:45:37 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPR383hz9s4r; Tue, 12 Jun 2018 16:45:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785931; bh=Gi/Fl0Qoz/KVdsubgQtZMbapEMSgv5VJ8MeXCR4UhzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T+47D6bOYbT/Mn0hvW4/CPjOZVITuvOK+5q8/ISFd0LF8VUCurXxCVQ/I4LG8eozV tntTa0dfj83DZ2CgGVAwNGRysHhu0wi4iWhfh8o1EdVEDRr7LLpt9kLqF+m1CtLTQ+ Np3VtYN2RyNNc5qHZ2uGQkwmSzsUpv9j93Uxs5Eg= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:41 +1000 Message-Id: <20180612064503.14282-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 11/33] osdep: powerpc64 align memory to allow 2MB radix THP page tables 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: lvivier@redhat.com, qemu-devel@nongnu.org, Nicholas Piggin , groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Nicholas Piggin This allows KVM with the Book3S radix MMU mode to take advantage of THP and install larger pages in the partition scope page tables (the host translation). Signed-off-by: Nicholas Piggin Signed-off-by: David Gibson --- include/qemu/osdep.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index afc28e5903..9ed62423c0 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -367,7 +367,8 @@ void qemu_anon_ram_free(void *ptr, size_t size); #endif =20 #if defined(__linux__) && \ - (defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)) + (defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) \ + || defined(__powerpc64__)) /* Use 2 MiB alignment so transparent hugepages can be used by KVM. Valgrind does not support alignments larger than 1 MiB, therefore we need special code which handles running on Valgrind. */ --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152878652492349.74248037797531; Mon, 11 Jun 2018 23:55:24 -0700 (PDT) Received: from localhost ([::1]:53252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdDA-00021Y-5j for importer@patchew.org; Tue, 12 Jun 2018 02:55:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3l-0002ig-To for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3k-0001rv-TG for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:41 -0400 Received: from ozlabs.org ([203.11.71.1]:55375) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3k-0001nD-Gu; Tue, 12 Jun 2018 02:45:40 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPS6l4Hz9s7L; Tue, 12 Jun 2018 16:45:31 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785932; bh=AAhQeb2UYR9Bj74RDn0/QfjoqURRszdhOgmj3qFHKbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U7JRN2TjRcGakzZk0O5QINHUUf1WFlO15pSl48Ry7EpRvl+t6YHQqkHg2qKKq3NSZ XbWfP6Y2Y57TrZvBBZyxU8Lw/NnSPE4kyS51899MaSf9S2wBr5jVkCzW0ZE0e4Y+ug l7UrWy5BYoHr1qNlRpNV+uympME5LUz90JNR+Ruc= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:42 +1000 Message-Id: <20180612064503.14282-13-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 12/33] MAINTAINERS: Add an entry for the MacIO device headers 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: lvivier@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Missed while moved in 7092e84d42b. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a40f558694..5286a1519c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -766,8 +766,9 @@ F: hw/ppc/mac_newworld.c F: hw/pci-host/uninorth.c F: hw/pci-bridge/dec.[hc] F: hw/misc/macio/ -F: include/hw/ppc/mac_dbdma.h F: hw/nvram/mac_nvram.c +F: include/hw/misc/macio/ +F: include/hw/ppc/mac_dbdma.h =20 Old World M: Alexander Graf --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152878647925625.478629146628577; Mon, 11 Jun 2018 23:54:39 -0700 (PDT) Received: from localhost ([::1]:53251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdCQ-0001Kk-H2 for importer@patchew.org; Tue, 12 Jun 2018 02:54:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3k-0002gK-41 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3j-0001po-Cz for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:40 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:42329) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3i-0001ie-Vm; Tue, 12 Jun 2018 02:45:39 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPS51Hqz9s70; Tue, 12 Jun 2018 16:45:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785932; bh=PH/+Dcu3NOrLKXJjO+cfioNq7EjcvjSMR6wZms6+afY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NiOaYEeU/FSjdXrkfS+HMH07NGtqJD3WQzRpjy+fyvisYUSIyIsi2KZPIl/eQTD/i vDmAK/DDhC0IustXVVC0kvQW/3hd39d2yOnrL0zjR8QzrjMQIHVhUhyG5poKKdbXHK uoz1GD8CQQzkOvlLnoMMOpIXjhGaxcP1ZV3tov00= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:43 +1000 Message-Id: <20180612064503.14282-14-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 13/33] MAINTAINERS: Add entries for the MOS6522 VIA device 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: lvivier@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Introduced in 51f233ec92c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5286a1519c..8a94517e9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -766,8 +766,10 @@ F: hw/ppc/mac_newworld.c F: hw/pci-host/uninorth.c F: hw/pci-bridge/dec.[hc] F: hw/misc/macio/ +F: hw/misc/mos6522.c F: hw/nvram/mac_nvram.c F: include/hw/misc/macio/ +F: include/hw/misc/mos6522.h F: include/hw/ppc/mac_dbdma.h =20 Old World --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787214433126.86633400883113; Tue, 12 Jun 2018 00:06:54 -0700 (PDT) Received: from localhost ([::1]:53328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdOD-0003X2-B4 for importer@patchew.org; Tue, 12 Jun 2018 03:06:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3l-0002io-VH for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3l-0001sH-4S for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:41 -0400 Received: from ozlabs.org ([203.11.71.1]:41805) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3k-0001nH-Nm; Tue, 12 Jun 2018 02:45:41 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPT2X1bz9s7G; Tue, 12 Jun 2018 16:45:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785933; bh=7Xrmsz92MZ7JCaqFeZEwX9RO0Xyt45x2yIAuRSxai5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NpH3UasHSAp41jK7U7ZgODJpwMU7G26ShVxghB+iRWKYojw35fF2zqb0bVj4RujdT jplq5IXyL9ONeafmmuCX1JKOvF/qOWTWgnNYu8faxTGte53Kb2qEHK9jdUR7R7HLiM kif+gcdw8Dn98T0pr27OgybcZcIqcYq5Q0aol/AU= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:44 +1000 Message-Id: <20180612064503.14282-15-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 14/33] hw/misc/mos6522: Add trailing '\n' to qemu_log() calls 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: lvivier@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/misc/mos6522.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 6163cea6ab..49166cb8ad 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -189,12 +189,12 @@ static uint64_t mos6522_get_load_time(MOS6522State *s= , MOS6522Timer *ti) =20 static void mos6522_portA_write(MOS6522State *s) { - qemu_log_mask(LOG_UNIMP, "portA_write unimplemented"); + qemu_log_mask(LOG_UNIMP, "portA_write unimplemented\n"); } =20 static void mos6522_portB_write(MOS6522State *s) { - qemu_log_mask(LOG_UNIMP, "portB_write unimplemented"); + qemu_log_mask(LOG_UNIMP, "portB_write unimplemented\n"); } =20 uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size) --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152878701508050.0054337442931; Tue, 12 Jun 2018 00:03:35 -0700 (PDT) Received: from localhost ([::1]:53311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdL4-0000dE-AA for importer@patchew.org; Tue, 12 Jun 2018 03:03:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3n-0002k8-GC for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3m-0001uH-GQ for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:43 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:46265) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3m-0001oH-3e; Tue, 12 Jun 2018 02:45:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPT5bZXz9s7c; Tue, 12 Jun 2018 16:45:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785933; bh=CNQDjDz+t3dpAnomBTvmrpeW8VFuTlLUpFK5ZV2W/qA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WiUKTfGh/acfCh/UnEaxDn7tdsmYw0Vmn7oxasJbZtua9NYQrtF+Z8mP+tdiY6il5 obf5C/o5Ey4DWgBaRTR7MZU3rP9WT4PQYuSYZORn1Zqcxr+XDBAE+IjBZ1M5hokeoB M9d86vfXgpKV6AZSgkKhTJPtDFl4uT2vs7AlqEAQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:45 +1000 Message-Id: <20180612064503.14282-16-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 15/33] ppc: remove obsolete pci_pmac_init() definitions from mac.h 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Commits 7b19318bee and 8ce3f743c7 removed the pci_pmac_init() and pci_pmac_u3_init() functions but missed the header prototypes in mac.h. Rem= ove them since they are no longer needed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/ppc/mac.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 22a7efbed6..dac96317af 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -97,12 +97,6 @@ void macio_init(PCIDevice *dev, /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" =20 -/* UniNorth PCI */ -UNINHostState *pci_pmac_init(qemu_irq *pic, - MemoryRegion *address_space_mem); -UNINHostState *pci_pmac_u3_init(qemu_irq *pic, - MemoryRegion *address_space_mem); - /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" #define MACIO_NVRAM(obj) \ --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786659761673.1617037977085; Mon, 11 Jun 2018 23:57:39 -0700 (PDT) Received: from localhost ([::1]:53275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdFK-00042n-UN for importer@patchew.org; Tue, 12 Jun 2018 02:57:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3n-0002k3-ET for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3m-0001uC-G3 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:43 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:35499) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3m-0001oF-3B; Tue, 12 Jun 2018 02:45:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPT3Kvwz9s7Q; Tue, 12 Jun 2018 16:45:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785933; bh=2ZHhU5sQsRJX8jaOpCiwEccHRvPE2ZG4s0UlecNvhnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXIdZJnNAG9h92rgnKJc3uBX5gN14LU405JZOwnIybsR6dESwJK/I7vM1kLW4fUt7 iBHktcrHe8cMpIxWbcXhggVY2j4feAjet6sJCieeFOhye0YCzm8TnCiGHw5x7lG2IO T/hpTdQWLsTCiukSuqSGbfmb1z68PmVyozAN/HCA= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:46 +1000 Message-Id: <20180612064503.14282-17-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 16/33] ppc: remove obsolete macio_init() definition from mac.h 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Commits b6712ea391 removed the macio_init() function but missed the header prototype in mac.h. Remove it since it is no longer needed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- hw/ppc/mac.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index dac96317af..89fa8bbed7 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -91,9 +91,6 @@ typedef struct MACIOIDEState { void macio_ide_init_drives(MACIOIDEState *ide, DriveInfo **hd_table); void macio_ide_register_dma(MACIOIDEState *ide); =20 -void macio_init(PCIDevice *dev, - MemoryRegion *pic_mem); - /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" =20 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787029851521.4550338296326; Tue, 12 Jun 2018 00:03:49 -0700 (PDT) Received: from localhost ([::1]:53312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdLJ-0000lw-02 for importer@patchew.org; Tue, 12 Jun 2018 03:03:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3p-0002mM-8J for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3m-0001tm-7P for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:45 -0400 Received: from ozlabs.org ([203.11.71.1]:41173) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3l-0001oo-Rf; Tue, 12 Jun 2018 02:45:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPT6jw3z9s7V; Tue, 12 Jun 2018 16:45:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785933; bh=bFT+lqBl/H0QnnDH5v+k0mwBvrTsSewhVYSK287XilA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oN4FcNuWL7mM5pfaMQYmzA99HDqKHJpIdIaIHAXPmb+rp8Hk6CLHEI7KZ3GtLQao/ uh9/Ab0TNahIvZROkEscxcB0rBptX2n1h2BBePOsZgBguhyiM18oJM/H0hxnhhOKqy ph1jeGpUXQ8iI1+Z0hror49KC6+3jmACv2NVbY8g= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:47 +1000 Message-Id: <20180612064503.14282-18-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 17/33] ppc: add missing FW_CFG_PPC_NVRAM_FLAT definition 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This is used in OpenBIOS to define the memory layout of the NVRAM device. W= hilst currently left at its default value, add the missing definition to ensure i= t is reserved. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- include/hw/ppc/ppc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h index ff0ac306be..b18ef3eefb 100644 --- a/include/hw/ppc/ppc.h +++ b/include/hw/ppc/ppc.h @@ -100,6 +100,7 @@ enum { #define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define FW_CFG_PPC_NVRAM_ADDR (FW_CFG_ARCH_LOCAL + 0x08) #define FW_CFG_PPC_BUSFREQ (FW_CFG_ARCH_LOCAL + 0x09) +#define FW_CFG_PPC_NVRAM_FLAT (FW_CFG_ARCH_LOCAL + 0x0a) =20 #define PPC_SERIAL_MM_BAUDBASE 399193 =20 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786708518904.0440472450368; Mon, 11 Jun 2018 23:58:28 -0700 (PDT) Received: from localhost ([::1]:53278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdG7-0004l4-OF for importer@patchew.org; Tue, 12 Jun 2018 02:58:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3p-0002mK-7n for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3n-0001v0-05 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:45 -0400 Received: from ozlabs.org ([203.11.71.1]:54873) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3m-0001qe-HS; Tue, 12 Jun 2018 02:45:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPV49JLzB3sk; Tue, 12 Jun 2018 16:45:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785934; bh=LD+JrzuzNDHKwy7LJSlIsRUZuSxtEaDxY0STVDy+Jh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=clhZjUAfYMx78J1uvcKhihTRspHxkg3VI2woOo+eBCHB4EYjmb3qZMxh4ReKcxLm7 PzsvQyqWJkqkxdQ3ubGsnEiIJRwW+yspJmdu+pW0vELLGkGITa82NVN29PcyULpTMC ljKo8ms1T34/3LcSFC9vbCBEKp6eFa4FAoZcfdt4= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:48 +1000 Message-Id: <20180612064503.14282-19-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 18/33] mos6522: fix vmstate_mos6522_timer version in vmstate_mos6522 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This was accidentally introduced when extracting the 6522 VIA functionality from the CUDA device, and prevents loadvm from completing successfully. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/mos6522.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 49166cb8ad..bcb306d357 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -405,7 +405,7 @@ static const VMStateDescription vmstate_mos6522 =3D { VMSTATE_UINT8(ifr, MOS6522State), VMSTATE_UINT8(ier, MOS6522State), VMSTATE_UINT8(anh, MOS6522State), - VMSTATE_STRUCT_ARRAY(timers, MOS6522State, 2, 1, + VMSTATE_STRUCT_ARRAY(timers, MOS6522State, 2, 0, vmstate_mos6522_timer, MOS6522Timer), VMSTATE_END_OF_LIST() } --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786881813398.7720004363572; Tue, 12 Jun 2018 00:01:21 -0700 (PDT) Received: from localhost ([::1]:53295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdIv-0007Ms-1y for importer@patchew.org; Tue, 12 Jun 2018 03:01:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3o-0002lI-Hn for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3m-0001uh-Q7 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:44 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:37535) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3m-0001p6-2W; Tue, 12 Jun 2018 02:45:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPV0W6wz9s7h; Tue, 12 Jun 2018 16:45:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785934; bh=gHJWOlZmTtihAZEkCFwjj16MqWjICumcWErIDmYDgs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YThguAGEUgxMMO0UkDLxKCTPRDW0uTgUhwvAFvDDOp2rlAxQKL8VoXsNOd8T4JH6y sOge5Svpr31klqARTfapMiiAhJJejVbiDY1aVV9kyD29erlfpJ5+lyB81XtNrkbwsv LAOxtLiOGK7esreBP+ANmer6REgA9zVsXdx2vxiM= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:49 +1000 Message-Id: <20180612064503.14282-20-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 19/33] cuda: embed mos6522_cuda device directly rather than using QOM object link 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Examining the migration stream it can be seen that the mos6522 device state= is being stored separately rather than as part of the CUDA device which is incorrect (and likely to cause issues if another mos6522 device is added to the machine). Resolve this by embedding the mos6522_cuda device directly within the CUDA device rather than using a QOM object link to reference the device separate= ly. Note that we also bump the version in vmstate_cuda to reflect this change: = this isn't particularly important for the moment as the Mac machine migration is= n't 100% reliable due to issues migrating the timebase under TCG. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/cuda.c | 44 +++++++++++++++--------------------- hw/misc/mos6522.c | 2 +- include/hw/misc/macio/cuda.h | 27 ++++++++++------------ include/hw/misc/mos6522.h | 2 ++ 4 files changed, 33 insertions(+), 42 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index bd9b862034..8aba2e63ec 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -65,7 +65,7 @@ static void cuda_receive_packet_from_host(CUDAState *s, static uint64_t cuda_get_counter_value(MOS6522State *s, MOS6522Timer *ti) { MOS6522CUDAState *mcs =3D container_of(s, MOS6522CUDAState, parent_obj= ); - CUDAState *cs =3D mcs->cuda; + CUDAState *cs =3D container_of(mcs, CUDAState, mos6522_cuda); =20 /* Reverse of the tb calculation algorithm that Mac OS X uses on bootu= p */ uint64_t tb_diff =3D muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), @@ -78,7 +78,7 @@ static uint64_t cuda_get_counter_value(MOS6522State *s, M= OS6522Timer *ti) static uint64_t cuda_get_load_time(MOS6522State *s, MOS6522Timer *ti) { MOS6522CUDAState *mcs =3D container_of(s, MOS6522CUDAState, parent_obj= ); - CUDAState *cs =3D mcs->cuda; + CUDAState *cs =3D container_of(mcs, CUDAState, mos6522_cuda); =20 uint64_t load_time =3D muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), cs->tb_frequency, NANOSECONDS_PER_SECOND= ); @@ -88,7 +88,7 @@ static uint64_t cuda_get_load_time(MOS6522State *s, MOS65= 22Timer *ti) static void cuda_set_sr_int(void *opaque) { CUDAState *s =3D opaque; - MOS6522CUDAState *mcs =3D s->mos6522_cuda; + MOS6522CUDAState *mcs =3D &s->mos6522_cuda; MOS6522State *ms =3D MOS6522(mcs); MOS6522DeviceClass *mdc =3D MOS6522_DEVICE_GET_CLASS(ms); =20 @@ -97,7 +97,7 @@ static void cuda_set_sr_int(void *opaque) =20 static void cuda_delay_set_sr_int(CUDAState *s) { - MOS6522CUDAState *mcs =3D s->mos6522_cuda; + MOS6522CUDAState *mcs =3D &s->mos6522_cuda; MOS6522State *ms =3D MOS6522(mcs); MOS6522DeviceClass *mdc =3D MOS6522_DEVICE_GET_CLASS(ms); int64_t expire; @@ -117,7 +117,7 @@ static void cuda_delay_set_sr_int(CUDAState *s) /* NOTE: TIP and TREQ are negated */ static void cuda_update(CUDAState *s) { - MOS6522CUDAState *mcs =3D s->mos6522_cuda; + MOS6522CUDAState *mcs =3D &s->mos6522_cuda; MOS6522State *ms =3D MOS6522(mcs); int packet_received, len; =20 @@ -462,7 +462,7 @@ static void cuda_receive_packet_from_host(CUDAState *s, static uint64_t mos6522_cuda_read(void *opaque, hwaddr addr, unsigned size) { CUDAState *s =3D opaque; - MOS6522CUDAState *mcs =3D s->mos6522_cuda; + MOS6522CUDAState *mcs =3D &s->mos6522_cuda; MOS6522State *ms =3D MOS6522(mcs); =20 addr =3D (addr >> 9) & 0xf; @@ -473,7 +473,7 @@ static void mos6522_cuda_write(void *opaque, hwaddr add= r, uint64_t val, unsigned size) { CUDAState *s =3D opaque; - MOS6522CUDAState *mcs =3D s->mos6522_cuda; + MOS6522CUDAState *mcs =3D &s->mos6522_cuda; MOS6522State *ms =3D MOS6522(mcs); =20 addr =3D (addr >> 9) & 0xf; @@ -492,9 +492,11 @@ static const MemoryRegionOps mos6522_cuda_ops =3D { =20 static const VMStateDescription vmstate_cuda =3D { .name =3D "cuda", - .version_id =3D 4, - .minimum_version_id =3D 4, + .version_id =3D 5, + .minimum_version_id =3D 5, .fields =3D (VMStateField[]) { + VMSTATE_STRUCT(mos6522_cuda.parent_obj, CUDAState, 0, vmstate_mos6= 522, + MOS6522State), VMSTATE_UINT8(last_b, CUDAState), VMSTATE_UINT8(last_acr, CUDAState), VMSTATE_INT32(data_in_size, CUDAState), @@ -530,12 +532,8 @@ static void cuda_realize(DeviceState *dev, Error **err= p) DeviceState *d; struct tm tm; =20 - d =3D qdev_create(NULL, TYPE_MOS6522_CUDA); - object_property_set_link(OBJECT(d), OBJECT(s), "cuda", errp); - qdev_init_nofail(d); - s->mos6522_cuda =3D MOS6522_CUDA(d); - /* Pass IRQ from 6522 */ + d =3D DEVICE(&s->mos6522_cuda); ms =3D MOS6522(d); sbd =3D SYS_BUS_DEVICE(s); sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms)); @@ -556,6 +554,10 @@ static void cuda_init(Object *obj) CUDAState *s =3D CUDA(obj); SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 + object_initialize(&s->mos6522_cuda, sizeof(s->mos6522_cuda), + TYPE_MOS6522_CUDA); + qdev_set_parent_bus(DEVICE(&s->mos6522_cuda), sysbus_get_default()); + memory_region_init_io(&s->mem, obj, &mos6522_cuda_ops, s, "cuda", 0x20= 00); sysbus_init_mmio(sbd, &s->mem); =20 @@ -590,8 +592,9 @@ static const TypeInfo cuda_type_info =3D { static void mos6522_cuda_portB_write(MOS6522State *s) { MOS6522CUDAState *mcs =3D container_of(s, MOS6522CUDAState, parent_obj= ); + CUDAState *cs =3D container_of(mcs, CUDAState, mos6522_cuda); =20 - cuda_update(mcs->cuda); + cuda_update(cs); } =20 static void mos6522_cuda_realize(DeviceState *dev, Error **errp) @@ -605,16 +608,6 @@ static void mos6522_cuda_realize(DeviceState *dev, Err= or **errp) ms->timers[1].frequency =3D (SCALE_US * 6000) / 4700; } =20 -static void mos6522_cuda_init(Object *obj) -{ - MOS6522CUDAState *s =3D MOS6522_CUDA(obj); - - object_property_add_link(obj, "cuda", TYPE_CUDA, - (Object **) &s->cuda, - qdev_prop_allow_set_link_before_realize, - 0, NULL); -} - static void mos6522_cuda_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); @@ -632,7 +625,6 @@ static const TypeInfo mos6522_cuda_type_info =3D { .name =3D TYPE_MOS6522_CUDA, .parent =3D TYPE_MOS6522, .instance_size =3D sizeof(MOS6522CUDAState), - .instance_init =3D mos6522_cuda_init, .class_init =3D mos6522_cuda_class_init, }; =20 diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index bcb306d357..524a250329 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -390,7 +390,7 @@ static const VMStateDescription vmstate_mos6522_timer = =3D { } }; =20 -static const VMStateDescription vmstate_mos6522 =3D { +const VMStateDescription vmstate_mos6522 =3D { .name =3D "mos6522", .version_id =3D 0, .minimum_version_id =3D 0, diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h index 494b709579..7dad469142 100644 --- a/include/hw/misc/macio/cuda.h +++ b/include/hw/misc/macio/cuda.h @@ -54,12 +54,21 @@ #define CUDA_TIMER_TICKLE 0x24 #define CUDA_COMBINED_FORMAT_IIC 0x25 =20 + +/* MOS6522 CUDA */ +typedef struct MOS6522CUDAState { + /*< private >*/ + MOS6522State parent_obj; +} MOS6522CUDAState; + +#define TYPE_MOS6522_CUDA "mos6522-cuda" +#define MOS6522_CUDA(obj) OBJECT_CHECK(MOS6522CUDAState, (obj), \ + TYPE_MOS6522_CUDA) + /* Cuda */ #define TYPE_CUDA "cuda" #define CUDA(obj) OBJECT_CHECK(CUDAState, (obj), TYPE_CUDA) =20 -typedef struct MOS6522CUDAState MOS6522CUDAState; - typedef struct CUDAState { /*< private >*/ SysBusDevice parent_obj; @@ -67,7 +76,7 @@ typedef struct CUDAState { MemoryRegion mem; =20 ADBBusState adb_bus; - MOS6522CUDAState *mos6522_cuda; + MOS6522CUDAState mos6522_cuda; =20 uint32_t tick_offset; uint64_t tb_frequency; @@ -92,16 +101,4 @@ typedef struct CUDAState { QEMUTimer *adb_poll_timer; } CUDAState; =20 -/* MOS6522 CUDA */ -struct MOS6522CUDAState { - /*< private >*/ - MOS6522State parent_obj; - - CUDAState *cuda; -}; - -#define TYPE_MOS6522_CUDA "mos6522-cuda" -#define MOS6522_CUDA(obj) OBJECT_CHECK(MOS6522CUDAState, (obj), \ - TYPE_MOS6522_CUDA) - #endif /* CUDA_H */ diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index a53c161b00..cb0fd7db78 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -146,6 +146,8 @@ typedef struct MOS6522DeviceClass { #define MOS6522_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(MOS6522DeviceClass, (obj), TYPE_MOS6522) =20 +extern const VMStateDescription vmstate_mos6522; + uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size); void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size); =20 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786834354511.1488403466674; Tue, 12 Jun 2018 00:00:34 -0700 (PDT) Received: from localhost ([::1]:53287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdI6-0006bj-92 for importer@patchew.org; Tue, 12 Jun 2018 03:00:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3n-0002kT-Nb for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3m-0001uY-ON for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:43 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:46009) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3l-0001pf-W1; Tue, 12 Jun 2018 02:45:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPV1ZjTzB3sg; Tue, 12 Jun 2018 16:45:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785934; bh=GrvWzIR6bhLHuUi20B2cMDZgFFwzB91K4qBbXoPlIvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qCzPWeft54AjtjwzEH7keBD5ZNcWAualuijwluRuEyGXc/KBQEjItBjfLSptzTsEV PSLQP1sQOwenrZWUz5nt5BdbYLllwk/sNpkqkcxjHkb4xE/5Q4PJ6nNjUT8xGGi2EG AHLI6aFRplQ8IzH3xnSyZw+FJm5OmUOCCDgaBCXc= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:50 +1000 Message-Id: <20180612064503.14282-21-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 20/33] mos6522: move timer frequency initialisation to mos6522_reset 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The 6522 VIA timer frequency cannot be set by altering registers within the device itself and hence it is a fixed property of the machine. Move the initialisation of the timer frequency to the mos6522 reset function and ensure that any subclasses always call the parent reset function so that it isn't required to store the timer frequency within vmstate_mos6522_timer itself. By moving the frequency initialisation to the device reset function then we find that the realize function for both mos6522 and mos6522_cuda becomes obsolete and can simply be removed. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/cuda.c | 6 +++--- hw/misc/mos6522.c | 13 +++---------- include/hw/misc/mos6522.h | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 8aba2e63ec..9651ed9744 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -597,12 +597,12 @@ static void mos6522_cuda_portB_write(MOS6522State *s) cuda_update(cs); } =20 -static void mos6522_cuda_realize(DeviceState *dev, Error **errp) +static void mos6522_cuda_reset(DeviceState *dev) { MOS6522State *ms =3D MOS6522(dev); MOS6522DeviceClass *mdc =3D MOS6522_DEVICE_GET_CLASS(ms); =20 - mdc->parent_realize(dev, errp); + mdc->parent_reset(dev); =20 ms->timers[0].frequency =3D CUDA_TIMER_FREQ; ms->timers[1].frequency =3D (SCALE_US * 6000) / 4700; @@ -613,7 +613,7 @@ static void mos6522_cuda_class_init(ObjectClass *oc, vo= id *data) DeviceClass *dc =3D DEVICE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_DEVICE_CLASS(oc); =20 - dc->realize =3D mos6522_cuda_realize; + dc->reset =3D mos6522_cuda_reset; mdc->portB_write =3D mos6522_cuda_portB_write; mdc->get_timer1_counter_value =3D cuda_get_counter_value; mdc->get_timer2_counter_value =3D cuda_get_counter_value; diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 524a250329..2f58b9707f 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -427,18 +427,12 @@ static void mos6522_reset(DeviceState *dev) /* s->ier =3D T1_INT | SR_INT; */ s->anh =3D 0; =20 + s->timers[0].frequency =3D s->frequency; s->timers[0].latch =3D 0xffff; set_counter(s, &s->timers[0], 0xffff); =20 - s->timers[1].latch =3D 0xffff; -} - -static void mos6522_realize(DeviceState *dev, Error **errp) -{ - MOS6522State *s =3D MOS6522(dev); - - s->timers[0].frequency =3D s->frequency; s->timers[1].frequency =3D s->frequency; + s->timers[1].latch =3D 0xffff; } =20 static void mos6522_init(Object *obj) @@ -469,11 +463,10 @@ static void mos6522_class_init(ObjectClass *oc, void = *data) DeviceClass *dc =3D DEVICE_CLASS(oc); MOS6522DeviceClass *mdc =3D MOS6522_DEVICE_CLASS(oc); =20 - dc->realize =3D mos6522_realize; dc->reset =3D mos6522_reset; dc->vmsd =3D &vmstate_mos6522; dc->props =3D mos6522_properties; - mdc->parent_realize =3D dc->realize; + mdc->parent_reset =3D dc->reset; mdc->set_sr_int =3D mos6522_set_sr_int; mdc->portB_write =3D mos6522_portB_write; mdc->portA_write =3D mos6522_portA_write; diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index cb0fd7db78..f52b41920b 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -130,7 +130,7 @@ typedef struct MOS6522State { typedef struct MOS6522DeviceClass { DeviceClass parent_class; =20 - DeviceRealize parent_realize; + DeviceReset parent_reset; void (*set_sr_int)(MOS6522State *dev); void (*portB_write)(MOS6522State *dev); void (*portA_write)(MOS6522State *dev); --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787667274335.3942332623684; Tue, 12 Jun 2018 00:14:27 -0700 (PDT) Received: from localhost ([::1]:53391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdVa-00027l-Gg for importer@patchew.org; Tue, 12 Jun 2018 03:14:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3s-0002rb-KT for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3r-00020V-9P for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:48 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:37503) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3q-0001um-Nu; Tue, 12 Jun 2018 02:45:47 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPX1hPYzB3sp; Tue, 12 Jun 2018 16:45:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785936; bh=b8/FNPWYjO+pf1gEhU5mrfxJLJKDf3Jld7UK5mJMc1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbVdzH9asvZ9x1XIuz7FYEXaKxcLB3A2Swfp0eirqPoqILQcv6PUU362KjtrjeKVj 4e1GGDeQn8R+HGEhpDcxCHvfULB2PlCkXLHGGalTQuB5iieYezvIsBphsrXonR0hih om2a5D4sjYi48LMiFMmUxYCuLC/RaCx1sNoHCbmU= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:51 +1000 Message-Id: <20180612064503.14282-22-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 21/33] mos6522: convert VMSTATE_TIMER_PTR_TEST to VMSTATE_TIMER_PTR 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: lvivier@redhat.com, Mark Cave-Ayland , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The timers are configured in the mos6522 init function and therefore will always exist, so the function can never return false. Peter also pointed out that this is the only remaining user of VMSTATE_TIMER_PTR_TEST in the codebase, so we might as well just convert it over to VMSTATE_TIMER_PTR and remove mos6522_timer_exist() as it is no longer required. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell Signed-off-by: David Gibson --- hw/misc/mos6522.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 2f58b9707f..44eb306cf1 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -369,13 +369,6 @@ static const MemoryRegionOps mos6522_ops =3D { }, }; =20 -static bool mos6522_timer_exist(void *opaque, int version_id) -{ - MOS6522Timer *s =3D opaque; - - return s->timer !=3D NULL; -} - static const VMStateDescription vmstate_mos6522_timer =3D { .name =3D "mos6522_timer", .version_id =3D 0, @@ -385,7 +378,7 @@ static const VMStateDescription vmstate_mos6522_timer = =3D { VMSTATE_UINT16(counter_value, MOS6522Timer), VMSTATE_INT64(load_time, MOS6522Timer), VMSTATE_INT64(next_irq_time, MOS6522Timer), - VMSTATE_TIMER_PTR_TEST(timer, MOS6522Timer, mos6522_timer_exist), + VMSTATE_TIMER_PTR(timer, MOS6522Timer), VMSTATE_END_OF_LIST() } }; --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787394734316.1034449091867; Tue, 12 Jun 2018 00:09:54 -0700 (PDT) Received: from localhost ([::1]:53343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdR7-00067D-Uu for importer@patchew.org; Tue, 12 Jun 2018 03:09:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3p-0002mG-7M for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3o-0001wA-2f for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:45 -0400 Received: from ozlabs.org ([203.11.71.1]:41849) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3n-0001t3-M7; Tue, 12 Jun 2018 02:45:43 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPW6SWqzB3sq; Tue, 12 Jun 2018 16:45:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785935; bh=gS0HCnz2yA1RGuJq7UdmY2XdzjOELLO3g2tiHSuHjJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9cpkornr4Y6JjkJi0I3W4LdapscEhddFdZJ0ou3z8IneEFIMLzd3AV1tyjgvateJ 9A/KbWzaRXRt2E+yt5tOfFrFIvskvw37t4GQDQ6r1vtORnZa/69v1hN/ft/fGDNDVe DyhnVf4+w4qdk4oWr7Asazt+ear8INdFvMUw/AYI= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:52 +1000 Message-Id: <20180612064503.14282-23-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 22/33] target/ppc: extend eieio for POWER9 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater POWER9 introduced a new variant of the eieio instruction using bit 6 as a hint to tell the CPU it is a store-forwarding barrier. The usage of this eieio extension was recently added in Linux 4.17 which activated the "support for a store forwarding barrier at kernel entry/exit". Unfortunately, it is not possible to insert this new eieio instruction without considerable change in ppc_tr_translate_insn(). So instead we loosen the QEMU eieio instruction mask and modify the gen_eieio() helper to test for bit6. On non-POWER9 CPUs, the bit6 is just ignored but a warning is emitted as this is not an instruction software should be using. Signed-off-by: C=C3=A9dric Le Goater Signed-off-by: David Gibson --- target/ppc/translate.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 8ba8f67dc5..5fe1ba6555 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -2967,7 +2967,28 @@ static void gen_stswx(DisasContext *ctx) /* eieio */ static void gen_eieio(DisasContext *ctx) { - tcg_gen_mb(TCG_MO_LD_ST | TCG_BAR_SC); + TCGBar bar =3D TCG_MO_LD_ST; + + /* + * POWER9 has a eieio instruction variant using bit 6 as a hint to + * tell the CPU it is a store-forwarding barrier. + */ + if (ctx->opcode & 0x2000000) { + /* + * ISA says that "Reserved fields in instructions are ignored + * by the processor". So ignore the bit 6 on non-POWER9 CPU but + * as this is not an instruction software should be using, + * complain to the user. + */ + if (!(ctx->insns_flags2 & PPC2_ISA300)) { + qemu_log_mask(LOG_GUEST_ERROR, "invalid eieio using bit 6 at @" + TARGET_FMT_lx "\n", ctx->base.pc_next - 4); + } else { + bar =3D TCG_MO_ST_LD; + } + } + + tcg_gen_mb(bar | TCG_BAR_SC); } =20 #if !defined(CONFIG_USER_ONLY) @@ -6483,7 +6504,7 @@ GEN_HANDLER(lswi, 0x1F, 0x15, 0x12, 0x00000001, PPC_S= TRING), GEN_HANDLER(lswx, 0x1F, 0x15, 0x10, 0x00000001, PPC_STRING), GEN_HANDLER(stswi, 0x1F, 0x15, 0x16, 0x00000001, PPC_STRING), GEN_HANDLER(stswx, 0x1F, 0x15, 0x14, 0x00000001, PPC_STRING), -GEN_HANDLER(eieio, 0x1F, 0x16, 0x1A, 0x03FFF801, PPC_MEM_EIEIO), +GEN_HANDLER(eieio, 0x1F, 0x16, 0x1A, 0x01FFF801, PPC_MEM_EIEIO), GEN_HANDLER(isync, 0x13, 0x16, 0x04, 0x03FFF801, PPC_MEM), GEN_HANDLER_E(lbarx, 0x1F, 0x14, 0x01, 0, PPC_NONE, PPC2_ATOMIC_ISA206), GEN_HANDLER_E(lharx, 0x1F, 0x14, 0x03, 0, PPC_NONE, PPC2_ATOMIC_ISA206), --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787222239520.3332030948777; Tue, 12 Jun 2018 00:07:02 -0700 (PDT) Received: from localhost ([::1]:53329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdOP-0003fO-Aa for importer@patchew.org; Tue, 12 Jun 2018 03:07:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3q-0002pB-5l for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3o-0001wf-LK for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:46 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:48405) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3n-0001sm-UP; Tue, 12 Jun 2018 02:45:44 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPV6kBQzB3h4; Tue, 12 Jun 2018 16:45:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785934; bh=kCQ72LN0rrl7sQ7Lv4KH4KeFutuaIRepKdTCPBVVCSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FBDsVlhCw3w5zsoKMxWaqrKRwMKIcF3li9QoDToNc0n63xiQt8S4+nLlwVlWpFaab 1Sf6qkhQHxnjeWHYEh7NhApDSwnQxYQvG/u4hDdzdUMG12kCgerNd/HpCpD84EGpRV fAACCHuSyL7S8UFzfpu/XpPpcRkxzvfE9iuQHvyo= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:53 +1000 Message-Id: <20180612064503.14282-24-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 23/33] ppc4xx_i2c: Clean up and improve error logging 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Make it more readable by converting register indexes to decimal (avoids lot of superfluous 0x0) and distinguish errors caused by accessing non-existent vs. unimplemented registers. No functional change. Signed-off-by: BALATON Zoltan Signed-off-by: David Gibson --- hw/i2c/ppc4xx_i2c.c | 94 ++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/hw/i2c/ppc4xx_i2c.c b/hw/i2c/ppc4xx_i2c.c index ab64d196be..d1936dbdca 100644 --- a/hw/i2c/ppc4xx_i2c.c +++ b/hw/i2c/ppc4xx_i2c.c @@ -31,7 +31,7 @@ #include "hw/hw.h" #include "hw/i2c/ppc4xx_i2c.h" =20 -#define PPC4xx_I2C_MEM_SIZE 0x12 +#define PPC4xx_I2C_MEM_SIZE 18 =20 #define IIC_CNTL_PT (1 << 0) #define IIC_CNTL_READ (1 << 1) @@ -70,7 +70,7 @@ static void ppc4xx_i2c_reset(DeviceState *s) i2c->intrmsk =3D 0; i2c->xfrcnt =3D 0; i2c->xtcntlss =3D 0; - i2c->directcntl =3D 0x0f; + i2c->directcntl =3D 0xf; i2c->intr =3D 0; } =20 @@ -85,7 +85,7 @@ static uint64_t ppc4xx_i2c_readb(void *opaque, hwaddr add= r, unsigned int size) uint64_t ret; =20 switch (addr) { - case 0x00: + case 0: ret =3D i2c->mdata; if (ppc4xx_i2c_is_master(i2c)) { ret =3D 0xff; @@ -139,58 +139,62 @@ static uint64_t ppc4xx_i2c_readb(void *opaque, hwaddr= addr, unsigned int size) TYPE_PPC4xx_I2C, __func__); } break; - case 0x02: + case 2: ret =3D i2c->sdata; break; - case 0x04: + case 4: ret =3D i2c->lmadr; break; - case 0x05: + case 5: ret =3D i2c->hmadr; break; - case 0x06: + case 6: ret =3D i2c->cntl; break; - case 0x07: + case 7: ret =3D i2c->mdcntl; break; - case 0x08: + case 8: ret =3D i2c->sts; break; - case 0x09: + case 9: ret =3D i2c->extsts; break; - case 0x0A: + case 10: ret =3D i2c->lsadr; break; - case 0x0B: + case 11: ret =3D i2c->hsadr; break; - case 0x0C: + case 12: ret =3D i2c->clkdiv; break; - case 0x0D: + case 13: ret =3D i2c->intrmsk; break; - case 0x0E: + case 14: ret =3D i2c->xfrcnt; break; - case 0x0F: + case 15: ret =3D i2c->xtcntlss; break; - case 0x10: + case 16: ret =3D i2c->directcntl; break; - case 0x11: + case 17: ret =3D i2c->intr; break; default: - qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%" - HWADDR_PRIx "\n", TYPE_PPC4xx_I2C, __func__, addr); + if (addr < PPC4xx_I2C_MEM_SIZE) { + qemu_log_mask(LOG_UNIMP, "%s: Unimplemented register 0x%" + HWADDR_PRIx "\n", __func__, addr); + } else { + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address 0x%" + HWADDR_PRIx "\n", __func__, addr); + } ret =3D 0; break; } - return ret; } =20 @@ -200,7 +204,7 @@ static void ppc4xx_i2c_writeb(void *opaque, hwaddr addr= , uint64_t value, PPC4xxI2CState *i2c =3D opaque; =20 switch (addr) { - case 0x00: + case 0: i2c->mdata =3D value; if (!i2c_bus_busy(i2c->bus)) { /* assume we start a write transfer */ @@ -225,19 +229,19 @@ static void ppc4xx_i2c_writeb(void *opaque, hwaddr ad= dr, uint64_t value, } } break; - case 0x02: + case 2: i2c->sdata =3D value; break; - case 0x04: + case 4: i2c->lmadr =3D value; if (i2c_bus_busy(i2c->bus)) { i2c_end_transfer(i2c->bus); } break; - case 0x05: + case 5: i2c->hmadr =3D value; break; - case 0x06: + case 6: i2c->cntl =3D value; if (i2c->cntl & IIC_CNTL_PT) { if (i2c->cntl & IIC_CNTL_READ) { @@ -263,32 +267,31 @@ static void ppc4xx_i2c_writeb(void *opaque, hwaddr ad= dr, uint64_t value, } } break; - case 0x07: - i2c->mdcntl =3D value & 0xDF; + case 7: + i2c->mdcntl =3D value & 0xdf; break; - case 0x08: - i2c->sts &=3D ~(value & 0x0A); + case 8: + i2c->sts &=3D ~(value & 0xa); break; - case 0x09: - i2c->extsts &=3D ~(value & 0x8F); + case 9: + i2c->extsts &=3D ~(value & 0x8f); break; - case 0x0A: + case 10: i2c->lsadr =3D value; - /*i2c_set_slave_address(i2c->bus, i2c->lsadr);*/ break; - case 0x0B: + case 11: i2c->hsadr =3D value; break; - case 0x0C: + case 12: i2c->clkdiv =3D value; break; - case 0x0D: + case 13: i2c->intrmsk =3D value; break; - case 0x0E: + case 14: i2c->xfrcnt =3D value & 0x77; break; - case 0x0F: + case 15: if (value & IIC_XTCNTLSS_SRST) { /* Is it actually a full reset? U-Boot sets some regs before */ ppc4xx_i2c_reset(DEVICE(i2c)); @@ -296,15 +299,20 @@ static void ppc4xx_i2c_writeb(void *opaque, hwaddr ad= dr, uint64_t value, } i2c->xtcntlss =3D value; break; - case 0x10: + case 16: i2c->directcntl =3D value & 0x7; break; - case 0x11: + case 17: i2c->intr =3D value; break; default: - qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad address at offset 0x%" - HWADDR_PRIx "\n", TYPE_PPC4xx_I2C, __func__, addr); + if (addr < PPC4xx_I2C_MEM_SIZE) { + qemu_log_mask(LOG_UNIMP, "%s: Unimplemented register 0x%" + HWADDR_PRIx "\n", __func__, addr); + } else { + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad address 0x%" + HWADDR_PRIx "\n", __func__, addr); + } break; } } --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787848619469.7757192593996; Tue, 12 Jun 2018 00:17:28 -0700 (PDT) Received: from localhost ([::1]:53411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdYV-0004m7-QT for importer@patchew.org; Tue, 12 Jun 2018 03:17:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3r-0002rE-NV for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3q-0001yl-9I for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:47 -0400 Received: from ozlabs.org ([203.11.71.1]:44767) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3p-0001vF-TR; Tue, 12 Jun 2018 02:45:46 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPY3vqJzB3sy; Tue, 12 Jun 2018 16:45:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785937; bh=O22wyXnKIcuL3U/IGp1f2ykRnSBlkOsJmgJ+ZluurgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e40wazKPN8rk+PRCN6VKCjU2yy6f2d/lSXx/3qIGiZgx46ksxJ9+LeKCCnHR3Unsb A5/StIpSvJb9AyeXFAFyHXgdsCch2cOCFvgLd852JD74rkj5YddIWceGEUZiXIKNj5 UuXBb+Knyju8yvDIEvKRMQfLT3lPhe8aXyq2FVrM= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:54 +1000 Message-Id: <20180612064503.14282-25-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 24/33] target/ppc: Allow PIR read in privileged mode 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: lvivier@redhat.com, Alexander Graf , luporl , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: luporl According to PowerISA, the PIR register should be readable in privileged mode also, not only in hypervisor privileged mode. PowerISA 3.0 - 4.3.3 Processor Identification Register "Read access to the PIR is privileged; write access is not provided." Figure 18 in section 4.4.4 explicitly confirms that mfspr PIR is privileged and doesn't require hypervisor state. Cc: David Gibson Cc: Alexander Graf Cc: qemu-ppc@nongnu.org Signed-off-by: Leandro Lupori Reviewed-by: Jose Ricardo Ziviani Reviewed-by: Greg Kurz Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- target/ppc/translate_init.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index 1a89017dde..bb9296f5a3 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -7819,7 +7819,7 @@ static void gen_spr_book3s_ids(CPUPPCState *env) /* Processor identification */ spr_register_hv(env, SPR_PIR, "PIR", SPR_NOACCESS, SPR_NOACCESS, - SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, SPR_NOACCESS, &spr_read_generic, NULL, 0x00000000); spr_register_hv(env, SPR_HID0, "HID0", --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787400279464.74909016733943; Tue, 12 Jun 2018 00:10:00 -0700 (PDT) Received: from localhost ([::1]:53344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdRH-0006Gf-F4 for importer@patchew.org; Tue, 12 Jun 2018 03:09:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3r-0002qs-7t for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3q-0001yT-1N for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:47 -0400 Received: from ozlabs.org ([203.11.71.1]:60935) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3p-0001v4-K8; Tue, 12 Jun 2018 02:45:45 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPY0xSLzB3t1; Tue, 12 Jun 2018 16:45:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785937; bh=U4BqNBo3O8aRt6uF7yEqnL7EqtPlVOKskwfE3fms4VQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8UvJ5rGTxurM8HcwaxwKOc1oCZdNhkQ7FH2nxi4/Fz/567G3IlclGcgacymGR95/ lE0K05i3IvoOnfji3hb8xWAo4ZLkaMM8hQEklUI2VuBDtGtu93HMbhATqGcrENj/QA pEtCTJB04IwwliVNqWWH2TbDak7zg4+8nTRqat/4= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:55 +1000 Message-Id: <20180612064503.14282-26-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 25/33] spapr: no need to verify the node 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: lvivier@redhat.com, David Hildenbrand , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand The node property can always be queried and the value has already been verified in pc_dimm_realize(). Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: David Hildenbrand Signed-off-by: David Gibson --- hw/ppc/spapr.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 2375cbee12..f16a0b2870 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3578,14 +3578,8 @@ static void spapr_machine_device_plug(HotplugHandler= *hotplug_dev, error_setg(errp, "Memory hotplug not supported for this machin= e"); return; } - node =3D object_property_get_uint(OBJECT(dev), PC_DIMM_NODE_PROP, = errp); - if (*errp) { - return; - } - if (node < 0 || node >=3D MAX_NODES) { - error_setg(errp, "Invaild node %d", node); - return; - } + node =3D object_property_get_uint(OBJECT(dev), PC_DIMM_NODE_PROP, + &error_abort); =20 spapr_memory_plug(hotplug_dev, dev, node, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) { --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786884258836.3001070678596; Tue, 12 Jun 2018 00:01:24 -0700 (PDT) Received: from localhost ([::1]:53298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdIx-0007Se-Gl for importer@patchew.org; Tue, 12 Jun 2018 03:01:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3s-0002rN-Dx for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3r-00020B-6U for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:48 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:42717) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3q-0001v6-KR; Tue, 12 Jun 2018 02:45:47 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPX5NgnzB3sm; Tue, 12 Jun 2018 16:45:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785936; bh=42N/fyONov12yVGGtbDxOP2Xk7h5a0Q9rfAzUAjxYPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fTb+QTANhu/EpyRROtxr12GutXK7bjXPvM3JfcJyxKWkQa+dVphyeULk8cToqXPuQ EgRcDtyqonwYep2WlKpeuksVkbsPAA/XdkdAACcO2/OMa8K7C6kD9+4+PJLffkzK3T SbkhyHPE1ZYS9vutzWRzI/qwsqt2U3F+d4/Ifz6U= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:56 +1000 Message-Id: <20180612064503.14282-27-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 26/33] spapr: move lookup of the node into spapr_memory_plug() 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: lvivier@redhat.com, David Hildenbrand , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Let's clean the hotplug handler up by moving lookup of the node into the function where it is actually being used. Signed-off-by: David Hildenbrand Reviewed-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f16a0b2870..1f577b274b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3136,7 +3136,7 @@ static void spapr_add_lmbs(DeviceState *dev, uint64_t= addr_start, uint64_t size, } =20 static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *de= v, - uint32_t node, Error **errp) + Error **errp) { Error *local_err =3D NULL; sPAPRMachineState *ms =3D SPAPR_MACHINE(hotplug_dev); @@ -3144,6 +3144,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr; uint64_t align, size, addr; + uint32_t node; =20 mr =3D ddc->get_memory_region(dimm, &local_err); if (local_err) { @@ -3163,6 +3164,8 @@ static void spapr_memory_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, goto out_unplug; } =20 + node =3D object_property_get_uint(OBJECT(dev), PC_DIMM_NODE_PROP, + &error_abort); spapr_add_lmbs(dev, addr, size, node, spapr_ovec_test(ms->ov5_cas, OV5_HP_EVT), &local_err); @@ -3572,16 +3575,11 @@ static void spapr_machine_device_plug(HotplugHandle= r *hotplug_dev, sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(ms); =20 if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { - int node; - if (!smc->dr_lmb_enabled) { error_setg(errp, "Memory hotplug not supported for this machin= e"); return; } - node =3D object_property_get_uint(OBJECT(dev), PC_DIMM_NODE_PROP, - &error_abort); - - spapr_memory_plug(hotplug_dev, dev, node, errp); + spapr_memory_plug(hotplug_dev, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) { spapr_core_plug(hotplug_dev, dev, errp); } --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787107317636.5654192910403; Tue, 12 Jun 2018 00:05:07 -0700 (PDT) Received: from localhost ([::1]:53314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdMY-0001wn-F1 for importer@patchew.org; Tue, 12 Jun 2018 03:05:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3r-0002qg-3S for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3p-0001yG-UT for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:47 -0400 Received: from ozlabs.org ([203.11.71.1]:58543) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3p-0001vJ-H3; Tue, 12 Jun 2018 02:45:45 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPY5K3wzB3sv; Tue, 12 Jun 2018 16:45:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785937; bh=GYxPXIewBmgTGOfJD6FdZOc+ZxzfoTGBjEEkyXnoLc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=It5+ERpgz1hjZlcFenYaGKAfh35XI4bUd2hhFLV+MjBoAi9iISSXEq0I7jNxNiIRy XW0jiEwLuk8qG8QYjZWn2RXlVVyY2+F5oomL9E7tgFpbH6IB+D9rqhDztGf6KzYcPE DXWvZU5COn7zyWxgd+BRJJmrKuozX3260MIxA9zk= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:57 +1000 Message-Id: <20180612064503.14282-28-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 27/33] spapr: move memory hotplug support check into spapr_memory_pre_plug() 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: lvivier@redhat.com, David Hildenbrand , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Let's finish cleaning up the hotplug handler. This check can be performed in the pre_plug code as the very first thing. Signed-off-by: David Hildenbrand Reviewed-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 1f577b274b..9b8b4068b1 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3184,12 +3184,18 @@ out: static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState= *dev, Error **errp) { + const sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(hotplug_dev); PCDIMMDevice *dimm =3D PC_DIMM(dev); PCDIMMDeviceClass *ddc =3D PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr; uint64_t size; char *mem_dev; =20 + if (!smc->dr_lmb_enabled) { + error_setg(errp, "Memory hotplug not supported for this machine"); + return; + } + mr =3D ddc->get_memory_region(dimm, errp); if (!mr) { return; @@ -3571,14 +3577,7 @@ out: static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { - MachineState *ms =3D MACHINE(hotplug_dev); - sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(ms); - if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { - if (!smc->dr_lmb_enabled) { - error_setg(errp, "Memory hotplug not supported for this machin= e"); - return; - } spapr_memory_plug(hotplug_dev, dev, errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) { spapr_core_plug(hotplug_dev, dev, errp); --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787278021567.0192633254475; Tue, 12 Jun 2018 00:07:58 -0700 (PDT) Received: from localhost ([::1]:53334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdPF-0004Rc-Bo for importer@patchew.org; Tue, 12 Jun 2018 03:07:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3t-0002ri-Oq for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3s-00021t-GB for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:49 -0400 Received: from ozlabs.org ([203.11.71.1]:51469) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3s-0001wV-3X; Tue, 12 Jun 2018 02:45:48 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPZ6L7PzB3t4; Tue, 12 Jun 2018 16:45:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785938; bh=+zg/zjkd9cQ07degxMS7eJQPQ7Um/9Fmn0JF37IzGn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M+QuDq9MDZ2vCsfYMvN+ENSjfVYthv2VVChhbcKBnuP8XK7E1BTv+GsOFPuqnjAfw OYUGLeVMnBq9F6HeTzGANaDrtLO//FC8KxvORZd7bjhaYD+Sy3kVsbaH9M/uKI8M4D KGuoDwiE5iBSVnsZqHgyaCy+FAdDir7XIu2xVqEQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:58 +1000 Message-Id: <20180612064503.14282-29-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 28/33] spapr: introduce machine unplug handler 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: lvivier@redhat.com, David Hildenbrand , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand We'll be handling unplug of e.g. CPUs and PCDIMMs via the general hotplug handler soon, so let's add that handler function. Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: David Hildenbrand Signed-off-by: David Gibson --- hw/ppc/spapr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 9b8b4068b1..c45f8bc75b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3584,6 +3584,11 @@ static void spapr_machine_device_plug(HotplugHandler= *hotplug_dev, } } =20 +static void spapr_machine_device_unplug(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) +{ +} + static void spapr_machine_device_unplug_request(HotplugHandler *hotplug_de= v, DeviceState *dev, Error **= errp) { @@ -3978,6 +3983,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) mc->get_default_cpu_node_id =3D spapr_get_default_cpu_node_id; mc->possible_cpu_arch_ids =3D spapr_possible_cpu_arch_ids; hc->unplug_request =3D spapr_machine_device_unplug_request; + hc->unplug =3D spapr_machine_device_unplug; =20 smc->dr_lmb_enabled =3D true; mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("power8_v2.0"); --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787471074739.1402099000003; Tue, 12 Jun 2018 00:11:11 -0700 (PDT) Received: from localhost ([::1]:53352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdSQ-0007So-9t for importer@patchew.org; Tue, 12 Jun 2018 03:11:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3s-0002rM-6l for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3q-0001zY-NP for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:48 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:43963) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3q-0001vT-7w; Tue, 12 Jun 2018 02:45:46 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPY6V85zB3t2; Tue, 12 Jun 2018 16:45:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785937; bh=hlvzV3Rpsd/NO5z9My8FQLTEAU/nTMHdKUYp1GZy6S0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ltNxSbq077/s63rCQeuHwR1RNQQ7mvhBZTfweXd1XpTTjnVkGUr/YPNprtaKPSOHz 5QzoaA2ux8L/iZdxm3UxcRm/VbX8XBRx/uyPvkhXfpj6yTiz+OGDuNfM0ytO4Fum+C FCcu8WhBT636JF5RImrVh/RKDTkYw1cO5eOfA/O0= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:44:59 +1000 Message-Id: <20180612064503.14282-30-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 29/33] spapr: handle pc-dimm unplug via hotplug handler chain 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: lvivier@redhat.com, David Hildenbrand , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Factor out memory unplug into separate function from spapr_lmb_release(). Then use generic hotplug_handler_unplug() to trigger memory unplug, which will call spapr_machine_device_unplug() -> spapr_memory_unplug() in the end. This way unplug operation is not buried in lmb internals and located in the same place like in other targets, following similar logic/call chain across targets. Acked-by: David Gibson Reviewed-by: Greg Kurz Reviewed-by: Igor Mammedov Signed-off-by: David Hildenbrand Signed-off-by: David Gibson --- hw/ppc/spapr.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c45f8bc75b..404d887f4e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3299,7 +3299,8 @@ static sPAPRDIMMState *spapr_recover_pending_dimm_sta= te(sPAPRMachineState *ms, /* Callback to be called during DRC release. */ void spapr_lmb_release(DeviceState *dev) { - sPAPRMachineState *spapr =3D SPAPR_MACHINE(qdev_get_hotplug_handler(de= v)); + HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); + sPAPRMachineState *spapr =3D SPAPR_MACHINE(hotplug_ctrl); sPAPRDIMMState *ds =3D spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(= dev)); =20 /* This information will get lost if a migration occurs @@ -3317,9 +3318,17 @@ void spapr_lmb_release(DeviceState *dev) =20 /* * Now that all the LMBs have been removed by the guest, call the - * pc-dimm unplug handler to cleanup up the pc-dimm device. + * unplug handler chain. This can never fail. */ - pc_dimm_memory_unplug(dev, MACHINE(spapr)); + hotplug_handler_unplug(hotplug_ctrl, dev, &error_abort); +} + +static void spapr_memory_unplug(HotplugHandler *hotplug_dev, DeviceState *= dev) +{ + sPAPRMachineState *spapr =3D SPAPR_MACHINE(hotplug_dev); + sPAPRDIMMState *ds =3D spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(= dev)); + + pc_dimm_memory_unplug(dev, MACHINE(hotplug_dev)); object_unparent(OBJECT(dev)); spapr_pending_dimm_unplugs_remove(spapr, ds); } @@ -3587,6 +3596,9 @@ static void spapr_machine_device_plug(HotplugHandler = *hotplug_dev, static void spapr_machine_device_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { + if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { + spapr_memory_unplug(hotplug_dev, dev); + } } =20 static void spapr_machine_device_unplug_request(HotplugHandler *hotplug_de= v, --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528786715928777.957641133939; Mon, 11 Jun 2018 23:58:35 -0700 (PDT) Received: from localhost ([::1]:53279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdGF-0004tC-6N for importer@patchew.org; Tue, 12 Jun 2018 02:58:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3t-0002rh-MJ for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3s-000229-O1 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:49 -0400 Received: from ozlabs.org ([203.11.71.1]:38585) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3s-0001xM-8p; Tue, 12 Jun 2018 02:45:48 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPb1v0qz9s1B; Tue, 12 Jun 2018 16:45:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785939; bh=hJ8NP0voDsfocPViz+9/qvCpMlkq6Z8/AMfTec3Xcz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKFYH7C2WtcOvjDiQQdmTQMNxphjTBAt+UzC/jZA6eKNv3w7gxACHF47fRdgoaSAk KqxyUKH8Mg4GO0PDvO9efyu/b8XeqFxO/xEqdExA369liBPmLJsY9eDAc3WOoqy8ML znST94guWLuPNRqGMsz7hSPOtEOmZpZiYs1iGpr4= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:45:00 +1000 Message-Id: <20180612064503.14282-31-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 30/33] spapr: handle cpu core unplug via hotplug handler chain 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: lvivier@redhat.com, David Hildenbrand , qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Factor out cpu core unplug into separate function from spapr_core_release(). Then use generic hotplug_handler_unplug() to trigger cpu core unplug, which would call spapr_machine_device_unplug() -> spapr_core_unplug() in the end. This way unplug operation is not buried in spapr internals and located in the same place like in other targets, following similar logic/call chain across targets. Acked-by: Igor Mammedov Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: David Hildenbrand Signed-off-by: David Gibson --- hw/ppc/spapr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 404d887f4e..f59999daac 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3416,7 +3416,15 @@ static void *spapr_populate_hotplug_cpu_dt(CPUState = *cs, int *fdt_offset, /* Callback to be called during DRC release. */ void spapr_core_release(DeviceState *dev) { - MachineState *ms =3D MACHINE(qdev_get_hotplug_handler(dev)); + HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); + + /* Call the unplug handler chain. This can never fail. */ + hotplug_handler_unplug(hotplug_ctrl, dev, &error_abort); +} + +static void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *de= v) +{ + MachineState *ms =3D MACHINE(hotplug_dev); sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(ms); CPUCore *cc =3D CPU_CORE(dev); CPUArchId *core_slot =3D spapr_find_cpu_slot(ms, cc->core_id, NULL); @@ -3598,6 +3606,8 @@ static void spapr_machine_device_unplug(HotplugHandle= r *hotplug_dev, { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { spapr_memory_unplug(hotplug_dev, dev); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) { + spapr_core_unplug(hotplug_dev, dev); } } =20 --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528787086421252.92813541805162; Tue, 12 Jun 2018 00:04:46 -0700 (PDT) Received: from localhost ([::1]:53313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdMD-0001Yu-MV for importer@patchew.org; Tue, 12 Jun 2018 03:04:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3t-0002rj-P3 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3s-00022L-Rq for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:49 -0400 Received: from ozlabs.org ([203.11.71.1]:57473) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3s-0001yx-ED; Tue, 12 Jun 2018 02:45:48 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPb3zx5zB3t6; Tue, 12 Jun 2018 16:45:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785939; bh=xDfyUEgaN82bqj0NScDzHK2aXHoQF/6wkB50GIBJIHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YhyHx3FuJwl9cQ1tudw+GjGk/o9J25RgjN4MOGJy61zy5fYIf852SR3tkElB9sROD 02CVyQYybE/t03NvWCis2nw0xie121uK+UQqpL6rhKBSy2DpR5BEP3t3bZy+zOOGQw 1Um/pObd2IlEJQg5WnpxpDk0ofA82NVfwdHIt14o= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:45:01 +1000 Message-Id: <20180612064503.14282-32-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 31/33] ppc/pnv: fix LPC HC firmware address space 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater A specific MemoryRegion is required for the LPC HC Firmware address space. Signed-off-by: C=C3=A9dric Le Goater Signed-off-by: David Gibson --- hw/ppc/pnv_lpc.c | 4 +++- include/hw/ppc/pnv_lpc.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 2317d1e62c..402c4fefa8 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -79,6 +79,7 @@ enum { =20 #define ISA_IO_SIZE 0x00010000 #define ISA_MEM_SIZE 0x10000000 +#define ISA_FW_SIZE 0x10000000 #define LPC_IO_OPB_ADDR 0xd0010000 #define LPC_IO_OPB_SIZE 0x00010000 #define LPC_MEM_OPB_ADDR 0xe0010000 @@ -429,6 +430,7 @@ static void pnv_lpc_realize(DeviceState *dev, Error **e= rrp) */ memory_region_init(&lpc->isa_io, OBJECT(dev), "isa-io", ISA_IO_SIZE); memory_region_init(&lpc->isa_mem, OBJECT(dev), "isa-mem", ISA_MEM_SIZE= ); + memory_region_init(&lpc->isa_fw, OBJECT(dev), "isa-fw", ISA_FW_SIZE); =20 /* Create windows from the OPB space to the ISA space */ memory_region_init_alias(&lpc->opb_isa_io, OBJECT(dev), "lpc-isa-io", @@ -440,7 +442,7 @@ static void pnv_lpc_realize(DeviceState *dev, Error **e= rrp) memory_region_add_subregion(&lpc->opb_mr, LPC_MEM_OPB_ADDR, &lpc->opb_isa_mem); memory_region_init_alias(&lpc->opb_isa_fw, OBJECT(dev), "lpc-isa-fw", - &lpc->isa_mem, 0, LPC_FW_OPB_SIZE); + &lpc->isa_fw, 0, LPC_FW_OPB_SIZE); memory_region_add_subregion(&lpc->opb_mr, LPC_FW_OPB_ADDR, &lpc->opb_isa_fw); =20 diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h index 023b4f0fec..53fdd5bb64 100644 --- a/include/hw/ppc/pnv_lpc.h +++ b/include/hw/ppc/pnv_lpc.h @@ -38,6 +38,7 @@ typedef struct PnvLpcController { /* ISA IO and Memory space */ MemoryRegion isa_io; MemoryRegion isa_mem; + MemoryRegion isa_fw; =20 /* Windows from OPB to ISA (aliases) */ MemoryRegion opb_isa_io; --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15287881939554.19732418294916; Tue, 12 Jun 2018 00:23:13 -0700 (PDT) Received: from localhost ([::1]:53445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSde0-00011P-PW for importer@patchew.org; Tue, 12 Jun 2018 03:23:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3u-0002rl-Qp for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3t-000238-NP for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:50255) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3t-0001zL-0d; Tue, 12 Jun 2018 02:45:49 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPb5rDBzB3t7; Tue, 12 Jun 2018 16:45:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785939; bh=XgGB1QsZQ3aw4HbRQSyROnl55lvlpN4BBI/4yY+efr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5MaNBstJl6lL4biey31/5PewsYl4Fmf7AaXFrNexboeYvi6Il7Ju4D6dDXFSPDMp 08NNEl1S1wC4kK6BCH8nbwVSzfpmXWchNEsonQLtqvnlw466HzQR8vvEUSKgGY0oZz U3CY6NZZWbDRwdBS7wVAFVZOPivrpUmj+A+sNhiU= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:45:02 +1000 Message-Id: <20180612064503.14282-33-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 32/33] xics_kvm: use KVM helpers 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater The KVM helpers hide the low level interface used to communicate to the XICS KVM device and provide a good cleanup to the XICS KVM models. Signed-off-by: C=C3=A9dric Le Goater Signed-off-by: David Gibson --- hw/intc/xics_kvm.c | 52 +++++++++++++--------------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 89fb20e2c5..8bdf6afe82 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -56,10 +56,6 @@ static QLIST_HEAD(, KVMEnabledICP) static void icp_get_kvm_state(ICPState *icp) { uint64_t state; - struct kvm_one_reg reg =3D { - .id =3D KVM_REG_PPC_ICP_STATE, - .addr =3D (uintptr_t)&state, - }; int ret; =20 /* ICP for this CPU thread is not in use, exiting */ @@ -67,7 +63,7 @@ static void icp_get_kvm_state(ICPState *icp) return; } =20 - ret =3D kvm_vcpu_ioctl(icp->cs, KVM_GET_ONE_REG, ®); + ret =3D kvm_get_one_reg(icp->cs, KVM_REG_PPC_ICP_STATE, &state); if (ret !=3D 0) { error_report("Unable to retrieve KVM interrupt controller state" " for CPU %ld: %s", kvm_arch_vcpu_id(icp->cs), strerror(er= rno)); @@ -96,10 +92,6 @@ static void icp_synchronize_state(ICPState *icp) static int icp_set_kvm_state(ICPState *icp, int version_id) { uint64_t state; - struct kvm_one_reg reg =3D { - .id =3D KVM_REG_PPC_ICP_STATE, - .addr =3D (uintptr_t)&state, - }; int ret; =20 /* ICP for this CPU thread is not in use, exiting */ @@ -111,7 +103,7 @@ static int icp_set_kvm_state(ICPState *icp, int version= _id) | ((uint64_t)icp->mfrr << KVM_REG_PPC_ICP_MFRR_SHIFT) | ((uint64_t)icp->pending_priority << KVM_REG_PPC_ICP_PPRI_SHIFT); =20 - ret =3D kvm_vcpu_ioctl(icp->cs, KVM_SET_ONE_REG, ®); + ret =3D kvm_set_one_reg(icp->cs, KVM_REG_PPC_ICP_STATE, &state); if (ret !=3D 0) { error_report("Unable to restore KVM interrupt controller state (0x= %" PRIx64 ") for CPU %ld: %s", state, kvm_arch_vcpu_id(icp->c= s), @@ -185,21 +177,15 @@ static const TypeInfo icp_kvm_info =3D { static void ics_get_kvm_state(ICSState *ics) { uint64_t state; - struct kvm_device_attr attr =3D { - .flags =3D 0, - .group =3D KVM_DEV_XICS_GRP_SOURCES, - .addr =3D (uint64_t)(uintptr_t)&state, - }; int i; + Error *local_err =3D NULL; =20 for (i =3D 0; i < ics->nr_irqs; i++) { ICSIRQState *irq =3D &ics->irqs[i]; - int ret; - - attr.attr =3D i + ics->offset; =20 - ret =3D ioctl(kernel_xics_fd, KVM_GET_DEVICE_ATTR, &attr); - if (ret !=3D 0) { + kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES, + i + ics->offset, &state, false, &local_err); + if (local_err) { error_report("Unable to retrieve KVM interrupt controller stat= e" " for IRQ %d: %s", i + ics->offset, strerror(errno)); exit(1); @@ -255,19 +241,13 @@ static void ics_synchronize_state(ICSState *ics) static int ics_set_kvm_state(ICSState *ics, int version_id) { uint64_t state; - struct kvm_device_attr attr =3D { - .flags =3D 0, - .group =3D KVM_DEV_XICS_GRP_SOURCES, - .addr =3D (uint64_t)(uintptr_t)&state, - }; int i; + Error *local_err =3D NULL; =20 for (i =3D 0; i < ics->nr_irqs; i++) { ICSIRQState *irq =3D &ics->irqs[i]; int ret; =20 - attr.attr =3D i + ics->offset; - state =3D irq->server; state |=3D (uint64_t)(irq->saved_priority & KVM_XICS_PRIORITY_MASK) << KVM_XICS_PRIORITY_SHIFT; @@ -293,8 +273,9 @@ static int ics_set_kvm_state(ICSState *ics, int version= _id) state |=3D KVM_XICS_QUEUED; } =20 - ret =3D ioctl(kernel_xics_fd, KVM_SET_DEVICE_ATTR, &attr); - if (ret !=3D 0) { + kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES, + i + ics->offset, &state, true, &local_err); + if (local_err) { error_report("Unable to restore KVM interrupt controller state" " for IRQs %d: %s", i + ics->offset, strerror(errno)); return ret; @@ -391,10 +372,6 @@ static void rtas_dummy(PowerPCCPU *cpu, sPAPRMachineSt= ate *spapr, int xics_kvm_init(sPAPRMachineState *spapr, Error **errp) { int rc; - struct kvm_create_device xics_create_device =3D { - .type =3D KVM_DEV_TYPE_XICS, - .flags =3D 0, - }; =20 if (!kvm_enabled() || !kvm_check_extension(kvm_state, KVM_CAP_IRQ_XICS= )) { error_setg(errp, @@ -431,20 +408,19 @@ int xics_kvm_init(sPAPRMachineState *spapr, Error **e= rrp) goto fail; } =20 - /* Create the kernel ICP */ - rc =3D kvm_vm_ioctl(kvm_state, KVM_CREATE_DEVICE, &xics_create_device); + /* Create the KVM XICS device */ + rc =3D kvm_create_device(kvm_state, KVM_DEV_TYPE_XICS, false); if (rc < 0) { error_setg_errno(errp, -rc, "Error on KVM_CREATE_DEVICE for XICS"); goto fail; } =20 - kernel_xics_fd =3D xics_create_device.fd; - + kernel_xics_fd =3D rc; kvm_kernel_irqchip =3D true; kvm_msi_via_irqfd_allowed =3D true; kvm_gsi_direct_mapping =3D true; =20 - return rc; + return 0; =20 fail: kvmppc_define_rtas_kernel_token(0, "ibm,set-xive"); --=20 2.17.1 From nobody Sat Apr 20 07:10:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528788035074462.11228045091616; Tue, 12 Jun 2018 00:20:35 -0700 (PDT) Received: from localhost ([::1]:53428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSdbW-0007Jx-99 for importer@patchew.org; Tue, 12 Jun 2018 03:20:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSd3u-0002rk-Pb for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSd3t-00023O-S9 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 02:45:50 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:52993) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSd3t-0001zl-DM; Tue, 12 Jun 2018 02:45:49 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 414gPc0359z9s1R; Tue, 12 Jun 2018 16:45:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1528785940; bh=I73OmbkDhQBMY3+apG3sZ2JyGT74QZ8gWGeFl19Qa8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kITs4HL3kaV4V7QAuhhbehILa4oMcJaBtJAM3H4FZvw/7TlII3sW9m0GgrjYsv4Us x5qvZfTJ2+imnzhICOsqte7fEudvDYF1m6TXXJVTL60g1vxBbkmwqVmjmkBVXHdi9W cGLkE8azzfDBhIAUQllOBpkVxYVTXHtqYy6hvyms= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 12 Jun 2018 16:45:03 +1000 Message-Id: <20180612064503.14282-34-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612064503.14282-1-david@gibson.dropbear.id.au> References: <20180612064503.14282-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 33/33] spapr_pci: Remove unhelpful pagesize warning 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: lvivier@redhat.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" By default, the IOMMU model built into the spapr virtual PCI host bridge supports 4kiB and 64kiB IOMMU page sizes. However this can be overridden which may be desirable to allow larger IOMMU page sizes when running a guest with hugepage backing and passthrough devices. For that reason a warning was printed when the device wasn't configured to allow the pagesize with which guest RAM is backed. Experience has proven, however, that this message is more confusing than useful. Worse it sometimes makes little sense when the host-available page sizes don't match those available on the guest, which can happen with a POWER8 guest running on a POWER9 KVM host. Long term we do want better handling to allow large IOMMU page sizes to be used, but for now this parameter and warning don't really accomplish it. So, remove the message, pending a better solution. Signed-off-by: David Gibson --- hw/ppc/spapr_pci.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 39a14980d3..f936ce63ef 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1717,13 +1717,6 @@ static void spapr_phb_realize(DeviceState *dev, Erro= r **errp) } =20 /* DMA setup */ - if (((sphb->page_size_mask & qemu_getrampagesize()) =3D=3D 0) - && kvm_enabled()) { - warn_report("System page size 0x%lx is not enabled in page_size_ma= sk " - "(0x%"PRIx64"). Performance may be slow", - qemu_getrampagesize(), sphb->page_size_mask); - } - for (i =3D 0; i < windows_supported; ++i) { tcet =3D spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn[i]); if (!tcet) { --=20 2.17.1