From nobody Mon Feb 9 09:51:43 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582204011; cv=none; d=zohomail.com; s=zohoarc; b=Q2qn/NY0yQNqtGs0dS3YLut/u672iR33s38JaDgTFQYD1+9tXqSGkByfcDagmRLxOa1Nrnl9qXqiPg7glb5qY1sKhd2gchp5Rdpf0/ki5bhdw/KwViQeeTFADr5bV/yAU8HDKCs8aYjGyZnUEEK6ZkCBcUZLARRVFziHwKv/FWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582204011; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ITJWX4R5p4ksnc/kel3YBxONMAl9sh6eL0+ZaFvIdlU=; b=TgODwj/hbt6pGPzDs4P+aow9rnQu/t0ws0GcitKWnI07FnBEpQ4tvxIN41LI/3fDao/T/E5B941bsgotMBemWl1nGEgySsyMLBG+G3JWIwNzbyGXjiSQYrCXqjnRE5vzVCeAs9szV3QABjInQI4IGlE/8qBmv51W9H+c0xAX2TI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1582204011249988.6571761554665; Thu, 20 Feb 2020 05:06:51 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lX5-00018b-Ok; Thu, 20 Feb 2020 13:06:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lX3-00016n-Qj for xen-devel@lists.xenproject.org; Thu, 20 Feb 2020 13:06:21 +0000 Received: from us-smtp-delivery-1.mimecast.com (unknown [207.211.31.81]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id ca1a1724-53e1-11ea-b0fd-bc764e2007e4; Thu, 20 Feb 2020 13:06:21 +0000 (UTC) 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-313-Sr4y9MXaMCytIX_rIUtg6Q-1; Thu, 20 Feb 2020 08:06:19 -0500 Received: by mail-wr1-f72.google.com with SMTP id d8so1701512wrq.12 for ; Thu, 20 Feb 2020 05:06:19 -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.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 05:06:15 -0800 (PST) X-Inumbo-ID: ca1a1724-53e1-11ea-b0fd-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582203981; 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=9T2fAo+6xtdSOASO+MDoJq7z4DL4xf6hcEaFpq9VX4A=; b=Iq+j47c/71o4ui3iyND8W4PWFq5fKyG5tcPNoZ5ML/QJTrFQZ9r2z7pVid5DzE0rgAWftc fOVYSsSqT6vNb8PzflBwqLaqTfRx1OI+1o0rYtd35UhllgX9M73uZHbZO/o43pnoeScs7e OPnJdmqnXJ8mYT/nMEPpvQfABMRnfFo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f0ShsBpyUInIOkeskmM477n/0YX3Rn03mTxtkP3QCEQ=; b=OA6JD0bZL/nZuvgLST800VfqRxWlWm6Pq6iz19hxr8EVAeFNcxIHr/zKI1/1HaLq4j ZY4sP3bzjGyvVLIYVgN6Hbey1CQSvw81MKgmZaSNQhBGjyBz3m+wwtDLOKC7MMozfjYR LWT7mqF9+qX9MdDJI3AUfqlEQuQ78Wa4ibPa24PUHfJaosWsHVTZcy70aQ0tZpWbQm+k SpwNiTq8VehgMKvgE59z1ObUcHYiiDEh9h/czD6SZHD/LwuxkH8/VJToJKgx/OCS3tVk Fqj7SOfJ3lPQGZVSgJ5rsb5aETXMnxDO/iW4PhVbm7VX7z3JormkD+iFxQSZZd31b9sz RpZw== X-Gm-Message-State: APjAAAUwpbsZAdqHsHZpNVYJssuDGnDN4NLc7gdkhggclNR508UiGaFl ZeWNQrkgGDM8IrGGxZZjwGnkwZBov8UjM0iTImAMuOs+9YRgPq8qxfZ+mx6A0HPvJnxEPT3arUr I9FHzmCG1LskoGowitrjQKlcGd3A= X-Received: by 2002:adf:ec02:: with SMTP id x2mr9464207wrn.8.1582203976536; Thu, 20 Feb 2020 05:06:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxxvhyunneK2qPGr0PvPMnzbnKoLc1KRvHi/EZUPnye+P/5CWZaGi4Yc+u50TlNAyrnI1YoAA== X-Received: by 2002:adf:ec02:: with SMTP id x2mr9464128wrn.8.1582203975917; Thu, 20 Feb 2020 05:06:15 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 20 Feb 2020 14:05:34 +0100 Message-Id: <20200220130548.29974-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200220130548.29974-1-philmd@redhat.com> References: <20200220130548.29974-1-philmd@redhat.com> MIME-Version: 1.0 X-MC-Unique: Sr4y9MXaMCytIX_rIUtg6Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [Xen-devel] [PATCH v3 06/20] exec: Let the address_space API use void pointer arguments 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=20Poussineau?= , Marcel Apfelbaum , Anthony Perard , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-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=20Le=20Goater?= , John Snow , David Gibson , Igor Mitsyanko , Cornelia Huck , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) As we are only dealing with a blob buffer, use a void pointer argument. This will let us simplify other APIs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/memory.h | 12 ++++++------ exec.c | 11 ++++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 6f8084f45e..afee185eae 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -2052,7 +2052,7 @@ void address_space_remove_listeners(AddressSpace *as); * @is_write: indicates the transfer direction */ MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, + MemTxAttrs attrs, void *buf, hwaddr len, bool is_write); =20 /** @@ -2070,7 +2070,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr= addr, */ MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - const uint8_t *buf, hwaddr len); + const void *buf, hwaddr len); =20 /** * address_space_write_rom: write to address space, including ROM. @@ -2096,7 +2096,7 @@ MemTxResult address_space_write(AddressSpace *as, hwa= ddr addr, */ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - const uint8_t *buf, hwaddr len); + const void *buf, hwaddr len); =20 /* address_space_ld*: load from an address space * address_space_st*: store to an address space @@ -2334,7 +2334,7 @@ void address_space_unmap(AddressSpace *as, void *buff= er, hwaddr len, =20 /* Internal functions, part of the implementation of address_space_read. = */ MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, hwaddr= len); + MemTxAttrs attrs, void *buf, hwaddr le= n); MemTxResult flatview_read_continue(FlatView *fv, hwaddr addr, MemTxAttrs attrs, void *buf, hwaddr len, hwaddr addr1, hwaddr l, @@ -2374,7 +2374,7 @@ static inline bool memory_access_is_direct(MemoryRegi= on *mr, bool is_write) */ static inline __attribute__((__always_inline__)) MemTxResult address_space_read(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, + MemTxAttrs attrs, void *buf, hwaddr len) { MemTxResult result =3D MEMTX_OK; @@ -2433,7 +2433,7 @@ address_space_read_cached(MemoryRegionCache *cache, h= waddr addr, */ static inline void address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, - void *buf, hwaddr len) + const void *buf, hwaddr len) { assert(addr < cache->len && len <=3D cache->len - addr); if (likely(cache->ptr)) { diff --git a/exec.c b/exec.c index 980cc0e2b2..1a80159996 100644 --- a/exec.c +++ b/exec.c @@ -3271,7 +3271,7 @@ static MemTxResult flatview_read(FlatView *fv, hwaddr= addr, } =20 MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr, - MemTxAttrs attrs, uint8_t *buf, hwaddr= len) + MemTxAttrs attrs, void *buf, hwaddr le= n) { MemTxResult result =3D MEMTX_OK; FlatView *fv; @@ -3287,7 +3287,7 @@ MemTxResult address_space_read_full(AddressSpace *as,= hwaddr addr, =20 MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - const uint8_t *buf, hwaddr len) + const void *buf, hwaddr len) { MemTxResult result =3D MEMTX_OK; FlatView *fv; @@ -3302,7 +3302,7 @@ MemTxResult address_space_write(AddressSpace *as, hwa= ddr addr, } =20 MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs att= rs, - uint8_t *buf, hwaddr len, bool is_write) + void *buf, hwaddr len, bool is_write) { if (is_write) { return address_space_write(as, addr, attrs, buf, len); @@ -3326,7 +3326,7 @@ enum write_rom_type { static inline MemTxResult address_space_write_rom_internal(AddressSpace *a= s, hwaddr addr, MemTxAttrs attr= s, - const uint8_t *= buf, + const void *ptr, hwaddr len, enum write_rom_= type type) { @@ -3334,6 +3334,7 @@ static inline MemTxResult address_space_write_rom_int= ernal(AddressSpace *as, uint8_t *ram_ptr; hwaddr addr1; MemoryRegion *mr; + const uint8_t *buf =3D ptr; =20 RCU_READ_LOCK_GUARD(); while (len > 0) { @@ -3366,7 +3367,7 @@ static inline MemTxResult address_space_write_rom_int= ernal(AddressSpace *as, /* used for ROM loading : can write in RAM and ROM */ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, - const uint8_t *buf, hwaddr len) + const void *buf, hwaddr len) { return address_space_write_rom_internal(as, addr, attrs, buf, len, WRITE_DATA); --=20 2.21.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel