From patchwork Wed Jun 24 18:55:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 692F5913 for ; Wed, 24 Jun 2020 19:00:04 +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 3AFE92082F for ; Wed, 24 Jun 2020 19:00:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hzvriC4V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AFE92082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAct-0002Pa-A7 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:00:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAbt-0008T6-RN for qemu-devel@nongnu.org; Wed, 24 Jun 2020 14:59:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:45268 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 1joAbr-0004A1-HW for qemu-devel@nongnu.org; Wed, 24 Jun 2020 14:59:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025137; 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=GleucLL2Nx/0Ws9nGlVY3nkce0HwyhUZjtZatcpcqG8=; b=hzvriC4VLnynFuawxoBxUk+ZrPuvLyLA2E/xEMaXE5Z43TfrzgJ+U+jG3s85XpsulFxFRY nRkRsnuCuWARqkrff9CQL/aAn3OaQQqw5VrFjy+YnasrIhRtOSTt4gCnBMDBEIFQO/9I7D Tvxg5e63ugtRW7OVMlMcWn6p62fynrs= 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-325-V163fZKcNjGEcZub07r8ZA-1; Wed, 24 Jun 2020 14:57:49 -0400 X-MC-Unique: V163fZKcNjGEcZub07r8ZA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CB9D8015F5; Wed, 24 Jun 2020 18:57:48 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 548D979325; Wed, 24 Jun 2020 18:57:39 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 1/9] hw/pci-host: add pci-intack write method Date: Thu, 25 Jun 2020 00:25:15 +0530 Message-Id: <20200624185523.762240-2-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 02:33:25 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add pci-intack mmio write method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Signed-off-by: Prasad J Pandit Reviewed-by: Li Qiang --- hw/pci-host/prep.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); } +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 = { .read = raven_intack_read, + .write = raven_intack_write, .valid = { .max_access_size = 1, }, From patchwork Wed Jun 24 18:55:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624069 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DED556C1 for ; Wed, 24 Jun 2020 19:07:07 +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 B593A20702 for ; Wed, 24 Jun 2020 19:07:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RVB42ngt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B593A20702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAjj-0004cG-0s for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:07:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAcY-0001TN-DP for qemu-devel@nongnu.org; Wed, 24 Jun 2020 14:59:42 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:41455 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 1joAcW-0004Hb-Pj for qemu-devel@nongnu.org; Wed, 24 Jun 2020 14:59:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025180; 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=CAvcXKMNNYEzKvFkC3eYkkP7W1Umfz9dUcLwqCKleIE=; b=RVB42ngt2FNl/YDlvYEgzCgz/D30zbyP5nAhzDZeTxwnYQLH2KoQKmmFbYBbvirZ6kMOQl PxCzEXZgmYxzEOJbKXimuec5dw3AQa0c8NT60kWJcUrvPjswTOf+s/BwZLileshBJdlDXI 42ysuSZnIMcilx9E+eCkDvpFP8ZTbGQ= 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-504-92jrp4ZTPxyWyuMKv5FhyA-1; Wed, 24 Jun 2020 14:58:00 -0400 X-MC-Unique: 92jrp4ZTPxyWyuMKv5FhyA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E005010059A4; Wed, 24 Jun 2020 18:57:58 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA0497931F; Wed, 24 Jun 2020 18:57:48 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 2/9] pci-host: add pcie-msi read method Date: Thu, 25 Jun 2020 00:25:16 +0530 Message-Id: <20200624185523.762240-3-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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/24 03:27:53 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add pcie-msi mmio read method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Signed-off-by: Prasad J Pandit Reviewed-by: Li Qiang --- hw/pci-host/designware.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); } +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, } static const MemoryRegionOps designware_pci_host_msi_ops = { + .read = designware_pcie_root_msi_read, .write = designware_pcie_root_msi_write, .endianness = DEVICE_LITTLE_ENDIAN, .valid = { From patchwork Wed Jun 24 18:55:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4363F6C1 for ; Wed, 24 Jun 2020 19:02: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 1A9B02082F for ; Wed, 24 Jun 2020 19:02:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WbqQjejM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A9B02082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAfI-0006Oy-9m for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:02:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAcF-0000qp-Uf for qemu-devel@nongnu.org; Wed, 24 Jun 2020 14:59:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27527 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 1joAcE-0004Fz-Br for qemu-devel@nongnu.org; Wed, 24 Jun 2020 14:59:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025161; 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=CgriznhCwBvOMRtD3ME0+7TKcTKrwTT32cTqkPHSJ5w=; b=WbqQjejMmpTHGuU8RNq7Ylu9JotPnrHLGatk9SweKqAbCbA2bGiPx43AbY7idcbvBTFSxG LBrQdlzk4CiN+D7QrQ550GwGb0HZn0fnFgCHK1/a2DzPK3FwDi7RWclNFNV9rkAtWciXH5 7OG3wtwyfUrJNZnmfSO8oNydt8NL9z8= 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-265-h8ko6v1-MzGQWjn6wd2BVg-1; Wed, 24 Jun 2020 14:58:06 -0400 X-MC-Unique: h8ko6v1-MzGQWjn6wd2BVg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 067AEC7451; Wed, 24 Jun 2020 18:58:05 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 233017931E; Wed, 24 Jun 2020 18:57:59 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 3/9] vfio: add quirk device write method Date: Thu, 25 Jun 2020 00:25:17 +0530 Message-Id: <20200624185523.762240-4-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 02:33:25 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add vfio quirk device mmio write method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Signed-off-by: Prasad J Pandit Reviewed-by: Li Qiang --- hw/vfio/pci-quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+) Update v2: use LOG_GUEST_ERROR -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg04962.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; } +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 = { .read = vfio_ati_3c3_quirk_read, + .write = vfio_ati_3c3_quirk_write, .endianness = DEVICE_LITTLE_ENDIAN, }; From patchwork Wed Jun 24 18:55:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624071 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C20C90 for ; Wed, 24 Jun 2020 19:08:02 +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 724E320702 for ; Wed, 24 Jun 2020 19:08:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZfAsh+mX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 724E320702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAkb-000654-M3 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:08:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAd9-000367-AG for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:00:19 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:25442 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 1joAd7-0004Tu-9C for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:00:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025216; 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=8UDbZPa3zDEE1UUML1O45YWn6QN5yhBRLIdhQszmnhc=; b=ZfAsh+mXoMkAcSPUxFO2dKoo+G9J1jhW6d9tbqEsV1TWQszmzlR/MnqZtht6PJk6nrSTJ8 0GgD47igCBx0qiGT7P27ZuAixM9e2bST/7bh+AL6m+yYce5d2UUW08q9KzAbxTi8wiWYtM N45gY+qllwRJV6J62RZuErd/EuTe+P8= 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-47-uoT3h1jvPJyFg3Z9Fd8K9A-1; Wed, 24 Jun 2020 14:58:11 -0400 X-MC-Unique: uoT3h1jvPJyFg3Z9Fd8K9A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BE03800C60; Wed, 24 Jun 2020 18:58:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A12441DC; Wed, 24 Jun 2020 18:58:05 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 4/9] prep: add ppc-parity write method Date: Thu, 25 Jun 2020 00:25:18 +0530 Message-Id: <20200624185523.762240-5-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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/24 01:59:40 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add ppc-parity mmio write method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Signed-off-by: Prasad J Pandit Acked-by: David Gibson --- hw/ppc/prep_systemio.c | 8 ++++++++ 1 file changed, 8 insertions(+) Update v2: use LOG_GUEST_ERROR -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg04975.html diff --git a/hw/ppc/prep_systemio.c b/hw/ppc/prep_systemio.c index bbc51b6e9a..03a2f8af6e 100644 --- a/hw/ppc/prep_systemio.c +++ b/hw/ppc/prep_systemio.c @@ -23,6 +23,7 @@ */ #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, hwaddr addr, return val; } +static void ppc_parity_error_writel(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + qemu_log_mask(LOG_GUEST_ERROR, "%s not implemented\n", __func__); +} + static const MemoryRegionOps ppc_parity_error_ops = { .read = ppc_parity_error_readl, + .write = ppc_parity_error_writel, .valid = { .min_access_size = 4, .max_access_size = 4, From patchwork Wed Jun 24 18:55:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624073 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6B0F90 for ; Wed, 24 Jun 2020 19:08:50 +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 7D47420702 for ; Wed, 24 Jun 2020 19:08:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cItlFbG2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D47420702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAlN-0007ZY-QO for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:08:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAdw-0004W4-0C for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:01:08 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:23165 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 1joAdt-0004jO-ML for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:01:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025265; 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=4loFTY4oY+modSCblVskwyCO4SWjwGRGpQh2kNPT3Dw=; b=cItlFbG2hAFBVVNqGk4H+qMa8Ji+dfFY/9l9dAHDoCR3NAWIYBtrOVulNGu64iOTYrIyQa NwZuCXz+SGKVvWdW1UTeNDIlvTAv2gbwv0oyFdGj9GTdblGywVl8dASFlUM3QPcm8+xduu dUjgnwhGReWOUhY3KRFcHXUaqM/+QLo= 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-38-CFpL2iGaPEu3_IE4cdb0LQ-1; Wed, 24 Jun 2020 14:58:19 -0400 X-MC-Unique: CFpL2iGaPEu3_IE4cdb0LQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C485F10059B9; Wed, 24 Jun 2020 18:58:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BAA61DC; Wed, 24 Jun 2020 18:58:10 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 5/9] nvram: add nrf51_soc flash read method Date: Thu, 25 Jun 2020 00:25:19 +0530 Message-Id: <20200624185523.762240-6-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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/24 00:34:35 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 --- hw/nvram/nrf51_nvm.c | 8 ++++++++ 1 file changed, 8 insertions(+) Update v2: return ldl_le_p() -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg04972.html diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index f2283c1a8d..8000ed530a 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -273,6 +273,13 @@ static const MemoryRegionOps io_ops = { .endianness = DEVICE_LITTLE_ENDIAN, }; +static uint64_t flash_read(void *opaque, hwaddr offset, unsigned size) +{ + NRF51NVMState *s = NRF51_NVM(opaque); + + assert(offset + size <= s->flash_size); + return ldl_le_p(s->storage + offset); +} static void flash_write(void *opaque, hwaddr offset, uint64_t value, unsigned int size) @@ -300,6 +307,7 @@ static void flash_write(void *opaque, hwaddr offset, uint64_t value, static const MemoryRegionOps flash_ops = { + .read = flash_read, .write = flash_write, .valid.min_access_size = 4, .valid.max_access_size = 4, From patchwork Wed Jun 24 18:55:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624077 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A9D790 for ; Wed, 24 Jun 2020 19:10: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 3091020702 for ; Wed, 24 Jun 2020 19:10:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gjsMuznS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3091020702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:44540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAnG-0001PV-Ed for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:10:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAeK-0005BU-Ou for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:01:32 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53222 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 1joAeH-0004ma-Ut for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:01:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025289; 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=PJsRBGUOb73DHRmjtLDJwi3qY0lfc6VGkHzLnBs0AxE=; b=gjsMuznSX648NertV8MqgHzPIREuKDaZhX5F1uvEe9czVyF+RW4kJQ8iWGhgo3bKfC08nx HDa8wuMJgcmRYSEfW1APieToPkRTFIf/VS/FC39nkEivn5SSpD6qz21mcI3n7CWnxUvUcV PhFXaW9VCm4+QxTD52PZ+0t4+rDiGyk= 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-466-0O0ggHP6MkinPsI-cYQxMg-1; Wed, 24 Jun 2020 14:58:26 -0400 X-MC-Unique: 0O0ggHP6MkinPsI-cYQxMg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EECE310059A6; Wed, 24 Jun 2020 18:58:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01AAD79305; Wed, 24 Jun 2020 18:58:18 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 6/9] spapr_pci: add spapr msi read method Date: Thu, 25 Jun 2020 00:25:20 +0530 Message-Id: <20200624185523.762240-7-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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/24 03:27:53 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add spapr msi mmio read method to avoid NULL pointer dereference issue. Reported-by: Lei Sun Signed-off-by: Prasad J Pandit Acked-by: David Gibson Reviewed-by: Li Qiang --- hw/ppc/spapr_pci.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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" /* 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; } +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, } static const MemoryRegionOps spapr_msi_ops = { - /* There is no .read as the read result is undefined by PCI spec */ - .read = NULL, + /* .read result is undefined by PCI spec + * define .read method to avoid assert failure in memory_region_init_io + */ + .read = spapr_msi_read, .write = spapr_msi_write, .endianness = DEVICE_LITTLE_ENDIAN }; From patchwork Wed Jun 24 18:55:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624059 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 167F4913 for ; Wed, 24 Jun 2020 19:02:34 +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 DDB092082F for ; Wed, 24 Jun 2020 19:02:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aOLkaN56" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDB092082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:48902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAfJ-0006QP-0P for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:02:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAd0-0002l2-1y for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:00:10 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34270 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 1joAcy-0004P0-9k for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025207; 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=dpVeb2EDnlHUKA8spt/+4lq5h1KKgQvFGfdRElRLfrY=; b=aOLkaN56LVOwNH06Oo/6BeHH2g9dmgeI/+2uej30G+RDXiJK3+b5D+g/Dx9iyW6YL6Lqs6 BWXyZQcAAh0ckJmu8jCkGcUFmt9IUF3HfkxYh0v/MFt+O0IGwkgxFWfLIZzVSf0OGCzjEd kd0hSNfxVi3F2NWQggZq59dyQUscRXg= 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-382-cgmIb294NxqdMZwTAhLC0A-1; Wed, 24 Jun 2020 14:58:31 -0400 X-MC-Unique: cgmIb294NxqdMZwTAhLC0A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F388210059A0; Wed, 24 Jun 2020 18:58:29 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A537E79325; Wed, 24 Jun 2020 18:58:25 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 7/9] tz-ppc: add dummy read/write methods Date: Thu, 25 Jun 2020 00:25:21 +0530 Message-Id: <20200624185523.762240-8-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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/24 03:27:53 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add tz-ppc-dummy mmio read/write methods to avoid assert failure during initialisation. Signed-off-by: Prasad J Pandit --- hw/misc/tz-ppc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/misc/tz-ppc.c b/hw/misc/tz-ppc.c index 6431257b52..dc8892f61f 100644 --- a/hw/misc/tz-ppc.c +++ b/hw/misc/tz-ppc.c @@ -196,7 +196,22 @@ static bool tz_ppc_dummy_accepts(void *opaque, hwaddr addr, g_assert_not_reached(); } +static uint64_t tz_ppc_dummy_read(void *opaque, hwaddr addr, unsigned size) +{ + qemu_log_mask(LOG_GUEST_ERROR, "%s not implemented\n", __func__); + return 0; +} + +static void tz_ppc_dummy_write(void *opaque, hwaddr addr, + uint64_t data, unsigned size) +{ + qemu_log_mask(LOG_GUEST_ERROR, "%s not implemented\n", __func__); +} + static const MemoryRegionOps tz_ppc_dummy_ops = { + /* define r/w methods to avoid assert failure in memory_region_init_io */ + .read = tz_ppc_dummy_read, + .write = tz_ppc_dummy_write, .valid.accepts = tz_ppc_dummy_accepts, }; From patchwork Wed Jun 24 18:55:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624075 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E9B090 for ; Wed, 24 Jun 2020 19:09:51 +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 34D8920702 for ; Wed, 24 Jun 2020 19:09:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Z5zWuvBW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34D8920702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:42536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAmM-00008f-GA for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:09:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAeV-0005IY-M0 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:01:45 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:29211 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 1joAeT-0004oy-S4 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:01:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025301; 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=jsOCKVDAnlVo7nwwW1cVlcGlJH5VAzWBJos0J7YBlL8=; b=Z5zWuvBWjEjD1e+eBDVaVT1akoArXP0Sj+SBzzGgpeep/cQAnZBqN2HZa6LPnMSuf96XFC KMuKQ3aFqa0riJPgxf+z5SXc2uTBAqgaQVfcOXvIyJALngCMrGje1acsTJPOLVJduaL2KG QG6X7M0057ZHU7Xj3Ivb/FX6CYGiY5c= 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-120-AVTgGQvmM7e4UQMR1eNXCA-1; Wed, 24 Jun 2020 14:58:39 -0400 X-MC-Unique: AVTgGQvmM7e4UQMR1eNXCA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB005EC1A1; Wed, 24 Jun 2020 18:58:37 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF44679325; Wed, 24 Jun 2020 18:58:30 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 8/9] imx7-ccm: add digprog mmio write method Date: Thu, 25 Jun 2020 00:25:22 +0530 Message-Id: <20200624185523.762240-9-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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/24 00:34:35 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Prasad J Pandit Add digprog mmio write method to avoid assert failure during initialisation. Signed-off-by: Prasad J Pandit Reviewed-by: Li Qiang --- hw/misc/imx7_ccm.c | 7 +++++++ 1 file changed, 7 insertions(+) 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_ops = { }, }; +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 = { .read = imx7_set_clr_tog_read, + .write = imx7_digprog_write, .endianness = DEVICE_NATIVE_ENDIAN, .impl = { .min_access_size = 4, From patchwork Wed Jun 24 18:55:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prasad Pandit X-Patchwork-Id: 11624065 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D3EBF1731 for ; Wed, 24 Jun 2020 19:06:22 +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 AA69120702 for ; Wed, 24 Jun 2020 19:06:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WlrtY/h7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA69120702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:32986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joAiz-0003Su-TU for patchwork-qemu-devel@patchwork.kernel.org; Wed, 24 Jun 2020 15:06:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joAcr-0002RJ-J6 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:00:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46782 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 1joAcp-0004Kx-J8 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 15:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593025198; 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=ar9EPNnW2UkZsgMWjVnCcQt7kxez+sGtf7BypjVxH9s=; b=WlrtY/h7KRBgqD1/lqeUIx/1G6pAK1ORIRPVcxyqpiVK1Q7R7EmkrqF1vEPmGLlxBRQMBI I+1cGDxIcF3rezYnSL/P2Qt4vurCHP5zQrTWHI7EDgonfmp5YGEhp0uGOKCqmOe0Xj7b/m PHdI2zRRzPc091BtgnuJ5ye4jvuYmXA= 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-293-Xg_17yIGNF-pbuJlylgdmQ-1; Wed, 24 Jun 2020 14:58:43 -0400 X-MC-Unique: Xg_17yIGNF-pbuJlylgdmQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C2DB107ACF8; Wed, 24 Jun 2020 18:58:42 +0000 (UTC) Received: from localhost.localdomain (unknown [10.74.8.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77CC871660; Wed, 24 Jun 2020 18:58:38 +0000 (UTC) From: P J P To: Paolo Bonzini Subject: [PATCH v2 9/9] memory: assert MemoryRegionOps callbacks are defined Date: Thu, 25 Jun 2020 00:25:23 +0530 Message-Id: <20200624185523.762240-10-ppandit@redhat.com> In-Reply-To: <20200624185523.762240-1-ppandit@redhat.com> References: <20200624185523.762240-1-ppandit@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=ppandit@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 02:33:25 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_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Qiang , QEMU Developers , Lei Sun , Alex Williamson , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 Signed-off-by: Prasad J Pandit Reviewed-by: Li Qiang --- memory.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Update v2: assert read/write_with_attrs methods -> https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg05717.html diff --git a/memory.c b/memory.c index 2f15a4b250..3d635a1bca 100644 --- a/memory.c +++ b/memory.c @@ -1496,7 +1496,13 @@ void memory_region_init_io(MemoryRegion *mr, uint64_t size) { memory_region_init(mr, owner, name, size); - mr->ops = ops ? ops : &unassigned_mem_ops; + if (ops) { + assert(ops->read || ops->read_with_attrs); + assert(ops->write || ops->write_with_attrs); + mr->ops = ops; + } else { + mr->ops = &unassigned_mem_ops; + } mr->opaque = opaque; mr->terminates = true; } @@ -1674,6 +1680,8 @@ void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, { Error *err = 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 = ops; mr->opaque = opaque;