All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Bernhard Beschow" <shentey@gmail.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 5/6] hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps
Date: Mon, 20 Feb 2023 22:43:28 +0000	[thread overview]
Message-ID: <87zg98q7n8.fsf@linaro.org> (raw)
In-Reply-To: <Y88BmxzRqtnpAsWG@dev-arch.thelio-3990X>


Nathan Chancellor <nathan@kernel.org> writes:

> Hi Philippe,
>
> On Wed, Jan 04, 2023 at 02:39:34PM +0100, Philippe Mathieu-Daudé wrote:
>> GT64120's PCI endianness swapping works on little-endian hosts,
>> but doesn't on big-endian ones. Instead of complicating how
>> CFGADDR/CFGDATA registers deal with endianness, use the existing
>> MemoryRegionOps from hw/pci/pci_host.c. Doing so also reduce the
>> access to internal PCI_HOST_BRIDGE fields.
>> 
>> Map the PCI_HOST_BRIDGE MemoryRegionOps into the corresponding
>> CFGADDR/CFGDATA regions in the ISD MMIO and remove the unused
>> code in the current ISD read/write handlers.
>> 
>> Update the mapping when PCI0_CMD register is accessed (in case
>> the endianness is changed).
>> 
>> This allows using the GT64120 on a big-endian host (and boot
>> the MIPS Malta machine in little-endian).
>> 
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> This change as commit 145e2198d7 ("hw/mips/gt64xxx_pci: Endian-swap
> using PCI_HOST_BRIDGE MemoryRegionOps") in QEMU master causes a hang
> when trying to poweroff a malta_defconfig + CONFIG_CPU_BIG_ENDIAN=y
> kernel on an x86_64 host. The kernel has been built from latest mainline
> using the kernel.org toolchains [1], just in case it matters.
>
> $ timeout --foreground 30s qemu-system-mips \
> -cpu 24Kf \
> -machine malta \
> -kernel vmlinux \
> -display none \
> -initrd rootfs.cpio \
> -m 512m \
> -nodefaults \
> -no-reboot \
> -serial mon:stdio
> ...
<snip>

Ahh also this commit got fingered by the tuxrun test for the same
combination:

  ./run --runtime docker --qemu-binary /home/alex.bennee/lsrc/qemu.git/builds/bisect/qemu-system-mips64 --device qemu-mips64

with my in flight patches for tuxrun's host support.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  parent reply	other threads:[~2023-02-20 22:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 13:39 [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 1/6] hw/pci/pci_host: Trace config accesses on unexisting functions Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 2/6] hw/mips/malta: Split FPGA LEDs/ASCII display updates Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 3/6] hw/mips/malta: Trace " Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 4/6] hw/mips/gt64xxx_pci: Accumulate address space changes Philippe Mathieu-Daudé
2023-01-04 13:39 ` [PATCH 5/6] hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps Philippe Mathieu-Daudé
2023-01-23 21:52   ` Nathan Chancellor
2023-01-24  2:17     ` BALATON Zoltan
2023-02-20 22:43     ` Alex Bennée [this message]
2023-01-04 13:39 ` [PATCH 6/6] tests/avocado: Add tests booting YAMON ROM on MIPS Malta machines Philippe Mathieu-Daudé
2023-01-04 14:12   ` Philippe Mathieu-Daudé
2023-01-04 18:20 ` [PATCH 0/6] hw/mips/gt64xxx_pci: Fix endianness swap on big-endian hosts Richard Henderson
2023-01-13  8:29 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg98q7n8.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=nathan@kernel.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shentey@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.