From patchwork Thu Feb 20 13:05:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11394077 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 48180138D for ; Thu, 20 Feb 2020 13:07:12 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 24A3E208C4 for ; Thu, 20 Feb 2020 13:07:12 +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="A04WDmT7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24A3E208C4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lWm-000107-2Z; Thu, 20 Feb 2020 13:06:04 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lWk-000102-Sx for xen-devel@lists.xenproject.org; Thu, 20 Feb 2020 13:06:02 +0000 X-Inumbo-ID: be4a00f8-53e1-11ea-8526-12813bfff9fa Received: from us-smtp-delivery-1.mimecast.com (unknown [205.139.110.61]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id be4a00f8-53e1-11ea-8526-12813bfff9fa; Thu, 20 Feb 2020 13:06:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582203961; 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; bh=gs0Sx5MSe2ZHpufIPviwETvw5yj3kxXeAW695lKR/TM=; b=A04WDmT7du6YAyESCnsSFaoBhgshBttIxV2o/ek3kFqyvmXf+qEKtR1Q3hX9baegTuUXCn dt4tkthCmcD6+X5rv5+5mAS0ljOOGhn10GW1R6Y4pOx5DsPMyAEpbAcTde439f4FNMzqtD dq6ShylSvvrF6GdZ9wSGN4vilJ5liyQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-ccuY-e0gN7eZjnQ56ReGtQ-1; Thu, 20 Feb 2020 08:05:55 -0500 X-MC-Unique: ccuY-e0gN7eZjnQ56ReGtQ-1 Received: by mail-wr1-f72.google.com with SMTP id 90so1711273wrq.6 for ; Thu, 20 Feb 2020 05:05:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gu1OfO+Xr177r6zD7C+F/TxHFq6mosreIYv9UCpXME0=; b=QfSyygPn0Po8IiPrMaq8tr3ygbQxWO13/A1PH/648ARcROaudVPoAjv6m+tG14Adqq fJaO+uzv6U/TQqQ3cVBUdxndSBJa7uDlSfFU4yvUquBppqI11dKkHXhxhNnbNBVJOp0+ gCqn8gUjpeeJP7V74P2B73CPnPD5eUTLkIA1Kt4JQW0QoCPr6ZENG59913oN+caNot+b vrCAzScHPXjSlfmXao9hijrnA85wPg45d1UE/syGgOsR+QfIsgbzlIGfXffJe4e8vIvA C2afKeYCNDKLsTLdrDfd21zbFE2XFJxkRHuCWAVPCfOq9arlujHT+Op9SA7xeK4hX2hp qikw== X-Gm-Message-State: APjAAAUpShrOBkRu+D9T00xz78GAtMZxSam+TRZZDHq0As+CIZ/YVtqo eaOqQM0Q5WnFOnqmgdHM/73UnL9nuNUCjaSEV5wtHGV4wcE52BBv7JbV6vxqDj0QtEUS9FOXc/L CUpR6DYSkJoRz3ItCoIzlJd9RNPs= X-Received: by 2002:a1c:f713:: with SMTP id v19mr4357663wmh.113.1582203953758; Thu, 20 Feb 2020 05:05:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzh9hNepHCOwe2XDVm3wY3ajt8F8GOM+lVXRr3SymvEGFarpB4eXHypTAiBAMMl7y3VSmAESQ== X-Received: by 2002:a1c:f713:: with SMTP id v19mr4357638wmh.113.1582203953503; Thu, 20 Feb 2020 05:05:53 -0800 (PST) Received: from localhost.localdomain (78.red-88-21-202.staticip.rima-tde.net. [88.21.202.78]) by smtp.gmail.com with ESMTPSA id b67sm4594690wmc.38.2020.02.20.05.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 05:05:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 20 Feb 2020 14:05:28 +0100 Message-Id: <20200220130548.29974-1-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [Xen-devel] [PATCH v3 00/20] global exec/memory/dma APIs cleanup X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Dmitry Fleytman , kvm@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Stefano Stabellini , Matthew Rosato , qemu-block@nongnu.org, David Hildenbrand , Halil Pasic , Christian Borntraeger , =?utf-8?q?Herv=C3=A9_Poussi?= =?utf-8?q?neau?= , Marcel Apfelbaum , Anthony Perard , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth , Eduardo Habkost , Stefan Weil , Alistair Francis , Richard Henderson , Paul Durrant , Eric Auger , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , John Snow , David Gibson , Igor Mitsyanko , Cornelia Huck , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This series is inspired from Peter Maydel cleanup patch: https://www.mail-archive.com/qemu-devel@nongnu.org/msg680625.html - Convert 'is_write' argument to boolean - Use void pointer for blob buffer - Remove unnecessary casts (Stefan Weil) - Replace [API]_rw() by [API]_read/write() when is_write is constant Supersedes: <20200218112457.22712-1-peter.maydell@linaro.org> Peter Maydell (1): Avoid address_space_rw() with a constant is_write argument Philippe Mathieu-Daudé (19): scripts/git.orderfile: Display Cocci scripts before code modifications hw: Remove unnecessary cast when calling dma_memory_read() exec: Let qemu_ram_*() functions take a const pointer argument exec: Rename ram_ptr variable exec: Let flatview API take void pointer arguments exec: Let the address_space API use void pointer arguments hw/net: Avoid casting non-const pointer, use address_space_write() Remove unnecessary cast when using the address_space API exec: Let the cpu_[physical]_memory API use void pointer arguments Remove unnecessary cast when using the cpu_[physical]_memory API hw/ide/internal: Remove unused DMARestartFunc typedef hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument exec: Let address_space_unmap() use a boolean 'is_write' argument Let address_space_rw() calls pass a boolean 'is_write' argument exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument Avoid cpu_physical_memory_rw() with a constant is_write argument scripts/coccinelle/exec_rw_const.cocci | 103 +++++++++++++++++++++++++ include/exec/cpu-all.h | 2 +- include/exec/cpu-common.h | 18 ++--- include/exec/memory.h | 16 ++-- include/hw/ide/internal.h | 3 +- include/sysemu/xen-mapcache.h | 4 +- target/i386/hvf/vmx.h | 7 +- accel/kvm/kvm-all.c | 6 +- dma-helpers.c | 4 +- exec.c | 75 +++++++++--------- hw/arm/boot.c | 6 +- hw/arm/smmu-common.c | 3 +- hw/arm/smmuv3.c | 10 +-- hw/display/exynos4210_fimd.c | 3 +- hw/display/milkymist-tmu2.c | 8 +- hw/display/omap_dss.c | 2 +- hw/display/omap_lcdc.c | 10 +-- hw/display/ramfb.c | 2 +- hw/dma/etraxfs_dma.c | 25 +++--- hw/dma/rc4030.c | 10 +-- hw/dma/xlnx-zdma.c | 11 +-- hw/i386/xen/xen-mapcache.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/core.c | 2 +- hw/ide/macio.c | 2 +- hw/ide/pci.c | 2 +- hw/misc/pc-testdev.c | 2 +- hw/net/cadence_gem.c | 21 +++-- hw/net/dp8393x.c | 70 +++++++++-------- hw/net/i82596.c | 25 +++--- hw/net/lasi_i82596.c | 5 +- hw/nvram/spapr_nvram.c | 4 +- hw/ppc/pnv_lpc.c | 8 +- hw/ppc/ppc440_uc.c | 6 +- hw/ppc/spapr_hcall.c | 4 +- hw/s390x/css.c | 12 +-- hw/s390x/ipl.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- hw/s390x/virtio-ccw.c | 2 +- hw/scsi/vmw_pvscsi.c | 8 +- hw/sd/sdhci.c | 15 ++-- hw/virtio/vhost.c | 8 +- hw/virtio/virtio.c | 7 +- hw/xen/xen_pt_graphics.c | 2 +- qtest.c | 52 ++++++------- target/i386/hax-all.c | 6 +- target/i386/hvf/x86_mmu.c | 12 +-- target/i386/whpx-all.c | 2 +- target/s390x/excp_helper.c | 2 +- target/s390x/helper.c | 6 +- target/s390x/mmu_helper.c | 2 +- scripts/git.orderfile | 3 + 52 files changed, 360 insertions(+), 266 deletions(-) create mode 100644 scripts/coccinelle/exec_rw_const.cocci