<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/linux-user/sh4, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/linux-user/sh4?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/linux-user/sh4?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-03-13T11:43:52Z</updated>
<entry>
<title>linux-user: Move tswap_siginfo out of target code</title>
<updated>2024-03-13T11:43:52Z</updated>
<author>
<name>Gustavo Romero</name>
<email>gustavo.romero@linaro.org</email>
</author>
<published>2024-03-09T03:08:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=4d6d8a05a0a6d102ca94e59a43804d65309921e3'/>
<id>urn:sha1:4d6d8a05a0a6d102ca94e59a43804d65309921e3</id>
<content type='text'>
Move tswap_siginfo from target code to handle_pending_signal. This will
allow some cleanups and having the siginfo ready to be used in gdbstub.

Signed-off-by: Gustavo Romero &lt;gustavo.romero@linaro.org&gt;
Suggested-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20240309030901.1726211-3-gustavo.romero@linaro.org&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>sh4: Coding style: Remove tabs</title>
<updated>2023-12-04T14:12:57Z</updated>
<author>
<name>Yihuan Pan</name>
<email>xun794@gmail.com</email>
</author>
<published>2023-11-24T04:45:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=55339361276a81ab3d306e6e8e81151e2977c5da'/>
<id>urn:sha1:55339361276a81ab3d306e6e8e81151e2977c5da</id>
<content type='text'>
Replaces TABS with spaces to ensure have a consistent coding
style with an indentation of 4 spaces in the SH4 subsystem.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/376
Signed-off-by: Yihuan Pan &lt;xun794@gmail.com&gt;
Reviewed-by: Thomas Huth &lt;thuth@redhat.com&gt;
Message-ID: &lt;20231124044554.513752-1-xun794@gmail.com&gt;
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
</content>
</entry>
<entry>
<title>linux-user/sh4: Fix crashes on signal delivery</title>
<updated>2023-10-18T22:32:16Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2023-09-28T16:42:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=3b894b699c9a9c064466e128c18be80a3f2113bc'/>
<id>urn:sha1:3b894b699c9a9c064466e128c18be80a3f2113bc</id>
<content type='text'>
sh4 uses gUSA (general UserSpace Atomicity) to provide atomicity on CPUs
that don't have atomic instructions. A gUSA region that adds 1 to an
atomic variable stored in @R2 looks like this:

  4004b6:       03 c7           mova    4004c4 &lt;gusa+0x10&gt;,r0
  4004b8:       f3 61           mov     r15,r1
  4004ba:       09 00           nop
  4004bc:       fa ef           mov     #-6,r15
  4004be:       22 63           mov.l   @r2,r3
  4004c0:       01 73           add     #1,r3
  4004c2:       32 22           mov.l   r3,@r2
  4004c4:       13 6f           mov     r1,r15

R0 contains a pointer to the end of the gUSA region
R1 contains the saved stack pointer
R15 contains negative length of the gUSA region

When this region is interrupted by a signal, the kernel detects if
R15 &gt;= -128U. If yes, the kernel rolls back PC to the beginning of the
region and restores SP by copying R1 to R15.

The problem happens if we are interrupted by a signal at address 4004c4.
R15 still holds the value -6, but the atomic value was already written by
an instruction at address 4004c2. In this situation we can't undo the
gUSA. The function unwind_gusa does nothing, the signal handler attempts
to push a signal frame to the address -6 and crashes.

This patch fixes it, so that if we are interrupted at the last instruction
in a gUSA region, we copy R1 to R15 to restore the correct stack pointer
and avoid crashing.

There's another bug: if we are interrupted in a delay slot, we save the
address of the instruction in the delay slot. We must save the address of
the previous instruction.

Cc: qemu-stable@nongnu.org
Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Reviewed-by: Yoshinori Sato &lt;ysato@users.sourcefoege.jp&gt;
Message-Id: &lt;b16389f7-6c62-70b7-59b3-87533c0bcc@redhat.com&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>linux-user: Split out cpu/target_proc.h</title>
<updated>2023-09-01T20:33:09Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-08-24T00:13:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=121c8dd69d7fa91558954eadc11bb6ce0474713c'/>
<id>urn:sha1:121c8dd69d7fa91558954eadc11bb6ce0474713c</id>
<content type='text'>
Move the various open_cpuinfo functions into new files.
Move the m68k open_hardware function as well.
All other guest architectures get a boilerplate empty file.

Tested-by: Helge Deller &lt;deller@gmx.de&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>linux-user: Define ELF_ET_DYN_BASE in $guest/target_mman.h</title>
<updated>2023-08-08T20:27:15Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-08-02T22:17:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=da2b71fab63f2396396021917eed9d52f33a45c0'/>
<id>urn:sha1:da2b71fab63f2396396021917eed9d52f33a45c0</id>
<content type='text'>
Copy each guest kernel's default value, then bound it
against reserved_va or the host address space.

Tested-by: Helge Deller &lt;deller@gmx.de&gt;
Reviewed-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>linux-user: Define TASK_UNMAPPED_BASE in $guest/target_mman.h</title>
<updated>2023-08-08T20:24:27Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-08-02T21:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=2d708164e0475064e0e2167bd73e8570e22df1e0'/>
<id>urn:sha1:2d708164e0475064e0e2167bd73e8570e22df1e0</id>
<content type='text'>
Provide default values that are as close as possible to the
values used by the guest's kernel.

Tested-by: Helge Deller &lt;deller@gmx.de&gt;
Reviewed-by: Helge Deller &lt;deller@gmx.de&gt;
Reviewed-by: Akihiko Odaki &lt;akihiko.odaki@daynix.com&gt;
Reviewed-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>linux-user: move target_flat.h to target subdirs</title>
<updated>2023-02-03T21:55:12Z</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2023-01-29T00:46:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=95fc5ed4a86b0d173bf55daf32e1697d11062648'/>
<id>urn:sha1:95fc5ed4a86b0d173bf55daf32e1697d11062648</id>
<content type='text'>
This makes target_flat.h behave like every other target_xxx.h header.
It also makes it actually work -- while the current header says adding
a header to the target subdir overrides the common one, it doesn't.
This is for two reasons:
* meson.build adds -Ilinux-user before -Ilinux-user/$arch
* the compiler search path for "target_flat.h" looks in the same dir
  as the source file before searching -I paths.

This can be seen with the xtensa port -- the subdir settings aren't
used which breaks stack setup.

Move it to the generic/ subdir and add include stubs like every
other target_xxx.h header is handled.

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20230129004625.11228-1-vapier@gentoo.org&gt;
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>target/sh4: Fix TB_FLAG_UNALIGN</title>
<updated>2022-10-04T19:33:05Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2022-08-29T01:58:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=ab419fd8a035a65942de4e63effcd55ccbf1a9fe'/>
<id>urn:sha1:ab419fd8a035a65942de4e63effcd55ccbf1a9fe</id>
<content type='text'>
The value previously chosen overlaps GUSA_MASK.

Rename all DELAY_SLOT_* and GUSA_* defines to emphasize
that they are included in TB_FLAGs.  Add aliases for the
FPSCR and SR bits that are included in TB_FLAGS, so that
we don't accidentally reassign those bits.

Fixes: 4da06fb3062 ("target/sh4: Implement prctl_unalign_sigbus")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/856
Reviewed-by: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>linux-user: Provide MADV_* definitions</title>
<updated>2022-09-27T07:30:09Z</updated>
<author>
<name>Ilya Leoshkevich</name>
<email>iii@linux.ibm.com</email>
</author>
<published>2022-09-06T00:08:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=9f22020b91ae235be2b27c47d11e842872ec5e85'/>
<id>urn:sha1:9f22020b91ae235be2b27c47d11e842872ec5e85</id>
<content type='text'>
Provide MADV_* definitions using target_mman.h header, similar to what
kernel does. Most architectures use the same values, with the exception
of alpha and hppa.

Signed-off-by: Ilya Leoshkevich &lt;iii@linux.ibm.com&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Message-Id: &lt;20220906000839.1672934-2-iii@linux.ibm.com&gt;
Signed-off-by: Laurent Vivier &lt;laurent@vivier.eu&gt;
</content>
</entry>
<entry>
<title>Remove qemu-common.h include from most units</title>
<updated>2022-04-06T12:31:55Z</updated>
<author>
<name>Marc-André Lureau</name>
<email>marcandre.lureau@redhat.com</email>
</author>
<published>2022-03-23T15:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=0f9668e0c197ab6de95f61a906703a1d127c11f8'/>
<id>urn:sha1:0f9668e0c197ab6de95f61a906703a1d127c11f8</id>
<content type='text'>
Signed-off-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Message-Id: &lt;20220323155743.1585078-33-marcandre.lureau@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
