From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520405; cv=none; d=zohomail.com; s=zohoarc; b=k+EErlHgrYEsvEzNY6BovDbALwF+5byZJkVS4Z20mZNYfwp8Kc+3oICSIMFZBIz8Gmyi8WQuWYyAIShdS8iqAfi2xKaRFm/YSTEQWaAm0twvbRdRiQcOIGsg6q1qUieQ/ztzbDV+qsfkLZM5aIrGS6CYatVWW0yXLi2Dddq2ons= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520405; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XuyDT1FR6CPgrj6UFGbDIJzcFEvpWD2/ACGuDBbcpME=; b=lNjdNVkbz4T2jBqMKZoh71hQZPLvngzQJUxaTZixbNwfFY5v8n7AaIieKPyXrFySsb7aB/neE8L/qaq8NA7V3BPzvUy3MUT4KSr0CrcHTrcUY2jMOALOX/NbIfUlNFPMmLYSgFCdRa63SL+fxw5V6SnC40BZ2Dk4vf6+TFtdg2I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520405313881.7762980607636; Tue, 30 Jun 2020 05:33:25 -0700 (PDT) Received: from localhost ([::1]:47700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFS0-0006ny-1x for importer@patchew.org; Tue, 30 Jun 2020 08:33:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFOZ-0003iT-36 for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:29:51 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58585 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFOX-0003Mv-DT for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:29:50 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-CdThLe7wMXapr4JFvRmtHA-1; Tue, 30 Jun 2020 08:29:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD42C800597; Tue, 30 Jun 2020 12:29:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D38C2CF79; Tue, 30 Jun 2020 12:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520188; 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=XuyDT1FR6CPgrj6UFGbDIJzcFEvpWD2/ACGuDBbcpME=; b=ecZHSQaviIs+p6pwML8GRvUyQElZTpbR7nd5kTPmt4SSSkxUW6OSvC1B9qo+CXTOsygjDt aSlr6x4ZAHPGNEMHe497EkKxWmc//yeaOkbgt6VVaEPc5iLvmWq/rTs+JR/i+BmXKUY4o+ gTMOS9wwe7GK86hgkcVYtQ/4xaGGSjk= X-MC-Unique: CdThLe7wMXapr4JFvRmtHA-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 1/9] hw/pci-host: add pci-intack write method Date: Tue, 30 Jun 2020 17:57:02 +0530 Message-Id: <20200630122710.1119158-2-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 03:55:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add pci-intack mmio write method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Reviewed-by: Li Qiang Signed-off-by: Prasad J Pandit Reviewed-by: Peter Maydell --- hw/pci-host/prep.c | 8 ++++++++ 1 file changed, 8 insertions(+) Update v3: Add Reviewed-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09395.html diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 367e408b91..3c8ff6af03 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/units.h" +#include "qemu/log.h" #include "qapi/error.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" @@ -119,8 +120,15 @@ static uint64_t raven_intack_read(void *opaque, hwaddr= addr, return pic_read_irq(isa_pic); } =20 +static void raven_intack_write(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__); +} + static const MemoryRegionOps raven_intack_ops =3D { .read =3D raven_intack_read, + .write =3D raven_intack_write, .valid =3D { .max_access_size =3D 1, }, --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520311; cv=none; d=zohomail.com; s=zohoarc; b=XBVy02WAwFkRhnS+ALddlufUb6bM9ZwJdpdkmz9WRx5Yv5WJjITwzxX1fSAmTtg3xmEjocnTm+83fQ4kCwuWuhbFUyr8ZA/YUffkJtZE/jwZYOCdaDd3aJARl9Y99T5epf65Ul8BZWSUfBwEpBRVlaiDCUezPMAHnVMRXi8KwmE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520311; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nf2jiKcgao0KRB8jp6YKGOLtoeAw61e09YX+V3F/S9o=; b=L3n4MlgSxZHk3kfY+AxZUy+MkbyJoHsjSF0SZSZylHEJkiyjeIh6yKddUM2EG3OkPDBLACpyk4jovl8s1kIbTJ/kwc25A+6oMlhdAiRhGPfIKP+hpST18GZapDjRfBsGt64j3bosQPsfA55TBkwUobBYyyO4koibPa23Qhtdkak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520311149101.76876755479338; Tue, 30 Jun 2020 05:31:51 -0700 (PDT) Received: from localhost ([::1]:44044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFQT-0005GV-Ej for importer@patchew.org; Tue, 30 Jun 2020 08:31:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFOt-00044x-OQ for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:30:11 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:33430 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFOr-0003SD-Tf for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:30:11 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-129-TGVF1GlwNBaNpnmwuv3oog-1; Tue, 30 Jun 2020 08:30:05 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8E5F104ECFE; Tue, 30 Jun 2020 12:29:59 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 32D335C66E; Tue, 30 Jun 2020 12:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520209; 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=nf2jiKcgao0KRB8jp6YKGOLtoeAw61e09YX+V3F/S9o=; b=czRrxgAVWI2EqE28Wd2CEPRQYpmVxxAJ11Wr/8uNuZSaLv8u0AOl1yE6O23Wt6l/1pI+/P VSES7lYI1uPEUg+r/jUgBgT74cKbyBROzhXtiuKvmuEalpkIVaDL+J/ZXW+7W2ZzRl7ZPt Lt9hZWM8WWWWrmIf7SIx9EjHF17yEAc= X-MC-Unique: TGVF1GlwNBaNpnmwuv3oog-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 2/9] pci-host: add pcie-msi read method Date: Tue, 30 Jun 2020 17:57:03 +0530 Message-Id: <20200630122710.1119158-3-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ppandit@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 02:00:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add pcie-msi mmio read method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Reviewed-by: Li Qiang Signed-off-by: Prasad J Pandit Reviewed-by: Peter Maydell --- hw/pci-host/designware.c | 9 +++++++++ 1 file changed, 9 insertions(+) Update v3: Add Reviewed-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09400.html diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 8492c18991..82262bdfdf 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/log.h" #include "hw/pci/msi.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_host.h" @@ -63,6 +64,13 @@ designware_pcie_root_to_host(DesignwarePCIERoot *root) return DESIGNWARE_PCIE_HOST(bus->parent); } =20 +static uint64_t designware_pcie_root_msi_read(void *opaque, hwaddr addr, + unsigned size) +{ + qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__); + return 0; +} + static void designware_pcie_root_msi_write(void *opaque, hwaddr addr, uint64_t val, unsigned len) { @@ -77,6 +85,7 @@ static void designware_pcie_root_msi_write(void *opaque, = hwaddr addr, } =20 static const MemoryRegionOps designware_pci_host_msi_ops =3D { + .read =3D designware_pcie_root_msi_read, .write =3D designware_pcie_root_msi_write, .endianness =3D DEVICE_LITTLE_ENDIAN, .valid =3D { --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520502; cv=none; d=zohomail.com; s=zohoarc; b=k8eXsGy8rvjzAJ9Casn7rPb9x1JRBVf8RmhQot7m5tIcZK2xUFzgcP4ZeZ/HUxu6cXpr9ak1v4JtmkmurEFO1zSD1KVi5domT4BabPo0uLN0FdOsQBMGkrqhmiovewnUdr+d52CQ0ZLO7a2MDruLHwt6Ne8D1FqxaWyJPKSe/kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520502; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g4NkpeznYcI4d0ovDvVCdOnMDUdG0xhZ5rvfXRRKl4I=; b=P0W63bwJhwtxttLMAWFVzDe5jyh+0dUc8Ohp7k6u1Luy4vh5LGTXEA4x6abx8oCSMiyUlBJn4txZtQmYMDqog9B5y1vCnli40+15PhmDytnSXe5qAa+d7lKf6Zrqj7cPMiLWER4OJcsoMMRTnwBVEWyPA2Nbvjhw4JhNM/IYwXY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520502132219.38577116378474; Tue, 30 Jun 2020 05:35:02 -0700 (PDT) Received: from localhost ([::1]:55906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFTY-0001h2-TX for importer@patchew.org; Tue, 30 Jun 2020 08:35:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFPK-0004RZ-6t for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:30:39 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:43985 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFPG-0003af-0I for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:30:37 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-3GazydatNPOP6g-SXHwttw-1; Tue, 30 Jun 2020 08:30:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29D39DB39; Tue, 30 Jun 2020 12:30:19 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C17835C241; Tue, 30 Jun 2020 12:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520232; 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=g4NkpeznYcI4d0ovDvVCdOnMDUdG0xhZ5rvfXRRKl4I=; b=WgDpkxyWNT+zMvcXRi51BqKMlAqzp9ivNaQdiYg2PDvDC5rtVBQJG6DP1+EfmdGtciooTC jLw47qyuxqR7bmpsawWFlBZNlLNq+AymYjj02VPCKijMvBI7qySB+FhP7uPlpyB0LmN9zz wm/YsEaY648g3flETXWH2J8gCwEsEcs= X-MC-Unique: 3GazydatNPOP6g-SXHwttw-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 3/9] vfio: add quirk device write method Date: Tue, 30 Jun 2020 17:57:04 +0530 Message-Id: <20200630122710.1119158-4-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ppandit@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 02:00:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add vfio quirk device mmio write method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Reviewed-by: Li Qiang Signed-off-by: Prasad J Pandit Acked-by: Alex Williamson Reviewed-by: Peter Maydell --- hw/vfio/pci-quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+) Update v3: Add Reviewed-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09406.html diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index d304c81148..cc6d5dbc23 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -14,6 +14,7 @@ #include "config-devices.h" #include "exec/memop.h" #include "qemu/units.h" +#include "qemu/log.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/module.h" @@ -264,8 +265,15 @@ static uint64_t vfio_ati_3c3_quirk_read(void *opaque, return data; } =20 +static void vfio_ati_3c3_quirk_write(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + qemu_log_mask(LOG_GUEST_ERROR, "%s not implemented\n", __func__); +} + static const MemoryRegionOps vfio_ati_3c3_quirk =3D { .read =3D vfio_ati_3c3_quirk_read, + .write =3D vfio_ati_3c3_quirk_write, .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520337; cv=none; d=zohomail.com; s=zohoarc; b=nRSWpiPxdJ+6vsllwfr70PsBx4mnEyDCuczkyyxWeTT0Zlzh+J/K0MZ/blfhzI3zEagXaO32IT+pKVuJCo4ktKe5Z8tgmQUZx1CF6yQExfs5zrTTZ7aUqE5SGAeWf1OHIc/jGoFb40+952zuXJP0HXBmskA5CE64yLXHqkPd2gU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520337; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nR2mlk71ijNyuzlqjwtm3TtC/BDoRCd3qq5v1Q1dItE=; b=P+AXoqOU5REkTjlcPnpHMnpBBgoubL5Y6OetA0Yim3xw0fOsHxwFdwGJ7+H8PbgS+h+g6tiPIiaUtg1tuo1FxSfhsTJMXFmU+Df2ngb8exzn/aGwyYkEm40bV+fEGdYldomrsgGoLuBuwZzcmvSV4P0UyRHEd1y8wunxVnW69TQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520337524441.3767991762014; Tue, 30 Jun 2020 05:32:17 -0700 (PDT) Received: from localhost ([::1]:45310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFQt-0005mB-95 for importer@patchew.org; Tue, 30 Jun 2020 08:32:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFPT-0004WB-KB for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:30:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29172 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFPR-0003b7-Mk for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:30:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-zynKvBOAM8Wo9xnDO-NmNQ-1; Tue, 30 Jun 2020 08:30:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 117832E94; Tue, 30 Jun 2020 12:30:28 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 940A25C66E; Tue, 30 Jun 2020 12:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520243; 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=nR2mlk71ijNyuzlqjwtm3TtC/BDoRCd3qq5v1Q1dItE=; b=LoOPKzoB4EH7J6h5YIXNiJmmEXGENUoZ+DhuGsYvZrYRBILyi2Rt66Kgb+Hmc6KRd2BW1b arU5vbFeLbTF8BkYXrFudy1qDzVUfSdUewB7ZidR2//81EBTmC62rXUShuMcyQ+kBnttwD hB6FZktzZC1yf+kjpI4dzc/8/LHR6tE= X-MC-Unique: zynKvBOAM8Wo9xnDO-NmNQ-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 4/9] prep: add ppc-parity write method Date: Tue, 30 Jun 2020 17:57:05 +0530 Message-Id: <20200630122710.1119158-5-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 03:55:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add ppc-parity mmio write method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Acked-by: David Gibson Signed-off-by: Prasad J Pandit --- hw/ppc/prep_systemio.c | 8 ++++++++ 1 file changed, 8 insertions(+) Update v3: Add Acked-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg08053.html diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index bbc51b6e9a..097f68f4a5 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/log.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -235,8 +236,15 @@ static uint64_t ppc_parity_error_readl(void *opaque, h= waddr addr, return val; } =20 +static void ppc_parity_error_writel(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid write access\n", __func__); +} + static const MemoryRegionOps ppc_parity_error_ops =3D { .read =3D ppc_parity_error_readl, + .write =3D ppc_parity_error_writel, .valid =3D { .min_access_size =3D 4, .max_access_size =3D 4, --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520464; cv=none; d=zohomail.com; s=zohoarc; b=W/n4/ScLDfAz8Z3ukjU8343GsY9X9MDiay79x9iNW+BQJWGzi6X679lnN4pH9WyXD1c2qirP13qDJTJU7/tjka5Zr0B9ulqUlX0RSr1p045TpWYKbRLMiomNMlP9K1gqQZVcVCjeIFSXaiQrIRBYdPaFoFdYe40qzaNHed8jNMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=huuVV6CmrhIMjX39cZvGBeBINYF6X+gwzf67AJA/UlA=; b=CX0LgFR30BGfFBH6U+SLx/hzAJrrYEa0Ye8eamGM1eFjiUZAXjNMnMEomyT8NylMnWlruvKtPC084zw80Xyz2f5yMgtVtHXGiEjLEoun8LjvV7+Ov/ZVea4MwBW55l0ifXTnd6DVj03OPAbeYThvsfZXwEB7iuTgQ8JBWw+/r1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520464810601.1538354555997; Tue, 30 Jun 2020 05:34:24 -0700 (PDT) Received: from localhost ([::1]:53352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFSx-0000eW-IO for importer@patchew.org; Tue, 30 Jun 2020 08:34:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFPj-0004yz-Mi for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:03 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:53277 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFPh-0003iP-Rw for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:03 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-_cPx-ChiOlaBQVUbHgek-w-1; Tue, 30 Jun 2020 08:30:46 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 323E51060B97; Tue, 30 Jun 2020 12:30:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E345C5C241; Tue, 30 Jun 2020 12:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520261; 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=huuVV6CmrhIMjX39cZvGBeBINYF6X+gwzf67AJA/UlA=; b=O+X3VWnrakfCmL2RtsorOx9rnN4Ve/wq9dO892cBrSQ1Ghi+WuJBPxXJXC8syhDoAx7Sek hq8p30l5zVMTlwZABKzOeNyD5TiNNg93s9h1zI67SnkldX68Lt6g6iDbYaqkeWrEznNviB kMJLoCQ6dkvlYW0VAwrmalk9QRPwVGc= X-MC-Unique: _cPx-ChiOlaBQVUbHgek-w-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 5/9] nvram: add nrf51_soc flash read method Date: Tue, 30 Jun 2020 17:57:06 +0530 Message-Id: <20200630122710.1119158-6-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ppandit@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 02:00:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add nrf51_soc mmio read method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Signed-off-by: Prasad J Pandit Reviewed-by: Peter Maydell --- hw/nvram/nrf51_nvm.c | 5 +++++ 1 file changed, 5 insertions(+) Update v3: use g_assert_not_reached() -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09560.html diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index f2283c1a8d..82e89d965b 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -273,6 +273,10 @@ static const MemoryRegionOps io_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 +static uint64_t flash_read(void *opaque, hwaddr offset, unsigned size) +{ + g_assert_not_reached(); +} =20 static void flash_write(void *opaque, hwaddr offset, uint64_t value, unsigned int size) @@ -300,6 +304,7 @@ static void flash_write(void *opaque, hwaddr offset, ui= nt64_t value, =20 =20 static const MemoryRegionOps flash_ops =3D { + .read =3D flash_read, .write =3D flash_write, .valid.min_access_size =3D 4, .valid.max_access_size =3D 4, --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520601; cv=none; d=zohomail.com; s=zohoarc; b=OBkwnOBkERB6r1Yg2Zb8u27mhx6zfp/FliI6uPA+8AbE0JQfGOCYythFrAyy7urvt/6I24GnMRYX/OKNFmTb2wGv86OPDNeKTcQehl+114EzjQTdgQHbgzIKEB4yXE+FJkBifObIukcVsxDdTwikBUviEWIWQfG/RXBjtlWurMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520601; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UqytC2fk6ON/bzO2ooHYivM9VguXfJO4IjAnv4dzJeY=; b=abbcs5o9+6I/WK56OzsOU96Sq8f4vzbcXb5y2LopY6kX+nWu/3NnZOEFB17ra3/Y8G1pUKBz6Zc/GcAKrglwwlMSZgzKp8wG9vnwIBRGdt/X2QUKaQ0hRnL9ANpBhO3+bFLkLOfvF0biddEfi38F+OgvbJ7zGmvdnZ0AcGfUU9M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520601681458.0233331696189; Tue, 30 Jun 2020 05:36:41 -0700 (PDT) Received: from localhost ([::1]:32836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFVA-0003t9-Az for importer@patchew.org; Tue, 30 Jun 2020 08:36:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFPn-00054e-5B for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:32141 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFPl-0003im-8U for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:06 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-54-wPAzjNDKMDap4zWznLcaTg-1; Tue, 30 Jun 2020 08:30:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC085A0C20; Tue, 30 Jun 2020 12:30:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E21725C1C5; Tue, 30 Jun 2020 12:30:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520264; 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=UqytC2fk6ON/bzO2ooHYivM9VguXfJO4IjAnv4dzJeY=; b=b9hExgUPuAYOoPiM5pQQF7hZA+r1vCtVzLh7xDqUB/vNFWBoFryeEYGOV27Cx9j8Vxv2qN Z0MwctN79oeP9Y/+U0mZHANfrunZzsO2v+VaDa2RALWDB2kDju9vNZPkmgIH/jDaACM9c0 C7La0IZwzXhzJBIFq6CRmlOsgxDmKLg= X-MC-Unique: wPAzjNDKMDap4zWznLcaTg-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 6/9] spapr_pci: add spapr msi read method Date: Tue, 30 Jun 2020 17:57:07 +0530 Message-Id: <20200630122710.1119158-7-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 03:55:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add spapr msi mmio read method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Acked-by: David Gibson Reviewed-by: Li Qiang Signed-off-by: Prasad J Pandit --- hw/ppc/spapr_pci.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) Update v3: Add Acked-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg08054.html diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 329002ac04..7033352834 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -52,6 +52,7 @@ #include "sysemu/kvm.h" #include "sysemu/hostmem.h" #include "sysemu/numa.h" +#include "qemu/log.h" =20 /* Copied from the kernel arch/powerpc/platforms/pseries/msi.c */ #define RTAS_QUERY_FN 0 @@ -738,6 +739,12 @@ static PCIINTxRoute spapr_route_intx_pin_to_irq(void *= opaque, int pin) return route; } =20 +static uint64_t spapr_msi_read(void *opaque, hwaddr addr, unsigned size) +{ + qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__); + return 0; +} + /* * MSI/MSIX memory region implementation. * The handler handles both MSI and MSIX. @@ -755,8 +762,10 @@ static void spapr_msi_write(void *opaque, hwaddr addr, } =20 static const MemoryRegionOps spapr_msi_ops =3D { - /* There is no .read as the read result is undefined by PCI spec */ - .read =3D NULL, + /* .read result is undefined by PCI spec + * define .read method to avoid assert failure in memory_region_init_io + */ + .read =3D spapr_msi_read, .write =3D spapr_msi_write, .endianness =3D DEVICE_LITTLE_ENDIAN }; --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520629; cv=none; d=zohomail.com; s=zohoarc; b=O7fNKQnjsKtfzfnH48GoFCqe/GpB47J6B32/uk5gMdSswgk0E+tb6JZ/1VGTrFzupI18dORezoaXyLo47YHC/jAaVcUKRDY0Wk91gtR43IQOld0jOcIh3nhSvxvLqxpu3mNr9C6TFO+A0aJppM6dDuaQtlr9XCMfvRUqsI5k9uc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520629; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=13ky1xAMDjm6BC9UbyOcoOYlgcqcL/dz1aVe9makXSo=; b=m2eK7mNdBX/R2CgBRK2v39mhzeE7ZKX1YipXfOLjmxOoLhefoiE/PBaaBANzYZQZgXSA4KvDrJ6oxKvIgs6yp8y79w/181fPL48LYyBF2lsWR8XdUM1hVUFhCbbqNcxCwuPFkKNjMAFx7V7jdhwGGwqNPS8NDkU1q+TocH7rJIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520629140363.5590718677521; Tue, 30 Jun 2020 05:37:09 -0700 (PDT) Received: from localhost ([::1]:35682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFVb-00051h-KM for importer@patchew.org; Tue, 30 Jun 2020 08:37:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFPx-0005DX-70 for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:18 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52190 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFPv-0003jj-1L for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-ddGoxLvNP4KRGGAd1ynbaA-1; Tue, 30 Jun 2020 08:30:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E077E107ACCA; Tue, 30 Jun 2020 12:30:57 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8553D5C1C5; Tue, 30 Jun 2020 12:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520274; 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=13ky1xAMDjm6BC9UbyOcoOYlgcqcL/dz1aVe9makXSo=; b=ZU9cwO/FwmYD87WHojJHvWajH/+ZD5yxhxbPQsMYEQLslA+RrxZoiZj6S5DahK4j6BJuD/ dY9H8LcRebrMddSp3whQPcaM2cTYETjFF5h2EwcwDEQ43UVo5t2E8I6Ggv++B/t09F3luG MGzKyTCqA0Rc+ogEYQV7q1DjqQImPEU= X-MC-Unique: ddGoxLvNP4KRGGAd1ynbaA-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 7/9] tz-ppc: add dummy read/write methods Date: Tue, 30 Jun 2020 17:57:08 +0530 Message-Id: <20200630122710.1119158-8-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 03:55:26 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add tz-ppc-dummy mmio read/write methods to avoid assert failure during initialisation. Signed-off-by: Prasad J Pandit Reviewed-by: Li Qiang Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/tz-ppc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) Update v3: use g_assert_not_reached() -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09451.html diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c index 6431257b52..36495c68e7 100644 --- a/hw/misc/tz-ppc.c +++ b/hw/misc/tz-ppc.c @@ -196,7 +196,21 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr = addr, g_assert_not_reached(); } =20 +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size) +{ + g_assert_not_reached(); +} + +static void tz_ppc_dummy_write(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + g_assert_not_reached(); +} + static const MemoryRegionOps tz_ppc_dummy_ops =3D { + /* define r/w methods to avoid assert failure in memory_region_init_io= */ + .read =3D tz_ppc_dummy_read, + .write =3D tz_ppc_dummy_write, .valid.accepts =3D tz_ppc_dummy_accepts, }; =20 --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520446; cv=none; d=zohomail.com; s=zohoarc; b=nNkeOgKc0g0l91J8TUSr+bqfCgB2mRVnEQV2QA5h2pVgf7tX2dNpKTu0Ni13SRpp6YZoFZPP2Wpwr/Fd4ABBWaSqmwIOcfQJyk6DjAVrdKzcLoVV/fhBo5hbky2GYrUsMuOMhOZC/TxDh6NTNEf09a1IM0GUAqajl9bSh6gTMu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520446; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=P5WJC/lONKTLoi6rxFfZsZwDAUiOGKmFKgrKK48Cwxw=; b=AdrS5lnblqHsew7mCtxh6dlkRaKu1vqvD7DLGHYTHCwFzDyRzJL0BjJMfpGgGd3ShJXIO/cy02T1u+pLrxJp8foA5M0+BOTJ8VZLVGKnrigatnlHrm84wHLH1EmJ2el2G2Z3q6U7pqZdGOpGRnhkSYapsHBH0aHDDrO+rUg0fEo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520446435293.64124998462637; Tue, 30 Jun 2020 05:34:06 -0700 (PDT) Received: from localhost ([::1]:51522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFSe-0008K9-QU for importer@patchew.org; Tue, 30 Jun 2020 08:34:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFQ0-0005EJ-13 for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:20 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:39440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFPx-0003jw-Hn for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:19 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-7ZEOMwn8M5KK1xcd4uzTzg-1; Tue, 30 Jun 2020 08:31:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4647019200E8; Tue, 30 Jun 2020 12:31:05 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 831395C1C5; Tue, 30 Jun 2020 12:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520276; 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=P5WJC/lONKTLoi6rxFfZsZwDAUiOGKmFKgrKK48Cwxw=; b=IL0O3a2XWuBvoYRL+dixv208CHFuZXhBZTaYZj6vBQgZ+NdYrVeO4tKxIf/B0eCBEcsd6+ Cgjzvx9rXJLtQfgQ955WQmoqJqyg8ezEYNQhK6rCRfhk191V8m5Yh1beB7urJb00i+NTqL +dW2D1M9z6HF6i7g9tn2s/Dh6HS7DmY= X-MC-Unique: 7ZEOMwn8M5KK1xcd4uzTzg-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 8/9] imx7-ccm: add digprog mmio write method Date: Tue, 30 Jun 2020 17:57:09 +0530 Message-Id: <20200630122710.1119158-9-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 02:00:02 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit Add digprog mmio write method to avoid assert failure during initialisation. Reviewed-by: Li Qiang Signed-off-by: Prasad J Pandit --- hw/misc/imx7_ccm.c | 7 +++++++ 1 file changed, 7 insertions(+) Update v3: Add Reviewed-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09452.html diff --git a/hw/misc/imx7_ccm.c b/hw/misc/imx7_ccm.c index 02fc1ae8d0..5ac5ecf74c 100644 --- a/hw/misc/imx7_ccm.c +++ b/hw/misc/imx7_ccm.c @@ -131,8 +131,15 @@ static const struct MemoryRegionOps imx7_set_clr_tog_o= ps =3D { }, }; =20 +static void imx7_digprog_write(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + qemu_log_mask(LOG_UNIMP, "%s not implemented\n", __func__); +} + static const struct MemoryRegionOps imx7_digprog_ops =3D { .read =3D imx7_set_clr_tog_read, + .write =3D imx7_digprog_write, .endianness =3D DEVICE_NATIVE_ENDIAN, .impl =3D { .min_access_size =3D 4, --=20 2.26.2 From nobody Thu Mar 28 21:34:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1593520582; cv=none; d=zohomail.com; s=zohoarc; b=cXDEZHBtY5BvVikW8fcB8MqX5jzrFkINztw+Vqe0v0lZom8gAAaZmLnZ5X41YemWDNsXd8Np7STB7zE+f4MTpHq078x3LWuMisSywgDyyDrbIgcdmGKvmpKU/4fom4R1TtfPK4h6LPYAF6OKP+zmj8iRsb2YBfg8v3GJ5CDyJUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593520582; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ov1jLUdvXIGnRIWFa0ql9vtSUGoOJxabVDi0h7uTGDE=; b=PePQoGDjWDIkCZPARyAI4SjgRNd15k+Xu6vKmkK+hEIXKCLtVr4CfUfhqT42j2DFCm6BG3wKN8wtFqnECaX4dvXC2ow9vsdUmXK2H43eMLM85S9cHCxuKbTFfROk2zqwEWWST4mpAwKyvnOjEhVC50BekcbXwyftXKW0Clb2EJk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1593520582267215.81851792279133; Tue, 30 Jun 2020 05:36:22 -0700 (PDT) Received: from localhost ([::1]:59242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFUq-0003A4-Rf for importer@patchew.org; Tue, 30 Jun 2020 08:36:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFQ4-0005Gn-Pb for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:25 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:20845 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jqFQ2-0003kU-MU for qemu-devel@nongnu.org; Tue, 30 Jun 2020 08:31:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-cy1kuH-HPFiQwy5xg28kBA-1; Tue, 30 Jun 2020 08:31:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7A9D19324B2; Tue, 30 Jun 2020 12:31:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 007925C1C5; Tue, 30 Jun 2020 12:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593520282; 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=ov1jLUdvXIGnRIWFa0ql9vtSUGoOJxabVDi0h7uTGDE=; b=PZ1gnrb6FC5EU2VLUQyewaatdBf+pgZ6LcQ1QyoiChonf8kyMmXBNCvbDUM/DL2yp/N/n8 s3qN3SBxA0UaT7ookugBUkdATE4WlLTrS6kvD2MLxhmuPeKTldGR0fcP4XGh7YFyuVEXbx DmSJEvkLnb/1u/nWJJt+xvNYYLE7VjU= X-MC-Unique: cy1kuH-HPFiQwy5xg28kBA-1 From: P J P To: Paolo Bonzini Subject: [PATCH v3 9/9] memory: assert MemoryRegionOps callbacks are defined Date: Tue, 30 Jun 2020 17:57:10 +0530 Message-Id: <20200630122710.1119158-10-ppandit@redhat.com> In-Reply-To: <20200630122710.1119158-1-ppandit@redhat.com> References: <20200630122710.1119158-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ppandit@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=ppandit@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/30 01:11:03 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-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: Peter Maydell , Prasad J Pandit , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Prasad J Pandit When registering a MemoryRegionOps object, assert that its read/write callback methods are defined. This avoids potential guest crash via a NULL pointer dereference. Suggested-by: Peter Maydell Reviewed-by: Li Qiang Signed-off-by: Prasad J Pandit Reviewed-by: Peter Maydell --- memory.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Update v3: Add Reviewed-by: ... -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg09467.html diff --git a/memory.c b/memory.c index 9200b20130..5e22bce326 100644 --- a/memory.c +++ b/memory.c @@ -1485,7 +1485,13 @@ void memory_region_init_io(MemoryRegion *mr, uint64_t size) { memory_region_init(mr, owner, name, size); - mr->ops =3D ops ? ops : &unassigned_mem_ops; + if (ops) { + assert(ops->read || ops->read_with_attrs); + assert(ops->write || ops->write_with_attrs); + mr->ops =3D ops; + } else { + mr->ops =3D &unassigned_mem_ops; + } mr->opaque =3D opaque; mr->terminates =3D true; } @@ -1663,6 +1669,8 @@ void memory_region_init_rom_device_nomigrate(MemoryRe= gion *mr, { Error *err =3D NULL; assert(ops); + assert(ops->read || ops->read_with_attrs); + assert(ops->write || ops->write_with_attrs); memory_region_init(mr, owner, name, size); mr->ops =3D ops; mr->opaque =3D opaque; --=20 2.26.2