From patchwork Tue Nov 5 13:04:15 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: 840794 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp328443wry; Tue, 5 Nov 2024 05:05:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVmhCS+anElsM9iCX+22xlFyfPgPukQRg4/bHPmNYwwOHgOPY9lv0WMw45N43fNH028pHQDpw==@linaro.org X-Google-Smtp-Source: AGHT+IGaKWvmV/5UBlBiBx2Is84DjNt5ZU3vaZ9RxD8TZHH/Sm78ZL3uws6V/STSNSXFC3Pw9hYc X-Received: by 2002:ac8:58d4:0:b0:460:a82a:39a8 with SMTP id d75a77b69052e-4613bff3422mr612253211cf.13.1730811947107; Tue, 05 Nov 2024 05:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730811947; cv=none; d=google.com; s=arc-20240605; b=MVXb8G3dy742y+EjnHG7vz2SjfaX1TRGyae5KPLEC2JCG83lvjZEKJexgWu+EvPhOx fqv5/Z/dCdfzUP4SIfxzjjVevm9mlfJy50CTZi3H2CIr1ayb4r5PV2SynmdG89PCxY8U tcBMZW9tn2/jv4WR1ZxNN8oeiA1bxm3GdGJknHDPpDigkRz4ICp3g5udUdkBBXvsFOj4 QuhxLLQA7I6bozsQzJal81DNFCR9vDhYhWWJiu3ZlkrCPxbMs916GPUroywRNGQIJQff l1AVqVrnZ9Q3pLt2DiPZXm3JWOMkRBkcO5M0K80Sb9RpOMgGCUbvTCIEWElVsiFZcse0 mn1A== 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=iDSm43fdf8jLcDNMuepzzXNnXrf+Cwp4vQFZzGV7m7k=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=LZG/6vzZBPluSshTT0ZPQqrMywX9VvQlJc8uZGcSvJFazO4AR3fEjzE8ZxZqah2Ne7 jSVRv5jdJsYi66zzsw/GVffpeOPdkO3jg6RW76Np47tXW5CTJoC2stNQxAsULBflonQm s4oEAv9IxYqT5ALq7jTYqT/eWAPIY2oG0V4plmrsKLV8gaVl1aSBy+m0kUk/pMRvYqC9 oNBa7ks+0/w8ZfVBwzls+Gmi5gceixylRUG9+kNXEgUXYLnAR0kE5VWJkWVL+9tznsj6 IA1fckbpYZfh/TwUA9MrGKBJXilHpYnzEqfSYX4FNGoX7NJZpMauHMG0QRrLO/Q9oOtU H5Qw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E6JTtC2V; 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-462b547ebecsi129689751cf.30.2024.11.05.05.05.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:05:47 -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=E6JTtC2V; 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 1t8JFJ-0001OY-OH; Tue, 05 Nov 2024 08:05:23 -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 1t8JF9-0001Ig-Ai for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:16 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JF7-0002Ne-6u for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:11 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4314c452180so39885605e9.0 for ; Tue, 05 Nov 2024 05:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811907; x=1731416707; 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=iDSm43fdf8jLcDNMuepzzXNnXrf+Cwp4vQFZzGV7m7k=; b=E6JTtC2VerCypEMjEv0NrrwmyGtbzYxaYorTGfowQbVQLIK0Vr5Rgt5ExV9Wg31Hl9 7sAasAYWjnpQBl1lAt4P/oqK4QSUxenfLpbBm+Ak2pj7uRoz4cZoKm13InPt/kGMQSlk ODqOLuIvOZqlleQqBTE8vN3D+1CzutbyLsW87X58VFZuOuSOtKMHHyqbn7B//eyGFJSa QVaGf2K7LLhxJ3+2rOA5JJJZn5Mrti6fqT0S7wtBG60FDfFbt0PFFTY2im6WUU0dewV0 Fby0Ere3onUF7amFdR81S4myb+aeykPcXUewlqeA1EG24f3tuECAYXw2QZ7idaujgf6Y qAhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811907; x=1731416707; 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=iDSm43fdf8jLcDNMuepzzXNnXrf+Cwp4vQFZzGV7m7k=; b=jYDo6OS59aBKbTRtgtFdpgzgzxAM7YVDCC+3Vp+3/5/Z22CLXKNSJmQLCxBynwEQzs SPDJoWIPGULoo4+Yb7jeJii49HsiL6xUSiIdxQB2LUbukbi+JDhqfmArFEEUCWn14IsF n/hI1SSFSa3J04ozU18kxkAwkoUxLCnpOYWOBrzrwWEZtrJaxroKk/BP8Pk3PfOiH0fD i/duG1CtxOtCcuowkf2wD41UqxVzp8L0XEoIVZcXxDCl7fN17aA1xOqBRTnlGvj21fXp cuMdHmOyl50cJiv735Cz4BTqVYN8O9OAqS6kD5Onrd1AuuznfXHYGTTib9onSLyrxWRV kzSw== X-Gm-Message-State: AOJu0Yz6quC6ClHIsLzq1ikHsMCq/dBqozI+Uf73xffLbd0Ki0yl3cLN T9jhiMtS/v9Syi3smvZneilrhs4tVIwNyqac6xElFKHOg24p0xv6V4Szu1QwChPwcV/c0sGBjJy ise8= X-Received: by 2002:a05:600c:4ed4:b0:428:b4a:7001 with SMTP id 5b1f17b1804b1-43288c32703mr112566525e9.15.1730811906941; Tue, 05 Nov 2024 05:05:06 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c113e687sm16288378f8f.84.2024.11.05.05.05.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:05:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 03/19] hw/microblaze/s3adsp1800: Explicit CPU endianness Date: Tue, 5 Nov 2024 14:04:15 +0100 Message-ID: <20241105130431.22564-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=unavailable 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 By default the machine's CPU endianness is 'big' order ('little-endian' property set to %false). This corresponds to the default when this machine was added; see commits 6a8b1ae2020 "microblaze: Add petalogix s3a1800dsp MMU linux ref-design." and 72b675caacf "microblaze: Hook into the build-system." which added: [ "$target_cpu" = "microblaze" ] && target_bigendian=yes Later commit 877fdc12b1a ("microblaze: Allow targeting little-endian mb") added little-endian support, forgetting to set the CPU endianness to little-endian. Not an issue since this property was never used, but we will use it soon, so explicit the endianness to get the expected behavior. Signed-off-by: Philippe Mathieu-Daudé --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index dad46bd7f98..37e9a05a62a 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -71,6 +71,8 @@ petalogix_s3adsp1800_init(MachineState *machine) cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort); + object_property_set_bool(OBJECT(cpu), "little-endian", + !TARGET_BIG_ENDIAN, &error_abort); qdev_realize(DEVICE(cpu), NULL, &error_abort); /* Attach emulated BRAM through the LMB. */ From patchwork Tue Nov 5 13:04:16 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: 840796 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp328447wry; Tue, 5 Nov 2024 05:05:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVNQmWbPm33HtONE4nXj5G0zXZaVRdMR/Ve1Nha2GFiKLXT2GKXv6fj8LTDrg2XjzgtqrpiDQ==@linaro.org X-Google-Smtp-Source: AGHT+IEDn5ZN/kwZHS3rVB1LAcPzkHVBjWec93x8EagXoY3BLcrJkyvQWGEtAdgU89Ubzlj//Ye6 X-Received: by 2002:a05:620a:370c:b0:7b1:1313:1246 with SMTP id af79cd13be357-7b2fb96ab78mr1985875585a.24.1730811947450; Tue, 05 Nov 2024 05:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730811947; cv=none; d=google.com; s=arc-20240605; b=X8qYJX28/UUo//Te8VJ2q3KN0kMpst3JAnnz04SFTsaQhHfY96y2fAMBm8DWzz0fMT UJMiL6YwX7Kq4wvlZ76+XtiPqTAjvzLheGtldGPpAxwpY1ZgzVJ4m3zFyKqh3ywpo0HY 2rfkGljp7tDqqJab8/2N/s4dgWDPgGIMLvMgxRGrCZXzoFEvd7rdaJWX0eVZt7oTygj5 8c6Gz08YU5r2Ug5W6PwHKy7QNXG90WLGsxxWZlHdsqCn2NZQpJsxYmuliAKWrn5foGnC CtyCRz7bt/1zuSKPi4ZD9H6DyjFtyIFjd5NVAKtY0OIFDFJT7U1FZSNdl2QdhFvVq55D tHGw== 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=FTPJzGm6ARvkieLOl7sA7FxSacHjsJ3U8wjcC2hw8sY=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=bpOjJfE9a/i8Ctbhl5i9ziAkO7MSh5s/cLswi5+hWxG+uAgMgOS+FIYD21AX8kuQ9i 3Mj6kKP2+/lzImDTOavt+l+HtyGWA2P1Y/BqJpNzGBbTSCIdcbeHQ1ln6aHAiBqln6NR i6VgrjVJc0FxR1K5Xie/rxh01R7aDRywBiBTUn2SUjPbYKnKzN6y4zT0RnaDMI21DYwx MZgOc9l2f2VOBHMYeFvySbW+13F8ycOU7scyRp3wT7TornZS0NXpab287N+jssNABOhd M6gmI+rgU/yi0O8fePryYIvJfHGAL9PvoNa0KGYAgyg1fG7zJdiIy9EVnVDkIOS5iaT2 Mo9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OI0zRu5W; 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-7b2f3a035f7si1380395385a.183.2024.11.05.05.05.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:05:47 -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=OI0zRu5W; 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 1t8JFO-0001gI-5n; Tue, 05 Nov 2024 08:05:26 -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 1t8JFJ-0001Ty-OS for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:23 -0500 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JFG-0002Py-St for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:21 -0500 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-539e3f35268so6650307e87.3 for ; Tue, 05 Nov 2024 05:05:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811917; x=1731416717; 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=FTPJzGm6ARvkieLOl7sA7FxSacHjsJ3U8wjcC2hw8sY=; b=OI0zRu5WPJ+u6FeIyijnr+v/CDA4CFJwjh7vSvWlDuK0d/WRj8kko2onvYiigSBlNM o7CrbtRKbhg26TWr9G+6o8IMXk8bCpnDWeFiCrNUpDbVsd+vTwVRpdFOveVUmNZS35kY 5d5/Bddr+G9epkTjJaAimElTSLfL0NkBNOXhuYMMC43QcPk4xQsDPwW/4l7o6upBCQ8r uP87a+HvhWRAU3Cp/SPgwLAuem+QJJ5Vl5B/PUi0Nyg/HxG7tdoCNVKbcKGr4aFykP82 kzLBHtTMPzunjyHEIGdLSJOUWfIxx4/rXFrdLxzOo+WgV5u1rE9DLWucEfYunEnczBHb 349Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811917; x=1731416717; 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=FTPJzGm6ARvkieLOl7sA7FxSacHjsJ3U8wjcC2hw8sY=; b=giP8hxGuRjbRaS/zBturzRvbup33IvQQzOJf4wONFFCfU7ebS4BOMMnzH8TurYez4G nz8A5Ao0hMk3lWLbu5OH0CotrFeqs/fZan87m8WTnJHIHmKqIX6NdHk9zrWRC6NAGiij zEAz8CM4Uw+ILGwAmvQGa8HmaD8Ik6aYPwwb27DgU5GSMtJaJFKtZs/+wvu5OHfa21vZ 0web53PW4EF1hva/A1cjZD4oPiRjaJfO5IS7kHFldpkVO/fk26OLXpP+F0+99F1HBble kGc2IPYcRvV1viqxTsF3hSJ4s+MqsPfH9TVf4fERizioI7DIWmgiC6ioD7l7o5E0L4tT tZ3g== X-Gm-Message-State: AOJu0YyucCHWLRhDdh2JZKMDyZXJGzLo4ARXzuApDHJx5QFM95OoHNVO kXiWmhrsWkoU/ITT3WlFbbs8kJgk6ZojEIU3thHbVsCD7IqTsK/6TwnuWvZOLMmz887e+xvakjG u1rA= X-Received: by 2002:a05:6512:1288:b0:535:68ab:7fdd with SMTP id 2adb3069b0e04-53d65df270cmr7648972e87.19.1730811916609; Tue, 05 Nov 2024 05:05:16 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd9a99d3sm219571055e9.38.2024.11.05.05.05.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:05:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 04/19] hw/microblaze/s3adsp1800: Rename unimplemented MMIO region as xps_gpio Date: Tue, 5 Nov 2024 14:04:16 +0100 Message-ID: <20241105130431.22564-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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=unavailable 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 The machine datasheet mentions the GPIO device as 'xps_gpio'. Rename it accordingly to easily find its documentation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 37e9a05a62a..581b0411e29 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -124,7 +124,7 @@ petalogix_s3adsp1800_init(MachineState *machine) sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, ETHLITE_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq[ETHLITE_IRQ]); - create_unimplemented_device("gpio", GPIO_BASEADDR, 0x10000); + create_unimplemented_device("xps_gpio", GPIO_BASEADDR, 0x10000); microblaze_load_kernel(cpu, ddr_base, ram_size, machine->initrd_filename, From patchwork Tue Nov 5 13:04:17 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: 840795 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp328448wry; Tue, 5 Nov 2024 05:05:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVKqi72K2nrWSowBNYj3oCLrVSZJDAHk5QmLEMAR/vc5eb2cw0cf2Vm8M0lapNPtNt9ydPFjQ==@linaro.org X-Google-Smtp-Source: AGHT+IE7wlER06KbPa6XZOSJEQd+KJS2f9ko/N7+vdhDGrOUTyJru41RhcmMWP8aH0VolKBEN2/G X-Received: by 2002:a05:620a:284a:b0:7ac:abb0:2317 with SMTP id af79cd13be357-7b2f24ef3eemr2759519385a.37.1730811947526; Tue, 05 Nov 2024 05:05:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730811947; cv=none; d=google.com; s=arc-20240605; b=kde2xy35RguSqnlmjY7Yu//12HhtbUUSdC93RujD2nhvKkXoYTLMI4iNHsOc3sYoqk qwDMihyAxwkgYUzYpd/eyYZb4PDreSnDKApj0IcOrJO+HAICKG1YX2ZhYtvi4iYG7ccH 5eo3L6b7wBAGvs6m/V2CR1z7lAk+1kUvwb1WGpB/P0OpLdgbBwamf+VNXpvw+fxT6j9I 83l3IA9JYphyra9RxW67lqJsiZtEh8WbWHSLNxt59LeG8DaIMTgAnukstPbSq+I/Sw4t bwWITfIWIt4w43rtnqvsLRRFWJ34sBaST5OzNIRuWS9sv2BitWbYUfEv+Se+d1gzg3rl GWkQ== 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=mc9pl0ol0oGGc5F+E40Idu3stjpto+GEuMxBJrUIFDk=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=GpRktWMMYJhj1QcWOxOhtp61AZNzdv4EIsa/aX2ALAEBfX4uaDlxlNeJps1kc2Oq58 /CSgZj+NKkIbpZcYqQjAyArgfhDp6KP3/lWF4HLorcyXrQ9m9RzPB/N48XXFmdhRdQQq hP4azNDFGNZ05MkfGOiPH4A4uKgdIY7+10MvxBm0gO3X6ggCeICXLUq5wfT7R5jzrHkN uMvEhy/MnufeGrbP2OL5TvrpOk8XuGXTIM9FxrW0dx89sKUWU3vw7pE/L9BaC7zEdQ94 2kLUimRRIe/Sre3U2R9YigP5fqHeRNZeKk0MDIDQjmYX40455/BqbLNkzOFAsu8lC331 beXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZXUPKuH2; 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-7b2f3a9b5d3si1330274285a.413.2024.11.05.05.05.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:05:47 -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=ZXUPKuH2; 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 1t8JFT-0001rL-LJ; Tue, 05 Nov 2024 08:05:31 -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 1t8JFS-0001r3-Mj for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:30 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JFQ-0002So-P6 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:30 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4314c452180so39888015e9.0 for ; Tue, 05 Nov 2024 05:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811927; x=1731416727; 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=mc9pl0ol0oGGc5F+E40Idu3stjpto+GEuMxBJrUIFDk=; b=ZXUPKuH2nZ3Ilyz61KkXvGPVau33Hs/yuV5kA85T4MUP/n6OpohbGtypeHVoFJl+O/ qCmEoqqd5s0Rr3nuXxP2EmlnFBN2QM9O/Pasjd5u4yVyyRfJEjoiXdy8LQPvNSttF58/ 9JKwHnVmmrpaztslo4n1wrm2IkimVc7h+Cr9y7fEIZ14vc3dEO25Kohlqs8y+Yub6MZR 7v1HzENrFq6PWfVU2M9mh54TXkIcMoO0M18HhgBhjInaw3F4Ctl2JfcWL4JuU/MNjGXH UK1bJZXFo+e641BOKtuyi2z1mtPw5uiNHBAriuwRvfnT3GMmydCfHAWb0YsL1AJ4yvNs ZUbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811927; x=1731416727; 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=mc9pl0ol0oGGc5F+E40Idu3stjpto+GEuMxBJrUIFDk=; b=XWnBGsjmncUDy33it+wP8crR+FAqeu9zoKTQq4/NRHpHdp6KfvvrVkv9DOm1hqn/EJ M+Hid4hJdNwpZJjfeIDhw1bDrhZ5gw/cSAUVB+qrnEC/8qXlldW/7+itCHufDNGFeKyI L7sN6d8c+fndsNnJ7bufaj2KJiB+3trWDgNOJcS+clHyiFAZemoOsCd8iYtRbzhZqGhX KKfLobRff+m8aj5v/bFr/wL6p1/hEo6N6Jfk6yfoCWFu4cXB6ptriqRJN/odg4c2e+08 kAtPDjGaJOVbpcSwRmTelXk8LbXQsp/WPA15ZWVXCWRk8vC0phqn/quW22ILrnY0BTHM owvw== X-Gm-Message-State: AOJu0Yw1SvaaNABwz7NqHcxTwOx1lcG/bI/BRdMYG0/ADmLFlW9mbSfQ LPz/cGfggNr3SfV9xLlmGl6oQ/7zBnUoKz/TDdy8PxZnzn1qPwAn00/f3PmuRyQUtD5YuuVB4Zr 107o= X-Received: by 2002:a05:6000:1a8e:b0:37d:2d6f:3284 with SMTP id ffacd0b85a97d-381c145bd78mr14773058f8f.9.1730811926954; Tue, 05 Nov 2024 05:05:26 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c116abdasm16358789f8f.97.2024.11.05.05.05.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:05:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 05/19] hw/microblaze/s3adsp1800: Declare machine type using DEFINE_TYPES macro Date: Tue, 5 Nov 2024 14:04:17 +0100 Message-ID: <20241105130431.22564-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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=unavailable 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 Replace DEFINE_MACHINE() by DEFINE_TYPES(), converting the class_init() handler. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 581b0411e29..6c0f5c6c651 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -55,6 +55,9 @@ #define ETHLITE_IRQ 1 #define UARTLITE_IRQ 3 +#define TYPE_PETALOGIX_S3ADSP1800_MACHINE \ + MACHINE_TYPE_NAME("petalogix-s3adsp1800") + static void petalogix_s3adsp1800_init(MachineState *machine) { @@ -132,11 +135,21 @@ petalogix_s3adsp1800_init(MachineState *machine) NULL); } -static void petalogix_s3adsp1800_machine_init(MachineClass *mc) +static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc, void *data) { + MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800"; mc->init = petalogix_s3adsp1800_init; mc->is_default = true; } -DEFINE_MACHINE("petalogix-s3adsp1800", petalogix_s3adsp1800_machine_init) +static const TypeInfo petalogix_s3adsp1800_machine_types[] = { + { + .name = TYPE_PETALOGIX_S3ADSP1800_MACHINE, + .parent = TYPE_MACHINE, + .class_init = petalogix_s3adsp1800_machine_class_init, + }, +}; + +DEFINE_TYPES(petalogix_s3adsp1800_machine_types) From patchwork Tue Nov 5 13:04:18 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: 840798 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp328723wry; Tue, 5 Nov 2024 05:06:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7mbqZ3L7BTLzOA056G4NbSzLpDEQlhx6ZMFHdbX7kIy96uKwWW5qzo4jzeM7h5zb+YNDPZg==@linaro.org X-Google-Smtp-Source: AGHT+IEVtzCNaJ3CJm921FuExMy+jTBNqhCu6HDKsr9V+vFzB2wvYHuwC9n14zKYcWhskX/5FKU6 X-Received: by 2002:ad4:5443:0:b0:6d3:413c:745b with SMTP id 6a1803df08f44-6d351b2084dmr235185066d6.34.1730811977270; Tue, 05 Nov 2024 05:06:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730811977; cv=none; d=google.com; s=arc-20240605; b=SHVithHuN6bOj0cUQV3BjFxGLzK4yry/CSBhNn4i493t6m3ayv++8IT8Bv3sux9peT 5a0DWF85DTep05DaCBYRBi5yJ3hzu5OyA/p004ey3fZKXGXqbGlmzpsvrVry+IfwYBNm i3d9wIm4oyvmREy8WzYhLaxIwJkRUztGV1q9fTDwifAU/vTyfaqG5H1F8zMqSt43Xtvj ZkCPMZe1C50XeO8TjfTvXvlbbMc1uzxt9TCyyevTttePipbqhGG1dgZKxR12E47z5tn4 jercSl8hbbR4TcS16koi97ux915zXE1Nev9pUSmZd6ty/YVZHIDvAm0U6SLwmSR1RSBA 29sQ== 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=qAZ8YzntwrQh/mqW41UtJKIzn7e3ZbFGPYghnfpczwc=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=SQ8P15jGKhsLj8N9llYFi3EC7m9nJXrM4n+v7EnbuKJ3mrgDZDPM1oQvo4ahpn+1xF 1U2XlBhMVNTUBLFV4e6IHGi0PmGz7xkgMiaYq37cIG2QzqCpd0ZhytIBvoAlpuSOaibz Cs522Iqea/kHaEDcvSbg0BaB+QcCAoAJ6SPuwcSPlbPoj1tf2SJfoiIaxpvK+9m2e4Lm 6550VdDH7rlhqUnaq8sALLdSpCCn5/H11kiFEE1Bd39DFY8p0xDESpBq+FoVs+XRPccj sJmS7JJl5TPAQ4FVoC4/8Pv4W/ssbgwXrSzg7LaUU1uvnWdGfVtY5UyeLzXcO35S/Tn+ hNzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="e3/WIxrZ"; 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-6d3541829d0si135520126d6.356.2024.11.05.05.06.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:06:17 -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="e3/WIxrZ"; 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 1t8JFf-0002Kd-Bc; Tue, 05 Nov 2024 08:05:43 -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 1t8JFc-0002Go-AZ for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:40 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JFa-0002Vc-NR for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:40 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-539e5c15fd3so5282848e87.3 for ; Tue, 05 Nov 2024 05:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811937; x=1731416737; 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=qAZ8YzntwrQh/mqW41UtJKIzn7e3ZbFGPYghnfpczwc=; b=e3/WIxrZmVbUjv7muhynuJUt9uheb1R5hxiRw53dJTuxYDvNuM5yc/apqsTqJ8uLlw V1NfO9zkQY6J15j4X7Xhdjfn9ezJ7vz6sleW7dSAk4igWd085sD3fg7lCHgDyi8X1Dy4 H1pUMwNcGa9B88AR6vBZKLaEoQKaSuyBD1Xxn6DaQ+yGxHdAcSL2ywX++7adcpqKM/mK HVnQ2w6zKL64UKNknbYB65PBMR2v2IlEuOLkirM5X+fHHBY11p++wkswXaTa82d//E1b gI+ZWXZt3Y6GcmNA7vzQOPAlqsWQ46hVLjLQa2TPBYBl1iN5ugNoyTJsS9wuvTl40lf3 dYXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811937; x=1731416737; 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=qAZ8YzntwrQh/mqW41UtJKIzn7e3ZbFGPYghnfpczwc=; b=G8ZAZCxP6y2akV5AgutY5nkXQ0blLVNVdHzLiNEytB+AIeh5J7AqOTQfeJb3yDpWvh B4sYWkUjzkflTMpWnTeZfULihcqa7TlHV7J/wjdF5UWfG29FRMVuFI9hhT+qoJ0FaFz1 4BEBBXU+aLLVzb6cAaIKOcIMTPUndh7Xy2bvcwdM+ZMb/GKYKs5UWuV/snXlqMEJQ6A3 EdnPLmSjxA0HMH1pAU7vIMdzOtcwYsQ+8KPZm1yr2ZKWbMBkdvR7mM0tx0Mqo2Tt0yG1 S2IKZnWNE3LpuEIH0vzdc7aFZllTDUBDce8e9ogJdjZosLK65LeAbjdfT2unymfBUFDK 1IoQ== X-Gm-Message-State: AOJu0YywvUwndLxL4axGH7irtdF1AiwuiBlvSz3c2IFbqspkywpnWbfj glrR+l+SZCGEbqJ1FMNV6oBKqjGoEI1e0JlboYWARJVnAHqCcU0ouqrpAyXi4LtKF5ESqiK6yFB SUQw= X-Received: by 2002:a05:6512:33d3:b0:539:e7b9:df03 with SMTP id 2adb3069b0e04-53b348c3954mr18508026e87.1.1730811936350; Tue, 05 Nov 2024 05:05:36 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e848csm222180125e9.3.2024.11.05.05.05.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:05:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 06/19] hw/microblaze: Fix MemoryRegionOps coding style Date: Tue, 5 Nov 2024 14:04:18 +0100 Message-ID: <20241105130431.22564-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.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=unavailable 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 Fix few MemoryRegionOps style before adding new fields in the following commits. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xilinx_uartlite.c | 4 ++-- hw/intc/xilinx_intc.c | 4 ++-- hw/net/xilinx_ethlite.c | 4 ++-- hw/timer/xilinx_timer.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index f325084f8b9..a69ad769cc4 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -172,8 +172,8 @@ static const MemoryRegionOps uart_ops = { .endianness = DEVICE_NATIVE_ENDIAN, .valid = { .min_access_size = 1, - .max_access_size = 4 - } + .max_access_size = 4, + }, }; static Property xilinx_uartlite_properties[] = { diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 6e5012e66eb..2b8246f6206 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -146,8 +146,8 @@ static const MemoryRegionOps pic_ops = { .endianness = DEVICE_NATIVE_ENDIAN, .valid = { .min_access_size = 4, - .max_access_size = 4 - } + .max_access_size = 4, + }, }; static void irq_handler(void *opaque, int irq, int level) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index bd812908085..11eb53c4d60 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -172,8 +172,8 @@ static const MemoryRegionOps eth_ops = { .endianness = DEVICE_NATIVE_ENDIAN, .valid = { .min_access_size = 4, - .max_access_size = 4 - } + .max_access_size = 4, + }, }; static bool eth_can_rx(NetClientState *nc) diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 32a9df69e0b..0822345779c 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -195,8 +195,8 @@ static const MemoryRegionOps timer_ops = { .endianness = DEVICE_NATIVE_ENDIAN, .valid = { .min_access_size = 4, - .max_access_size = 4 - } + .max_access_size = 4, + }, }; static void timer_hit(void *opaque) From patchwork Tue Nov 5 13:04:19 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: 840797 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp328692wry; Tue, 5 Nov 2024 05:06:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUtwbT09+Xqt7yjtP7ht4Cz/LPWqPA43P33aYPrXFyVFKXTQeIuPZAKW+Pl46j7bn9TvA5g4w==@linaro.org X-Google-Smtp-Source: AGHT+IEHNAZ5dtVaspIwjpPPTeQCrThicc7J51poeycg8S43w++hECEvVGJ06y4C7L7U7XndYecy X-Received: by 2002:a05:6214:2f84:b0:6cc:2cd6:24 with SMTP id 6a1803df08f44-6d35c199932mr208327126d6.36.1730811973745; Tue, 05 Nov 2024 05:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730811973; cv=none; d=google.com; s=arc-20240605; b=fzcpNNnk+gSW2padZBXhp5RADSNP+DoEmHIvvKTJkQsgpVFVH4AUposC95d20LT3lL pqMEFIWkI7oCqZheggjJfn1PhBet4dup1MS3McAXo0kRKox3uLrTZqX6Dx22G7rbvYDY qofmbWaANslMJ9xtCAQGPrPyih4LmtEfybzm1OIK7smuEXOHq89oksV76tt9+F7ihZLV 14q8cNhnruwxn/YgjMjOVeEwCjOOPFpsYJ2LNcuSYP+2Tn4xS8GV0zbEwbUMoSExFF4s s4vsFkd2v8WZKEbr7YoliMideWkQvv0ZmqqckeNZ59yoG02IWLHcozMg9Zdw3fDSK0mX WZcA== 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=UmQHqWTaQOMkWHXP0Jn/QpgcUfCH1B37UiHSpX6N2KA=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=kE7tFmkeKQb1z/4x/jFmuFhLTeI8e6hFtGGUFdIGnkIX6VCKExZP2nh/WSikA0YZkw 2Ni64vwkvkaVAzgy57vKIDtxpFqJ2IY7A/TXQPkuQDE+hOVslZjoZNsaenXZVewwLD+z 3XDHR/pIZkVWAvSzL5qW81py2YFNk/wnMgeHj82nNb3+CDPKT6R+syjjNnmb7+z3VVT5 UAJy+wJxFELhT/Cs8Rmc3J/INpei/DPwEuQmeDpPI82AtM3FYjmvzAqFGJpLF6KGzHL6 HR504yJqzyLye+lHKH85s7uY2Lw3S+aoTvu6zVxhQa9ONTbrdHxSZSqBX9AZ07tth+Xi uPzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s5HPSlAw; 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-7b2f3a0487asi1347920085a.203.2024.11.05.05.06.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:06:13 -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=s5HPSlAw; 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 1t8JFp-0002u1-TQ; Tue, 05 Nov 2024 08:05:53 -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 1t8JFo-0002mJ-0i for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:52 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JFm-0002X5-Ad for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:05:51 -0500 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-539ee1acb86so5437842e87.0 for ; Tue, 05 Nov 2024 05:05:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811948; x=1731416748; 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=UmQHqWTaQOMkWHXP0Jn/QpgcUfCH1B37UiHSpX6N2KA=; b=s5HPSlAwC2nA+to5RFYRJHwjdxqCcpkRZTt+rMvMVhefAgAA6uPMsU/1ILGUOCMtUL Sk4japgXgFTaW4BRSox/gTdrBSrXrn0iM3pFSrkrYlUjMLqk6VBjfFr2cX3ChPGLCDNk Uu2mUHdtrZvQhmshMSqJLQO9GMDHXwHbIdTR/EI9kQiN8x6bL+xHF7w5GuyQvvaOjAMw 9Llwloovy8KhI7Fu8Ub71BH5Z/nmNllEZFjKvlliuLRePn0HwqrvKLLwup2Ck3FvlMhx 2W8/o6fVYisL6Olt0uz0GYBxPmvmi4hR8aTaJV0YhTp6FURjybGWvW//u9Vi20Advcyq A54Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811948; x=1731416748; 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=UmQHqWTaQOMkWHXP0Jn/QpgcUfCH1B37UiHSpX6N2KA=; b=W+CI1cfOBAyJXx5aw2ol/3jsyBlMcv6lh1RTKsT5IM9WG1OfMTQCfR5lT+szdQtHtY ykwKPhmxmUvQbNT++qRoqK5wacDaLGrTQWcmQKzb+cDKI90V0F6cydg52zijRHYnP9lN nKCfo24NanGSrz8iON8xmPGrlLXyUuXzr692RYL5MZPE59Z3D+9bQiHD4OMtZ+3NLq+b xR4NpfhaznWZRW63yHcA3nbQrybpzY7IvgcxdJLzlrnxGIOCqbkUiImXt3uH6gBEKpAF q2BnfU9MZhzjwi/4n2Cz4DQB1qpfb68/7tOdw/hLAHXrGs5GaCECQagpYDVdpiMMAas6 5izA== X-Gm-Message-State: AOJu0YyWsSJtuFrPyD7Qh5Nm22iPLNQmHpWgSBqUswmgQqT5PRR6PnSO XSgYSj5kbKSR+pObMMOoLSgMYw6olC14evhmoluKjsOXJM/3KJ0ExreD9AJoBsQBkLR4in7+EyS Lov4= X-Received: by 2002:a05:6512:10d1:b0:539:f10b:ff93 with SMTP id 2adb3069b0e04-53d65df7cb4mr6726958e87.27.1730811948119; Tue, 05 Nov 2024 05:05:48 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c113e528sm16313895f8f.78.2024.11.05.05.05.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:05:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 07/19] hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit Date: Tue, 5 Nov 2024 14:04:19 +0100 Message-ID: <20241105130431.22564-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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 All these MemoryRegionOps read() and write() handlers are implemented expecting 32-bit accesses. Clarify that setting .impl.min/max_access_size fields. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/char/xilinx_uartlite.c | 4 ++++ hw/intc/xilinx_intc.c | 4 ++++ hw/net/xilinx_ethlite.c | 4 ++++ hw/timer/xilinx_timer.c | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/hw/char/xilinx_uartlite.c b/hw/char/xilinx_uartlite.c index a69ad769cc4..892efe81fee 100644 --- a/hw/char/xilinx_uartlite.c +++ b/hw/char/xilinx_uartlite.c @@ -170,6 +170,10 @@ static const MemoryRegionOps uart_ops = { .read = uart_read, .write = uart_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 1, .max_access_size = 4, diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 2b8246f6206..1762b34564e 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -144,6 +144,10 @@ static const MemoryRegionOps pic_ops = { .read = pic_read, .write = pic_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 4, .max_access_size = 4, diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 11eb53c4d60..ede7c172748 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -170,6 +170,10 @@ static const MemoryRegionOps eth_ops = { .read = eth_read, .write = eth_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 4, .max_access_size = 4, diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 0822345779c..28ac95edea1 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -193,6 +193,10 @@ static const MemoryRegionOps timer_ops = { .read = timer_read, .write = timer_write, .endianness = DEVICE_NATIVE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, .valid = { .min_access_size = 4, .max_access_size = 4, From patchwork Tue Nov 5 13:04:20 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: 840801 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329305wry; Tue, 5 Nov 2024 05:07:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVyAEqStRnB0A0wBVo9++Cd9jk6JOT2lE6r4Oxn+GNzZ2PzMlyzrYUp/JPWRCv+UmyYZ482TQ==@linaro.org X-Google-Smtp-Source: AGHT+IGdnMXn0/E0puwVBVDSr0D54LkBD0ACalN7mKgzLqM7HLxAMtrru9iKOOWTLSMs7A3ILaG6 X-Received: by 2002:a05:622a:3cf:b0:460:8fd3:b393 with SMTP id d75a77b69052e-462b869d7f8mr255376001cf.28.1730812035798; Tue, 05 Nov 2024 05:07:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812035; cv=none; d=google.com; s=arc-20240605; b=ac6eX4GDt2bi6IBGkE8FKs9HiANCJzZgePdsDqyQHSUNhccUi+rWAeGpTcY8wgiqjm Qkm5W0cGLXCpAyevSqC4ilmMEMhBv2J1hmWs8I7kZFrE341lu+273SWTIrYBbgUBZNat oq2oA39mrQDQVti3Mp4NxpebGqO/y0hRaWlDcs7Sb7SoOMf3tj0h8t1NEYRvWw1LFuuv RJwBcVMj7YqqxyXHfezuSJ60CkUXzdQmgmKALimSFsvIvYM17hk6VFaxCx43CUU6iM4C uK9nDXp34I0B7mZLzpSlYBMTTz6u413OuYAhZuwrKLK55nKnjB4OavuaBSPHfoL+waXt 6WSQ== 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=owZyMcyuMkQxG2xNbQN7m9vwX8uFO4GAfwfRH2jZDis=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=XOcUS4MBmY9wLl7tw3pbIXf0G8by/jswXuLoUAbd28r5ArH/fLodU1hh0AaTJ6lnFG n3lWH1iYDfuru76hgS3VQ0jaNfm6jom8akXWQvEm2dEAl01JLGByIMAmUygt+pnTC2GC 3HyYaISOP4krJ4OthiFYOOfI7MyOwXCBLeJBUlX41V7xPBekKCH0+OTpPjT4jjEDrEzH sUq6BkYpuDTfpcnAoqMWyMnTLKPIUMC+DSDpswDkcTg86xTw/NpU4oFyfbP7ajxJOSuY nN7ejlbzkCDQDRejrWxAOIm7TQscrGeE/YrVRV3HsPfNQbgNSTVEM3H5Zpw8Pi/IY1nV yGhw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tTxcnEmW; 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-462ad0d286bsi136157771cf.185.2024.11.05.05.07.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:15 -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=tTxcnEmW; 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 1t8JFz-0003Qs-Gp; Tue, 05 Nov 2024 08:06:03 -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 1t8JFx-0003Mc-LT for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:01 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JFv-0002YQ-Tb for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:01 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43155afca99so39755345e9.1 for ; Tue, 05 Nov 2024 05:05:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811958; x=1731416758; 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=owZyMcyuMkQxG2xNbQN7m9vwX8uFO4GAfwfRH2jZDis=; b=tTxcnEmWdAewOUh5wvOKpkIMlfoSnSJv3+6oidwpJLIygkp9qeMQJ2zwtWOF2nrRRh gdNpSKUdM+EveBZHpaJlnSrlIMn0eE5p4Z1sgo44VGZuaQYL/K/NeX0gC8uBjAUOM+Uk thuaxsGGP0L/TkMAUsHrimZc6UBpLDc9WmYI8HX2C3Nk0FMMaxEDHjLfuJC5YpLTGvei hNFKtJ8x93QUs9puGcGSWl9g1BnRjcFzvX46LIVwyB3GXJ8UuDx0rYNIjlvtg17B9zbt Xa3cb2ei2gHzN6qk1fRkAliNINGvFhWtSTlGoo5+vBIGcledLcI7ArUIK03KceaecVK3 /rlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811958; x=1731416758; 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=owZyMcyuMkQxG2xNbQN7m9vwX8uFO4GAfwfRH2jZDis=; b=cBA3tyzB2NIocZhIaiq6agohc+uMi6nCcVqXFGcNLrx+TRntH7iJC0P2ohduATBZyb oujnQCt6HLAqtASqdYiBRyeHJo7x5N/8a8FZnTlA7IqdmnMqnuN03Bd8f4yWdt5f2cl+ sjWtX55cS/ph5/BASrI/LPWTiSbE5E72vQ0iBPOvd+tJwsjOho+A8n6iDY8sU1Y+oQxX JG9uGC2pMCCNUQveLqp5NP3EnTblWBmagRqFERxLSMMsV5YOu+S5Q9uSysnkZxRrxBsf Kue0OWWQ+KoMjDEMMATVCYCpmUF6zFPl+9yJG34ve3KNcUmrTcAIpnuFPFec5BrDHqSW 4Gnw== X-Gm-Message-State: AOJu0YwqkZHcsFXzNCBViAPi5fGnLsheK/Aw69W7eDXvfVpto+yMNdWm XcRhlHO07lBBYUmzxo9/fnEii0zla7lCGzpfoWfny2SmzjzIopU673AwB1Uodw9mg6GwJ3zYZoZ Ujxc= X-Received: by 2002:a05:600c:35c5:b0:431:9340:77e0 with SMTP id 5b1f17b1804b1-4327dab3f6cmr161052765e9.9.1730811957278; Tue, 05 Nov 2024 05:05:57 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e853esm223671995e9.8.2024.11.05.05.05.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:05:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 08/19] hw/microblaze: Propagate CPU endianness to microblaze_load_kernel() Date: Tue, 5 Nov 2024 14:04:20 +0100 Message-ID: <20241105130431.22564-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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=unavailable 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 Pass vCPU endianness as argument so we can load kernels with different endianness (different from the qemu-system-binary builtin one). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/microblaze/boot.h | 4 ++-- hw/microblaze/boot.c | 8 ++++---- hw/microblaze/petalogix_ml605_mmu.c | 2 +- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- hw/microblaze/xlnx-zynqmp-pmu.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/microblaze/boot.h b/hw/microblaze/boot.h index 5a8c2f79750..d179a551a69 100644 --- a/hw/microblaze/boot.h +++ b/hw/microblaze/boot.h @@ -2,8 +2,8 @@ #define MICROBLAZE_BOOT_H -void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, - uint32_t ramsize, +void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian, + hwaddr ddr_base, uint32_t ramsize, const char *initrd_filename, const char *dtb_filename, void (*machine_cpu_reset)(MicroBlazeCPU *)); diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index ed61e483ee8..3675489fa5b 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -114,8 +114,8 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr) return addr - 0x30000000LL; } -void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, - uint32_t ramsize, +void microblaze_load_kernel(MicroBlazeCPU *cpu, bool is_little_endian, + hwaddr ddr_base, uint32_t ramsize, const char *initrd_filename, const char *dtb_filename, void (*machine_cpu_reset)(MicroBlazeCPU *)) @@ -144,13 +144,13 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, /* Boots a kernel elf binary. */ kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &entry, NULL, &high, NULL, - TARGET_BIG_ENDIAN, EM_MICROBLAZE, 0, 0); + !is_little_endian, EM_MICROBLAZE, 0, 0); base32 = entry; if (base32 == 0xc0000000) { kernel_size = load_elf(kernel_filename, NULL, translate_kernel_address, NULL, &entry, NULL, NULL, NULL, - TARGET_BIG_ENDIAN, EM_MICROBLAZE, 0, 0); + !is_little_endian, EM_MICROBLAZE, 0, 0); } /* Always boot into physical ram. */ boot_info.bootstrap_pc = (uint32_t)entry; diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index 61e47d83988..d2b2109065d 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -204,7 +204,7 @@ petalogix_ml605_init(MachineState *machine) cpu->cfg.pvr_regs[5] = 0xc56be000; cpu->cfg.pvr_regs[10] = 0x0e000000; /* virtex 6 */ - microblaze_load_kernel(cpu, MEMORY_BASEADDR, ram_size, + microblaze_load_kernel(cpu, true, MEMORY_BASEADDR, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, NULL); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 6c0f5c6c651..8110be83715 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -129,7 +129,7 @@ petalogix_s3adsp1800_init(MachineState *machine) create_unimplemented_device("xps_gpio", GPIO_BASEADDR, 0x10000); - microblaze_load_kernel(cpu, ddr_base, ram_size, + microblaze_load_kernel(cpu, !TARGET_BIG_ENDIAN, ddr_base, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, NULL); diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c index 567aad47bfc..bdbf7328bf4 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -172,7 +172,7 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine) qdev_realize(DEVICE(pmu), NULL, &error_fatal); /* Load the kernel */ - microblaze_load_kernel(&pmu->cpu, XLNX_ZYNQMP_PMU_RAM_ADDR, + microblaze_load_kernel(&pmu->cpu, true, XLNX_ZYNQMP_PMU_RAM_ADDR, machine->ram_size, machine->initrd_filename, machine->dtb, From patchwork Tue Nov 5 13:04:21 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: 840804 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329521wry; Tue, 5 Nov 2024 05:07:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPn1QM7XQghjfX/c6d/jaE7pVPsBTtlC5WwRmndQaONSCukos12OzBvjQdKAKpyVMPzq58dg==@linaro.org X-Google-Smtp-Source: AGHT+IENzOJHanOEcFznU0yb06Oeu6U9ruXzwiU2FhpHy7fwYINzG4zjpNk0PUUye5ecRROujq7I X-Received: by 2002:a05:620a:2405:b0:7b1:56ce:d9e6 with SMTP id af79cd13be357-7b2fb9dc8e1mr2068751485a.64.1730812060344; Tue, 05 Nov 2024 05:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812060; cv=none; d=google.com; s=arc-20240605; b=L3Qr/7BSXolCmLweJtoiV91b1EvUSA9Owa2rUyalYLpbQku5PbaAAeT92ShnjKARLG 3T81emu8kWbVGRTtZ+uPpLxlUIJjw+oyCs19KSKBjOSckaW09vyW6uf2mt20prgWowdz cIZc6x8K8e7Q1BtasTpfb5nOzLxII9pHdbONDRSLdpByEaTFGoMR0B2aPuS3JsypZC2B zUFGvKiGR+tjRH6RYxVh80Z9L8h5phiaEqxQjta8C+Sieiwt4SNAge9Chs/MFTnaTZ3A m/GprDCx0fQqjPP16bUluRXlSoYfiPs5XYeMozF0I4RqrxABQ3lFV72ALi/eqx0SGCkG u4Yw== 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=kz42cmMFB8jc7GreGUWRF6XY9EJ0BnYu9J8zOkqLmVs=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=Hg1D0lajuZ//ZvratoHIZdmPuYXZOsfyi7V+hwashmAwMpFnl9TaZFKPes7x5fKDIO 7AAl0dLALYjfK6XJy9raQ0NbGYJZeJDe0vemKfazOtEHHs3A4qn09YCOqgQ5bW7GAkRE /fY2alICRztzSwiQlzMudxUgiuPBgkjGaG5RWhKTy1IDbCG4F78NsBm8qHg9cKyZMCup HCEOf8CQj0PYfiR48Wz2To5ag+FdJJ2nJUjmpBnDX2pON3y+L2fp/CpKe4M3ykNWNzM+ yI9n88gjOrJY8zCZMoQV8+DT9CCfHmq7OatUcihjoD0mWs7lk8esgifRFCwbvdA99mAJ iuOA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yvd+TdA2; 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-7b2f39f1f21si1329151985a.90.2024.11.05.05.07.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:40 -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=Yvd+TdA2; 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 1t8JGD-000468-6X; Tue, 05 Nov 2024 08:06:17 -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 1t8JG6-0003i1-L1 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:11 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JG3-0002Yx-JZ for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:10 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-37d41894a32so3137971f8f.1 for ; Tue, 05 Nov 2024 05:06:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811966; x=1731416766; 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=kz42cmMFB8jc7GreGUWRF6XY9EJ0BnYu9J8zOkqLmVs=; b=Yvd+TdA2OZ0srQfysSZYncN9VXypsibYwkQm5JWQvYAzvNW34b/6RMRLs0cGdi4hZE XYBQD0iVkBywoZqM9tPLtO3g2nxdFtRj95N4+uC7j8QNOrgk0lhYJ2bPO7J+33tPi25x BMC/+zZ1wDEge9ZgYys16PUE3/QtNXbVZ53QELIGQHNtPx6Pc8MZCBwQqrH1uehrL3j7 oHfP2TYk/WhlHvQG1dVGhxgyY9kOoscUF+kUuzjOA6UVST7jp8y9H0aIRBmvVT82OKm2 sdFM8b7NCT50nDWu8ghorYMn8fM7fZ/4ie5RKgH+ZFNFDGQvJKP56LfBsIeJLiTBqeiH 2W+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811966; x=1731416766; 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=kz42cmMFB8jc7GreGUWRF6XY9EJ0BnYu9J8zOkqLmVs=; b=xL9FYHtySyjyjzkKu8+qIq3WLE0tjcYCKrJ5wFKFPxd/ebiYeH1qLblLo8VyPg2URf JpixuYxwHGKTh2/19/JJH2iBX7YouAkn08v9yq1hDPdM3ttB9IpK5i38E+MesIZeERrN T94ViGiz3m6rDNOVyfMs8Dd2Hje0+YFicBGia1/3Tf9SCxQuNDfKjgH5l0eQkFDkiedA y0OtD8i3atSPk4Og75HXef7dCLrClc8ow6bItSiggftRRXrSI1H1PdC/3zi2HiOJ2HxK YyByx+oo7I8Uy26w4HDzwW5Hy1cyCUCmy9Fg3/ObmOYyWNaxWr81Kb39MVnaqjjRGuCp E/ig== X-Gm-Message-State: AOJu0YzJ0UstDKJgKKqmGvn23YZkO7fvFNpkGOFa90Fth9ZLwcT+XHNG s+/ZMFNG0qq/pbJRNhXtnV3B7cvOlGUtNes2YEWyxaJTfHlmzSDy7uOMSA+QbV3cs/nOZTtWqn3 OSEA= X-Received: by 2002:a05:6000:718:b0:37c:f561:1130 with SMTP id ffacd0b85a97d-381c149f129mr15229256f8f.18.1730811965862; Tue, 05 Nov 2024 05:06:05 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10b7bb7sm16338383f8f.3.2024.11.05.05.06.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:06:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 09/19] hw/intc/xilinx_intc: Only expect big-endian accesses Date: Tue, 5 Nov 2024 14:04:21 +0100 Message-ID: <20241105130431.22564-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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=unavailable 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 Per the datasheet (reference added in file header, p.9) 'Programming Model' -> 'Register Data Types and Organization': "The XPS INTC registers are read as big-endian data" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/intc/xilinx_intc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c index 1762b34564e..71f743a1f14 100644 --- a/hw/intc/xilinx_intc.c +++ b/hw/intc/xilinx_intc.c @@ -3,6 +3,9 @@ * * Copyright (c) 2009 Edgar E. Iglesias. * + * https://docs.amd.com/v/u/en-US/xps_intc + * DS572: LogiCORE IP XPS Interrupt Controller (v2.01a) + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -143,12 +146,20 @@ static void pic_write(void *opaque, hwaddr addr, static const MemoryRegionOps pic_ops = { .read = pic_read, .write = pic_write, - .endianness = DEVICE_NATIVE_ENDIAN, + /* The XPS INTC registers are read as big-endian data. */ + .endianness = DEVICE_BIG_ENDIAN, .impl = { .min_access_size = 4, .max_access_size = 4, }, .valid = { + /* + * All XPS INTC registers are accessed through the PLB interface. + * The base address for these registers is provided by the + * configuration parameter, C_BASEADDR. Each register is 32 bits + * although some bits may be unused and is accessed on a 4-byte + * boundary offset from the base address. + */ .min_access_size = 4, .max_access_size = 4, }, From patchwork Tue Nov 5 13:04:22 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: 840799 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp328881wry; Tue, 5 Nov 2024 05:06:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVk/HjPyFNN5dOdtZVSVOWH2vqnxirwlfF4Vfo8lAr1lO499oaUsrO07VXCLOhRFr8Dw3iFsA==@linaro.org X-Google-Smtp-Source: AGHT+IFmuS7E8llkDUGW18aeeLi3eLZJfg5uHNPYlrxrThOvdpphcNWlngZB5aDP6vUweTGMafeQ X-Received: by 2002:a05:620a:19a9:b0:7b1:3754:7d83 with SMTP id af79cd13be357-7b2f24c532amr2816852985a.9.1730811993639; Tue, 05 Nov 2024 05:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730811993; cv=none; d=google.com; s=arc-20240605; b=SB59XIq+LOEeQjqMVlPNTOxEc2C6/kgrKcMfODyrNJ/umtExSSwRDTZRx/NOB88ieG tUp9CuqdmIU/9yF0oYkMxuD02WMz30J1t1eorUU2mAiOhmd3GMcoKiTz7eEQgAE1FL3e uIe2MOOnLKMxkvk7rYH/qmksHJLEpfbkkFDA9g5N7Wxk5CYdJkOMobZdL6dO71IRrZFG dM83ok9Cyv5PW4f2jDxM1P0QLa7IdOxxhIWmOWOFxCeiBmp3kN76/MihwVlBXAx7bClG 9Jh3Yj+z9NFex5HOfbXjl4NYT8RN6WLa/1HPAXldSKvmIXaaZp0DZ4DPODnOUexoqDVS LYUA== 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=ofAZFiczDEOu9xgPawLxt48aoodtpVY0sVqQebDNA74=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=gurRDiTSHwAzCwxjxI1LnrZwLHFKFT6vmXb3i5fsdWqDpv6PPhNj61Vd6K6932OdAf blp3mUcxRCM54bHthqnxzMJToeFQNt73h1WdHKMwB5uhg0CZyh0Taxf8ln2YSRTgM5p1 /Ibu6Du3LVLf1FEt+oPFMU/s7EGl2iTkhE4MPRvJlm1NpwBP/UKHcFGJPQCes+gdRHHl QBoRQqai4Q+XtfrxPSxIJvWtFBxttBUsDyRrOu63CpfzUb7nOemTbFvnkTBPClqUMXh9 +/x2kgCMGgV1QjbLIsUNGlAzBIEpLT63lJA4tSbs+vtrx2edrM2r5Q3anau69aDgecJu Mz7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XeSG3ZtH; 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-7b2f3ad0d8csi1309588485a.695.2024.11.05.05.06.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:06:33 -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=XeSG3ZtH; 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 1t8JGL-0004kR-Dx; Tue, 05 Nov 2024 08:06:25 -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 1t8JGJ-0004cl-7M for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:23 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JGF-0002aX-5l for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:22 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43161c0068bso46044925e9.1 for ; Tue, 05 Nov 2024 05:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811977; x=1731416777; 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=ofAZFiczDEOu9xgPawLxt48aoodtpVY0sVqQebDNA74=; b=XeSG3ZtHsbO0F6EF9/mYVy/zZKIgeVbGJxqwyoPI5lmtzGuoVr3mAIg8c4LoiLyoHS +p8v4B9IXZJEGRxJq/YbjxFGpWQcE/wSHhc1iwvtFjLuGyg7h9lEMOrcSplz55+Zi6YR 5b6XpZUYsGoCGGArYTS5WWRGrR1VFQmDnlUnlB1Oc+0izmis8HiLmUElsmsConxNxa5j u7lbaeAPtdVHEcZCgH4IKYBxCEQMcGBT+FZlP1PhEDyc/YJFgCZ+KFzRnRhYGqe500zN vupHAQCNvokEnfHWo47KtrZSDcv+Del6bnJITDvQDlCuFUD0G/7r7y2PeDt4AaF6nXvT QjNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811977; x=1731416777; 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=ofAZFiczDEOu9xgPawLxt48aoodtpVY0sVqQebDNA74=; b=pOVL6ezWUqRcEhNnBfpKj5QvCoivQ/GN0cDt7gO7JZukNhBiFs3wsYynxcx520xWeQ e3qGu1T3+10ELmVDW6tiCTu1oC3CXGzIqGxqNtSP01J84NWUS6Q77x7jHDY+WKDMSveM l4ttcYOf9JIhxtExdnEKTPaRchKzW/r7Eon8TkEfryU2q4kRjyaQZ8Rgj0oBShPVGiiV /PmzajqYEWnrTk0bUIaNPPHGhso7NMWKAd8XjHBN+yO36ThfpffCmFqyVWKlwz/dkq9x okM0/jg6wMiRN6IbNzQ0mDpVi8kEW/4Yk4LD6heqBKT58XgTi8JZp6coU4dUxP45w415 VUYw== X-Gm-Message-State: AOJu0Yx0DN98CAs9Ax5OO3HownTg6TGZ6Wth7lI4AEUjAJ3UcKyWqxy0 i4uD1dKzhp+jrKXeTYhyefFgAJTu47xvO288EPzgOEU5dZkhiUeBf6IRyJoYwlmrFLja4R5Nakf kHAQ= X-Received: by 2002:a05:600c:1c15:b0:42f:8fcd:486c with SMTP id 5b1f17b1804b1-43283297a37mr131910645e9.33.1730811977415; Tue, 05 Nov 2024 05:06:17 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d5e7c8bsm193062535e9.26.2024.11.05.05.06.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:06:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 10/19] hw/timer/xilinx_timer: Only expect big-endian accesses Date: Tue, 5 Nov 2024 14:04:22 +0100 Message-ID: <20241105130431.22564-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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=unavailable 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 Per the datasheet (reference added in file header, p.10): 'Register Data Types and Organization': "The XPS Timer/Counter registers are organized as big-endian data." Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/timer/xilinx_timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 28ac95edea1..3e272c8bb39 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -3,6 +3,9 @@ * * Copyright (c) 2009 Edgar E. Iglesias. * + * DS573: https://docs.amd.com/v/u/en-US/xps_timer + * LogiCORE IP XPS Timer/Counter (v1.02a) + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -192,7 +195,7 @@ timer_write(void *opaque, hwaddr addr, static const MemoryRegionOps timer_ops = { .read = timer_read, .write = timer_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, .impl = { .min_access_size = 4, .max_access_size = 4, From patchwork Tue Nov 5 13:04:23 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: 840806 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329680wry; Tue, 5 Nov 2024 05:07:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXXSefMLkxF+gNIYK+7++3LeOVjBBufESGKD7lRGGQi2y1AE8FV1g9AvpJhXzGZpiTPHxGieg==@linaro.org X-Google-Smtp-Source: AGHT+IHO18XNHCxQN+IB9GQOenWj2ohYls/N6ZxZMEXHH7NXgmyfReS/LO7o6fUWjneBg+FzvGB0 X-Received: by 2002:ac8:7d8e:0:b0:460:a367:5d5f with SMTP id d75a77b69052e-461717c96a5mr324481451cf.59.1730812076857; Tue, 05 Nov 2024 05:07:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812076; cv=none; d=google.com; s=arc-20240605; b=jxObPTPabfVpoz3Vs+6L5Yhkvgx4qeybbSNa4XCcN0J52aNBjKgmXxDH3LdVPmWdGI MrcpTrmAalFg2kYrcRZufVDCPKXKMS2dH59e+Zim6mQLqSk5doU/3vzkX9fJ1wa9rZIv f2T23y3T3cyE8H1Sq6udFM4Wfw0FeLSWLPSu7hezetuf0I/5Cu4Ftfusdwy66htf0+Y6 LffkGsY4NG4FBxg5wGpbaGgMtId4JZrtVSyaxVjsS7NfWWyf6NUHXv5aPf9m69rY3jlf yuBU14kOWDBrUk4l77FJcIaAcKoxRUqX6TiBc8aKvYl7v1nOzXBEHBtKszWwsLt1aYen A9pg== 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=wFGgkm5n4LzlLdg21RwAQ7vz4q2WxQLn0Ned6IA69o0=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=c2mDGxcDQLlccUWm5Q5Q/fEgEchYGEKkFbBk0kZz3e7CM/L9AsRilQ3fEcpQ4Jw2rS 6ATKpJOXm+qJBmO4I2rH3XUD5gUGnsw88IntwA3j/hgINN2cwjvUkEg7FJadgaJS36R2 iTq5LfQpYtiWYknuuM+bAJ4Z3PWYDA5+lcGADUnl23jELIoY/5VZroA+h/wxHroRHu9Y BPH1RojCZGFdxn3woeB0bO1ci07eMIGPiV6zVRuXgwriyypLJmnSESWxplqUa/a+dvPQ awmtHbJm8XyJeBCMVZEknySr4hdgQsIEyrynjR9DIH9Md25/1V031Tunrofg3iWT9Hxu pyTw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qJ30FYtU; 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-462ad0b2ee9si142316311cf.51.2024.11.05.05.07.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:56 -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=qJ30FYtU; 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 1t8JGW-0005SV-BM; Tue, 05 Nov 2024 08:06:36 -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 1t8JGR-0005Bm-6l for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:31 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JGP-0002c3-I1 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:30 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-539e8607c2aso5924211e87.3 for ; Tue, 05 Nov 2024 05:06:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811986; x=1731416786; 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=wFGgkm5n4LzlLdg21RwAQ7vz4q2WxQLn0Ned6IA69o0=; b=qJ30FYtUzFL7E65u+UymvYD3rWqD31n/DVReb78dLiCq1KhYiD5mNN0KOcJKhUOard xqdpJVN0y5D3GViSXrdWvHPj5FXMb3sPEUZTdU2YBSAEzByseK8P2LZN7qaxCDwxBbUt 9FzkwGh1pE+yR+yvXEvEUgoRClf+rnieUl6dOsyg3ayh1fEmjsCfN3YXVRgZa/5AZ1Vo 83ek2w3Jl4tUu4Oe6onPAP7dSwrh3uwu9KexRViQfwCWc0K85EmOaijLM3ZrjlSnTbTy WTlUcXxOLtc8WjLq151n6OJK0wF1F2uUetO1RCiA9HfRgQJRg019lzmI2Qo5oKQrgspd glRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811986; x=1731416786; 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=wFGgkm5n4LzlLdg21RwAQ7vz4q2WxQLn0Ned6IA69o0=; b=gz4c8/DhNxVigkXW0djFNqgXfDxkCJ75MViQEtQXY9MdvZVIceVwTLCIE+2mGnRUkl cDb0QpclnJSOWK/ggEvCjQXbyfJfi+ggV3Afsluv8JL1hCes/IFsNn6hO31Wd4DKQdOv j7Kyaf3g5TffvlXCug2QhWiqX+554eueyOJOPlM3p23cSfHBe6OP8xh2fX+td3Nl3sHh 2063IwwQHbhqHMJt23caobKvmS9WP0Fm25B18wUz56KNJ/WzjoXeUJLrAlX1v1A8tVox yrANqEGipVzge+MW+JbGdOyuusCiCYnMim8kC8LXbdlHiHnROMNHbayidkYoBtnbPxwA lNcQ== X-Gm-Message-State: AOJu0YxJ+FJKyrbd6rIhZqvoJQwfH/TDLSUsYYdMWCknMnFNT2GN8O9b ihGTwPlnD6xwhctK5tEs7zU9nC9/oDfnZR8HRTBHlb1HB7ekNsl2Hz8t7IQ3FYlf/3MpZYOPHvq k9c4= X-Received: by 2002:a05:6512:1152:b0:539:ee0d:2bb4 with SMTP id 2adb3069b0e04-53b3491cb3cmr18858667e87.45.1730811986405; Tue, 05 Nov 2024 05:06:26 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c113e5e3sm16241441f8f.82.2024.11.05.05.06.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:06:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 11/19] hw/timer/xilinx_timer: Allow down to 8-bit memory access Date: Tue, 5 Nov 2024 14:04:23 +0100 Message-ID: <20241105130431.22564-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.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=unavailable 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 Allow down to 8-bit access, per the datasheet (reference added in previous commit): "Timer Counter registers are accessed as one of the following types: • Byte (8 bits) • Half word (2 bytes) • Word (4 bytes)" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Anton Johansson --- hw/timer/xilinx_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 3e272c8bb39..e9498fc7eec 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -201,7 +201,7 @@ static const MemoryRegionOps timer_ops = { .max_access_size = 4, }, .valid = { - .min_access_size = 4, + .min_access_size = 1, .max_access_size = 4, }, }; From patchwork Tue Nov 5 13:04:24 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: 840800 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329280wry; Tue, 5 Nov 2024 05:07:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVOf8xzJeBCtZtanvihpqxFBRIXB2VydTa0BZxH00C0jwdNruG4BW6QgGUCtFKKvQDvAHaFXQ==@linaro.org X-Google-Smtp-Source: AGHT+IGubH9pfYBNSPxPKw9gW87kd18/hpbxBjNMupAhiJKnkOtvpOfOYt6P628zroWI0hXECwVA X-Received: by 2002:a05:622a:50d:b0:458:3871:e062 with SMTP id d75a77b69052e-4613c039f1fmr551067391cf.34.1730812033082; Tue, 05 Nov 2024 05:07:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812033; cv=none; d=google.com; s=arc-20240605; b=C7BJRx3RQvAD5Bot/B2TZbvUBo0sKhYvxutadgGQYBLLrSoq02xHgB20Bto8uC9T3B z5lCam3qLh5lS3A7g/d+3Gyyx+J2UmQMLRFEiXnmw2j+hUsp4xmxc3n/N8NzH4pWfDgj xPsj0FSrvAD6/CaEMbyJJf3QkLT3UY6w0fZE0jz4P7BPrbEqYpvcNLgqIUj4FjibFbCN jsjdTsQausHAL3KRK6K0ra9poAmx5uyIDC37oqRP8KtGukyMw2hmvLwvcRkbilJSMr4H PWh6wbbfTVgqmLWHwaRojSmg7UPhmZ3BjIBKuNYUrhiv+JNPlo07DiXx1VirTC4QtO/D HUyg== 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=8o7w6mm+R/wQGpGGVYXrXktqPkxmlHPhQB9iwAgMFYc=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=QbJYGNclS2sh1m/7oXbJusGVXkDESDYLRlt9Xz9PUh9HgbxfCiIl/v13XdaHTehpEe ovWdT1RuNdfXmY36sFAvA9B9p1BC7CaxGI2zcYWRDnzUp0MunG67wKnvexSBzQMdRed6 XBjf7B/Yf7v5J5YIO6XhV+lbEmfvOiUD99IhIPzQiHwLsqN3f6rTBsyy7OcWk6HQEsGE nX/cJqQTS9EP3Gaw0IKgyRz81PQkR+BssYHdDemzVKbVBvll5iZthys+J+Sao0tPAhL2 8TJaxUlHvdif2fsINZ/YZUiAChpBCSFBdamUsK/rJ8lEq6ekOnJpLDH/sYsoqikw0NkD lRBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MxAp+1eh; 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-462ad272aa2si129896561cf.677.2024.11.05.05.07.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:13 -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=MxAp+1eh; 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 1t8JGl-00065y-M3; Tue, 05 Nov 2024 08:06:51 -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 1t8JGa-0005fE-A6 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:42 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JGY-0002d2-A9 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:40 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4316a44d1bbso46496155e9.3 for ; Tue, 05 Nov 2024 05:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730811996; x=1731416796; 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=8o7w6mm+R/wQGpGGVYXrXktqPkxmlHPhQB9iwAgMFYc=; b=MxAp+1ehdfasvlGIbeGzzUdYsHvm29DUahviUlIv/AL3BUtqUlsUmQkGAAf/V9fbuV 2F/qKMIQ4qT692ob6zlwFdhBcc/9UwiBRbaThXMnmCQVZg9SFctb+ypUwdtpGKnn4/Bi CMajKhcPq8XV0PMZejRvmybMiyp0OH25G0449MeMaDzJPCiQzOBCBtGMTHwZ6D6j/2Nk wQiFMkS5JzFaLJDgQudsryJRV8iL/71BqLFAZtZlRVQLK+JV+CvKRiERpnDSrgNsl6JO HWKqUi3g1upvQj39rVv+Y4eB7NwsvjOD8zFREY1Mq9TdN4btNHQmWiO9Zv883IUJuV45 2J2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730811996; x=1731416796; 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=8o7w6mm+R/wQGpGGVYXrXktqPkxmlHPhQB9iwAgMFYc=; b=krzmkqeHqOz3f6l/eD6xYFVjwqDPervCoYHdePLkkBr5N77zrdoWpAiaKfy68nXH58 eiig2WtyzV8V/ZAn1GAw0dRzvYKTgkWHgm9TpT5otesNHCXM70CQZkIXNLT+a9Vu7f4k 77vzRsCE5NortigHrAkT1DmsFSA2dlzdDPkokHN812sX1OSqDMnd2Bsr76+QKavOzTIG VRgRChOpug2Pdj+xZ1+K/PWqUyRbskIlqSWR5LXl1eksxXGny4OmzO9Rs+ncenOiyb0h cKDPyUJDkEoxVCIZQLmAf4igkhxytvvkZuPncEyEYWz0mAllAIoVSwLX3lcV0mfi9V1J CQ9g== X-Gm-Message-State: AOJu0YyFFKVHPqAugrGm0HyMclj9tUeBoMz0F2jBoUEnkD66nltJcKVA pKqIyVYuVTh3Q4TiruPENO+6YZPyJqs20BgC/lRCmQJLumXHDcuOqkJT2E8jYPbn6oJuXnZNXJ5 mtDk= X-Received: by 2002:a05:600c:3507:b0:431:4e3f:9dee with SMTP id 5b1f17b1804b1-4327b6f46d3mr165594015e9.4.1730811995992; Tue, 05 Nov 2024 05:06:35 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d5c65absm185489175e9.16.2024.11.05.05.06.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:06:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 12/19] hw/net/xilinx_ethlite: Only expect big-endian accesses Date: Tue, 5 Nov 2024 14:04:24 +0100 Message-ID: <20241105130431.22564-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 The Xilinx 'ethlite' device was added in commit b43848a100 ("xilinx: Add ethlite emulation"), being only built back then for a big-endian MicroBlaze target (see commit 72b675caac "microblaze: Hook into the build-system"). I/O endianness access was then clarified in commit d48751ed4f ("xilinx-ethlite: Simplify byteswapping to/from brams"). Here the 'fix' was to use tswap32(). Since the machine was built as big-endian target, tswap32() use means the fix was for a little endian host. While the datasheet (reference added in file header) is not precise about it, we interpret such change as the device expects accesses in big-endian order. Besides, this is what other Xilinx/MicroBlaze devices use (see the 3 previous commits). Correct the MemoryRegionOps endianness. Add a 'access-little-endian' property, so if the bus access expect little-endian order we swap the values. Replace the tswap32() calls accordingly. Set the property on the single machine using this device. Signed-off-by: Philippe Mathieu-Daudé --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + hw/net/xilinx_ethlite.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 8110be83715..8407dbee12a 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -123,6 +123,7 @@ petalogix_s3adsp1800_init(MachineState *machine) qemu_configure_nic_device(dev, true, NULL); qdev_prop_set_uint32(dev, "tx-ping-pong", 0); qdev_prop_set_uint32(dev, "rx-ping-pong", 0); + qdev_prop_set_bit(dev, "access-little-endian", !TARGET_BIG_ENDIAN); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, ETHLITE_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq[ETHLITE_IRQ]); diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index ede7c172748..44ef11ebf89 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -3,6 +3,9 @@ * * Copyright (c) 2009 Edgar E. Iglesias. * + * DS580: https://docs.amd.com/v/u/en-US/xps_ethernetlite + * LogiCORE IP XPS Ethernet Lite Media Access Controller + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -25,7 +28,6 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qom/object.h" -#include "exec/tswap.h" #include "hw/sysbus.h" #include "hw/irq.h" #include "hw/qdev-properties.h" @@ -65,6 +67,7 @@ struct xlx_ethlite NICState *nic; NICConf conf; + bool access_little_endian; uint32_t c_tx_pingpong; uint32_t c_rx_pingpong; unsigned int txbuf; @@ -103,9 +106,12 @@ eth_read(void *opaque, hwaddr addr, unsigned int size) break; default: - r = tswap32(s->regs[addr]); + r = s->regs[addr]; break; } + if (s->access_little_endian) { + bswap32s(&r); + } return r; } @@ -117,6 +123,10 @@ eth_write(void *opaque, hwaddr addr, unsigned int base = 0; uint32_t value = val64; + if (s->access_little_endian) { + bswap32s(&value); + } + addr >>= 2; switch (addr) { @@ -161,7 +171,7 @@ eth_write(void *opaque, hwaddr addr, break; default: - s->regs[addr] = tswap32(value); + s->regs[addr] = value; break; } } @@ -169,7 +179,7 @@ eth_write(void *opaque, hwaddr addr, static const MemoryRegionOps eth_ops = { .read = eth_read, .write = eth_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_BIG_ENDIAN, .impl = { .min_access_size = 4, .max_access_size = 4, @@ -256,6 +266,8 @@ static void xilinx_ethlite_init(Object *obj) } static Property xilinx_ethlite_properties[] = { + DEFINE_PROP_BOOL("access-little-endian", struct xlx_ethlite, + access_little_endian, false), DEFINE_PROP_UINT32("tx-ping-pong", struct xlx_ethlite, c_tx_pingpong, 1), DEFINE_PROP_UINT32("rx-ping-pong", struct xlx_ethlite, c_rx_pingpong, 1), DEFINE_NIC_PROPERTIES(struct xlx_ethlite, conf), From patchwork Tue Nov 5 13:04:25 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: 840808 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329897wry; Tue, 5 Nov 2024 05:08:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXu4jEYUdDaYXWx1o2Fq3cQrWVm8Y4xYJuIgy2UJTEgO3xrKhfKAKJdaKD+qMFJPT/fmebuDQ==@linaro.org X-Google-Smtp-Source: AGHT+IEkc+z4/g9sGOBspv246Cy1ngUaiPgtq5/Ied1FfE7C2ZlnqD5UUTs4m4BinoSfiBlxc44q X-Received: by 2002:a05:620a:284a:b0:7b1:2016:7775 with SMTP id af79cd13be357-7b2f24f0d83mr2904010685a.36.1730812099568; Tue, 05 Nov 2024 05:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812099; cv=none; d=google.com; s=arc-20240605; b=KQChjE4xHxyZI7xg0uLtil1CsK6A9RzUH20kpZBx7vVpQwnWF1pZNyZ1MkNziERsw6 8E8Smy4X56bSETrf3dW/8D7MA+TdZYCxRtad439+w+vaXMXlQWaHufuXvO5NjwltLM8v fCoGt2/DKq0jyfHP2RPr7TE8YD8lehk2RamPnvgbh9AGCt9UxTqOwBmPXXqJSWOmq36n ejzJzFLxOQQdcpWMaL2tMKfklyzJvJAXtlJZ4bYV3pHfwzD+jX4BVsc3LUFH2FugnHzB 5SXDq0/9ZJPpEd0F/wlqm1RVY69/wLPMfSpIkPAmolM+9EWIGfjEm53dnFvWMiq6Xcg0 M2Wg== 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=2HA1iYoQhge6HN2CHRy7t3YqB3wWBO4DLLl9qjbY1CM=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=DiqOSxRqQFhT/7mBxBSD+0aGsCSV7fp5dUp+GUpZaxYwxRLVmMHSuAy+YbLlRhpBnB IgXc1sAlwqGyvb4XxemCHzQj56rjHAzEKQ4/rV18o7MJHzJf6rgTHN09qS2X/EXoc7kQ IA6IXMmankOOEl6tH/p5Q8cyDm4Yy0PXUbYFvlgTCIlcjOipDEivNWSQQsSpcQ3Wv2Fn K0i+6jvi24/1g/9XC33EJlcW2Gn+ULJ+Ek/rmbhZ4ovaFmRQMGymq9I6f8ILoevqX/nk lptiNCNvGGGJajQUr9zSFF8DEVIg/A5geaaRuYIrs4TXhtfomiVuaFkni4iKxe/NtQQN 6N5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lpo9L8Rk; 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-7b2f3a0315esi1345784385a.165.2024.11.05.05.08.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:08:19 -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=Lpo9L8Rk; 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 1t8JGy-0006Om-B4; Tue, 05 Nov 2024 08:07:06 -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 1t8JGk-00064L-LF for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:50 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JGh-0002ec-Mw for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:06:50 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-37d4ac91d97so4578004f8f.2 for ; Tue, 05 Nov 2024 05:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812006; x=1731416806; 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=2HA1iYoQhge6HN2CHRy7t3YqB3wWBO4DLLl9qjbY1CM=; b=Lpo9L8RkA4YYSK/qvcTHeX06Up0oGGU189jK6IG9s3BkMb+IThDvaeAjn5RfdLUGKN f2VXhFE3fVZDYu3IYU5QqAojUS70baIaahc/IwwM1lfS807lC84wBEDmLI33X9unujm/ Fg1oihOaT6YkHb2nIlvv+VTfB6xWvylHbwrJyFJZTGE4jZ4bNyIjcSdDy/qKIYllDOj4 yq8W/rkUeLt3mD49yXVnJl2g5Gs/L2H/LzKz0eyOLBdM7/yLgBW3KiF3yTfWlBWRzpNe qqaIFNWhwOMJ52/tHePpYvBPTllS6X4kB3xl8lCovgNFN0KGIwboagxCANvq/kZ9cRxc gpiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812006; x=1731416806; 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=2HA1iYoQhge6HN2CHRy7t3YqB3wWBO4DLLl9qjbY1CM=; b=BB0v0nfLoJrpBTuzP9eH5aZQWckwK/inN/TgPjZSreUZiVA9kldvzMstODpdzcffac 7D7BiTrkOS+XOl0mBgMLRBH99+IrWgybzoEqDYnYxMDJnXNmbh8k02yCjIdXNWnC4Opz ZDQD/GwptjTQcrXMauotDSgIoZWlWA03lRz5IY+u2puJfzAfBfY83j8HMxTbEl6xcGfu jTzAX4tfuYiv0/7X30nXcNBs6lwbBAF1SPtvVVPbC46LXAAyVUmE3FoJLIz6VVriqDfI /ZI/vscVK+uRF3l5rA1om8nxLeu3z7pKIaDB+YK0WCW1F1qKPiWvLYaw0LSzoCLzGdO6 1LpQ== X-Gm-Message-State: AOJu0YxidGYEAKlYlTsPqRrw7t28VQe0kISJWhLFzF36QRrRpes+hjfY /vegvHVhH4HU6Yx43CkMxkq6/q3fA677DM2nPRxylD6BQCgxjXmiGyD6wl26HWawi4yGPTkQRkm vS0M= X-Received: by 2002:a05:6000:1a8c:b0:37d:5042:c8de with SMTP id ffacd0b85a97d-381c7a5d4eemr16315520f8f.22.1730812005816; Tue, 05 Nov 2024 05:06:45 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10d4d1fsm16076930f8f.38.2024.11.05.05.06.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:06:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 13/19] target/microblaze: Explode MO_TExx -> MO_TE | MO_xx Date: Tue, 5 Nov 2024 14:04:25 +0100 Message-ID: <20241105130431.22564-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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=unavailable 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 Extract the implicit MO_TE definition in order to replace it by runtime variable in the next commit. Mechanical change using: $ for n in UW UL UQ UO SW SL SQ; do \ sed -i -e "s/MO_TE$n/MO_TE | MO_$n/" \ $(git grep -l MO_TE$n target/microblaze); \ done Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/translate.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 4beaf69e76a..4c25b1e4383 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -779,13 +779,13 @@ static bool trans_lbui(DisasContext *dc, arg_typeb *arg) static bool trans_lhu(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TEUW, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); } static bool trans_lhur(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TEUW, dc->mem_index, true); + return do_load(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, true); } static bool trans_lhuea(DisasContext *dc, arg_typea *arg) @@ -797,26 +797,26 @@ static bool trans_lhuea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TEUW, MMU_NOMMU_IDX, false); + return do_load(dc, arg->rd, addr, MO_TE | MO_UW, MMU_NOMMU_IDX, false); #endif } static bool trans_lhui(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_load(dc, arg->rd, addr, MO_TEUW, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); } static bool trans_lw(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TEUL, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); } static bool trans_lwr(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TEUL, dc->mem_index, true); + return do_load(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, true); } static bool trans_lwea(DisasContext *dc, arg_typea *arg) @@ -828,14 +828,14 @@ static bool trans_lwea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TEUL, MMU_NOMMU_IDX, false); + return do_load(dc, arg->rd, addr, MO_TE | MO_UL, MMU_NOMMU_IDX, false); #endif } static bool trans_lwi(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_load(dc, arg->rd, addr, MO_TEUL, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); } static bool trans_lwx(DisasContext *dc, arg_typea *arg) @@ -845,7 +845,7 @@ static bool trans_lwx(DisasContext *dc, arg_typea *arg) /* lwx does not throw unaligned access errors, so force alignment */ tcg_gen_andi_tl(addr, addr, ~3); - tcg_gen_qemu_ld_i32(cpu_res_val, addr, dc->mem_index, MO_TEUL); + tcg_gen_qemu_ld_i32(cpu_res_val, addr, dc->mem_index, MO_TE | MO_UL); tcg_gen_mov_tl(cpu_res_addr, addr); if (arg->rd) { @@ -929,13 +929,13 @@ static bool trans_sbi(DisasContext *dc, arg_typeb *arg) static bool trans_sh(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TEUW, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); } static bool trans_shr(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TEUW, dc->mem_index, true); + return do_store(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, true); } static bool trans_shea(DisasContext *dc, arg_typea *arg) @@ -947,26 +947,26 @@ static bool trans_shea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TEUW, MMU_NOMMU_IDX, false); + return do_store(dc, arg->rd, addr, MO_TE | MO_UW, MMU_NOMMU_IDX, false); #endif } static bool trans_shi(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_store(dc, arg->rd, addr, MO_TEUW, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); } static bool trans_sw(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TEUL, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); } static bool trans_swr(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TEUL, dc->mem_index, true); + return do_store(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, true); } static bool trans_swea(DisasContext *dc, arg_typea *arg) @@ -978,14 +978,14 @@ static bool trans_swea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TEUL, MMU_NOMMU_IDX, false); + return do_store(dc, arg->rd, addr, MO_TE | MO_UL, MMU_NOMMU_IDX, false); #endif } static bool trans_swi(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_store(dc, arg->rd, addr, MO_TEUL, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); } static bool trans_swx(DisasContext *dc, arg_typea *arg) @@ -1014,7 +1014,7 @@ static bool trans_swx(DisasContext *dc, arg_typea *arg) tcg_gen_atomic_cmpxchg_i32(tval, cpu_res_addr, cpu_res_val, reg_for_write(dc, arg->rd), - dc->mem_index, MO_TEUL); + dc->mem_index, MO_TE | MO_UL); tcg_gen_brcond_i32(TCG_COND_NE, cpu_res_val, tval, swx_fail); From patchwork Tue Nov 5 13:04:26 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: 840803 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329451wry; Tue, 5 Nov 2024 05:07:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU108gJuhbHbNV/aeQhJo7+mRgfswGy31H6uKNiVQV3oRL9ICQJ7XH/C1nmR7h9cylUF5yOKg==@linaro.org X-Google-Smtp-Source: AGHT+IFgDRyU8smUR9Jl0zm6o7bnLgiuBHH0KMACb7gbv2mENDqo85vwVfPq4WMvbYA5xAZIZXfh X-Received: by 2002:a05:6214:458a:b0:6d3:44b5:a6ca with SMTP id 6a1803df08f44-6d354275ddamr301672946d6.6.1730812051541; Tue, 05 Nov 2024 05:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812051; cv=none; d=google.com; s=arc-20240605; b=ZnTAn4un9CPF1u1xHFmNjTkIPPIWlmmvGz8WCya3JkeZCirRhjduK8qB0SIJlb4PHu 2zuv/n5XxbSmq88k7DFbc2CaPDQFyC4qgtTRwhqYHC3QevVDV6LRcaEGOjKOHVCzzYTq aZXFWY+lNUtwPshb1IThvDOmZuILU17WqP8nsc59YpzL1r8yqPC8FfuFNqWiDbHdqX8H 8cz85otrqGQ2VTbupflDr/WERCwp696MU/7JtcA3TyouzjnPnC8Y8SRpoE+Qvjy1NY7+ gIAwUns7aD2BA/Ewep6uKf5kwkcGB2ucNX0pnZfreupaB3Gd7H85yVI15TgmsLcnSnK1 lPgQ== 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=HyHIXr57KAvT5hBpjPnN9Ar0+PrPE9jeXHrn1Pe661M=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=JH8BE9csuw/r2YvTxCANhYDuyrkpgya1kPDHSZNd5/VNz1XjFClOkHBVxINp18QGq9 wo8OAfsZjxonPuCQFc0zPtjSdLNtoAlQkk3WY7KAZC2T2ag8WoWcaK5mvJf40YtX0t3B oZiEsE5/gQhBKx2eTj0J9HGFiR1SGacrE0LchtcKulwNo1PG+R7qSOY+1+bp7rf1GBFx K9hYdpgyugdbUrGqHbmn0aCzM4qaxbOKN+zeBLYt90VPEyk94nL05rf3iqRC/IgxYtdD qmTX2c5RAL8AZlLiqEc6V9gIt2E+laDwhEUgcL1A+/MmuyQf7d8ng+jE39Mm0xMeXslk 2a6w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sq3D5JRI; 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-6d35416af90si134021566d6.228.2024.11.05.05.07.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:31 -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=Sq3D5JRI; 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 1t8JHD-0006t0-Af; Tue, 05 Nov 2024 08:07:19 -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 1t8JGw-0006Ux-Hw for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:05 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JGs-0002fU-HX for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:02 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37d70df0b1aso3496430f8f.3 for ; Tue, 05 Nov 2024 05:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812015; x=1731416815; 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=HyHIXr57KAvT5hBpjPnN9Ar0+PrPE9jeXHrn1Pe661M=; b=Sq3D5JRIQyVTZIYsnK5pKoTFj5Sv/LE5CCAuJ0AoNOfr8oze+0DcNs7LX0B8+QM+dy T1UyLXuSI9zICSfiRJzzFZklVz52gZnR4lX0OtaeRFuWQ3giJFa93v3PAtzhUlyHEJ8K HUizoKR/Euh2edSospuzeVPpD9wMMp0botVgdfw14FC9/c+RVNnmqkI+++lZ5WlHjH8O RW5GeWjbXoyYGzrzwDIrKbO5H6M0Ro0NipJMc3hEb2lvfdxW1JSB41OlyQfjPv728NGm 1QHd/LhXPEmCyJwz/NQX2WenI/0XIhzDDMv18SmKTc+/LJvCOu1pe25rCfkIAX4hDY/d M5Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812015; x=1731416815; 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=HyHIXr57KAvT5hBpjPnN9Ar0+PrPE9jeXHrn1Pe661M=; b=nTnk33mI1dnXJ3DIvGPotzvnq5/4uk3jvdXLFe/f59uKaX9RqG4siHrpa72XyVKETy 9g9ep4begoTS8GH4oa/oDTWGEZYjEBuUPE08PoNg8XmZsN7vJOk3EfjNiDMp9KMoHAzB pxpxA5FGf7MnCvoTDi2t187SwbLNJDIoX1jWkkbkDqOqHHdZp2dYWF/k7tVmHDLPNKWO yUtIRBGNjzQrZKYT7A6shOnZK7UTV5gZJkE663JqBzvVWdU+5R1jNVvvEAEJJTYv2Jms /Nt9yZNCG5FgO8uGaYOb1PD4vwaqHFCJtuiwWyCtRQN5uDE0kN05hZczNC8mGUBFBVy4 eLOQ== X-Gm-Message-State: AOJu0Yw9+qMqFt0vMQsEeNzAPsvRmLM9+TfW7yIwX8SNAH0JqWb/V9f3 NXOD3dZtgDqTdHFUT/NpeN+I76GRkHcUX1UcT+ghQOwHLU3RvU0pSF9KhkMltpaceaY5NlN/GtC f2b0= X-Received: by 2002:adf:fc8b:0:b0:37d:5026:f787 with SMTP id ffacd0b85a97d-380611e10f1mr23213351f8f.38.1730812015049; Tue, 05 Nov 2024 05:06:55 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c113e51csm16313213f8f.79.2024.11.05.05.06.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:06:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 14/19] target/microblaze: Set MO_TE once in do_load() / do_store() Date: Tue, 5 Nov 2024 14:04:26 +0100 Message-ID: <20241105130431.22564-15-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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 All callers of do_load() / do_store() set MO_TE flag. Set it once in the callees. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/translate.c | 36 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 4c25b1e4383..86f3c196189 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -712,6 +712,8 @@ static bool do_load(DisasContext *dc, int rd, TCGv addr, MemOp mop, { MemOp size = mop & MO_SIZE; + mop |= MO_TE; + /* * When doing reverse accesses we need to do two things. * @@ -779,13 +781,13 @@ static bool trans_lbui(DisasContext *dc, arg_typeb *arg) static bool trans_lhu(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_UW, dc->mem_index, false); } static bool trans_lhur(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, true); + return do_load(dc, arg->rd, addr, MO_UW, dc->mem_index, true); } static bool trans_lhuea(DisasContext *dc, arg_typea *arg) @@ -797,26 +799,26 @@ static bool trans_lhuea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TE | MO_UW, MMU_NOMMU_IDX, false); + return do_load(dc, arg->rd, addr, MO_UW, MMU_NOMMU_IDX, false); #endif } static bool trans_lhui(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_load(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_UW, dc->mem_index, false); } static bool trans_lw(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_UL, dc->mem_index, false); } static bool trans_lwr(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, true); + return do_load(dc, arg->rd, addr, MO_UL, dc->mem_index, true); } static bool trans_lwea(DisasContext *dc, arg_typea *arg) @@ -828,14 +830,14 @@ static bool trans_lwea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_load(dc, arg->rd, addr, MO_TE | MO_UL, MMU_NOMMU_IDX, false); + return do_load(dc, arg->rd, addr, MO_UL, MMU_NOMMU_IDX, false); #endif } static bool trans_lwi(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_load(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); + return do_load(dc, arg->rd, addr, MO_UL, dc->mem_index, false); } static bool trans_lwx(DisasContext *dc, arg_typea *arg) @@ -862,6 +864,8 @@ static bool do_store(DisasContext *dc, int rd, TCGv addr, MemOp mop, { MemOp size = mop & MO_SIZE; + mop |= MO_TE; + /* * When doing reverse accesses we need to do two things. * @@ -929,13 +933,13 @@ static bool trans_sbi(DisasContext *dc, arg_typeb *arg) static bool trans_sh(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_UW, dc->mem_index, false); } static bool trans_shr(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, true); + return do_store(dc, arg->rd, addr, MO_UW, dc->mem_index, true); } static bool trans_shea(DisasContext *dc, arg_typea *arg) @@ -947,26 +951,26 @@ static bool trans_shea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TE | MO_UW, MMU_NOMMU_IDX, false); + return do_store(dc, arg->rd, addr, MO_UW, MMU_NOMMU_IDX, false); #endif } static bool trans_shi(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_store(dc, arg->rd, addr, MO_TE | MO_UW, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_UW, dc->mem_index, false); } static bool trans_sw(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_UL, dc->mem_index, false); } static bool trans_swr(DisasContext *dc, arg_typea *arg) { TCGv addr = compute_ldst_addr_typea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, true); + return do_store(dc, arg->rd, addr, MO_UL, dc->mem_index, true); } static bool trans_swea(DisasContext *dc, arg_typea *arg) @@ -978,14 +982,14 @@ static bool trans_swea(DisasContext *dc, arg_typea *arg) return true; #else TCGv addr = compute_ldst_addr_ea(dc, arg->ra, arg->rb); - return do_store(dc, arg->rd, addr, MO_TE | MO_UL, MMU_NOMMU_IDX, false); + return do_store(dc, arg->rd, addr, MO_UL, MMU_NOMMU_IDX, false); #endif } static bool trans_swi(DisasContext *dc, arg_typeb *arg) { TCGv addr = compute_ldst_addr_typeb(dc, arg->ra, arg->imm); - return do_store(dc, arg->rd, addr, MO_TE | MO_UL, dc->mem_index, false); + return do_store(dc, arg->rd, addr, MO_UL, dc->mem_index, false); } static bool trans_swx(DisasContext *dc, arg_typea *arg) From patchwork Tue Nov 5 13:04:27 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: 840807 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329745wry; Tue, 5 Nov 2024 05:08:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgBLZOP31T+raXd0AINwz+U4nr8zYkiq1ZgBbbKIvkI/0O967m4EbEoz6nAdFHHk9zALTc1g==@linaro.org X-Google-Smtp-Source: AGHT+IFR9PPh9d/7b8am5rlYuxf0vL4Y7uj1Wu7JkdkF8irKNkuQllpGZ2utevzD4jvSY1ODYGtT X-Received: by 2002:a05:6214:3a84:b0:6cd:4972:59b1 with SMTP id 6a1803df08f44-6d1857030c9mr605870096d6.27.1730812083606; Tue, 05 Nov 2024 05:08:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812083; cv=none; d=google.com; s=arc-20240605; b=M5W7EXQu/nGxn3XO7RtAnmV28ZBAm0hG7cPi/fIT8njdNdpzyi43Gz9whjERBztNet NUmuRkHYC1lkWNuj1CiEe2LPTZz8pDVKmoCpmzvIFgK1hcEl2QB47Gl0MOVmkie3mc9E RzOSWIDrNMqAbcRvhMWwIvJD27ZrsQod1hEiUHPXroA++wsJwN8Occ58jUjf/vGSgLiJ Qnzy7qttfklyWagb98Gdv0gWNrlOgTWez0Hq9+fPy5f6WfAKxbm0gW61OAOKAtpykGiZ fWXLk+L1gOKIR0AQFHGHAaWgCQcbkjLxXRu5IPYjKtLwhf2hQ45OfohBcEB7OoHzAMGT 4d0g== 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=Kbb2EbjAWyPRswDzNr8J6AfAT+vMH4Ts659xVE0GgBY=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=Mq0Rd4Nq71TDn8gmTki2+v1rEeB+kTxFJyw2sBSDuVpOHKABm1gvnjTwlJy/5DZUGB AwMBUnNqfAugAgOedsl6jvAvxSt5bjDa8kgQakarfCPBX5o3B0hQvrHFeHl18AJ8djqS 7Et/jgMS+Ah6garaEq67tFdryhgX4fUqkFZLf5BobgLabXIrveFGh4Qku4QzeBAz/lb5 A6bh84MKeHjrb4yQxbbYdezEUlAGlz/rl76winI5Jgqch47nkSs2lkbTp2jaqetEK5Vz 4jpF3/VQXUmGn+WCFO2KGWMmeE1RAXdJI+RTZMN45iH7DxN3pFo7Rl1xWPxh9BFa4O5g cRMA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NMS/MpdH"; 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-6d353fd0768si132072736d6.161.2024.11.05.05.08.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:08:03 -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="NMS/MpdH"; 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 1t8JHJ-0007TA-9k; Tue, 05 Nov 2024 08:07:25 -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 1t8JH4-0006c1-9Z for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:12 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JH0-0002gL-Ug for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:09 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-37d808ae924so3014871f8f.0 for ; Tue, 05 Nov 2024 05:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812024; x=1731416824; 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=Kbb2EbjAWyPRswDzNr8J6AfAT+vMH4Ts659xVE0GgBY=; b=NMS/MpdHv0mL+xXX4MDKMtHhCQD8tUoLFhAHOWTYVdzr25FdS5FjZuabDfzOLGrYTm a7bLb1/DQAfa6SN8YoSaJkhjlM2Hqd1XoF6qPaFjTbpVosaNYxnjYZo3b3tbk4ZR0Mrc u2sat5CPvv3ypxBGsvgr5PmeGHrHpY9jM/FBnWTC0et/Dp9kxqch+mmicDmAfXbLDa5d 783kZgl7DNu7FV5g411uE1MB9RK0hh08hjYF8Li1neIxLmroTy491X8bbqAKkpufpkn5 PhzyZ0UwBuPzNWxkQ9VXcGZJj8+xfA8HhQDzUuIHmsRedQ1PtFOfCuApSPWTGDikV7LV Vl/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812024; x=1731416824; 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=Kbb2EbjAWyPRswDzNr8J6AfAT+vMH4Ts659xVE0GgBY=; b=jfLD7xrBTW+U62hKJtmEDQbudrzl3feTrEVSqoRmGjbt+XZrGe8SrzS+vvOZcZDv7I dBc2m1+mzkRNr9fHVH1Nel3gx5Y+6vxLjrx+lcBySbnX0KWlSelhJep3PoGxyQTs8ckz bUz6lFFZ+hgJ5HKKXNZpDXzsbNsPJt+swslXBNWwi+StTNr3ofhvU7K4D2ZsXhSw0uIU /DimTTNYQ525fxj/5kE4fKid3/TP3RHUJTk2+AhV7MBZZKTmtsMbABjeqE1d97UgIHLK 00eVhxgPbQ+HPxwMbC51GjKk6tlDcj0dudiVu23zcFKyE4PXIWTWJ5lupZUK0d4cK/Eq ielw== X-Gm-Message-State: AOJu0YxD/sN6a9o5MCdmRqMfbdat0R6TPbLpiMk0hUMw/4JvxFqURjYn Ra6juGym4rYoEKf5DL1NveZs6gxTT3IQOSrdQbTBDhO1ALibwZOBHthTLuWX6a9lgeHXIkYQ9z/ T/mE= X-Received: by 2002:a5d:5d09:0:b0:381:dff2:cf08 with SMTP id ffacd0b85a97d-381dff2cff8mr3069929f8f.2.1730812024322; Tue, 05 Nov 2024 05:07:04 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c113e073sm16114234f8f.66.2024.11.05.05.07.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:07:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 15/19] target/microblaze: Introduce mo_endian() helper Date: Tue, 5 Nov 2024 14:04:27 +0100 Message-ID: <20241105130431.22564-16-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 mo_endian() returns the target endianness, currently static. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/translate.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 86f3c196189..0b466db694c 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -707,12 +707,17 @@ static void record_unaligned_ess(DisasContext *dc, int rd, } #endif +static inline MemOp mo_endian(DisasContext *dc) +{ + return MO_TE; +} + static bool do_load(DisasContext *dc, int rd, TCGv addr, MemOp mop, int mem_index, bool rev) { MemOp size = mop & MO_SIZE; - mop |= MO_TE; + mop |= mo_endian(dc); /* * When doing reverse accesses we need to do two things. @@ -847,7 +852,8 @@ static bool trans_lwx(DisasContext *dc, arg_typea *arg) /* lwx does not throw unaligned access errors, so force alignment */ tcg_gen_andi_tl(addr, addr, ~3); - tcg_gen_qemu_ld_i32(cpu_res_val, addr, dc->mem_index, MO_TE | MO_UL); + tcg_gen_qemu_ld_i32(cpu_res_val, addr, dc->mem_index, + mo_endian(dc) | MO_UL); tcg_gen_mov_tl(cpu_res_addr, addr); if (arg->rd) { @@ -864,7 +870,7 @@ static bool do_store(DisasContext *dc, int rd, TCGv addr, MemOp mop, { MemOp size = mop & MO_SIZE; - mop |= MO_TE; + mop |= mo_endian(dc); /* * When doing reverse accesses we need to do two things. @@ -1018,7 +1024,7 @@ static bool trans_swx(DisasContext *dc, arg_typea *arg) tcg_gen_atomic_cmpxchg_i32(tval, cpu_res_addr, cpu_res_val, reg_for_write(dc, arg->rd), - dc->mem_index, MO_TE | MO_UL); + dc->mem_index, mo_endian(dc) | MO_UL); tcg_gen_brcond_i32(TCG_COND_NE, cpu_res_val, tval, swx_fail); From patchwork Tue Nov 5 13:04:28 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: 840802 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329426wry; Tue, 5 Nov 2024 05:07:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUQh/JFVwbK1aLeWIeeOh6WZN1pBBveI0dD5eZKcu4qtmDiCUJi/0lqHCUjGMUEkubHzs4Eaw==@linaro.org X-Google-Smtp-Source: AGHT+IFHJXjNex35WWZvHEDKwPWol1gW18OEI4dqCdwm/WB6hKXxHRvWUvhR8QR3QHmBGje09W/L X-Received: by 2002:a05:622a:1109:b0:460:8ede:cf48 with SMTP id d75a77b69052e-462b86567dcmr231703341cf.10.1730812048750; Tue, 05 Nov 2024 05:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812048; cv=none; d=google.com; s=arc-20240605; b=MU4/Qmqn7w9M4aj+gKvnyEd+78hYCi79yqwuOKB78KGGUU9Z5nYH42ZzalEN7ir/zr XKic+iHiUxSvjULLQew6NRtoXFULVK2cAQhAWSZ1lkKr02zZ7gsonP2V8Nf4ClflgrEs fzbEzY7I69szJRV+/Zfc3UROMZMhyQw8NllXn/HdUl1GkkSoQeFDl2Y1rtPUJ3A79bM2 tbDG309FxP9gGjxysVVEU9/Uo6LtEZ4BiF6Z30RZ+WdTGMOep2HHr03rVNQBPgCnLb60 KAQmgf39ClLqbUnuTyypA4yOBZK2EahSM0n08Kb2QAcwM1dM4ORCgHFFJkjwBKW1sY6e XDBg== 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=x3QZDoqX/9aQeCd67Fxf+7IHrX4YKBlVMoYZ3cKr6J0=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=Vx1lJKxq2kSuRSSPK2AIYwl6h8nKDVzSH+nt2K7wj5AXirevGnzqHq7AZ9jj7iFqBh 234uvkI9Z7EK8Zuq3uY+XJsWGvnrBWHL9Nm/3SVzrnaYQAaZsmlblETZzzzwYCb+so77 UltcjI1ba/AMED7H0RaQoSRuK8lW01O96JYQYgLjxIjyumKh0er33+oZ5WP6xv7dmByG D47HxTirgKkkuGV+963SGijT/6PVf9vLE2g1hbNHa1O0PefZ2bjSwqRVavDDPFSTAp1o Gmiq57FOK9C8GA6N8ybXiqKwGUYet1EigoyfswzWXl6X2zW75uE19zKEDZpD3aeCnnUG MxoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Fx5T+/Nf"; 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-462ad0b2a20si146068091cf.89.2024.11.05.05.07.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:28 -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="Fx5T+/Nf"; 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 1t8JHG-0007AR-F4; Tue, 05 Nov 2024 08:07:22 -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 1t8JHB-0006pf-8s for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:17 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JH8-0002hK-BS for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:17 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-37ed3bd6114so3136879f8f.2 for ; Tue, 05 Nov 2024 05:07:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812032; x=1731416832; 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=x3QZDoqX/9aQeCd67Fxf+7IHrX4YKBlVMoYZ3cKr6J0=; b=Fx5T+/Nfvkrkjz42mbrGdXsM6lQSdqc0jzTPq0wGMUEIg9Y8Y/iznyv/zwGDS9n0WK Z07GZDuHebljE2j1DGrHJOSsUMb/rYeJrvC81OyksckFK4KkImv2E6nY/7K8uoV3bbg8 PIa4Cv6qOyCCUC6SvOqPfYGL5h3zLLPyIRISQ8pzbohcDCQTcuRcizqp29hMr/x6cXZL dJTsO9v3k7oUDI5miUoDynv5XgMVWKfjGSVlIW0E3s+S8ZZwgTlop7htROrJfvm1fRw5 bGMHJGDyfQUfy5nqcG/yTf8Rx+IUQLJPVzu0b95LbI/8yO5+6TFLM99cPaK9BHlwBnbY ozmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812032; x=1731416832; 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=x3QZDoqX/9aQeCd67Fxf+7IHrX4YKBlVMoYZ3cKr6J0=; b=lYyZMVVlQjK5ixK80JGi4lm36viQTR8ZqR+Lzk+B5eMhGQuRHYx9KT5z7i3sHGNsyC /RvuRzycXTE4d+1qj/6GHVknMgToSjnSvIfhChNyXpiB+TPUoxsD3lWzCFqvwJd2EAs2 /ykRb6x9TdYMAmOiY0JFpE2SPiTu0mlsKMU1eCXw4G7Q2EK5qrCRU8+2534ihlNA/q4/ IZuMBtk3BjsrRDAssPa8jngrZTIHovDemEzSU/elM9FcUxEE2RfUCfI3uvBfuyk7Pz2S EvG6ABWgU5doWqTZ8WDlBQinO/+0XWVPqOdZY+Rm3S5GXlTr69lIJqQOnboEb/O/stdn b+fg== X-Gm-Message-State: AOJu0YwUCrqpfveBO/ogRUz9ja4yrBUau8EvxbaaGvGOdKYA7WUmmEs+ vtIjKRgxlUHAoA9h/gKAc6doprKd5PtUXOAt40IaXuIqDuaBcAYWOXZ8K/3jMQgN72z5gwb0nzA hgho= X-Received: by 2002:a05:6000:410a:b0:381:cfea:2818 with SMTP id ffacd0b85a97d-381cfea2a53mr9258718f8f.30.1730812031787; Tue, 05 Nov 2024 05:07:11 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c116b11esm16096019f8f.104.2024.11.05.05.07.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:07:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 16/19] target/microblaze: Consider endianness while translating code Date: Tue, 5 Nov 2024 14:04:28 +0100 Message-ID: <20241105130431.22564-17-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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=unavailable 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 Consider the CPU ENDI bit, swap instructions when the CPU endianness doesn't match the binary one. Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.h | 7 +++++++ target/microblaze/translate.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 3e5a3e5c605..6d540713eb5 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -412,6 +412,13 @@ void mb_tcg_init(void); /* Ensure there is no overlap between the two masks. */ QEMU_BUILD_BUG_ON(MSR_TB_MASK & IFLAGS_TB_MASK); +static inline bool mb_cpu_is_big_endian(CPUState *cs) +{ + MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); + + return !cpu->cfg.endi; +} + static inline void cpu_get_tb_cpu_state(CPUMBState *env, vaddr *pc, uint64_t *cs_base, uint32_t *flags) { diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 0b466db694c..5595ae4fadb 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -709,7 +709,7 @@ static void record_unaligned_ess(DisasContext *dc, int rd, static inline MemOp mo_endian(DisasContext *dc) { - return MO_TE; + return dc->cfg->endi ? MO_LE : MO_BE; } static bool do_load(DisasContext *dc, int rd, TCGv addr, MemOp mop, @@ -1646,7 +1646,8 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs) dc->tb_flags_to_set = 0; - ir = translator_ldl(cpu_env(cs), &dc->base, dc->base.pc_next); + ir = translator_ldl_swap(cpu_env(cs), &dc->base, dc->base.pc_next, + mb_cpu_is_big_endian(cs) != TARGET_BIG_ENDIAN); if (!decode(dc, ir)) { trap_illegal(dc, true); } From patchwork Tue Nov 5 13:04:29 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: 840809 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329933wry; Tue, 5 Nov 2024 05:08:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVzB4zROPg6fEX6/DuTo76ikq6aPt6nztTqdGtoEA5lGzz7pp20Ad10mGgi5J/RMNDfJ7MzUQ==@linaro.org X-Google-Smtp-Source: AGHT+IGTA3q8YpdL9h518Gw6r9rKHzdAmzuXossKGT8iBthbfUBuFpmRAcZfueIU21l87esboEp9 X-Received: by 2002:a05:622a:134c:b0:460:ab13:f53c with SMTP id d75a77b69052e-462b8688a59mr242178711cf.20.1730812102494; Tue, 05 Nov 2024 05:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812102; cv=none; d=google.com; s=arc-20240605; b=J2Yv22fVKyJxM5LxW0fL8paTev2nVfXBWbWOrShSDm8oE4wBr3hJhy/coFXJuW19Bj SgjtLBmImyUk8mMH+OtYereMrdGlnD+QA077rob/yPiRMV8kYDaIX6LKL4yfTKaOAfUt m0SkV+hu80Cl876VUffFImEvZRXFRLJsJuwZFxou+npHa6cVyruf2fCkX9nYEzRN4om3 Zfit6UmZR+OBlzem0krzNLFIYTvc0uD3bKx2l8FkSrDDNQv+DQ32JX4dV3dAMQrxacxG Bcr9nJ/6yNUyTQyqNWdo8ghbqoJlyphayHsOdn3rzeTE46UkfVISiqOpHHt8OG90iCoQ QndQ== 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=haV4HgajOuBZyaKR8WLf7rNEDHwvap87jZ2MipEC/AA=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=Ce66PXNL0KvKVi8m+VyIsj1Cemn8vuVzRuaUpCDRg88fpWEbjwgnBrw4BEt0zQjn1H jjemC4XUS1q4cyOac4oZM7m/JzBjQiTHi7s4zdk520HRPEvtrtanBnVnOLD8HvVe34ES wRcPpKu26RN2Sv2wi0Xe10BveF99eoQIEQn+sZ4omGEJjHh24jHP2TXYsrdfKbh0ezHr CGM+ECeQn9i/PvDEHq9+v05HxYxKTcGMgjqiAO6RuQC/uQTLndWOCKSQqUXPYgoqcu1x jPNGpEtgG34fIeY5kcJr5nlpVkIu/w9Ks2sCPS2sG+jHa88b6LjVg0Caka4yC8Ne1PJl mxNw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s1Aiu+VY; 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-462ad1f2728si142715111cf.409.2024.11.05.05.08.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:08:22 -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=s1Aiu+VY; 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 1t8JHN-00085Q-QO; Tue, 05 Nov 2024 08:07: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 1t8JHJ-0007XX-5u for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:25 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JHG-0002ik-Li for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:24 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4315e62afe0so46604425e9.1 for ; Tue, 05 Nov 2024 05:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812041; x=1731416841; 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=haV4HgajOuBZyaKR8WLf7rNEDHwvap87jZ2MipEC/AA=; b=s1Aiu+VY1z0Dm2oTkkBy6GKbQsiTcUGXL1TDRUg1ujpQLdQtoFGAFnbVFYCScpwBH4 9UyngPnCQre4b8mfU6IzxXwc/MwnBctuc/iYS/kTCzHsPCc8e86fpVhha57CTRLq3mgp d7gUBTscT7zlyzZuWu2f3n6EofCAq1qDYvCwvtll3e+2/iV8/LwLzylRHvO4rtFvg4TM zf9CoFOnFaTYkYJ0LyuufnvucqdCXZg0uhmwkueQ9N9kSwBVsFKv0Ox5dw7Gz9SJUL41 XxoiGmXzO2ah9VPUWUva42gyZYYTVhVCVB9ckwZP5r2v8ciV5co29hVlZF73reXFobEB CStg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812041; x=1731416841; 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=haV4HgajOuBZyaKR8WLf7rNEDHwvap87jZ2MipEC/AA=; b=GevW/asssy0w7/rFCpDZH3IjsNzxnhOYQecdYXWT+44AY357ximmYoeycFrKG5K8Aa Kf0bVmYSyfu/skXgai56mQtioLNXz6iXiVf+H46D5htLAGpTMhjUjbAU1yooUWNZPW/0 Oc15UKzbrYjSKLTEV816Fte4VB+LKOkplbhms1AIyx1yAnQk6Q/JyXm3Sz/das9yp+T3 Udf72BPGvrTE4sgH3doIDh9Aiba51A6a4sZIPu5bb+L8REUpkgJsRZqRWFyHdaBIQJt7 7Uy+AvWfiLf9DQZnmHWGff4rx7IwOBkUBhMstZhKyqDKPeNRP4QnVyqKSKySNSWs02mJ TSyA== X-Gm-Message-State: AOJu0Yx9q/vL9/6X0vonIyNu2ZqzqvD+rNQ6Q//C4PO5KkPSLxe9Z1PN aZZkdYelQ/UmgI5dCGrhYmMMRh14RFY9EAU+xxv0HvuBwZSSWbpfa9+OLZdiTQrov6s+zl9pkkO kPts= X-Received: by 2002:a05:600c:4f83:b0:42c:c28c:e477 with SMTP id 5b1f17b1804b1-4319ad089b0mr277982415e9.23.1730812040858; Tue, 05 Nov 2024 05:07:20 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431bd8e8471sm226896305e9.4.2024.11.05.05.07.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:07:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 17/19] hw/microblaze: Support various endianness for s3adsp1800 machines Date: Tue, 5 Nov 2024 14:04:29 +0100 Message-ID: <20241105130431.22564-18-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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=unavailable 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 Introduce an abstract machine parent class which defines the 'little_endian' property. Duplicate the current machine, which endian is tied to the binary endianness, to one big endian and a little endian machine; updating the machine description. Keep the current default machine for each binary. 'petalogix-s3adsp1800' machine is aliased as: - 'petalogix-s3adsp1800-be' on big-endian binary, - 'petalogix-s3adsp1800-le' on little-endian one. Signed-off-by: Philippe Mathieu-Daudé --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 55 +++++++++++++++++++++--- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 8407dbee12a..f5195327b76 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -55,8 +55,17 @@ #define ETHLITE_IRQ 1 #define UARTLITE_IRQ 3 +typedef struct PetalogixS3adsp1800MachineClass { + MachineClass parent_obj; + + bool little_endian; +} PetalogixS3adsp1800MachineClass; + #define TYPE_PETALOGIX_S3ADSP1800_MACHINE \ - MACHINE_TYPE_NAME("petalogix-s3adsp1800") + MACHINE_TYPE_NAME("petalogix-s3adsp1800-common") +DECLARE_CLASS_CHECKERS(PetalogixS3adsp1800MachineClass, + PETALOGIX_S3ADSP1800_MACHINE, + TYPE_PETALOGIX_S3ADSP1800_MACHINE) static void petalogix_s3adsp1800_init(MachineState *machine) @@ -71,11 +80,13 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *phys_ram = g_new(MemoryRegion, 1); qemu_irq irq[32]; MemoryRegion *sysmem = get_system_memory(); + PetalogixS3adsp1800MachineClass *pmc; + pmc = PETALOGIX_S3ADSP1800_MACHINE_GET_CLASS(machine); cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort); object_property_set_bool(OBJECT(cpu), "little-endian", - !TARGET_BIG_ENDIAN, &error_abort); + pmc->little_endian, &error_abort); qdev_realize(DEVICE(cpu), NULL, &error_abort); /* Attach emulated BRAM through the LMB. */ @@ -123,33 +134,63 @@ petalogix_s3adsp1800_init(MachineState *machine) qemu_configure_nic_device(dev, true, NULL); qdev_prop_set_uint32(dev, "tx-ping-pong", 0); qdev_prop_set_uint32(dev, "rx-ping-pong", 0); - qdev_prop_set_bit(dev, "access-little-endian", !TARGET_BIG_ENDIAN); + qdev_prop_set_bit(dev, "access-little-endian", pmc->little_endian); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, ETHLITE_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq[ETHLITE_IRQ]); create_unimplemented_device("xps_gpio", GPIO_BASEADDR, 0x10000); - microblaze_load_kernel(cpu, !TARGET_BIG_ENDIAN, ddr_base, ram_size, + microblaze_load_kernel(cpu, pmc->little_endian, ddr_base, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, NULL); } -static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc, void *data) +static void petalogix_s3adsp1800_machine_class_init_be(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); + PetalogixS3adsp1800MachineClass *pmc = PETALOGIX_S3ADSP1800_MACHINE_CLASS(oc); - mc->desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800"; + pmc->little_endian = false; + mc->desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800 (big endian)"; mc->init = petalogix_s3adsp1800_init; +#if TARGET_BIG_ENDIAN mc->is_default = true; + mc->alias = "petalogix-s3adsp1800"; +#endif +} + +static void petalogix_s3adsp1800_machine_class_init_le(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + PetalogixS3adsp1800MachineClass *pmc = PETALOGIX_S3ADSP1800_MACHINE_CLASS(oc); + + pmc->little_endian = true; + mc->desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800 (little endian)"; + mc->init = petalogix_s3adsp1800_init; +#if !TARGET_BIG_ENDIAN + mc->is_default = true; + mc->alias = "petalogix-s3adsp1800"; +#endif } static const TypeInfo petalogix_s3adsp1800_machine_types[] = { { .name = TYPE_PETALOGIX_S3ADSP1800_MACHINE, .parent = TYPE_MACHINE, - .class_init = petalogix_s3adsp1800_machine_class_init, + .abstract = true, + .class_size = sizeof(PetalogixS3adsp1800MachineClass), + }, + { + .name = MACHINE_TYPE_NAME("petalogix-s3adsp1800-be"), + .parent = TYPE_PETALOGIX_S3ADSP1800_MACHINE, + .class_init = petalogix_s3adsp1800_machine_class_init_be, + }, + { + .name = MACHINE_TYPE_NAME("petalogix-s3adsp1800-le"), + .parent = TYPE_PETALOGIX_S3ADSP1800_MACHINE, + .class_init = petalogix_s3adsp1800_machine_class_init_le, }, }; From patchwork Tue Nov 5 13:04:30 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: 840805 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329654wry; Tue, 5 Nov 2024 05:07:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXtckhmTQnYZaGc9mLID4Id4lrHa3b4mF9m3Hx1Uhm++idM+VBVmDie+ndpV5PKWeQ7o1zRqQ==@linaro.org X-Google-Smtp-Source: AGHT+IF1J8FHgVsIR4Li47fxC6cHkX5cSWdrekEEjyMm/ffQ2Dw34Fv2iAmN0YG2/wBCgrgkz862 X-Received: by 2002:a05:6214:5d0e:b0:6d1:9f1b:b669 with SMTP id 6a1803df08f44-6d3542eddbbmr330951946d6.15.1730812073099; Tue, 05 Nov 2024 05:07:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812073; cv=none; d=google.com; s=arc-20240605; b=c9aX9XtiWKF9ihMIzqyFtjpLQnqhiQkC4u1evBymFD3U2LXY7B4NuoTmFUoFDuUyoR f1F7BZEz4qqu3c3DK5d55O1nH/lvAZ5qCkkxgM358jwZoTbMjVk8wCCMpW8UWGpYcuZY sDeGUZahw624gG5PZ9vOUkqoYWnPKfyXfS7G3d2t8CD+BXPn6h8Q641lKoQco52NvOoI okWaKou8aF0pe4BPsk1qLPSsx9fMNpypqoTliHHbXKU5AyuUuQdn0NZOGFQgEipi6YvG kZAhlbJnVC+EWmzJp0vwyaKPZOdfK61uPVZ2Q42EVpAnykpXKiUs7+E27pY3x0rYU5X2 ZqCQ== 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=uvCwniH1d5vJ2TSLTLYsHQTeRtQ/cjS0HoIHKDsL7Ck=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=gRYKKbfWaqEcry4tDP6gVTzHeBDwjzPGuzAbRMpcoSEXe1qlbH1vTAj8GUG0kKiGEN xWgvYNPWZYbDLbqhZcofghkoiOFNPcUF46XXq9Z3j/qULPESPVTj8Cq8tD0bx3ohYme5 ZHxi3QfcPlwxsYaGYcaI9oVyiWKi2TrGwUTGoQYLMmLdZA82xMki+52iklQkY+M7Ki60 oMl2sjmpWrW4nY1ERHfVrnfAcPuAdjXCZCLjAaJ5c9V/yrD7DTfEhOt8o/BJHTdLWFBw I9zMis3cMOHccErgtvqdE++td9CQFD0PMfIFMS8sfSYZyKPOPqosuBAocaqxjKVUh3pw 4Ptw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mh9Om4Hc; 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-6d353fa85e0si136783266d6.28.2024.11.05.05.07.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:07:53 -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=mh9Om4Hc; 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 1t8JHV-0000T3-GA; Tue, 05 Nov 2024 08:07: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 1t8JHS-0000BQ-75 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:34 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JHQ-0002kA-0I for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:33 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4316f3d3c21so42045365e9.3 for ; Tue, 05 Nov 2024 05:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812050; x=1731416850; 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=uvCwniH1d5vJ2TSLTLYsHQTeRtQ/cjS0HoIHKDsL7Ck=; b=mh9Om4HcUnhQbbqBtfWrPlfkyUJYJUQwDjZdqCWZpyH4hzrzjTqAJygG+wrxtvfLD+ Qds/2PkhtIV02a8aa6bIuTJQIGzdVYqbOeWLaR5Zvn25nVD72iU+ykLZFPEW0r4WUHxL MWkjmpZjOxmfidfRQnca4RRhEDbjrIjl4hPK4EpxJt7S+9yqzYCFdHxfAvLvHxEpGdaL 6TVn6SSZmdow21aBNl0NHeuUK0EjqzDF73bkILE22Ej27ef3biVr0QEaKtGr/gnB47FE qRorleVlzIdmVcZ+cH32II9TG4O5DKcpvHKSLESjLHUzDOqoINLYP4p0BkuS7O701wYG drEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812050; x=1731416850; 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=uvCwniH1d5vJ2TSLTLYsHQTeRtQ/cjS0HoIHKDsL7Ck=; b=rjECd7D30h6J/Dyfvgypw5p9L4Q49uPOd2vigH6mvyYrXi7GMcd41JmPPpR7wR5oD9 vQ5XdWISbUEWdTFiEMBnGB4JlK55WYXpxcHwsbTAksG3J97UhtGdj34u9GMxd8QiFEML qfWE/XPgI34gx+Iz9Fip8ENSczUqjPTWz0Lg+f1U5tSCXcgyuPA0i6LPYKQbnZ4N01/5 lUa5ADMRN/jBw4mXxdVqFI8w5ZGoxXThcd4Rj4IyOw5CkpFhGrE7MKiQsznOJ3chuBoE zCBF0QLVQzFgjb0xk5rppiTOrYof0Psi9Tlfhp6oyW9d8rn5vfpwON9Ij0P1LtagPw/e Vsaw== X-Gm-Message-State: AOJu0YwqvcJ7yZI6UkewWSf6kscdYGKRCsQqKnHDn8NQKf4SVwHs3fjn ALpQqYeoMvc3s+HW/NhtiJ/vJlGrhMD7KTPnxaFkn2PBsfFTIQfGw6uFiRtqRwffqgsg6WakQZY nado= X-Received: by 2002:a05:600c:4fd3:b0:431:52b7:a485 with SMTP id 5b1f17b1804b1-431bb98fc9fmr209119645e9.19.1730812050247; Tue, 05 Nov 2024 05:07:30 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d5ac387sm194360095e9.1.2024.11.05.05.07.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:07:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 18/19] tests/functional: Explicit endianness of microblaze assets Date: Tue, 5 Nov 2024 14:04:30 +0100 Message-ID: <20241105130431.22564-19-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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=unavailable 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 The archive used in test_microblaze_s3adsp1800.py (testing a big-endian target) contains a big-endian kernel. Rename using the _BE suffix. Similarly, the archive in test_microblazeel_s3adsp1800 (testing a little-endian target) contains a little-endian kernel. Rename using _LE suffix. These changes will help when adding cross-endian kernel tests. Signed-off-by: Philippe Mathieu-Daudé --- tests/functional/test_microblaze_s3adsp1800.py | 6 +++--- tests/functional/test_microblazeel_s3adsp1800.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py index 4f692ffdb1a..2b2f7822707 100755 --- a/tests/functional/test_microblaze_s3adsp1800.py +++ b/tests/functional/test_microblaze_s3adsp1800.py @@ -17,14 +17,14 @@ class MicroblazeMachine(QemuSystemTest): timeout = 90 - ASSET_IMAGE = Asset( + ASSET_IMAGE_BE = Asset( ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/' 'day17.tar.xz'), '3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057') - def test_microblaze_s3adsp1800(self): + def test_microblaze_s3adsp1800_be(self): self.set_machine('petalogix-s3adsp1800') - file_path = self.ASSET_IMAGE.fetch() + file_path = self.ASSET_IMAGE_BE.fetch() archive_extract(file_path, self.workdir) self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/day17/ballerina.bin') diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py index faa3927f2e9..1aee5149fb1 100755 --- a/tests/functional/test_microblazeel_s3adsp1800.py +++ b/tests/functional/test_microblazeel_s3adsp1800.py @@ -17,14 +17,14 @@ class MicroblazeelMachine(QemuSystemTest): timeout = 90 - ASSET_IMAGE = Asset( + ASSET_IMAGE_LE = Asset( ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'), 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22') - def test_microblazeel_s3adsp1800(self): + def test_microblazeel_s3adsp1800_le(self): self.require_netdev('user') self.set_machine('petalogix-s3adsp1800') - file_path = self.ASSET_IMAGE.fetch() + file_path = self.ASSET_IMAGE_LE.fetch() archive_extract(file_path, self.workdir) self.vm.set_console() self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin') From patchwork Tue Nov 5 13:04:31 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: 840810 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp329987wry; Tue, 5 Nov 2024 05:08:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU9xVPNX/uu/dbL8lvkhGuZPmWEAZ4ki1q391SWpwZfcpdFLa1pRIDWON9SQoTIqx0TULM1ng==@linaro.org X-Google-Smtp-Source: AGHT+IEtpvOhBzuNRhEBjMq3cdljnPpBNl/6t9ZKwrSLGGNQh9G1dCljiGmcubJtf7T6y5MXvvcg X-Received: by 2002:a05:620a:4082:b0:7ac:d673:2057 with SMTP id af79cd13be357-7b2f24c51ffmr3486729485a.13.1730812108070; Tue, 05 Nov 2024 05:08:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730812108; cv=none; d=google.com; s=arc-20240605; b=ikb4ISQKM0vYuUZVI2/cG7rRPXYjeibXRTwcnZRxcX6HOOMNSqZLH+MI754ImNus00 CDMFlmOgMRhiE0dbMRs/HIZLCd3dVKDYVaLdUwIk1h9lJM9Lz8ylHPPURePslFn0/Qdo 0Z6WwjseF0JD0jfQLucXUU1gpZXSjopehjdruTGnXMx4vV3neSSguhEk9Jc8ADNbjRC9 QxdLkqmpEpjg1ATx1XiWqgp/DpnGMebdp2egPReZ+K2fg0n3fdKi2HhrYD+v2/0Azp20 NOFbOfmmC1rpjVV3Tarij0xmoBvesGOnCl5Wxw8+obuyUk/v3dEPxvez+j4Ag+6gMPFd d5sA== 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=iGrQLs85iCO+ooJQZbg2Q0E0dHdOyXnWOUnrVx9dt/s=; fh=t3XyJLi79GAl74vwjx9CHyT1q7cQJdnSqFDS2FXNV/w=; b=fwAFozs0TLKUys9oixhqPPa5XJq1vQ+f2I2lJZisDitHa3wwDL3+Kj+CL62GZ5nSqQ HvqhTlAHfmBnfflHtv7qPrX7GFsdrua/nfu1ho5Hqhs+oKNelrAUMuWXGFPh8+b9i3oV +851aP/RFMAyJscIhjEh21utK5S9h6QFPUZ8iWyWqLasdkRj6y4S5PWKcXw11h9B9h26 pgaIDLCfseSjll3lxF3lGWmB/XLK60KIku9ccIgAO0uhdzCWsW8ZLqAFc3o5Aa55LCIU xiQjKKrip3INRMfuHlQh9hrLfSHqQca7siQyzDFhMfM3DKYdCzoVJb+uWm14+//jfjZH el+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p7UplYso; 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-7b2f3a9d2fesi1474728985a.415.2024.11.05.05.08.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 05:08:28 -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=p7UplYso; 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 1t8JHi-0001UM-Se; Tue, 05 Nov 2024 08:07:51 -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 1t8JHg-0001O7-Pl for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:48 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8JHe-0002mE-UY for qemu-devel@nongnu.org; Tue, 05 Nov 2024 08:07:48 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-37d49ffaba6so3682886f8f.0 for ; Tue, 05 Nov 2024 05:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730812065; x=1731416865; 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=iGrQLs85iCO+ooJQZbg2Q0E0dHdOyXnWOUnrVx9dt/s=; b=p7UplYsopUDrR9bQxsQNNf+/ABPKai0G9SUQzGaxakVA0i3Hw1E3tMNfKLrDZss9gs WPahsSIx77KwVxoTR52QGinkc3yXybT+iemMPAtf+6noc2pizCKVXocVlacJk1VhU5rY 9YSapTsr6/I/APXYiofkKYeaNvSoidtdH+e5kARVviPu+t/QEj996gLQZr0PCz4kYgPV 3S06D9wbojiHpisMrXE/JFZ2dGnMGkWH1bkdjQFDWd3CPwAdKbcDYF9RoS0R6NDrNH+l 2G08yqBg8j07H/Qt1KlT5G1c8MePkBmqAyyO5AwYwdtr3xSbSIGrd4a3AgF3BiLHVXJF tl0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730812065; x=1731416865; 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=iGrQLs85iCO+ooJQZbg2Q0E0dHdOyXnWOUnrVx9dt/s=; b=eaiaVrhJinvJbma4FehrQxXWeiQDIxnzukoIOeQeyen7VTNrsCXiZGBHtAAJ9iPySf 96awT/Ye94XemdXKDoYlWiaP7XOYeEE4THvqVi0vQpHHHiG7kibqc4nhteWr+bO2UWTg nukvfyoVbY2q2/tmvoMET+t+A2lZDKc35gmjLqPbDG2gasoYB7xuZfIjmrbp/5H1xxvy LItH19NthJeH0nLHBkSOPDTkTEBr8aVjMgN6+njx3ucnVF4FYulRM2w6xQK3VIjWusaY H/EYl0kN6f6fkmOaXQs1+0qztOMkhwxXG84UsylsxFT+2shz2ZZstTPyPfYrhx8ui473 ZgDA== X-Gm-Message-State: AOJu0Ywb/gpQeL1ebEFwjqyh3w5v1Yq9hvC9kWgDsEf1569uetlF/huH TpNJlW211TUSzvtqkQUriHep358Al4/oVGcq2VWpzhX14y0WoTf3cvftrpwkaOHCy30FseCsjOR 3uFw= X-Received: by 2002:adf:f802:0:b0:37c:d2f3:b3af with SMTP id ffacd0b85a97d-381b705688bmr15321823f8f.5.1730812065186; Tue, 05 Nov 2024 05:07:45 -0800 (PST) Received: from localhost.localdomain (86.red-88-29-160.dynamicip.rima-tde.net. [88.29.160.86]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10d439esm16225993f8f.44.2024.11.05.05.07.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 05:07:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Anton Johansson Cc: "Edgar E. Iglesias" , Peter Maydell , Alistair Francis , Thomas Huth , qemu-arm@nongnu.org, devel@lists.libvirt.org, =?utf-8?q?Marc-Andr=C3=A9_Lur?= =?utf-8?q?eau?= , Paolo Bonzini , Jason Wang , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 19/19] tests/functional: Add microblaze cross-endianness tests Date: Tue, 5 Nov 2024 14:04:31 +0100 Message-ID: <20241105130431.22564-20-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105130431.22564-1-philmd@linaro.org> References: <20241105130431.22564-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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 Copy/paste the current tests, but call the opposite endianness machines, testing: - petalogix-s3adsp1800-le machine (little-endian CPU) on the qemu-system-microblaze binary (big-endian) - petalogix-s3adsp1800-be machine (big-endian CPU) on the qemu-system-microblazeel binary (little-endian). Signed-off-by: Philippe Mathieu-Daudé --- Clever refactor left for later --- .../functional/test_microblaze_s3adsp1800.py | 21 +++++++++++++++++++ .../test_microblazeel_s3adsp1800.py | 19 +++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/tests/functional/test_microblaze_s3adsp1800.py b/tests/functional/test_microblaze_s3adsp1800.py index 2b2f7822707..7f5e8b6024f 100755 --- a/tests/functional/test_microblaze_s3adsp1800.py +++ b/tests/functional/test_microblaze_s3adsp1800.py @@ -36,5 +36,26 @@ def test_microblaze_s3adsp1800_be(self): # message, that's why we don't test for a later string here. This # needs some investigation by a microblaze wizard one day... + ASSET_IMAGE_LE = Asset( + ('http://www.qemu-advent-calendar.org/2023/download/day13.tar.gz'), + 'b9b3d43c5dd79db88ada495cc6e0d1f591153fe41355e925d791fbf44de50c22') + + def test_microblaze_s3adsp1800_le(self): + self.require_netdev('user') + self.set_machine('petalogix-s3adsp1800-le') + file_path = self.ASSET_IMAGE_LE.fetch() + archive_extract(file_path, self.workdir) + self.vm.set_console() + self.vm.add_args('-kernel', self.workdir + '/day13/xmaton.bin') + self.vm.add_args('-nic', 'user,tftp=' + self.workdir + '/day13/') + self.vm.launch() + wait_for_console_pattern(self, 'QEMU Advent Calendar 2023') + time.sleep(0.1) + exec_command(self, 'root') + time.sleep(0.1) + exec_command_and_wait_for_pattern(self, + 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', + '821cd3cab8efd16ad6ee5acc3642a8ea') + if __name__ == '__main__': QemuSystemTest.main() diff --git a/tests/functional/test_microblazeel_s3adsp1800.py b/tests/functional/test_microblazeel_s3adsp1800.py index 1aee5149fb1..60543009bab 100755 --- a/tests/functional/test_microblazeel_s3adsp1800.py +++ b/tests/functional/test_microblazeel_s3adsp1800.py @@ -38,5 +38,24 @@ def test_microblazeel_s3adsp1800_le(self): 'tftp -g -r xmaton.png 10.0.2.2 ; md5sum xmaton.png', '821cd3cab8efd16ad6ee5acc3642a8ea') + ASSET_IMAGE_BE = Asset( + ('https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/' + 'day17.tar.xz'), + '3ba7439dfbea7af4876662c97f8e1f0cdad9231fc166e4861d17042489270057') + + def test_microblazeel_s3adsp1800_be(self): + self.set_machine('petalogix-s3adsp1800-be') + file_path = self.ASSET_IMAGE_BE.fetch() + archive_extract(file_path, self.workdir) + self.vm.set_console() + self.vm.add_args('-kernel', self.workdir + '/day17/ballerina.bin') + self.vm.launch() + wait_for_console_pattern(self, 'This architecture does not have ' + 'kernel memory protection') + # Note: + # The kernel sometimes gets stuck after the "This architecture ..." + # message, that's why we don't test for a later string here. This + # needs some investigation by a microblaze wizard one day... + if __name__ == '__main__': QemuSystemTest.main()