From patchwork Tue Jun 9 07:32:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281119 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ABF6C433DF for ; Tue, 9 Jun 2020 07:34:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2A97207C3 for ; Tue, 9 Jun 2020 07:34:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hfMJppeO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2A97207C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYm4-00070t-3C for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:34:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkB-00044v-DT for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:23 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:33138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkA-0007WI-Ey for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:23 -0400 Received: by mail-wr1-x441.google.com with SMTP id l11so20080763wru.0 for ; Tue, 09 Jun 2020 00:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JSDexJUoRc6C2dBRPfkhG4h1BGjFFYK10Clp3IocDL8=; b=hfMJppeOHfs2XSDo401PBnMmW1ulSegyUL0Gb5YjynL0a1P1H8vRTP3d4ILbeLDZQm nzDykrSiuobROMTrr21CarIvcoOXOPZhltix+P318lUKddh5ugYAdZ4+7/BjuIzjHcom HZcL+IKO0rHmrfhIxVC6hD7XCOIgnRs88JijJAbur2Mj1MYkj4FHBHLvi/GYabdDGgPP oK/IYqSFGRSYZa8w7gfPwiRIdnIpDyudvVjIcAvoaYUDhPcjhLwoJA7inovTphwx2Znt cu9qYUiSP8GqRNbvbhcXiH0sH7DVwJNnqFfwV1a4Zt2KZFTdhhj4+FMItK1ufJEbi9xz 9CiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JSDexJUoRc6C2dBRPfkhG4h1BGjFFYK10Clp3IocDL8=; b=qT9SDqJp13GHD0Y3G3+W5A53+d10ffyP9BfdpxiqyugqnDh7Ic3xYnavRCnyzpCTA3 MwRXfLENH6CjIAJSWPHuJ6BwU4cSrMIL7tOBwUGM2Pqxl3SN1JksERd5xxAkCEPpxUS5 9vfqJ00NzfgD4YlQZKgiOz2b+gn/DGW9A00Sil5mLbjFhkZ/xW5EddKWiSsRwqzCTo14 jmtA4eN0MlobKtWE5RUugncdJ3KsEUm4VtmImUunWtsMQW34JSaJQAgdT11+Idw2Zxyd NAnSE6+Ae3o7XkUqMzSIhFqHvXWHTYncFmM/z2Q1ulqK2KHI4kiL7LEZUNmsyRGlHtpj /Yag== X-Gm-Message-State: AOAM533ddQ2D/B2F+HhteJPVPGmxKQiFzMInEXJhMXEP4rUn865CgysT pAgJ1Akc5EqcneCfcCgj2PF1F5mO X-Google-Smtp-Source: ABdhPJy/Q+jV+z7FHe3WTmQZ7Z8YN7l/TTZKkWMkeIHxIusFi5cYikfKOP6MHIFHiKXZnVAwWE0LPQ== X-Received: by 2002:adf:e749:: with SMTP id c9mr3113129wrn.25.1591687939666; Tue, 09 Jun 2020 00:32:19 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/16] hw/misc/empty_slot: Convert 'size' field as qdev property Date: Tue, 9 Jun 2020 09:32:01 +0200 Message-Id: <20200609073214.14079-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Artyom Tarasenko Message-Id: <20200510152840.13558-4-f4bug@amsat.org> --- hw/core/empty_slot.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c index 5ab426e965..0df086fe98 100644 --- a/hw/core/empty_slot.c +++ b/hw/core/empty_slot.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" #include "qemu/module.h" +#include "hw/qdev-properties.h" #include "hw/empty_slot.h" //#define DEBUG_EMPTY_SLOT @@ -57,17 +58,13 @@ void empty_slot_init(hwaddr addr, uint64_t slot_size) if (slot_size > 0) { /* Only empty slots larger than 0 byte need handling. */ DeviceState *dev; - SysBusDevice *s; - EmptySlot *e; dev = qdev_create(NULL, TYPE_EMPTY_SLOT); - s = SYS_BUS_DEVICE(dev); - e = EMPTY_SLOT(dev); - e->size = slot_size; + qdev_prop_set_uint64(dev, "size", slot_size); qdev_init_nofail(dev); - sysbus_mmio_map_overlap(s, 0, addr, -10000); + sysbus_mmio_map_overlap(SYS_BUS_DEVICE(dev), 0, addr, -10000); } } @@ -80,11 +77,17 @@ static void empty_slot_realize(DeviceState *dev, Error **errp) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } +static Property empty_slot_properties[] = { + DEFINE_PROP_UINT64("size", EmptySlot, size, 0), + DEFINE_PROP_END_OF_LIST(), +}; + static void empty_slot_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = empty_slot_realize; + device_class_set_props(dc, empty_slot_properties); } static const TypeInfo empty_slot_info = { From patchwork Tue Jun 9 07:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2E0AC433DF for ; Tue, 9 Jun 2020 07:36:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0C2A2074B for ; Tue, 9 Jun 2020 07:36:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="oeNn1QLx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0C2A2074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYni-0000wd-R0 for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:36:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkB-00044s-Bi for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:23 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:37466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkA-0007WK-Kw for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:23 -0400 Received: by mail-wr1-x42a.google.com with SMTP id x13so20071241wrv.4 for ; Tue, 09 Jun 2020 00:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ys/xyxuX8fMwGT919bDlpMl+pENH1CXUCrM9T9iwbXw=; b=oeNn1QLxCWPC1oApF8dukZQFJLxTZ043I7lEHsc1mqAgmYh1ujfqS1cCrFDAkYPxNu 4CXMRjt+F8opiMTeQJl65SOnshYTOAdh9ad70bZUY1VlAWgkKviQuVbVZEFNh1auIkzd eEuBZJnGapljPh1EgUXjZoDnboND9kpGN+QiXjG0+t2zSU3SDunqr00cJcKy13F/5X/2 /dfz1SrUwnpF6y5ZkBGEtLUD60N8iiCD1A4MxyA4mqDzFglJuOCFDIVXrxuVNVhQvTCq PiRkXCIcIfmhdpDznyJvnDnr/7aX2GnDiNr9LtT7Nk+0zPzGFN2wwk6QrRTRpGibdKF3 sEWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ys/xyxuX8fMwGT919bDlpMl+pENH1CXUCrM9T9iwbXw=; b=liIqZi2x/u3t3+6weIxP4G5WSBx+vfcw4sHwkt+yNJwaXWUU7jK67YwtQicJmhiG+x ZRVKVxq4kucTIIK5EjmKVvxBSN4Ks96XSlBWRTSViChF4c/r9ti2nbv3VQB9JFm2LTGq zSbQhmy2hI5XlQ4vFGJoos4i/XdnEhP2EXiIjr7156abgCTPclQs7+V2TmUBI1iS8SZB sjs53g0Ny6wnzrvP/9KhzIHWprFXiZFBil1yHQ2bNRoO7Ho9GVSYLkex/LzFnOGhijYV tca8I0zjG8tCtO84UR8WZ2VVR63TJVvsexRLqhcKpQk7yb11B329bWscyA6InpGrTyJT eoCA== X-Gm-Message-State: AOAM5320M51wY8TLxviPGKUrOWySCXJBn/JtUgFxjwusB2wrVXmOxMTj AuT0lPO3Ed70ATGjTnrm95X0wLGU X-Google-Smtp-Source: ABdhPJyocJu4bPvJg8ncPXYqIVmAMfqDx7bMGoMYAxuMVpNzD7NeqSiQ7nPwKCpvD1XkOSUV1hLlSA== X-Received: by 2002:a5d:4490:: with SMTP id j16mr3132758wrq.276.1591687940791; Tue, 09 Jun 2020 00:32:20 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/16] hw/misc/empty_slot: Add a 'name' qdev property Date: Tue, 9 Jun 2020 09:32:02 +0200 Message-Id: <20200609073214.14079-5-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Add a 'name' qdev property so when multiple slots are accessed, we can notice which one is accessed. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Artyom Tarasenko Message-Id: <20200510152840.13558-5-f4bug@amsat.org> --- hw/core/empty_slot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c index 0df086fe98..576b276c4b 100644 --- a/hw/core/empty_slot.c +++ b/hw/core/empty_slot.c @@ -31,6 +31,7 @@ typedef struct EmptySlot { SysBusDevice parent_obj; MemoryRegion iomem; + char *name; uint64_t size; } EmptySlot; @@ -72,13 +73,17 @@ static void empty_slot_realize(DeviceState *dev, Error **errp) { EmptySlot *s = EMPTY_SLOT(dev); + if (s->name == NULL) { + s->name = g_strdup("empty-slot"); + } memory_region_init_io(&s->iomem, OBJECT(s), &empty_slot_ops, s, - "empty-slot", s->size); + s->name, s->size); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } static Property empty_slot_properties[] = { DEFINE_PROP_UINT64("size", EmptySlot, size, 0), + DEFINE_PROP_STRING("name", EmptySlot, name), DEFINE_PROP_END_OF_LIST(), }; From patchwork Tue Jun 9 07:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92F33C433DF for ; Tue, 9 Jun 2020 07:37:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60F9E207F9 for ; Tue, 9 Jun 2020 07:37:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QZwx6qET" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60F9E207F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYoq-0002G9-Kh for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:37:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkC-00046V-Di for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:24 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:46052) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkB-0007Wd-Ib for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:24 -0400 Received: by mail-wr1-x42f.google.com with SMTP id c3so20036973wru.12 for ; Tue, 09 Jun 2020 00:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=idot/QDNLgKUfkv/Kifwf1j/trErlW/RBMlHKACXiRc=; b=QZwx6qETfdfmbSCN+2wAvaFhzrcVKRUBv815jN/puBVbS/f4vxAbRdUdK0tOqkkAlq daqJAiQgvgL7U1j7bC3yEmM56jtHVc8hhl0h4CSHuew/0mJAlmEnkakMQkyp/tDICSo7 P1kZR0dDrFOkNs3CfsehMM4mYKcu+qRjjL0v6i9SWGMqFyhKzBTCW3aXSWS8a/JDbvVJ FranaQywWzzACMtOWr9dRMVv6V8mHEtAb0NnIZWMj3YHMzkZip5nLMKnyUv24VhMiZCT UG7dDljh1oEYp1z5h8NGFvSM1qsHroMAoRU7enAPS9isFBi+22lfrfyd8WqP5/BQR03I N5jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=idot/QDNLgKUfkv/Kifwf1j/trErlW/RBMlHKACXiRc=; b=ht1cSa2fWL+hPEM7sfD3VTbjCc0l8pIJXSqPGIund7qQJxy+H55jLFqGcAC7ol8ctI JoK56BhwzuoF2tIaET8k1Ln1ByGc/715Hd0QAN4fvpmIp6veDVPtQJvQjzlY2S0imumw /uDlFqGVRWFgm/E5sTxJBdfgBfsHzST9ogU9Kis01AyZO0WM2EqbG+5Pt0iEY6RyiNiD Df62Xdip3kkXNCQMaP1dgOKGbIzefgIo0/MsyYRdMUjUcnpZClFXvVjvG+0/Sj6Ui3Fq jUbS8iLUxnY+gynSSN7uAQpUGlqDXjub3hTky4bIOajgHFpNdu6YAtYHh4kVxs0QedQa CNiA== X-Gm-Message-State: AOAM533WPq2iiQFHQD/xL2lgV7G7c+H+yvR/+WEuVthYR5Irm2VdGFHz lR/vIq0psxH4ZaxFfXC7RwYsQ+sz X-Google-Smtp-Source: ABdhPJwJQwE4R2E7g8IVAZOdrJEj08ziEHbiTwKnbzLe3Lx35icAesQrd8wFOI/cNlyEfUepOdSpTg== X-Received: by 2002:adf:b348:: with SMTP id k8mr3167562wrd.157.1591687941923; Tue, 09 Jun 2020 00:32:21 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/16] hw/misc/empty_slot: Convert debug printf() to trace event Date: Tue, 9 Jun 2020 09:32:03 +0200 Message-Id: <20200609073214.14079-6-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Acked-by: Artyom Tarasenko Message-Id: <20200510152840.13558-6-f4bug@amsat.org> --- hw/core/empty_slot.c | 19 ++++++++----------- hw/core/trace-events | 4 ++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/core/empty_slot.c b/hw/core/empty_slot.c index 576b276c4b..d28f7f99c9 100644 --- a/hw/core/empty_slot.c +++ b/hw/core/empty_slot.c @@ -14,15 +14,7 @@ #include "qemu/module.h" #include "hw/qdev-properties.h" #include "hw/empty_slot.h" - -//#define DEBUG_EMPTY_SLOT - -#ifdef DEBUG_EMPTY_SLOT -#define DPRINTF(fmt, ...) \ - do { printf("empty_slot: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) do {} while (0) -#endif +#include "trace.h" #define TYPE_EMPTY_SLOT "empty_slot" #define EMPTY_SLOT(obj) OBJECT_CHECK(EmptySlot, (obj), TYPE_EMPTY_SLOT) @@ -38,14 +30,19 @@ typedef struct EmptySlot { static uint64_t empty_slot_read(void *opaque, hwaddr addr, unsigned size) { - DPRINTF("read from " TARGET_FMT_plx "\n", addr); + EmptySlot *s = EMPTY_SLOT(opaque); + + trace_empty_slot_write(addr, size << 1, 0, size, s->name); + return 0; } static void empty_slot_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr); + EmptySlot *s = EMPTY_SLOT(opaque); + + trace_empty_slot_write(addr, size << 1, val, size, s->name); } static const MemoryRegionOps empty_slot_ops = { diff --git a/hw/core/trace-events b/hw/core/trace-events index 1ac60ede6b..bbb68fb6f0 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -34,3 +34,7 @@ clock_disconnect(const char *clk) "'%s'" clock_set(const char *clk, uint64_t old, uint64_t new) "'%s', ns=%"PRIu64"->%"PRIu64 clock_propagate(const char *clk) "'%s'" clock_update(const char *clk, const char *src, uint64_t val, int cb) "'%s', src='%s', ns=%"PRIu64", cb=%d" + +# empty_slot.c +empty_slot_read(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "rd addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]" +empty_slot_write(uint64_t addr, unsigned width, uint64_t value, unsigned size, const char *name) "wr addr:0x%04"PRIx64" data:0x%0*"PRIx64" size %u [%s]" From patchwork Tue Jun 9 07:32:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DE5FC433DF for ; Tue, 9 Jun 2020 07:39:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C12D2074B for ; Tue, 9 Jun 2020 07:39:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CPYkQZGQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C12D2074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYqs-0005Ps-Il for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:39:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkG-00047l-2U for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:28 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:33139) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkF-0007XD-Ao for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:27 -0400 Received: by mail-wr1-x441.google.com with SMTP id l11so20081038wru.0 for ; Tue, 09 Jun 2020 00:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eos1WJYtuH+j1S1wUpCIWosKP33E+t99Sgm1VOZwc6c=; b=CPYkQZGQj7J+btW5HYGhY0jUEJyiIabxf4hgCcCEtoWcv8s1i4XAFYKBtZBYjngbKy 38B8K7MF78ayml029JnH1uzqxeTIaTPic3COCCZnCDlkLHFml73r3XhczuIUw5h2FsUS WXVXTwebPSgpmDqb8Bg0xY5jvEeOxZFDHRL+ICZJPdY5szPbJFpJfDGe70BNJI/JwNoo LBbL+6uoD7R3en/wnCur3vmvv4qlxwVv9jI6DzkI4rTLkw7bqxhQMiZ3C7Vp3Mlhz4dx QzkTnKfCLRcqHq6y8Kxig2SlhTex2aF7C2JgPNcThOUsRbiSJiR/6S2iRA9f3C0/LqMF 2aTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eos1WJYtuH+j1S1wUpCIWosKP33E+t99Sgm1VOZwc6c=; b=ZvY2UZUs6b19BqCaJYnUbLxwD33V6/lShiHcHa50Luy5m9sdSk9K+bKH+bdByzNYCb rbpuHOrSkE0Y8uzl1a/9uSeDk+pG64l5fOxQtuMQu1ZyDfbBYk7vCvs0c7Iq7VRMVSht 7hzvMZpfvGBtujoaXR21VsVI0T4qO8PmaKv+cQ+5qUCVRZYHWs2s+nRq9M1liWh65rff gpBrrmUb51Rn0RM/0wVua4zKhZ5W5G0xQqNt01irn0eCx0nBTK93538BkjlEWzVqr8D/ 42wI25YLrSRHr3oiguXAD38oCO3eED2Kskosg0rfkAYggRKYRE0VuXnhKH8tj1rvrfu6 1A+Q== X-Gm-Message-State: AOAM531c/liOhr0kU4WriXRYECCx1iehSYJydAJ+0tmvBRIeEiPP+GhX 6cbkhxJ3IGWSXGxvY/Q8njin+usM X-Google-Smtp-Source: ABdhPJxWBes8rekotyittBo4qWr+y1X+ByU0YTWgGM7wWCofXWIMWCdKTUsSmVFhKMksdm5n1FUHxA== X-Received: by 2002:a5d:61d0:: with SMTP id q16mr3045561wrv.182.1591687945500; Tue, 09 Jun 2020 00:32:25 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/16] hw/sparc/leon3: Map the UART device unconditionally Date: Tue, 9 Jun 2020 09:32:06 +0200 Message-Id: <20200609073214.14079-9-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The UART is present on the chipset regardless there is a character device connected to it. Map it unconditionally. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Artyom Tarasenko Reviewed-by: KONRAD Frederic Message-Id: <20200608172144.20461-2-f4bug@amsat.org> --- hw/sparc/leon3.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 8f024dab7b..cc55117dec 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -339,16 +339,14 @@ static void leon3_generic_hw_init(MachineState *machine) 0, LEON3_TIMER_IRQ, GRLIB_APBIO_AREA); /* Allocate uart */ - if (serial_hd(0)) { - dev = qdev_create(NULL, TYPE_GRLIB_APB_UART); - qdev_prop_set_chr(dev, "chrdev", serial_hd(0)); - qdev_init_nofail(dev); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_UART_OFFSET); - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irqs[LEON3_UART_IRQ]); - grlib_apb_pnp_add_entry(apb_pnp, LEON3_UART_OFFSET, 0xFFF, - GRLIB_VENDOR_GAISLER, GRLIB_APBUART_DEV, 1, - LEON3_UART_IRQ, GRLIB_APBIO_AREA); - } + dev = qdev_create(NULL, TYPE_GRLIB_APB_UART); + qdev_prop_set_chr(dev, "chrdev", serial_hd(0)); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, LEON3_UART_OFFSET); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, cpu_irqs[LEON3_UART_IRQ]); + grlib_apb_pnp_add_entry(apb_pnp, LEON3_UART_OFFSET, 0xFFF, + GRLIB_VENDOR_GAISLER, GRLIB_APBUART_DEV, 1, + LEON3_UART_IRQ, GRLIB_APBIO_AREA); } static void leon3_generic_machine_init(MachineClass *mc) From patchwork Tue Jun 9 07:32:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB59AC433E0 for ; Tue, 9 Jun 2020 07:41:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85CDA2074B for ; Tue, 9 Jun 2020 07:41:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vFbheXaj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 85CDA2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYtQ-0001oH-Rg for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:41:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkK-00049W-DR for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:32 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:40390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkG-0007XM-7q for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:28 -0400 Received: by mail-wr1-x441.google.com with SMTP id h5so20074648wrc.7 for ; Tue, 09 Jun 2020 00:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tdQA57lBeQOvfXchna8N/D8Nyo98nJ4cAaaQhD8ORsY=; b=vFbheXajUu3sgB8XRH5I1gdvhMlo45aUS6lYEAEMj2oV5YCkTmn3ywN3Z1TkklURiH 2La1hJ+pglcsmC/8BRJBSUPnk3k/EUcOdPMRWLA9ev5lCDcHe8Dz+8WIMN3Eu1F8XrYB sUL+PugTmnW1ltu3HG8CXAFxhgsM6B8rbckePxW/AYNmPTwlFbCH8EKfxz67d21c5sTN 5ofN98W/NH+jZgAW3qr6djfq0MfImOuA7XcGoECBy+GQHbyg3KPvTbUKiOcmeDnrtSJb 0WL7oB4uCxgQJW1u3yNjxqOTC9tF4h88BvsBpKQignbavfpfgM9Djh/7mPgekE4F6IPj wI5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tdQA57lBeQOvfXchna8N/D8Nyo98nJ4cAaaQhD8ORsY=; b=trWbVBuqRlEtCNqBBYBdeT2hCPiQv5IWH7wSkzzwwgQ92yF5VUXLSNpcHlFqymQPoQ tp2W0Yg/ygA7pSqI6r6wrJq3m1nqVtjKj0/RemF6u6q84mzuiVGB2/DRgIf4pJei0uye 5a779lZz/p5vsXRpDzzLmcjkRbDpOUR+g3HBBfgyeXiTI8dNZgdaDli4PrTii8pEyNnj ZYF/a8MrmSO+wYYF/hYqW+K9UK2rE/4Lyxlf/t+88dc3hpeWf7j/+9xJdGVrqbMqNeXS L7ADm/zGqjhgx8OBKGuz0ZEQ+FR6yKEWYeAjgOItoxip5qHOpXR9/RgHzADGsXHkVSTX xO2A== X-Gm-Message-State: AOAM531ICdMzm1Cjef6eZmcEFmLUVdsStQyJZSA0AZq9pPxYYGrONcGI 8M0nqRvkUsHu9Ggxr9OyEE376yAn X-Google-Smtp-Source: ABdhPJx9ZgRmV+P4rgQIOQvbsA6BXsriqLApJ2rVxWsdNn19aDMpRpJ5YkN5A27oPODJ80nNI1TcKA== X-Received: by 2002:a5d:6087:: with SMTP id w7mr3168891wrt.158.1591687946702; Tue, 09 Jun 2020 00:32:26 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/16] hw/sparc64/niagara: Map the UART device unconditionally Date: Tue, 9 Jun 2020 09:32:07 +0200 Message-Id: <20200609073214.14079-10-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::441; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The UART is present on the machine regardless there is a character device connected to it. Map it unconditionally. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Artyom Tarasenko Message-Id: <20200608172144.20461-4-f4bug@amsat.org> --- hw/sparc64/niagara.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c index ab5ef8c5b3..148a26890e 100644 --- a/hw/sparc64/niagara.c +++ b/hw/sparc64/niagara.c @@ -152,10 +152,8 @@ static void niagara_init(MachineState *machine) exit(1); } } - if (serial_hd(0)) { - serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200, - serial_hd(0), DEVICE_BIG_ENDIAN); - } + serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, + 115200, serial_hd(0), DEVICE_BIG_ENDIAN); create_unimplemented_device("sun4v-iob", NIAGARA_IOBBASE, NIAGARA_IOBSIZE); sun4v_rtc_init(NIAGARA_RTC_BASE); } From patchwork Tue Jun 9 07:32:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 313EDC433DF for ; Tue, 9 Jun 2020 07:43:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDE852074B for ; Tue, 9 Jun 2020 07:43:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cuT6QXJW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDE852074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYur-00043i-VB for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:43:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkL-0004CO-MT for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:33 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:33142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkK-0007XZ-7d for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:33 -0400 Received: by mail-wr1-x444.google.com with SMTP id l11so20081208wru.0 for ; Tue, 09 Jun 2020 00:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b/OykygRwVllcM0LU21qFqXRkh6UcxIdIvocNlUkuAY=; b=cuT6QXJW/6joXiohF2Sw6YX+QAfTtElydWkOJSe1a/S2X8hjxzSdsbNXxAWMxC1KTl jWXBHz9u55n/yvvlD0mT+bm9eN2JR71GUXLksjcCoUFCsmWo7TtUEH0DqqyelWPJ+T41 3bR7zIjYgXYdCDTQgsVkvF5ZuycHSo6gpDADq04MvCGulyD1sEnFFNxgfkDH0JHoIRNC A3zmc9LHNvFaoiw3peXeElX527jLFkewOTr5QUdMKEvAfjSLjNshpcpSAoIzHepyKtcF BpHoI+xYbJfMszMITcNXX88nhUXdMFJ/PoB/wWAryWhxno3xoyqDSomg/VCLNoPcFm8f ce+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=b/OykygRwVllcM0LU21qFqXRkh6UcxIdIvocNlUkuAY=; b=QFgpV1QzxxnQzIXDFKIH/JHr9SfoenMBziPEDKbr8FT5TxsQs5jdPYsjbr9k6VxMn8 gWL02KZFhiW+Ef7ZseSjQMx2D7OypcNsSoCOO7zdyaZ94qGQkqNWiY063G6z4PcrjinZ jjypEKUJgBRHs7LE77+IDJY0EyqjL+Xn06sTQdXfC+CGXJh80xeDdWkj5cCZkkBA0cg0 OcZe7ZY973PIGg4AKXG12gsrz1upW5rdgGuK8pWtvJvV174XqqKDomjCx7IuxWA1qsWI I+rJrIKI0EBZus+viB442fKerHRH2D4UcUi2odBm0ylE3zVHBZgSTywgFU2LNdoryMAQ 5aZg== X-Gm-Message-State: AOAM531tigauV7EGgXOZ5vu+jVx1dO05K4lE/TUsQoUltjPea/UHiyeI Km8ue4omRz+wOUUXkPxB0tYNS7Yu X-Google-Smtp-Source: ABdhPJz2cRcrqVNjGsSLegGPr13tfJFLf3miJ2jXbQu05nDiTP8R0wqltM1RlLLphxiyPglltSrxmw== X-Received: by 2002:adf:a350:: with SMTP id d16mr2977293wrb.237.1591687949040; Tue, 09 Jun 2020 00:32:29 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/16] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers Date: Tue, 9 Jun 2020 09:32:09 +0200 Message-Id: <20200609073214.14079-12-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Similarly to commit 158b659451 with the APB PnP registers, guests can crash QEMU when writting to the AHB PnP registers: $ echo 'writeb 0xfffff042 69' | qemu-system-sparc -M leon3_generic -S -bios /etc/magic -qtest stdio [I 1571938309.932255] OPENED [R +0.063474] writeb 0xfffff042 69 Segmentation fault (core dumped) (gdb) bt #0 0x0000000000000000 in () #1 0x0000562999110df4 in memory_region_write_with_attrs_accessor (mr=mr@entry=0x56299aa28ea0, addr=66, value=value@entry=0x7fff6abe13b8, size=size@entry=1, shift=, mask=mask@entry=255, attrs=...) at memory.c:503 #2 0x000056299911095e in access_with_adjusted_size (addr=addr@entry=66, value=value@entry=0x7fff6abe13b8, size=size@entry=1, access_size_min=, access_size_max=, access_fn=access_fn@entry= 0x562999110d70 , mr=0x56299aa28ea0, attrs=...) at memory.c:539 #3 0x0000562999114fba in memory_region_dispatch_write (mr=mr@entry=0x56299aa28ea0, addr=66, data=, op=, attrs=attrs@entry=...) at memory.c:1482 #4 0x00005629990c0860 in flatview_write_continue (fv=fv@entry=0x56299aa7d8a0, addr=addr@entry=4294963266, attrs=..., ptr=ptr@entry=0x7fff6abe1540, len=len@entry=1, addr1=, l=, mr=0x56299aa28ea0) at include/qemu/host-utils.h:164 #5 0x00005629990c0a76 in flatview_write (fv=0x56299aa7d8a0, addr=4294963266, attrs=..., buf=0x7fff6abe1540, len=1) at exec.c:3165 #6 0x00005629990c4c1b in address_space_write (as=, addr=, attrs=..., attrs@entry=..., buf=buf@entry=0x7fff6abe1540, len=len@entry=1) at exec.c:3256 #7 0x000056299910f807 in qtest_process_command (chr=chr@entry=0x5629995ee920 , words=words@entry=0x56299acfcfa0) at qtest.c:437 Instead of crashing, log the access as unimplemented. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: KONRAD Frederic Message-Id: <20200331105048.27989-3-f4bug@amsat.org> --- hw/misc/grlib_ahb_apb_pnp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c index e230e25363..72a8764776 100644 --- a/hw/misc/grlib_ahb_apb_pnp.c +++ b/hw/misc/grlib_ahb_apb_pnp.c @@ -136,8 +136,15 @@ static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size) return ahb_pnp->regs[offset >> 2]; } +static void grlib_ahb_pnp_write(void *opaque, hwaddr addr, + uint64_t val, unsigned size) +{ + qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__); +} + static const MemoryRegionOps grlib_ahb_pnp_ops = { .read = grlib_ahb_pnp_read, + .write = grlib_ahb_pnp_write, .endianness = DEVICE_BIG_ENDIAN, }; From patchwork Tue Jun 9 07:32:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281114 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0702C433E0 for ; Tue, 9 Jun 2020 07:40:47 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8AF0A2074B for ; Tue, 9 Jun 2020 07:40:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="t3HhdleI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8AF0A2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYsI-0008Fv-OZ for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkL-0004BE-6p for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:33 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37157) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkK-0007Xb-7V for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:32 -0400 Received: by mail-wr1-x443.google.com with SMTP id x13so20071689wrv.4 for ; Tue, 09 Jun 2020 00:32:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BKwzKZtrbxU02j73ueEcyHllddh/ol1Dq+AGgYyiyJs=; b=t3HhdleIImJBA0xMLGx7YL3FR2NxtWCDWJ1qFSCsxOwINNeOjndksMM5sBWoeLJMxa nclJnQ62hikK3rX7dD1QTF+ZFkMhFhTSoPRrgtaM/wcDP2q2PBjXO5Ek+ndYrbK6kkvD 5GFxB6bNUSeusPEi97pqCyehrGPUOZQ1ARxzoc2PXEOsZd+5fHTkszm1GujOathvaCvI LiN94VIKb0BOtgFOcfCDXZ3YJNZFSFOaZ90RyYM6giEBkiWp+IJffPLQbBY2duUSARdV brmehWTQHtBLPO31gsIvKZWhjfv529OTA3DHskxKwTNIdcadfDGC+h5B+ZvAa8UwUd2c WITA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BKwzKZtrbxU02j73ueEcyHllddh/ol1Dq+AGgYyiyJs=; b=AH71V84Asrau4JuQfZ0LI23inMzVKIAr5+ddgyIQXDcFqPznm96VCGoPAcl0JUt0rk 6PA0IKalya8Ai9Wey595pP/i+5iiwjZ9ub2bbkGdqJb9Q67K3e8nkG89uV7ZsTCOcjKd ajCjuXupJ5Yzfc9sRbccg1d6v8nYUzXNz1cOQgCebvQvH3RO5q55kgBEOCyCVQ03bGJp iH54wKf03yW0zhhXKVmM5fFesUW4A8V2/u2IzlSpeodkoSw3JAKPPnSS6OHvkgBaUpDT FkUlY8CcRKg5naoKvV0D7iAxLuLVsfG6bCE35SIt5ZgrjzcYL8TtFfCGCYeLYNP4Ry1K 5wgQ== X-Gm-Message-State: AOAM532VKEIR6cU7VA1y69vB34jGtaCV2bBula8O3TcKPXK3t8K5mjvq 8ecKqgXi7PO6mdia+m8w3eZ+hST1 X-Google-Smtp-Source: ABdhPJxPyA+960c94CGmRIQcTTddtKuPFlnmmzmpQNg/tnzGht2WMYg+gQm6RwqVBteTcit9id/7ew== X-Received: by 2002:a5d:4e88:: with SMTP id e8mr3022757wru.188.1591687950134; Tue, 09 Jun 2020 00:32:30 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/16] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses Date: Tue, 9 Jun 2020 09:32:10 +0200 Message-Id: <20200609073214.14079-13-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The Plug & Play region of the AHB/APB bridge can be accessed by various word size, however the implementation is clearly restricted to 32-bit: static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size) { AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque); return ahb_pnp->regs[offset >> 2]; } Similarly to commit 0fbe394a64 with the APB PnP registers, set the MemoryRegionOps::impl min/max fields to 32-bit, so memory.c::access_with_adjusted_size() can adjust when the access is not 32-bit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: KONRAD Frederic Message-Id: <20200331105048.27989-4-f4bug@amsat.org> --- hw/misc/grlib_ahb_apb_pnp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c index 72a8764776..d22ed00206 100644 --- a/hw/misc/grlib_ahb_apb_pnp.c +++ b/hw/misc/grlib_ahb_apb_pnp.c @@ -146,6 +146,10 @@ static const MemoryRegionOps grlib_ahb_pnp_ops = { .read = grlib_ahb_pnp_read, .write = grlib_ahb_pnp_write, .endianness = DEVICE_BIG_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, }; static void grlib_ahb_pnp_realize(DeviceState *dev, Error **errp) From patchwork Tue Jun 9 07:32:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A3D8C433E0 for ; Tue, 9 Jun 2020 07:44:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C857A2074B for ; Tue, 9 Jun 2020 07:44:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W36hHERf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C857A2074B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYwB-0006M4-4v for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkN-0004Hf-V9 for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:35 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:39490) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkN-0007YE-4X for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:35 -0400 Received: by mail-wr1-x42e.google.com with SMTP id t18so20073094wru.6 for ; Tue, 09 Jun 2020 00:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P/mKxtHL0UxIRvwcZTV/zvAsg90s7x/j5V+O3iTow44=; b=W36hHERfCfDWWt1sq5dxY5LL6DlTu7P82yLIpAU4SenJ/pocvmhjz98MYSP2sVFoxW jufy9jf2tJiq72dPWvkWCUdL/vjyRrxEYKDe2/8/ETxUbQutYfpHnzOjCj/KmXCDVUNZ tjz4hYEPwdp1RfF+hMy/Upcw3at0T4ZRmJo4CcK0YHkeeZU1PtozQK164K/LxOJT8NI2 CZsqD3DLHhGjrsZYmzk2d90Csl7oBZXFhbIyxQRP4eKGWTgeNxdwi+I8gnSyHdnNpQgN CRt1wyseVg/c0eRBpqT3sAZQ/kj2E5wbnoR2lkumyukb1QzkMaralkvJVQjLfJBMdl3V XIBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=P/mKxtHL0UxIRvwcZTV/zvAsg90s7x/j5V+O3iTow44=; b=tZDzY++QT1shf85Bg1BtLMunyVxgRNR5wLBzhNfklndyvewIGERDfaLf+2rSE789RM Vx7XZMVgCBqRM8YEhfLwQ4P+QJrgfXbG8zCfy13F3nVvNJviO9D0SUaszZIkq7VDy6sO y/0i5WapG0IDdfxWAkkHNbQMNopc0mv/OlNp0SwJKzgeWnnozuTlEwOujMfIpYkWLxNT Y44KtN2XKeG4Ko/iFdU5CwmjYSReW+hzYKemRqQkYT65564kL8EoR4ALydTY2vD7HGLx XAux4+MtRhKWpcIDqv/h3Tz+V4fn+ZpOWH76mhsSvvByqcArA3YSlekOV7VNhroARf/L 2RQg== X-Gm-Message-State: AOAM532gxvPjaDyfRlX+iJm9LbaXws1Y5j4ENl2ARG/PRU1XIAWGAOi3 zE5t4KLIRiuljzWsbTU0YbJPU4Av X-Google-Smtp-Source: ABdhPJxV6BT3PE+jmGctOwa//GP20bP8SyRTOlj7B8RaAU9l2+CImuPhKdfotkn9G+eRgNluhJ5bRA== X-Received: by 2002:a5d:4bcb:: with SMTP id l11mr3065533wrt.363.1591687953481; Tue, 09 Jun 2020 00:32:33 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/16] target/sparc/int32_helper: Remove DEBUG_PCALL definition Date: Tue, 9 Jun 2020 09:32:13 +0200 Message-Id: <20200609073214.14079-16-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We define DEBUG_PCALL since b884fc5e (2012-10-06). 7.5 years later it is safe to assume we can remove it :) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: KONRAD Frederic Message-Id: <20200331105048.27989-7-f4bug@amsat.org> --- target/sparc/int32_helper.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index 813b47dbb2..c56dd3df18 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -23,9 +23,7 @@ #include "exec/log.h" #include "sysemu/runstate.h" -#define DEBUG_PCALL -#ifdef DEBUG_PCALL static const char * const excp_names[0x80] = { [TT_TFAULT] = "Instruction Access Fault", [TT_ILL_INSN] = "Illegal Instruction", @@ -58,7 +56,6 @@ static const char * const excp_names[0x80] = { [TT_DIV_ZERO] = "Division By Zero", [TT_NCP_INSN] = "Coprocessor Disabled", }; -#endif void sparc_cpu_do_interrupt(CPUState *cs) { @@ -71,7 +68,6 @@ void sparc_cpu_do_interrupt(CPUState *cs) cpu_get_psr(env); } -#ifdef DEBUG_PCALL if (qemu_loglevel_mask(CPU_LOG_INT)) { static int count; const char *name; @@ -104,7 +100,6 @@ void sparc_cpu_do_interrupt(CPUState *cs) #endif count++; } -#endif #if !defined(CONFIG_USER_ONLY) if (env->psret == 0) { if (cs->exception_index == 0x80 && From patchwork Tue Jun 9 07:32:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 281116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 147A9C433E0 for ; Tue, 9 Jun 2020 07:38:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0E5F2074B for ; Tue, 9 Jun 2020 07:38:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NggRqcRL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0E5F2074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:39344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiYq8-0004SV-48 for qemu-devel@archiver.kernel.org; Tue, 09 Jun 2020 03:38:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiYkP-0004Jw-61 for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:37 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:36378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiYkO-0007YN-CT for qemu-devel@nongnu.org; Tue, 09 Jun 2020 03:32:36 -0400 Received: by mail-wr1-x430.google.com with SMTP id q11so20094364wrp.3 for ; Tue, 09 Jun 2020 00:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zwLwjsoqgTFgZrqe9d7QANVT2RwPZgdh3/KDYhJg9q4=; b=NggRqcRL1dgsJBdnw+Z401yh/8hzAW9WwO0IoKb32n+qFpa4ar4xYNrWdz+9vyo/GC 6FMr17Ea/Y9Wt27Sykq8bgO+CHwt22TsIl6zvYEFPq3TOb8excMa5I3fTY4Stk8oLWs7 HaMabCcX/QkZ3PJzCbdP+2PSLxluHgtbbE7pIF014+oi6Gt2zLr7xaEIcvr8IiaFMYRz TLDJgeRFiVFUTCXksNEeie0Vmap9XeBilsVAhNv4+OIjgFCNzB970KctK5KIyrXWjcwC MYsUC/m9N+KtOfVdHfdWSFcnzTvj82/U8sPP7B2z2e7Xf3mceUIxB2xSaT8vNXU3xIOT T+ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zwLwjsoqgTFgZrqe9d7QANVT2RwPZgdh3/KDYhJg9q4=; b=uNy/UCx4gkT0Ph/IxlvqAsycfb2dj1YP+HdTW86zGwiQ++J0UrUN/7hOdEhiyTrxAf q0sMLDOQUsVeVKE31mcY/qD08CPPB2qLnNEk85QFrwYIjWh4jl0GBgHBCCsYIbjkfzhf lHMYFTTd1yZwVAto/JNHW6suWiRWOyY4gAqyjxrfG1xRU0kFo2yxbCk4IqpKamEMjyFb OzDxYqDbMRBvCI4n5llI6b8xFXXAm4uXxUgILPoNUdXnE3ZvfjMJ+ELHFDhGLx8EeEOv yrFWXrMn95+qFTQhn3t4DQtDye9ior/vrAmO658O1ISz2j1L/3vxmSDtcQ6gy8GoziJq HQFw== X-Gm-Message-State: AOAM533UDF+7zaz02TPHKHUN3+jVmDfe7huNupEnsT6j8J0R54PsU192 Zb3IdziuL6Vj17Vg/GJzkANG8173 X-Google-Smtp-Source: ABdhPJw4x+X9Le+6CgfIMJ07XpbJsFk8TLYpGTXwUBKZT9TJkLn98ef/8yoN2NmHEQiAd+PJ4/Vk5g== X-Received: by 2002:a05:6000:1192:: with SMTP id g18mr3020148wrx.326.1591687954787; Tue, 09 Jun 2020 00:32:34 -0700 (PDT) Received: from localhost.localdomain (181.red-88-10-103.dynamicip.rima-tde.net. [88.10.103.181]) by smtp.gmail.com with ESMTPSA id m3sm2036192wmc.0.2020.06.09.00.32.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 00:32:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/16] target/sparc/int32_helper: Extract and use excp_name_str() Date: Tue, 9 Jun 2020 09:32:14 +0200 Message-Id: <20200609073214.14079-17-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200609073214.14079-1-f4bug@amsat.org> References: <20200609073214.14079-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Mark Cave-Ayland , KONRAD Frederic , Fabien Chouteau , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Aleksandar Markovic , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Improve exception error report: Before: qemu: fatal: Trap 0x06 while interrupts disabled, Error state After: qemu: fatal: Trap 0x06 (Window Underflow) while interrupts disabled, Error state Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: KONRAD Frederic Message-Id: <20200331105048.27989-8-f4bug@amsat.org> --- target/sparc/int32_helper.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c index c56dd3df18..9a71e1abd8 100644 --- a/target/sparc/int32_helper.c +++ b/target/sparc/int32_helper.c @@ -57,6 +57,14 @@ static const char * const excp_names[0x80] = { [TT_NCP_INSN] = "Coprocessor Disabled", }; +static const char *excp_name_str(int32_t exception_index) +{ + if (exception_index < 0 || exception_index >= ARRAY_SIZE(excp_names)) { + return "Unknown"; + } + return excp_names[exception_index]; +} + void sparc_cpu_do_interrupt(CPUState *cs) { SPARCCPU *cpu = SPARC_CPU(cs); @@ -77,10 +85,7 @@ void sparc_cpu_do_interrupt(CPUState *cs) } else if (intno >= 0x80) { name = "Trap Instruction"; } else { - name = excp_names[intno]; - if (!name) { - name = "Unknown"; - } + name = excp_name_str(intno); } qemu_log("%6d: %s (v=%02x)\n", count, name, intno); @@ -106,8 +111,9 @@ void sparc_cpu_do_interrupt(CPUState *cs) env->def.features & CPU_FEATURE_TA0_SHUTDOWN) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } else { - cpu_abort(cs, "Trap 0x%02x while interrupts disabled, Error state", - cs->exception_index); + cpu_abort(cs, "Trap 0x%02x (%s) while interrupts disabled, " + "Error state", + cs->exception_index, excp_name_str(cs->exception_index)); } return; }