From nobody Tue May 7 14:22:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599441350; cv=none; d=zohomail.com; s=zohoarc; b=On9eNaesZ30zRgP3ieG0CExQ6odgr9GdA6hVRezM0UEQi5nmOpUfo29GErAOkFtvMZuJWGLI5yoOqIfBtc/TU8QNqd+rIzW7R+j/SD66ohOe5X7jIVJDiGyzx1JtVj4Wvb733FDkQoBkjoyMjWXUdlSPfiYcQ8xTH/3PonFxzw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599441350; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=bbSZmAbx1t0XX9K3FIPuzWI0Sx28Y4x/c2CAULydyHg=; b=TNTK0JscQUbfgJ1SJjknVkMwQDuqGm1n7FoneAhqxUzhWbDOuW6BGvvJgZqfaowNxKSAvnkXGBdMFcTPxApQM2Ia28l7pWZ8Ba4btund0vb8ps650IpH9rRBA+3gsqva7VAXwMabHrp7s+aOis0r5wMMCJscaRsjJWD6AiClAUQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599441350313331.1253101965634; Sun, 6 Sep 2020 18:15:50 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-194-1VTlH1hyMGmPPQiJTUjsnw-1; Sun, 06 Sep 2020 21:15:47 -0400 Received: by mail-wm1-f69.google.com with SMTP id u5so3169997wme.3 for ; Sun, 06 Sep 2020 18:15:47 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id n17sm23201953wrw.0.2020.09.06.18.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 18:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599441348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bbSZmAbx1t0XX9K3FIPuzWI0Sx28Y4x/c2CAULydyHg=; b=i3YErcnsOYMaZZ+l1og+A8ZpMo0B80fig6QaOHwHNjcoyjsNmyTGXDx85hcf+yyfa1VcZQ GFCmidNDMsYMe2tkQLjWJIsXawM66VDO569nHSztEz+kmkTkOwW3KsKEzYnY9RDC4rfjWI b2MPvhyQat/B6oGrUzYxoy/fWo/vHgY= X-MC-Unique: 1VTlH1hyMGmPPQiJTUjsnw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bbSZmAbx1t0XX9K3FIPuzWI0Sx28Y4x/c2CAULydyHg=; b=gad/n1AAQPRQrL1ZpOVV+7zR4f1Y+mc0jyuW1xCSUPHqx4yxq3qIFLVeBDn6uH/eih n9++WsgTc72PkY/ffXOvTHqyUAQu0F0VFVa16EM1AXtAVXI5CVFWAJekn8+R2pit296k VyvET7b+CPmtzMxNhljeZgsJaW9Vygfpel0ogKrbIStVbeu+0B9f36mROjGfwog+4Q1G nCpUnslulAAbXJ87o1rTvN8105HQYOiQyJETw47FeetXuIK9UcHKL1OAc629kpuhXOsW QbVKGm5UN8t897+GQl5M2PADkv9oJLag9JAi0zi8JO3wu4NcUlKUXwKb8LxjTIc/00es orLA== X-Gm-Message-State: AOAM532+nA4l2k/nTO6BUV50HzS5UJG+LenyplqSd9n0bdrHnClJB4HN TTQ3kkQE2OWkUUsrC94sJljaMGVw4l4KGkSsyb/ExjAFtI9NRFHg607UyXwckEFFgRNGbVGSjUk 8ZMHbR1ubq7HYwg== X-Received: by 2002:a05:600c:2159:: with SMTP id v25mr19406418wml.180.1599441346106; Sun, 06 Sep 2020 18:15:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO7P7MDFSxuNwm8hp+goa/1xw+xrpaBpnqEXGnMQAGa4aDHvieQoyl32P3iwa2FaEdFRdsdg== X-Received: by 2002:a05:600c:2159:: with SMTP id v25mr19406401wml.180.1599441345889; Sun, 06 Sep 2020 18:15:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Aleksandar Rikalo , Aleksandar Markovic , Jiaxun Yang , Peter Maydell , Aurelien Jarno , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/2] hw/mips/mipssim: Use MMIO serial device on fake ISA I/O Date: Mon, 7 Sep 2020 03:15:37 +0200 Message-Id: <20200907011538.818996-2-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200907011538.818996-1-philmd@redhat.com> References: <20200907011538.818996-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The 'mipssim' is not a real hardware, it is a simulator. There is an ISA MMIO space mapped at 0x1fd00000, however this is not a real ISA bus (no ISA IRQ). So can not use the TYPE_ISA_SERIAL device... Instead we have been using a plain MMIO device, but named it IO. TYPE_SERIAL_IO is a superset of TYPE_SERIAL_MM, using regshift=3D0 and endianness=3DDEVICE_LITTLE_ENDIAN. Directly use the TYPE_SERIAL_MM device, enforcing the regshift/endianness values. 'regshift' default is already '0'. 'endianness' is meaningless for 8-bit accesses. This change breaks migration back compatibility, but this is not an issue for the mipssim machine. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/mips/mipssim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c index 1b3b7622035..5d4ad74828d 100644 --- a/hw/mips/mipssim.c +++ b/hw/mips/mipssim.c @@ -216,10 +216,11 @@ mips_mipssim_init(MachineState *machine) * MIPS CPU INT2, which is interrupt 4. */ if (serial_hd(0)) { - DeviceState *dev =3D qdev_new(TYPE_SERIAL_IO); + DeviceState *dev =3D qdev_new(TYPE_SERIAL_MM); =20 qdev_prop_set_chr(dev, "chardev", serial_hd(0)); - qdev_set_legacy_instance_id(dev, 0x3f8, 2); + qdev_prop_set_uint8(dev, "regshift", 0); + qdev_prop_set_uint8(dev, "endianness", DEVICE_LITTLE_ENDIAN); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, env->irq[4]); sysbus_add_io(SYS_BUS_DEVICE(dev), 0x3f8, --=20 2.26.2 From nobody Tue May 7 14:22:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599441357; cv=none; d=zohomail.com; s=zohoarc; b=S0iIA8/pDu1X0CPtKPEsuRj2kP8hQzDAh7iI0rGYYwilTyBt6aqAqQLFMhw4Uto/lEVtgeHFVmnLrtemQsewgkr8gWxHXBLeoEKW26Tiwu41LFOFmCSIbt+2NaZm8zOEnnpaUs0AGIQ0O4Ij/YywqJjm8VL+nqfq52Etmoqg0Wo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599441357; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=PYKMuCNTu0CWpezTgFvQrBp6rENgdo+gYHsIjc8AdfQ=; b=lWeJBAjIj4c4EXZgjRC3g1DDTL66n4PecqC0wNOTVXhvfLUcicVSIiiUoWatcLLLlf0/jFJs1RBw5n+v+p7mkZtAdpDudNqSZ8Ibfuylz3qzdO9K6gZzR3q3FAj8AS5lmuBYHlX23KIftXArcv0xbcwGbC1t+SCs/+OqQSUN6HU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599441357582431.1789029885151; Sun, 6 Sep 2020 18:15:57 -0700 (PDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-iXqok92HPvm-0G3czELAaQ-1; Sun, 06 Sep 2020 21:15:52 -0400 Received: by mail-wr1-f71.google.com with SMTP id b7so5100020wrn.6 for ; Sun, 06 Sep 2020 18:15:52 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id z7sm17477175wrw.93.2020.09.06.18.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 18:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599441355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PYKMuCNTu0CWpezTgFvQrBp6rENgdo+gYHsIjc8AdfQ=; b=FNqhTuT66tpmGVjQA2cd9mq186a/RWrl7C4fxSACWWErtiJKOG0B2PIU48ow1HpYAAh6YS yj4SYMOaKuEdzlhY4pcr3icwfA6ZzLRmuTVwnaop/hbunB+cjfjpdY4Uzo2IagEvqI3nz3 OgHqMvgwTackwM7B54DJRNlyp4p54zE= X-MC-Unique: iXqok92HPvm-0G3czELAaQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PYKMuCNTu0CWpezTgFvQrBp6rENgdo+gYHsIjc8AdfQ=; b=aLI+IA+tlRPKRcF/OdktWFGzYIIKEwY8dNnZgC2UwoKfQ4fP2Ru87rP0MWlUxwqr68 WLqnJZLpV++sonb/Ln5RupbchAKgkl2rxG2whABz0Fb4jxQqAl8f3e1GskUfhO4yuFsM DWoBv218789cusDbqGysuIWVhxJL250PepZFPqKKQBIxZS2JwAogo0e3PbCh4vIEBc0W xoDfsfPlFa0Fq2QUn99kmL3wWArTqw2i12Uc00W01jlM7GEakVIWLi+FhVZko4UmctuZ jk5ueD481ai64c465Dqh0ANLMoxGpkZ3l9xuhLG2XziiPMLzU4kI7AtLx4UipvRiBYYf fetw== X-Gm-Message-State: AOAM533GwUVUkm0D2K9XjtGC/dwvDr2Q7oKo2CilsZjxT5edpB61dbb+ TMz6fHAM+UQAZdReGPNP/mzub94cCG1V1Z9G2ED24dBdOIu9S6WGVKIFYYpIk900l/ObtqRGgyb g5v3sj6ffd64gwQ== X-Received: by 2002:a1c:f70a:: with SMTP id v10mr18189118wmh.39.1599441351169; Sun, 06 Sep 2020 18:15:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp7uqF2w1dkwMk5iiatrzjFNk6Kd88XKncpUINmWVImn57FgsXdh5KS5SYBt1ngUriRbtMrg== X-Received: by 2002:a1c:f70a:: with SMTP id v10mr18189097wmh.39.1599441351010; Sun, 06 Sep 2020 18:15:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Aleksandar Rikalo , Aleksandar Markovic , Jiaxun Yang , Peter Maydell , Aurelien Jarno , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/2] hw/char/serial: Remove TYPE_SERIAL_IO (superset of TYPE_SERIAL_MM) Date: Mon, 7 Sep 2020 03:15:38 +0200 Message-Id: <20200907011538.818996-3-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200907011538.818996-1-philmd@redhat.com> References: <20200907011538.818996-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.003 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) TYPE_SERIAL_IO is a superset of TYPE_SERIAL_MM, and it is not used anymore. Remove it. Suggested-by: Paolo Bonzini Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/char/serial.h | 9 --------- hw/char/serial.c | 41 ---------------------------------------- 2 files changed, 50 deletions(-) diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 535fa23a2b8..81d7ba1917f 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -88,12 +88,6 @@ typedef struct SerialMM { uint8_t endianness; } SerialMM; =20 -typedef struct SerialIO { - SysBusDevice parent; - - SerialState serial; -} SerialIO; - extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; =20 @@ -105,9 +99,6 @@ void serial_set_frequency(SerialState *s, uint32_t frequ= ency); #define TYPE_SERIAL_MM "serial-mm" #define SERIAL_MM(s) OBJECT_CHECK(SerialMM, (s), TYPE_SERIAL_MM) =20 -#define TYPE_SERIAL_IO "serial-io" -#define SERIAL_IO(s) OBJECT_CHECK(SerialIO, (s), TYPE_SERIAL_IO) - SerialMM *serial_mm_init(MemoryRegion *address_space, hwaddr base, int regshift, qemu_irq irq, int baudbase, diff --git a/hw/char/serial.c b/hw/char/serial.c index 23864794929..fd80ae55929 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -985,46 +985,6 @@ const MemoryRegionOps serial_io_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -static void serial_io_realize(DeviceState *dev, Error **errp) -{ - SerialIO *sio =3D SERIAL_IO(dev); - SerialState *s =3D &sio->serial; - - if (!qdev_realize(DEVICE(s), NULL, errp)) { - return; - } - - memory_region_init_io(&s->io, OBJECT(dev), &serial_io_ops, s, "serial"= , 8); - sysbus_init_mmio(SYS_BUS_DEVICE(sio), &s->io); - sysbus_init_irq(SYS_BUS_DEVICE(sio), &s->irq); -} - -static void serial_io_class_init(ObjectClass *klass, void* data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - - dc->realize =3D serial_io_realize; - /* No dc->vmsd: class has no migratable state */ -} - -static void serial_io_instance_init(Object *o) -{ - SerialIO *sio =3D SERIAL_IO(o); - - object_initialize_child(o, "serial", &sio->serial, TYPE_SERIAL); - - qdev_alias_all_properties(DEVICE(&sio->serial), o); -} - - -static const TypeInfo serial_io_info =3D { - .name =3D TYPE_SERIAL_IO, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(SerialIO), - .instance_init =3D serial_io_instance_init, - .class_init =3D serial_io_class_init, -}; - static Property serial_properties[] =3D { DEFINE_PROP_CHR("chardev", SerialState, chr), DEFINE_PROP_UINT32("baudbase", SerialState, baudbase, 115200), @@ -1178,7 +1138,6 @@ static const TypeInfo serial_mm_info =3D { static void serial_register_types(void) { type_register_static(&serial_info); - type_register_static(&serial_io_info); type_register_static(&serial_mm_info); } =20 --=20 2.26.2