From patchwork Wed Nov 6 18:46:08 2024 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: 841069 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp685745wru; Wed, 6 Nov 2024 10:46:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUdocCU+FCKcw7U44iIvGcQcBOGCNRWDp9cM8RQyzv3f+u1IxKcZThV/sXdGntHsAjoRjwxlA==@linaro.org X-Google-Smtp-Source: AGHT+IFOx82WGfRE3r9UF2CoODkIRkvj17Scm0mgo63rAZqoYyqN5XIqKsyWbqTgkb2JrRiBkiOI X-Received: by 2002:ac8:5989:0:b0:458:34fb:5d59 with SMTP id d75a77b69052e-4613c026da2mr608882611cf.29.1730918811603; Wed, 06 Nov 2024 10:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730918811; cv=none; d=google.com; s=arc-20240605; b=leFAwhGEjusLjewL3nwM+MLXUvwwh7ujOYvsboti20EGGdeMMwEmPMzNzRJpb7VHzQ NChlauJowvQC+CdsJRsmq52TcFh5XlcPFR6dIpfglWndyX0a/6Q/YF8sl5SAS5STL5t0 4f0OX4FOVOmcmnWXROmxGL1fncEJc9RL2PfiV16qhzoDDNvN0aI3LAVnAxnJd3IBKLt9 K7BBBo0SuIKiAbmELAQB+XI9X17LWuTS82EiL83dlBrdxu3+tGlChXfeI+SLn9Xn266a Xo9g0k5Z6Hg01uLgaM2pOrlf5XFtZBECciNHvM05EgxSMJmaeTfqha7mR/1c5TED/o+U G73Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JkT1yg2VZs3DMTFUZrgUQwWp62WZ2rdU+E0+QzLt/pA=; fh=jDhTT5t6/SNd3Lmy0g3KlPwh8+DK1Bwi2jXD8rwBeIY=; b=IetVdmGzeqT2czXdxgQLrfd5uHpnN0NIcbq8/RH7bvkRfTXQS/1QWSDM2+FlHXImay 5zPNBxMG0/RFkrRoKixCczh4mHfukOGojvz4GchGQumg6u83dmIngecWbAjXknbBaScH TRcRxd7K4dSzY9TDJWRfBQZOnA69RU1GHc8Fol9JiocJlQJOFcP23I5wewXQ+ee5PHJr uTHVqzyNCrB0ns6SMzm6up3IujY3uxHoLcE8HtuX+jn68AFs1VgS9ffuArtKIhGPFiKy CBdKj20pLqgEEZNBGqY6lgmhz+Sf6iD+4lCmB94yOjjvsepxQ+lXqhIvbetzjSieloLC AEqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WeN27aJ9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ad1a0f64si167282301cf.363.2024.11.06.10.46.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 10:46:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WeN27aJ9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8l30-0008Ns-Cq; Wed, 06 Nov 2024 13:46:30 -0500 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 ) id 1t8l2u-0008NC-Dj for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:25 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8l2s-0000uc-Ls for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:24 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5cece886771so307697a12.0 for ; Wed, 06 Nov 2024 10:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730918781; x=1731523581; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JkT1yg2VZs3DMTFUZrgUQwWp62WZ2rdU+E0+QzLt/pA=; b=WeN27aJ9rftVQ7AK8QiaSsU3/vxDQDoNUDm4A+B8uc5/1FdUl1mIwUTThIYFrl+oIj 0y0ZzH1MfMN7zmTeMm4UQbiyFHnLv3pmzM+IYTUMQSvH2sNFNcMRwn08eqor92zy+X2l sPJq5VfdOVf08VHf39tQVx6v9a2uQljnV4rGOVPNBTJdPv3iRwIm+zLpaU1YJvxPWgZR dO2GQDaagWBZgy+dvoibzMIOJ2GW5BGSqVq8bMf1jYiw8x/Wp9UrWz5T699eZ7Tb+mpU n8zmYfe+Kb/rymvN+aYOG84QqNKCCDFoMB08kn8QQlGh8tvXLSRqXS7Ufk2Dwnd4YlNM hZMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730918781; x=1731523581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JkT1yg2VZs3DMTFUZrgUQwWp62WZ2rdU+E0+QzLt/pA=; b=eTsG3z8yhdSGXMTqpFiexMfdV1xQ3wDg6qLHAsWeei94BrATGCpXZ0xCLv79QUisHJ MBKgJnU+kQsV8aRDteNz/QZfSbrNR6P3m9O2CKsydDmHZmbOrw05isSjZ2ZeTw4QKDci jMY+W8TcH4Admqr7jusnlrOCpZG8igbwuzWu/wX5KOT56z9YRGhlIvBOaOBug3tN3zDB CAn0VKFgsBUE2QFW6oJ+md++6uC8j1cci2yK03XvLBz+ETycQ6EjlMOiGhXKHiy9mrTe GkzKR1J6VhCDB6AEjqTIxfG7JF27qxVw14rqGKrsBqRcp/k41RIqoeBWxJYD9KUjsprj y7QA== X-Gm-Message-State: AOJu0YxCqsJb/al/O95mncml4ut/iSLXzEQjas+JyxdpEoITwlSh8Jg+ 13RdJbzTM0qqPCpO5NUcYR/cAzPeC9mOC6M1tMoR4fSZy45U2gmlK64QLqsFWu3N4Py1qmdF+p6 M X-Received: by 2002:a05:6402:26c8:b0:5ce:e5be:d042 with SMTP id 4fb4d7f45d1cf-5cefc66ec4amr296655a12.5.1730918780697; Wed, 06 Nov 2024 10:46:20 -0800 (PST) Received: from localhost.localdomain ([154.14.63.34]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cee6b0fc4dsm3129846a12.84.2024.11.06.10.46.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Nov 2024 10:46:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, Paolo Bonzini , Marcel Apfelbaum , "Edgar E. Iglesias" , Bastian Koppelmann , Anthony PERARD , Eduardo Habkost , Thomas Huth , Jia Liu , Stafford Horne , Paul Durrant , Mark Cave-Ayland , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 1/5] hw/i386: Mark devices as little-endian Date: Wed, 6 Nov 2024 18:46:08 +0000 Message-ID: <20241106184612.71897-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241106184612.71897-1-philmd@linaro.org> References: <20241106184612.71897-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These devices are only used by the X86 targets, which are only built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN definition expand to DEVICE_LITTLE_ENDIAN (besides, the DEVICE_BIG_ENDIAN case isn't tested). Simplify directly using DEVICE_LITTLE_ENDIAN. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i386/kvm/apic.c | 2 +- hw/i386/pc.c | 4 ++-- hw/i386/vapic.c | 2 +- hw/i386/xen/xen_apic.c | 2 +- hw/i386/xen/xen_platform.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c index a72c28e8a7..3a5d69e8d0 100644 --- a/hw/i386/kvm/apic.c +++ b/hw/i386/kvm/apic.c @@ -214,7 +214,7 @@ static void kvm_apic_mem_write(void *opaque, hwaddr addr, static const MemoryRegionOps kvm_apic_io_ops = { .read = kvm_apic_mem_read, .write = kvm_apic_mem_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static void kvm_apic_reset(APICCommonState *s) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 830614d930..2259589e0d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1064,7 +1064,7 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) static const MemoryRegionOps ioport80_io_ops = { .write = ioport80_write, .read = ioport80_read, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, .impl = { .min_access_size = 1, .max_access_size = 1, @@ -1074,7 +1074,7 @@ static const MemoryRegionOps ioport80_io_ops = { static const MemoryRegionOps ioportF0_io_ops = { .write = ioportF0_write, .read = ioportF0_read, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, .impl = { .min_access_size = 1, .max_access_size = 1, diff --git a/hw/i386/vapic.c b/hw/i386/vapic.c index ef7f8b967f..fd906fdf78 100644 --- a/hw/i386/vapic.c +++ b/hw/i386/vapic.c @@ -718,7 +718,7 @@ static uint64_t vapic_read(void *opaque, hwaddr addr, unsigned size) static const MemoryRegionOps vapic_ops = { .write = vapic_write, .read = vapic_read, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static void vapic_realize(DeviceState *dev, Error **errp) diff --git a/hw/i386/xen/xen_apic.c b/hw/i386/xen/xen_apic.c index 101e16a766..a94e9005cb 100644 --- a/hw/i386/xen/xen_apic.c +++ b/hw/i386/xen/xen_apic.c @@ -36,7 +36,7 @@ static void xen_apic_mem_write(void *opaque, hwaddr addr, static const MemoryRegionOps xen_apic_io_ops = { .read = xen_apic_mem_read, .write = xen_apic_mem_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static void xen_apic_realize(DeviceState *dev, Error **errp) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index ec0e536e85..3b3e745822 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -514,7 +514,7 @@ static void platform_mmio_write(void *opaque, hwaddr addr, static const MemoryRegionOps platform_mmio_handler = { .read = &platform_mmio_read, .write = &platform_mmio_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static void platform_mmio_setup(PCIXenPlatformState *d) From patchwork Wed Nov 6 18:46:09 2024 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: 841074 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp686026wru; Wed, 6 Nov 2024 10:47:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUnJhDJS/WrbQlBcgMTkQFHy71r5RdmxBmJ2D48Tc+y40/St9oa0goNoKBu36/ATdY65ZegWw==@linaro.org X-Google-Smtp-Source: AGHT+IE6g66i5t4TjzLPGePkcz0+luhIe92GVECdutX9t7ORDhq13gVTNg7VntleVIKoSJG+SeIz X-Received: by 2002:a05:6358:70cc:b0:1c3:8c84:e08c with SMTP id e5c5f4694b2df-1c5e32cc05dmr1555616255d.10.1730918850483; Wed, 06 Nov 2024 10:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730918850; cv=none; d=google.com; s=arc-20240605; b=JvEIsqUYMxsSv+H36oB9yTU1O0hczY09gldNLu/oYdDKFOencYay4BOczJn9iShrSM YH7Uuy3k4QCxeKu7xe0EaabqAPVV4JqM0dXEza6zkY9MNgzxNNviYLEMRmqGZwUeBUJK 0LajqAw90TxQS0zLD7NKbegiQo938Cdh1IpglDQuslZ0IclAFPvNe4xXNZGc6yxt6lr3 ucNUAlpM3ZzxyKRZtF7VUxF8aPh7ZF4y87tEo2TnnUtgAkm+sRWeJpBLKLy4RxtHAygN Fb5xnGceGGNbPaM20VsFuHNyC5hLqWlW2Pss2VzSrUNoDdPpb5LWIJ7bAP3HnV70YzlF peew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iNstnbcurcwe9tiYawZfa8Zi088/DUlHFBmK9/a+8zY=; fh=jDhTT5t6/SNd3Lmy0g3KlPwh8+DK1Bwi2jXD8rwBeIY=; b=Xfg74MOquB/lXArmHwyCygeTn4m5tS6SyhJBfGD0RCH0Vj0yETWVZ4dXz3EQNn1VCX C76BHg+IvUbDjgLEom8x1VNWJxq2OsZ98YL1oulqnHNcvu6gpps7+V04a+pd8OX1k3f+ qElygXCeZ0HLmDIk8TTGQXCvpWhV+cWJmSEMAOcPehHo2Q1h+iIyN4A+jGHsCujvKVkr Jk7CoBSoO4zCmzOtwAzpJhGYGu175lMN3l7+8/zNvd+mdP0icaDPooP/GCfWadhiBH1R 7wJAqXule5M8+THLXbGu9FqCGvjYt7bVkg3e/08GMqgor0SkgCItB+nOhS/cRBlCI5qg E2XQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jjv83wV1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d35416ab05si168162436d6.223.2024.11.06.10.47.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 10:47:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jjv83wV1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8l33-0008Q0-Cf; Wed, 06 Nov 2024 13:46:33 -0500 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 ) id 1t8l2y-0008NV-VU for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:29 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8l2x-0000v9-FD for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:28 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a9ed0ec0e92so9457266b.0 for ; Wed, 06 Nov 2024 10:46:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730918785; x=1731523585; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iNstnbcurcwe9tiYawZfa8Zi088/DUlHFBmK9/a+8zY=; b=Jjv83wV1lY6IO/4e/sk0GXNxwM4LdIwlGSTgZ1/swRoAAgf584+dX3N2gSqYt0emYr 3cSj6usG7IVGx0yi2VFpbehF2IDJ46/b4SnfeElM7a03Bf32w/MoRifiFgCGv+MZrvR4 gFRJG3fT+mL2BZPlAmB+1m4QY0z3fcN3FRg2T0ng5KgO10HJbc5YUQuBjEj7v85wecSx MBbEKJgYjjk3bcyl+yUyZwbw9C1Xwm0xiKThFPaJve/EjW8HGfhlU8JDCwQQ2tInVpsK XUS4vCZRHgU2s6oCd1HpKyJHnBmCDXhyo6pH7qOJeRkLm4efT7Aqfw9srFExGI5AN+vo CFSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730918785; x=1731523585; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iNstnbcurcwe9tiYawZfa8Zi088/DUlHFBmK9/a+8zY=; b=V0ZQMTS6VbFX/UNNp0RPm93A1saPNk9afj9XaVDrT0XYWxoyHWX/pk1LwpaujJcYM0 T86B3yVDqSVVDr6vN5w58K5XaeLPKhxM6RdgOBVup3Jy3egLXvDwFOb3x8Khtb2eCjwy 8Ock7hWBbUwqH7NqD+bVG95scnOSrYcfiQqZJ54LSD2RKVrG5dNmwUt56gnQjUomTAnh yjj4D8Kxr2QZaFmn9miPkMPWE7ObIvl0xAjxa2Qp4pFlaBEE5O3GAmSMtdZqhQwm7XNo NtpJGJ6fIVE2MOY0Hr79qyxCwZK/9RqiE+i0sduTJ8GEe4yQaI6MQXoxaCsnt51yqNUy IdCA== X-Gm-Message-State: AOJu0YzptxToQG3zfyuZDFB0lwTMSDpF4BysNC6cbAfnKnIUNg7k3yeL ZZKmypkkyO0HDsVdu/d7U42N53JZ2ioLp5F/6bPo6xiTDaTcVImxFA6gfwbTpSaOrtCeZr2sWoz D X-Received: by 2002:a17:907:94cb:b0:a9a:835b:fc77 with SMTP id a640c23a62f3a-a9e6549106bmr2239257766b.8.1730918785638; Wed, 06 Nov 2024 10:46:25 -0800 (PST) Received: from localhost.localdomain ([89.101.134.25]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb16d9f96sm318040866b.75.2024.11.06.10.46.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Nov 2024 10:46:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, Paolo Bonzini , Marcel Apfelbaum , "Edgar E. Iglesias" , Bastian Koppelmann , Anthony PERARD , Eduardo Habkost , Thomas Huth , Jia Liu , Stafford Horne , Paul Durrant , Mark Cave-Ayland , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 2/5] hw/tricore: Mark devices as little-endian Date: Wed, 6 Nov 2024 18:46:09 +0000 Message-ID: <20241106184612.71897-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241106184612.71897-1-philmd@linaro.org> References: <20241106184612.71897-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These devices are only used by the TriCore target, which is only built as little-endian. Therefore the DEVICE_NATIVE_ENDIAN definition expand to DEVICE_LITTLE_ENDIAN (besides, the DEVICE_BIG_ENDIAN case isn't tested). Simplify directly using DEVICE_LITTLE_ENDIAN. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- hw/tricore/tricore_testdevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevice.c index ae95c49565..169f5907e9 100644 --- a/hw/tricore/tricore_testdevice.c +++ b/hw/tricore/tricore_testdevice.c @@ -47,7 +47,7 @@ static const MemoryRegionOps tricore_testdevice_ops = { .min_access_size = 4, .max_access_size = 4, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static void tricore_testdevice_init(Object *obj) From patchwork Wed Nov 6 18:46:10 2024 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: 841071 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp685905wru; Wed, 6 Nov 2024 10:47:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWeqmdhmi3O/8fZ4JnA5i09becDpFGBbIBa9jsXelam+fFIHPHef+IqpCrDb5B9RRXO6UYlKQ==@linaro.org X-Google-Smtp-Source: AGHT+IFFnzUtfJn6n7FRWj/Vzt4hhgEjf52ZJEJWAQHkAwLaZEFs4niH7g5phum4sV4QXzYYpnte X-Received: by 2002:a05:6214:4386:b0:6cb:5f28:6b73 with SMTP id 6a1803df08f44-6d345faca85mr375671476d6.9.1730918834111; Wed, 06 Nov 2024 10:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730918834; cv=none; d=google.com; s=arc-20240605; b=fhhQDqZH/nxMQAClUBY7af91fFXNmwhNQLdM4/JaeZeNAcil/Zvk383uGXwOK0iwRw pfbORtKj17nl8CbRMGhKmexd+7XLYSd1zMJY0B4SNH3MEbSnHlXahfERgzgMXHLurnT5 +w7kYw83/pHRd961XGaTKFjv3iHUXatqhaQ/MHGouncmsdjk/OW9hzZG2S912juFTDEz XLdMWmXBEurGAeT/Ivp5iB5eEA6aDeQWSpMxtvSVNZwcBfWpzVRRA2egfm9pc53g/6u6 EyfhuvEIbkZ+Dkj96s1hpfJtouY2L5T6HzBbEbXPHl+XrrUcOZF6Zz+KanwE0+4QzpX0 Uxnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yO3kVmbmcBoFVWzYS+y583sX7R+jYDZcKW8eZMLJiQc=; fh=jDhTT5t6/SNd3Lmy0g3KlPwh8+DK1Bwi2jXD8rwBeIY=; b=kpbp4AKHdctap9dcajuowmI6KZCTLMurmrarmqaunsTsIt92NLxJp1v5z6+hFykHyY /MhiZN7iHqKG89NuufVZX1ZQEEME5iAjaZqQSDMxJdfw1pGmffuM0cDPsQjoksAiwlHw A2+OCNmrRGCTIDe3XvII6gewRJrihI7/h0iAkN2SMsZRK4O/JtiK3WpZuU1WvZjeVexA hyfQnrOjXXnoKKSMg+2DuDn1SmEiDLF4i8DvtlBF8LFYhIPchW30HDGtdnwMwvtyGrAB KIUdAqoQ2Bixw+rWwJ45hp4L3RUAlMjque29Pm0YjYob67iQA4uEbJHbYjFhwz7MjzzT vTDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NgFGhTip; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d353fd07edsi162404396d6.147.2024.11.06.10.47.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 10:47:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NgFGhTip; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8l37-0008SG-SR; Wed, 06 Nov 2024 13:46:37 -0500 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 ) id 1t8l34-0008RJ-E9 for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:35 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8l32-0000vm-Qa for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:34 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a99f1fd20c4so11610066b.0 for ; Wed, 06 Nov 2024 10:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730918791; x=1731523591; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yO3kVmbmcBoFVWzYS+y583sX7R+jYDZcKW8eZMLJiQc=; b=NgFGhTipH9Q57B0CgUSTZwcisRJrrerO575IRQ8mlU+ITHWkQIBblkurs2owa1VlCN c7mbTYedBooI/RXQTMqdJSgLVnhy/kKDz5Hv9DmdaLGugCtRO9PClSaghVjYk8KwpXiM 4Pd8mbvyj28bVIQ4fD0sRAKZ9GArc9Z/Glp/ACvMlkU2ggHWQe02l1hzjVIsDBITNoGO Lv9cjJ0Tx1lpkbwA6UYK0erdXQSS6YfwkEaDefw1CXuOQRJi+pBG/qgr+vavY/GzwpGe i1x89eTXhHMJu4UZkmbh2wTwYfwWaggabAFUuoB3QwreYmsywVjBxWNuq7I9w/t6Ki7F cv9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730918791; x=1731523591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yO3kVmbmcBoFVWzYS+y583sX7R+jYDZcKW8eZMLJiQc=; b=sPTQ8fRbMFlPVfy8kftpPbieoRtePU53+hRs/oBL9UYG1QC9Aegm4VxvsSIXrjTyZE C38UibogPsefrffvq0YVv1Lavx6CND4Uyb3XStnEy5YeaVlvjPpUC1ZaC3d/bWbpgvwg Q8z9gGddYWiuWtZJfyosfm3NQKAR/5IK+6R2M/PGVyoymhYeEhhw7Hpv6br+CnMwrwUC lSyW+p7JtYBzxdRh/1+iiwsSMP0gydf8+JU7dOPECAss8SU63tsHND9T2todUQ5UJj5n QRpQOtzMhJe/jR+OjDPzHbe9tw0DYQUhExVh6vVkE8gqZ+n/g1zvW3gOZ5nxJHnkWxhG iSQQ== X-Gm-Message-State: AOJu0YwxWrqVcnhFn3hgqiqimvvie5S2o5RlzKzxdLGxk5crYKA63Y/5 yjNA1fBvNQEKMY0R3CtzHZGAWbeCTsyCFybbS5FtYM7itpASbh+zf0eQmmQG7dH0hWiclACKCtU o X-Received: by 2002:a17:907:7ba7:b0:a9a:522a:eddd with SMTP id a640c23a62f3a-a9e5089b4admr2275919566b.11.1730918790907; Wed, 06 Nov 2024 10:46:30 -0800 (PST) Received: from localhost.localdomain ([89.101.241.141]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb16f8e2csm315523366b.91.2024.11.06.10.46.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Nov 2024 10:46:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, Paolo Bonzini , Marcel Apfelbaum , "Edgar E. Iglesias" , Bastian Koppelmann , Anthony PERARD , Eduardo Habkost , Thomas Huth , Jia Liu , Stafford Horne , Paul Durrant , Mark Cave-Ayland , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 3/5] hw/m68k: Mark devices as big-endian Date: Wed, 6 Nov 2024 18:46:10 +0000 Message-ID: <20241106184612.71897-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241106184612.71897-1-philmd@linaro.org> References: <20241106184612.71897-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These devices are only used by the M68K target, which is only built as big-endian. Therefore the DEVICE_NATIVE_ENDIAN definition expand to DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't tested). Simplify directly using DEVICE_BIG_ENDIAN. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- hw/m68k/mcf5206.c | 2 +- hw/m68k/mcf5208.c | 6 +++--- hw/m68k/mcf_intc.c | 2 +- hw/m68k/next-kbd.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index 7247cdbe5e..4892924fc2 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -582,7 +582,7 @@ static const MemoryRegionOps m5206_mbar_ops = { .write = m5206_mbar_writefn, .valid.min_access_size = 1, .valid.max_access_size = 4, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static void mcf5206_mbar_realize(DeviceState *dev, Error **errp) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index e37cd50d18..4166877066 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -155,7 +155,7 @@ static uint64_t m5208_timer_read(void *opaque, hwaddr addr, static const MemoryRegionOps m5208_timer_ops = { .read = m5208_timer_read, .write = m5208_timer_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static uint64_t m5208_sys_read(void *opaque, hwaddr addr, @@ -192,7 +192,7 @@ static void m5208_sys_write(void *opaque, hwaddr addr, static const MemoryRegionOps m5208_sys_ops = { .read = m5208_sys_read, .write = m5208_sys_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static uint64_t m5208_rcm_read(void *opaque, hwaddr addr, @@ -224,7 +224,7 @@ static void m5208_rcm_write(void *opaque, hwaddr addr, static const MemoryRegionOps m5208_rcm_ops = { .read = m5208_rcm_read, .write = m5208_rcm_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic, diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c index 9fc30b03ba..5f38c49077 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -166,7 +166,7 @@ static void mcf_intc_reset(DeviceState *dev) static const MemoryRegionOps mcf_intc_ops = { .read = mcf_intc_read, .write = mcf_intc_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static void mcf_intc_instance_init(Object *obj) diff --git a/hw/m68k/next-kbd.c b/hw/m68k/next-kbd.c index bc67810f31..4d87edc2de 100644 --- a/hw/m68k/next-kbd.c +++ b/hw/m68k/next-kbd.c @@ -163,7 +163,7 @@ static const MemoryRegionOps kbd_ops = { .write = kbd_writefn, .valid.min_access_size = 1, .valid.max_access_size = 4, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, }; static void nextkbd_event(void *opaque, int ch) From patchwork Wed Nov 6 18:46:11 2024 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: 841072 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp685942wru; Wed, 6 Nov 2024 10:47:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVRkiDljls+0rQfEFAUOzm015F0EKsqYKQqgEBA7jHcoJcCDUQSBtOmy+5VeKbrHnEkx8WeDQ==@linaro.org X-Google-Smtp-Source: AGHT+IGlfwVzdywcxVOVxB417PxTWORJaHm8cf7QEHtdu0MZO0hdEfds+aVLg8AigM1jt6rf0nic X-Received: by 2002:ad4:5aab:0:b0:6cc:819:5075 with SMTP id 6a1803df08f44-6d393c728ddmr5220866d6.18.1730918838626; Wed, 06 Nov 2024 10:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730918838; cv=none; d=google.com; s=arc-20240605; b=gFc0Y+Xd6iwDiRrl+6l0UtdeC58wNABODdnkEx71fRsJWsYuTTUcpYHsPUMhqgXkqQ 8fOnDJ/I4bMC0Sg9UG6eWtDGd2Qna54RfVE5hjeEUkBLyp3BoKJKyVRkpz58iCnPQ621 SmyMVQdbIICpCEhKDX5tqQ4+wDAHVOfoz9FwpRjVFrhx13bffgCsVkpuWEnUEei8EOk/ T66ExnKcvONavc/61e9vC3QyA1ghGoB9GMP7a+9w0IrPCwpFOp6ewqrlRL812+qySvk0 votAKdJVxTRJvO3mt6fcLfTRGQoO7kWiAC6WhFQyZOS3YPo7EmA0hmYtmbgZ5/+50iKS g6hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YsFK2U3XFqb/vEljmH+2siHctjoVhJmmiNdlJHfI0/4=; fh=jDhTT5t6/SNd3Lmy0g3KlPwh8+DK1Bwi2jXD8rwBeIY=; b=EmVtOzQrAwonGK0qA692RTbW6GrzWi7UgSLFpzrN9AGoWXSGRWru7TyeR1bnvl0qKo KdtPw11V9Q88icZcm9iLj1s/+y9SMD7JzEaHpLbzxd/vnaCaB6KiGl5aSDsuSKxr8CN6 tgGWA3r+ZCtkUBKoy5e9b2mUA29Fn9+rOvvrVs3sYNX2p/mvW0gJ4pk5TY6p/2XRrlz3 XxZc9cU4GkQgrPH5h8WQL2okq4FLYmPOUEyqwGjB8OBRc0l1x20wG4U2K8x6hG7lIYH7 SQRTWRJiWWwV5nFB3Z/axUMh/aS1NkZHEkPeJ1ZAlg8OJJzcj4BGJx4lPmVCyS786ee2 nFqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hQ3ZYRKe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d353fa9f9csi161291216d6.31.2024.11.06.10.47.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 10:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hQ3ZYRKe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8l3A-00008x-SM; Wed, 06 Nov 2024 13:46:40 -0500 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 ) id 1t8l39-0008Sb-N4 for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:39 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8l37-0000wM-So for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:39 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a9acafdb745so35863766b.0 for ; Wed, 06 Nov 2024 10:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730918796; x=1731523596; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YsFK2U3XFqb/vEljmH+2siHctjoVhJmmiNdlJHfI0/4=; b=hQ3ZYRKeM9RAz5rhZfvn6iN87PgTvsn886yZGBDiHPXycfDLPXac9nom/2TlwaY8w7 H2hQIDgE19jHgXGirJBejG/SocHvYHya80hAZKTpn/YDCOkm4VExxbI49SBKAiVTNahe rVD6haCZiKt7IKVeTibTlCOK1kZS/haq4mdUiEwWxvnNiof4bmgZesYSMuh0d4/G4DKS MvI0T2KWc5YxLWV4qauxcX/nT/fuYD3kD6krs7khZDb8CuuHbdcoo/HC9e7SGdZMOhzw zA2TzNGM7G/s3sdMsl8d7WvXRoyMq4SVJw82Xk93iab5LNaNLfOv76AgUAj06psASqUa pRvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730918796; x=1731523596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YsFK2U3XFqb/vEljmH+2siHctjoVhJmmiNdlJHfI0/4=; b=n4JP25EBpM7gCtsOzDvxj72LTiA6LRjgcxpVUOaSJQiy8fWA1PePpurGlKnt5Tcuc1 yk0xN2duRcMR/Tu4vQbIKeKdDdxMKPqLHWwU8vttWvGFqC7i1wRyHtX6bWoDEdEaIuIZ nOnmrjW8qDRlLQvjApzffjVvBLHuLsudOL0Gi1jkJYaHCChVrT2O8WkGQPskfJpxEL7O 8DEp0LdiuA4cNKlBkP9mOHSBDjl7NxB+gKWqPB8rFQMUwxfXq2BXZePHwPAUhP8rwf+t 5wKg10TjFD+YEF/6v+vqZfVSqnyVO97RohtpKNRq/iIRIAmJbUQ9pvOzzNe8hqHS8T34 n7XA== X-Gm-Message-State: AOJu0YwHpwHvKj5vYXsVfSk+uwGRaM6P5Ye/LaDjXmX91Q+7/YuIGddL 0Rhs+cNpQQh8RHMtQkGACO7uIjkvtLT7fD6vSaumbX7LyBkts3mdtsyHfrWN6fvNBzs4DS6OZTD R X-Received: by 2002:a17:907:7f90:b0:a9e:670f:9485 with SMTP id a640c23a62f3a-a9ed51c6ed6mr17121666b.30.1730918795914; Wed, 06 Nov 2024 10:46:35 -0800 (PST) Received: from localhost.localdomain ([89.101.134.25]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb16d9d68sm317330266b.72.2024.11.06.10.46.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Nov 2024 10:46:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, Paolo Bonzini , Marcel Apfelbaum , "Edgar E. Iglesias" , Bastian Koppelmann , Anthony PERARD , Eduardo Habkost , Thomas Huth , Jia Liu , Stafford Horne , Paul Durrant , Mark Cave-Ayland , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 4/5] hw/openrisc: Mark devices as big-endian Date: Wed, 6 Nov 2024 18:46:11 +0000 Message-ID: <20241106184612.71897-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241106184612.71897-1-philmd@linaro.org> References: <20241106184612.71897-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These devices are only used by the OpenRISC target, which is only built as big-endian. Therefore the DEVICE_NATIVE_ENDIAN definition expand to DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't tested). Simplify directly using DEVICE_BIG_ENDIAN. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- hw/openrisc/openrisc_sim.c | 2 +- hw/openrisc/virt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 9fb63515ef..794c175bdb 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -266,7 +266,7 @@ static void openrisc_sim_serial_init(Or1ksimState *state, hwaddr base, } serial_mm_init(get_system_memory(), base, 0, serial_irq, 115200, serial_hd(OR1KSIM_UART_COUNT - uart_idx - 1), - DEVICE_NATIVE_ENDIAN); + DEVICE_BIG_ENDIAN); /* Add device tree node for serial. */ nodename = g_strdup_printf("/serial@%" HWADDR_PRIx, base); diff --git a/hw/openrisc/virt.c b/hw/openrisc/virt.c index 47d2c9bd3c..ede57fe391 100644 --- a/hw/openrisc/virt.c +++ b/hw/openrisc/virt.c @@ -236,7 +236,7 @@ static void openrisc_virt_serial_init(OR1KVirtState *state, hwaddr base, qemu_irq serial_irq = get_per_cpu_irq(cpus, num_cpus, irq_pin); serial_mm_init(get_system_memory(), base, 0, serial_irq, 115200, - serial_hd(0), DEVICE_NATIVE_ENDIAN); + serial_hd(0), DEVICE_BIG_ENDIAN); /* Add device tree node for serial. */ nodename = g_strdup_printf("/serial@%" HWADDR_PRIx, base); From patchwork Wed Nov 6 18:46:12 2024 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: 841073 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp686027wru; Wed, 6 Nov 2024 10:47:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW44mE7LrIYMjuEQeduZX1xy741zwA5tMpTyGhTUFOGrHMZZjslBjZxenpnJNHGfpwFUOf+Yg==@linaro.org X-Google-Smtp-Source: AGHT+IGh8GNKY3pBFGPG5d095uy5RTHMi+xhyfKeD81rOZCfiL/MMyVLa1c4JVAdqQwEWDSW4yRI X-Received: by 2002:a05:6358:5d89:b0:1aa:c4b4:b26f with SMTP id e5c5f4694b2df-1c5f9a4e397mr990121255d.26.1730918850547; Wed, 06 Nov 2024 10:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730918850; cv=none; d=google.com; s=arc-20240605; b=eNZ65jXdJwUa0ULpVves0JQT5wX/J+MTYfd9Kb2pbBfyEDBVqUerY4HcFORsaaqMo0 p2OIGTTPB5ngbVloG+DFpwqT+cuZloRMU+1Ai1lu3/mpJK5Uh/GRJbFFQCjmdJDEFC9b Tz5zLcJfxffVbv4USkGbh+q1AJWBOO3WKrIhpEIMRBiYqUQiC8Cs8Kn3iQ0UxYqDs0JX i1mIC6um4YJLJVlD0nTphwM6VGYJRWR3ToE+v8264gWiQNGGYj8+INPgkcr0WhKHTLmf POi3tp3dSnJghsOCiAsvnnF0ZswKMsKvrNR1VuI5iCz22FcapiOB7Wv3SxWccpm+hfS4 5YfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MkGkfKVgrldMieE36JppEsQQQbpaD8YlgbmPxpDRAVA=; fh=jDhTT5t6/SNd3Lmy0g3KlPwh8+DK1Bwi2jXD8rwBeIY=; b=HrEORxhy9Lh3deguY3L45fdDUp+E+fmD0nyM5/fjui+faVN0YUGZRqG6lnRQqH0D1E i6bak6iLWzcMZjW4C/oQhWsFlQSdGe0kpVXKEXahopry1cQk7poq3ktaLUKcowCzmUZg +AX2SUL+Tu7d26IwwUOK7/Jucka5hmAdNlv/4AJQtfkLFUOT+LVMSmXMThPLFPnDX57O YkYrNVHS72ERqYfQMvN+TSsJc0x1ashJ/HepFA9pioiJFesTVEt/HvgG9fykgaDlAI0o ndLUk1R6J0+ry50ZJ9ZU1mfjjO3QFrbM13wq7QgRdAbCtLiCHa8gn3w1a5sFAZ2W4rSX 1z1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=osv6OU1H; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b2f3ab1362si1639392785a.547.2024.11.06.10.47.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2024 10:47:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=osv6OU1H; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8l3H-0000IT-JV; Wed, 06 Nov 2024 13:46:47 -0500 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 ) id 1t8l3E-0000GD-T5 for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:44 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8l3D-0000xY-9o for qemu-devel@nongnu.org; Wed, 06 Nov 2024 13:46:44 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-539ee1acb86so60977e87.0 for ; Wed, 06 Nov 2024 10:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730918801; x=1731523601; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MkGkfKVgrldMieE36JppEsQQQbpaD8YlgbmPxpDRAVA=; b=osv6OU1HWBee3MMmvMD60DrfReffFfr36fmC2BoZHr+p+1MRjX/LOR0DQ9MhXNEMnS 1PW7ON0HuxuQJOiNDMIgx5QLsf6kMh82X3olvoZRkTjLQ2b2sqmfr9FDY5FZuR5H1Mbc GPshzs6H0E4Z4NeJLI1L1vBMHwFMHN7D80+Yb0Qgstbu3kKA2MWbOmHCDsJGWcWQZ430 /x98iiUTjIzLkNMmoF9vGsuSSEf9IArrvwBZWtQaMnc4v2gbRjd1KppDN59AUwv6H8l4 FKzSZS2GQWZ2AFOqcfTLTT1D503/BOvoYf4MRvAeCedIiFNIyx2i8dVcypZdfN8F8qGt JF9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730918801; x=1731523601; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MkGkfKVgrldMieE36JppEsQQQbpaD8YlgbmPxpDRAVA=; b=VYOZ+p626y8VBHdFaYXtViKt4WZRLn0lyl3T/XclRHvhGNWXQhLH+TONMEUyaJFtHT QUrahuf31oMVb6Kyr3dMTvefH5MzyWBz8URGvmObTS72gHLi92Nlrfi26ORWvYqKnyB1 qDLFLZiMFl8b4PBc8pEpXwT4Sg6tEpb2YzrvNmwUy/AVP7Rg+IPQcXsT+bj/+jRTjupP tLz25UdW1htrWxwFNDORJsd5myC2f0TAuKF4zn0fzdiJmO6i7Qp/87Q/zP8mNqc+egDN iJD08wYeq8OWp2Wd74fps6Ty+wYM3uMP9p1gTnpPdOiPjKx0xuckfEnd/WZ5yExYWbkv xn0A== X-Gm-Message-State: AOJu0YwvjqnspmI5LXezWfgkVQhkbDvDwIdoa/FksxY7mRjTI0Wnxqnx 8Vdrdc+6B6dVTSGNJLJ7INYlTLBK9/LYGaT+PrYvCW/qqr6W/y0I8tyYDVhKeZbZNl5wSkKdehK A X-Received: by 2002:a05:6512:3c96:b0:530:aa09:b6bf with SMTP id 2adb3069b0e04-53d65df7628mr10283658e87.24.1730918800919; Wed, 06 Nov 2024 10:46:40 -0800 (PST) Received: from localhost.localdomain ([89.101.134.25]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9eb16a7dc6sm314521266b.7.2024.11.06.10.46.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 06 Nov 2024 10:46:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Stefano Stabellini , Richard Henderson , xen-devel@lists.xenproject.org, Paolo Bonzini , Marcel Apfelbaum , "Edgar E. Iglesias" , Bastian Koppelmann , Anthony PERARD , Eduardo Habkost , Thomas Huth , Jia Liu , Stafford Horne , Paul Durrant , Mark Cave-Ayland , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 5/5] hw/sparc: Mark devices as big-endian Date: Wed, 6 Nov 2024 18:46:12 +0000 Message-ID: <20241106184612.71897-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241106184612.71897-1-philmd@linaro.org> References: <20241106184612.71897-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org These devices are only used by the SPARC targets, which are only built as big-endian. Therefore the DEVICE_NATIVE_ENDIAN definition expand to DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't tested). Simplify directly using DEVICE_BIG_ENDIAN. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson --- hw/sparc/sun4m_iommu.c | 2 +- hw/sparc64/sun4u.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/sun4m_iommu.c b/hw/sparc/sun4m_iommu.c index 6f765e97e4..4486508e3b 100644 --- a/hw/sparc/sun4m_iommu.c +++ b/hw/sparc/sun4m_iommu.c @@ -238,7 +238,7 @@ static void iommu_mem_write(void *opaque, hwaddr addr, static const MemoryRegionOps iommu_mem_ops = { .read = iommu_mem_read, .write = iommu_mem_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, .valid = { .min_access_size = 4, .max_access_size = 4, diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 541c7f74fa..9d7aebf632 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -254,7 +254,7 @@ static void power_mem_write(void *opaque, hwaddr addr, static const MemoryRegionOps power_mem_ops = { .read = power_mem_read, .write = power_mem_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, .valid = { .min_access_size = 4, .max_access_size = 4,