From patchwork Tue Jun 18 22:45:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Roman Kiryanov X-Patchwork-Id: 13703125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 141C9C2BA15 for ; Tue, 18 Jun 2024 22:46:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJhaH-0001y9-0j; Tue, 18 Jun 2024 18:45:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3FQ5yZgQKCjQhaYhWeeWbU.SecgUck-TUlUbdedWdk.ehW@flex--rkir.bounces.google.com>) id 1sJhaF-0001xh-BD for qemu-devel@nongnu.org; Tue, 18 Jun 2024 18:45:47 -0400 Received: from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3FQ5yZgQKCjQhaYhWeeWbU.SecgUck-TUlUbdedWdk.ehW@flex--rkir.bounces.google.com>) id 1sJhaD-0000sp-SA for qemu-devel@nongnu.org; Tue, 18 Jun 2024 18:45:47 -0400 Received: by mail-pj1-x104a.google.com with SMTP id 98e67ed59e1d1-2c7a8949243so815625a91.0 for ; Tue, 18 Jun 2024 15:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718750741; x=1719355541; darn=nongnu.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=sLRZ+W5a1GgYaQElKB7uBWALvxAWVGcbEd0ESEwZBlI=; b=ypbp9fD72T5SxFmu3G4OflCfOKiOB5lThEcIgcN3hbqxdMMHTTy8PQQKSfLUZT8tkI QXjqQKmT9N++qwtlSzhyHhQ8lLUSDJ7VUECCsj9c4lSX553LUk6XRjZsV9jsNw1zZ3d2 jy+0PVoffoESpD1cw0w+kACWEXE00yHSZCCTRsHYH1UsCIkHNI77TuD3tA/q3FqsTUts wx6lp3HNuqnCiASaCMMB0J+i0l5wtgNtPC0P/QKxyK3XFmU2eF+GLCyRSN/hwobl6cuH gY2Z+ICn+EsP9++sM/xowWJiq6TH8rEjuCZ34l7qDT9hFDsEzLNSfu3y42STlNeIXt+y /YmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718750741; x=1719355541; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sLRZ+W5a1GgYaQElKB7uBWALvxAWVGcbEd0ESEwZBlI=; b=I6JmSq36QaIwBqSwWOrHTxKqPHdxVkXCjoAp88FBb5UZGioYJ1/ww9MpI6Ay5HzSwo pt0m5lZlilqG6wl428E15f9P9wfWFA9HZUSkR+Jn2TD1GNfXGAiRAnMdCjYgdmc7kWiN g+OgwPfXuNH7lIxQ/gyS0c+SQYi8w1DX43KsuJZzQ4BlnFePGXT0uqog8vVugtQsh0Iq d688tsqY4Nd8JIZiTt4G+K7oMadqW3kJS7fwETXRkONKnMUW9IFyWFYCWz2PkB1biqXY Zu+q9SArGvrTbpc23BW+hWKiu9h5PLtpVouk4zzU8lWwvlzPmawP2PE1rhBjgnFZRRXH 2ccw== X-Gm-Message-State: AOJu0YzmWLpwjV93mbwXT1Rhl/1+RbTx+nMmVBR09ij+WEMgmjz79tE2 n5xqFl2if4o9iLL4ngvroTXIqKLVjackzYv67rTZV9dzfuf08om1avPHECHCS5X/x0SsHqNuXLw PazTri0EIkorB79Y36fuy5F/9PuZRhlf/FNQwk50TXZx37eKqEm5CzavFkhDsq8lInsbM+zhaYq 1TPvOk6vBvpTlIbek+EqLj X-Google-Smtp-Source: AGHT+IGLtYi0LS25uAEXiWPSxFOgSMMG/cYtXpu3vPw17ZqxYNTXIx8tgtjLhWA2bOWjYhiASwKb4AZb X-Received: from rkir98.kir.corp.google.com ([2620:15c:7d:4:fddf:5bf:9eb2:410e]) (user=rkir job=sendgmr) by 2002:a17:902:d2c5:b0:1f9:a0f5:7ec5 with SMTP id d9443c01a7336-1f9aa484e01mr344175ad.11.1718750741376; Tue, 18 Jun 2024 15:45:41 -0700 (PDT) Date: Tue, 18 Jun 2024 15:45:28 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Message-ID: <20240618224528.878425-1-rkir@google.com> Subject: [PATCH 1/3] exec: Make the MemOp enum cast explicit From: Roman Kiryanov To: qemu-devel@nongnu.org Cc: jansene@google.com, mett@google.com, jpcottin@google.com, Roman Kiryanov Received-SPF: pass client-ip=2607:f8b0:4864:20::104a; envelope-from=3FQ5yZgQKCjQhaYhWeeWbU.SecgUck-TUlUbdedWdk.ehW@flex--rkir.bounces.google.com; helo=mail-pj1-x104a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org to use the QEMU headers with a C++ compiler. Google-Bug-Id: 331190993 Change-Id: I785f2e65d192287f1f964d2840131b653755648c Signed-off-by: Roman Kiryanov Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/exec/memop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/memop.h b/include/exec/memop.h index 06417ff361..f881fe7af4 100644 --- a/include/exec/memop.h +++ b/include/exec/memop.h @@ -161,7 +161,7 @@ static inline MemOp size_memop(unsigned size) /* Power of 2 up to 8. */ assert((size & (size - 1)) == 0 && size >= 1 && size <= 8); #endif - return ctz32(size); + return (MemOp)ctz32(size); } /* Big endianness from MemOp. */ From patchwork Tue Jun 18 22:45:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kiryanov X-Patchwork-Id: 13703126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E2BAEC27C4F for ; Tue, 18 Jun 2024 22:46:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJhaV-00022M-PV; Tue, 18 Jun 2024 18:46:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3JQ5yZgQKCkQxqoxmuumrk.iuswks0-jk1krtutmt0.uxm@flex--rkir.bounces.google.com>) id 1sJhaT-00021d-Ny for qemu-devel@nongnu.org; Tue, 18 Jun 2024 18:46:01 -0400 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3JQ5yZgQKCkQxqoxmuumrk.iuswks0-jk1krtutmt0.uxm@flex--rkir.bounces.google.com>) id 1sJhaS-0000vH-CE for qemu-devel@nongnu.org; Tue, 18 Jun 2024 18:46:01 -0400 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-627f43bec13so114787557b3.0 for ; Tue, 18 Jun 2024 15:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718750757; x=1719355557; darn=nongnu.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=/FsgzP5gOq3lw1ZO8OOACBPPIdQdCifFEE2A6QE7Gg8=; b=dQ9lS3S8xEkUyax+mjsinP+JUNN9cUzcRNcFHwTMHRbOiltBl1HTG0mc9+GUboZkvr Rpkar9LEaTSBxeHEW5gGk1IRfKKay1m5HBCVVdhABNce5Vp8rcBZmsztKJGSN7q31CgW AtOqqdchynXcErrIeY2ioTD6VC2wHZe05vTp12VuBtZrxZd3zlhklW5E5Ki0v1h8AQv1 SeDSCtSso5e5gW5mFie00WcdgUZZ1F/3ei/HeY6TQMo/ihFfRwytmnlS2Wh+mWkpjtY4 IgSJp4ECzxxAmv/m11m93Ig5E63As++MXaOES41cxJez0DeDXd5VD4NBeFpTcvf0P+b5 BkMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718750757; x=1719355557; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/FsgzP5gOq3lw1ZO8OOACBPPIdQdCifFEE2A6QE7Gg8=; b=K0qIGy+/25gm74OrLlmp4FsJ0ebJZ0RCH1QXvFsjlxJRhtMCOpwbithIc0KQqdzElc ZapEIUrd3AWtBl22RmtwLRkIcNrkv0BMChchYov9HEp/wUbVng21dYms1HSaHR1zyHlF raTA48sUnbNVzAKpQX985XSL2LnizTN8NwnPBCH/NhvgV0kvBgf78cJuBAS15C5kCGar qmd15SeNgkht+DxMH0tVCv5C7cd/eUNENMkZSU0CCuJ4HOEpYiPEY6w5xrAoK3Eu3IQB cQgSrm6AHvENpKB1d8bmNPY1QdeeUrTNmlFsV9vhiYdFHJ9KsAX8A7KJNAWLOkbSLHft dVaQ== X-Gm-Message-State: AOJu0YzOEOpUay5lNDZc8a3YP9a+MDS5Oa4+UruNHbljzcYkbaZkEO9n xLqCGEm1Shbto/XoJU/01hq/sLNH6Tc7VRf6VXqlqNQWInN7RGr7hnL6SxQSW9fN9QBQsbgQLzN qHfbzqmxqFeiVcnDI8J05oyoVFf0CpwM24NtUBlFT+H4qIDPELejVyHRcFH5K3I1oIfkIEZqh6f CqZ55mly2jh34hthvqh+4b X-Google-Smtp-Source: AGHT+IGoeVeUfBrRoep4gm7CX9XFk9vIuYtfidl4od3BeszhDQ4FKilmZO01SB6tnV9yQ9yEfhHsDn0b X-Received: from rkir98.kir.corp.google.com ([2620:15c:7d:4:fddf:5bf:9eb2:410e]) (user=rkir job=sendgmr) by 2002:a05:690c:b91:b0:62c:f6fd:5414 with SMTP id 00721157ae682-63a8e1dad55mr2579827b3.3.1718750757082; Tue, 18 Jun 2024 15:45:57 -0700 (PDT) Date: Tue, 18 Jun 2024 15:45:53 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Message-ID: <20240618224553.878869-1-rkir@google.com> Subject: [PATCH 2/3] exec: avoid using C++ keywords in function parameters From: Roman Kiryanov To: qemu-devel@nongnu.org Cc: jansene@google.com, mett@google.com, jpcottin@google.com, Roman Kiryanov Received-SPF: pass client-ip=2607:f8b0:4864:20::114a; envelope-from=3JQ5yZgQKCkQxqoxmuumrk.iuswks0-jk1krtutmt0.uxm@flex--rkir.bounces.google.com; helo=mail-yw1-x114a.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org to use the QEMU headers with a C++ compiler. Google-Bug-Id: 331190993 Change-Id: Ic4e49b9c791616bb22c973922772b0494706092c Signed-off-by: Roman Kiryanov Reviewed-by: Richard Henderson --- include/exec/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 1be58f694c..d7591a60d9 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -945,7 +945,7 @@ struct MemoryListener { * the current transaction. */ void (*log_start)(MemoryListener *listener, MemoryRegionSection *section, - int old, int new); + int old_val, int new_val); /** * @log_stop: @@ -964,7 +964,7 @@ struct MemoryListener { * the current transaction. */ void (*log_stop)(MemoryListener *listener, MemoryRegionSection *section, - int old, int new); + int old_val, int new_val); /** * @log_sync: From patchwork Tue Jun 18 22:46:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kiryanov X-Patchwork-Id: 13703127 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2CF44C27C4F for ; Tue, 18 Jun 2024 22:46:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJhae-00023f-4u; Tue, 18 Jun 2024 18:46:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3Lw5yZgQKCk470y7w44w1u.s426u2A-tuBu1343w3A.47w@flex--rkir.bounces.google.com>) id 1sJhac-00023B-Pk for qemu-devel@nongnu.org; Tue, 18 Jun 2024 18:46:10 -0400 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3Lw5yZgQKCk470y7w44w1u.s426u2A-tuBu1343w3A.47w@flex--rkir.bounces.google.com>) id 1sJhaa-0000yH-Ts for qemu-devel@nongnu.org; Tue, 18 Jun 2024 18:46:10 -0400 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62fb4a1f7bfso134840667b3.3 for ; Tue, 18 Jun 2024 15:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718750767; x=1719355567; darn=nongnu.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=uYBO9SMQOAuy7srXieS/MVLo7c5YxoAf3JV1nWhajaI=; b=xybCoZE5Q3ohFKuPrGm32+tF3SMS7WqUAW7h5p/qHiAOlFrVZRYhHrzkSw8BIqpURm teWpNpkRPxwDEd4y//Q/mmCx53PA/hEUlWVGp/00R4Pj5JlsaSajtRMqLhUmM/bauj3A NnByirSWldYg3ypJy1onVB4qFkVM5xdeYcKnsezhUjelmpKDxTQ6ykw5YySmSqgnm3S1 jkFFm8FbQGJNme3mS1HpoXo27hIlEx+0i3780Z07ddCfCYBuJlaMyOhNc/B0c1DKmAZV MVp7uBeg4sgR5FWcOio3/349vlp9pUIxbtwOtjTz96irkbr3FX0N+lYuToVjS1cTdwwn hqtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718750767; x=1719355567; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=uYBO9SMQOAuy7srXieS/MVLo7c5YxoAf3JV1nWhajaI=; b=NmvM7Bp/A5cbBjsH9FBuY94gHifBuIdf5EuQsIG/qoB/d7vv1J9aWfpDKeLcKm/yG5 tQb1SChSD914rp1MaCIO3nGfEbgSHkH0TNG69o4x5BpHWS56BCCvqmaei5WcEY8oN3Vm XDlmxYSMezM8wV7hIWb/eRitycMt9XV6fHwLKiCOZaB2BJYHbbojAz7HcJFiyh380tHg fcVz1r+Y4NisklOKaLC5Mqk2aIhDteFqSRS07WBZy/tXKDGuZ2SS7++jHnfyofLFbaF3 QcW+/vI5WQgaDlmodDUpay12e/cagXBSHGljzjwh6Fo9YoaVDosm3vvBtXzfCzYnHqlC G9xg== X-Gm-Message-State: AOJu0Yx8BC6wkH0j0lQA96z0vO52JrqLSWdtcxxVSEmfzjWlWAgk+zk9 IkYykhZbB5bwcB2n7NKJGmPcOSCHERJxaKiwKyYP+Q9nNru3uo7RyqIQoNMgTWkiM7N8Sn8Ap2d DnxroRZoD3DZQmoeU4lxUN0sYlW6V2HIexu4gB9jQK48XYLqzrDIKn1LwBNIiEn8NRnWPOWBmZJ f1bAUShYYGqZVJ3bFz0yaR X-Google-Smtp-Source: AGHT+IHHNeK4OdBHrUxfEuJlgsxDiD+dX+JMgk+/4SSHFFZ8lpOSSa4wD48fA11ybDciAikyZsQ2nnpc X-Received: from rkir98.kir.corp.google.com ([2620:15c:7d:4:fddf:5bf:9eb2:410e]) (user=rkir job=sendgmr) by 2002:a05:6902:1003:b0:e02:bd4f:def2 with SMTP id 3f1490d57ef6-e02be20b2ccmr379731276.11.1718750767055; Tue, 18 Jun 2024 15:46:07 -0700 (PDT) Date: Tue, 18 Jun 2024 15:46:04 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.627.g7a2c4fd464-goog Message-ID: <20240618224604.879275-1-rkir@google.com> Subject: [PATCH 3/3] exec: use char* for pointer arithmetic From: Roman Kiryanov To: qemu-devel@nongnu.org Cc: jansene@google.com, mett@google.com, jpcottin@google.com, Roman Kiryanov Received-SPF: pass client-ip=2607:f8b0:4864:20::1149; envelope-from=3Lw5yZgQKCk470y7w44w1u.s426u2A-tuBu1343w3A.47w@flex--rkir.bounces.google.com; helo=mail-yw1-x1149.google.com X-Spam_score_int: -95 X-Spam_score: -9.6 X-Spam_bar: --------- X-Spam_report: (-9.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org void* pointer arithmetic is not in the C standard. This change allows using the QEMU headers with a C++ compiler. Google-Bug-Id: 331190993 Change-Id: I5a064853429f627c17a9213910811dea4ced6174 Signed-off-by: Roman Kiryanov Reviewed-by: Richard Henderson --- include/exec/memory.h | 8 ++++---- include/exec/memory_ldst_cached.h.inc | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index d7591a60d9..738e4cef2c 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -2839,7 +2839,7 @@ static inline uint8_t address_space_ldub_cached(MemoryRegionCache *cache, { assert(addr < cache->len); if (likely(cache->ptr)) { - return ldub_p(cache->ptr + addr); + return ldub_p((char*)cache->ptr + addr); } else { return address_space_ldub_cached_slow(cache, addr, attrs, result); } @@ -2850,7 +2850,7 @@ static inline void address_space_stb_cached(MemoryRegionCache *cache, { assert(addr < cache->len); if (likely(cache->ptr)) { - stb_p(cache->ptr + addr, val); + stb_p((char*)cache->ptr + addr, val); } else { address_space_stb_cached_slow(cache, addr, val, attrs, result); } @@ -3123,7 +3123,7 @@ address_space_read_cached(MemoryRegionCache *cache, hwaddr addr, assert(addr < cache->len && len <= cache->len - addr); fuzz_dma_read_cb(cache->xlat + addr, len, cache->mrs.mr); if (likely(cache->ptr)) { - memcpy(buf, cache->ptr + addr, len); + memcpy(buf, (char*)cache->ptr + addr, len); return MEMTX_OK; } else { return address_space_read_cached_slow(cache, addr, buf, len); @@ -3144,7 +3144,7 @@ address_space_write_cached(MemoryRegionCache *cache, hwaddr addr, { assert(addr < cache->len && len <= cache->len - addr); if (likely(cache->ptr)) { - memcpy(cache->ptr + addr, buf, len); + memcpy((char*)cache->ptr + addr, buf, len); return MEMTX_OK; } else { return address_space_write_cached_slow(cache, addr, buf, len); diff --git a/include/exec/memory_ldst_cached.h.inc b/include/exec/memory_ldst_cached.h.inc index d7834f852c..f767e53a3d 100644 --- a/include/exec/memory_ldst_cached.h.inc +++ b/include/exec/memory_ldst_cached.h.inc @@ -30,7 +30,7 @@ static inline uint16_t ADDRESS_SPACE_LD_CACHED(uw)(MemoryRegionCache *cache, assert(addr < cache->len && 2 <= cache->len - addr); fuzz_dma_read_cb(cache->xlat + addr, 2, cache->mrs.mr); if (likely(cache->ptr)) { - return LD_P(uw)(cache->ptr + addr); + return LD_P(uw)((char*)cache->ptr + addr); } else { return ADDRESS_SPACE_LD_CACHED_SLOW(uw)(cache, addr, attrs, result); } @@ -42,7 +42,7 @@ static inline uint32_t ADDRESS_SPACE_LD_CACHED(l)(MemoryRegionCache *cache, assert(addr < cache->len && 4 <= cache->len - addr); fuzz_dma_read_cb(cache->xlat + addr, 4, cache->mrs.mr); if (likely(cache->ptr)) { - return LD_P(l)(cache->ptr + addr); + return LD_P(l)((char*)cache->ptr + addr); } else { return ADDRESS_SPACE_LD_CACHED_SLOW(l)(cache, addr, attrs, result); } @@ -54,7 +54,7 @@ static inline uint64_t ADDRESS_SPACE_LD_CACHED(q)(MemoryRegionCache *cache, assert(addr < cache->len && 8 <= cache->len - addr); fuzz_dma_read_cb(cache->xlat + addr, 8, cache->mrs.mr); if (likely(cache->ptr)) { - return LD_P(q)(cache->ptr + addr); + return LD_P(q)((char*)cache->ptr + addr); } else { return ADDRESS_SPACE_LD_CACHED_SLOW(q)(cache, addr, attrs, result); } @@ -76,7 +76,7 @@ static inline void ADDRESS_SPACE_ST_CACHED(w)(MemoryRegionCache *cache, { assert(addr < cache->len && 2 <= cache->len - addr); if (likely(cache->ptr)) { - ST_P(w)(cache->ptr + addr, val); + ST_P(w)((char*)cache->ptr + addr, val); } else { ADDRESS_SPACE_ST_CACHED_SLOW(w)(cache, addr, val, attrs, result); } @@ -87,7 +87,7 @@ static inline void ADDRESS_SPACE_ST_CACHED(l)(MemoryRegionCache *cache, { assert(addr < cache->len && 4 <= cache->len - addr); if (likely(cache->ptr)) { - ST_P(l)(cache->ptr + addr, val); + ST_P(l)((char*)cache->ptr + addr, val); } else { ADDRESS_SPACE_ST_CACHED_SLOW(l)(cache, addr, val, attrs, result); } @@ -98,7 +98,7 @@ static inline void ADDRESS_SPACE_ST_CACHED(q)(MemoryRegionCache *cache, { assert(addr < cache->len && 8 <= cache->len - addr); if (likely(cache->ptr)) { - ST_P(q)(cache->ptr + addr, val); + ST_P(q)((char*)cache->ptr + addr, val); } else { ADDRESS_SPACE_ST_CACHED_SLOW(q)(cache, addr, val, attrs, result); }