<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pm24.git/arch/x86/um/shared, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.kobert.dev/pm24.git/atom/arch/x86/um/shared?h=master</id>
<link rel='self' href='https://git.kobert.dev/pm24.git/atom/arch/x86/um/shared?h=master'/>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/'/>
<updated>2024-10-23T10:13:16Z</updated>
<entry>
<title>um: switch to regset API and depend on XSTATE</title>
<updated>2024-10-23T10:13:16Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2024-10-23T09:41:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=3f17fed2149192c7d3b76a45a6a87b4ff22cd586'/>
<id>urn:sha1:3f17fed2149192c7d3b76a45a6a87b4ff22cd586</id>
<content type='text'>
The PTRACE_GETREGSET API has now existed since Linux 2.6.33. The XSAVE
CPU feature should also be sufficiently common to be able to rely on it.

With this, define our internal FP state to be the hosts XSAVE data. Add
discovery for the hosts XSAVE size and place the FP registers at the end
of task_struct so that we can adjust the size at runtime.

Next we can implement the regset API on top and update the signal
handling as well as ptrace APIs to use them. Also switch coredump
creation to use the regset API and finally set HAVE_ARCH_TRACEHOOK.

This considerably improves the signal frames. Previously they might not
have contained all the registers (i386) and also did not have the
sizes and magic values set to the correct values to permit userspace to
decode the frame.

As a side effect, this will permit UML to run on hosts with newer CPU
extensions (such as AMX) that need even more register state.

Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Link: https://patch.msgid.link/20241023094120.4083426-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: make stub_exe _start() pure inline asm</title>
<updated>2024-10-23T07:04:59Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2024-10-22T12:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=14d4a7b516e993cf3926758a7ede569d8e119855'/>
<id>urn:sha1:14d4a7b516e993cf3926758a7ede569d8e119855</id>
<content type='text'>
Since __attribute__((naked)) cannot be used with functions
containing C statements, just generate the few instructions
it needs in assembly directly.

While at it, fix the stack usage ("1 + 2*x - 1" is odd) and
document what it must do, and why it must adjust the stack.

Fixes: 8508a5e0e9db ("um: Fix misaligned stack in stub_exe")
Link: https://lore.kernel.org/linux-um/CABVgOSntH-uoOFMP5HwMXjx_f1osMnVdhgKRKm4uz6DFm2Lb8Q@mail.gmail.com/
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: Calculate stub data address relative to stub code</title>
<updated>2024-10-10T11:37:22Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2024-09-19T12:45:07Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=91f0a0c5cc5bc863888a936fbd05394c6e284466'/>
<id>urn:sha1:91f0a0c5cc5bc863888a936fbd05394c6e284466</id>
<content type='text'>
Instead of using the current stack pointer, we can also use the current
instruction to calculate where the stub data is. With this the stub data
only needs to be aligned to a full page boundary.

Changing this has the advantage that we do not have a hole in the memory
space above the stub data (which would need to be explicitly cleared).

Another motivation to do this is that with the planned addition of a
SECCOMP based userspace the stack pointer may not be fully trustworthy.

Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Link: https://patch.msgid.link/20240919124511.282088-7-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: Add generic stub_syscall1 function</title>
<updated>2024-10-10T10:29:08Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2024-09-19T12:45:02Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=cbb8e65e234e0139c0c516bb6b9110d210eecd3f'/>
<id>urn:sha1:cbb8e65e234e0139c0c516bb6b9110d210eecd3f</id>
<content type='text'>
The 64bit version did not have a stub_syscall1 function yet. Add it as
it will be useful to implement a static binary for stub loading.

Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Link: https://patch.msgid.link/20240919124511.282088-2-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: remove copy_context_skas0</title>
<updated>2024-07-03T15:09:49Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin.berg@intel.com</email>
</author>
<published>2024-07-03T13:45:31Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=a5d2cfe749e2917266956751262328da35e0925d'/>
<id>urn:sha1:a5d2cfe749e2917266956751262328da35e0925d</id>
<content type='text'>
The kernel flushes the memory ranges anyway for CoW and does not assume
that the userspace process has anything set up already. So, start with a
fresh process for the new mm context.

Signed-off-by: Benjamin Berg &lt;benjamin.berg@intel.com&gt;
Link: https://patch.msgid.link/20240703134536.1161108-8-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: Rework syscall handling</title>
<updated>2024-07-03T15:09:49Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin@sipsolutions.net</email>
</author>
<published>2024-07-03T13:45:28Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=76ed9158e1d474e963fc59da7a461b27a2212c5a'/>
<id>urn:sha1:76ed9158e1d474e963fc59da7a461b27a2212c5a</id>
<content type='text'>
Rework syscall handling to be platform independent. Also create a clean
split between queueing of syscalls and flushing them out, removing the
need to keep state in the code that triggers the syscalls.

The code adds syscall_data_len to the global mm_id structure. This will
be used later to allow surrounding code to track whether syscalls still
need to run and if errors occurred.

Signed-off-by: Benjamin Berg &lt;benjamin@sipsolutions.net&gt;
Link: https://patch.msgid.link/20240703134536.1161108-5-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: Add generic stub_syscall6 function</title>
<updated>2024-07-03T15:09:49Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin@sipsolutions.net</email>
</author>
<published>2024-07-03T13:45:27Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=542dc79f6ea601788704a79ff54283c2bea265e9'/>
<id>urn:sha1:542dc79f6ea601788704a79ff54283c2bea265e9</id>
<content type='text'>
This function will be used by the new syscall handling code.

Signed-off-by: Benjamin Berg &lt;benjamin@sipsolutions.net&gt;
Link: https://patch.msgid.link/20240703134536.1161108-4-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: Remove stub-data.h include from common-offsets.h</title>
<updated>2024-07-03T15:09:48Z</updated>
<author>
<name>Benjamin Berg</name>
<email>benjamin@sipsolutions.net</email>
</author>
<published>2024-07-03T13:45:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=d1d3a2e69b2419d77f8f99315ac931c5ba3cb475'/>
<id>urn:sha1:d1d3a2e69b2419d77f8f99315ac931c5ba3cb475</id>
<content type='text'>
Further commits will require values from common-offsets.h inside
stub-data.h. Resolve the possible circular dependency and simply use
offsetof() inside stub_32.h and stub_64.h.

Signed-off-by: Benjamin Berg &lt;benjamin@sipsolutions.net&gt;
Link: https://patch.msgid.link/20240703134536.1161108-2-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
</content>
</entry>
<entry>
<title>um: Fix the -Wmissing-prototypes warning for get_thread_reg</title>
<updated>2024-04-30T12:15:17Z</updated>
<author>
<name>Tiwei Bie</name>
<email>tiwei.btw@antgroup.com</email>
</author>
<published>2024-04-23T12:58:54Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=3144013e48f4f6e5127223c4ebc488016815dedb'/>
<id>urn:sha1:3144013e48f4f6e5127223c4ebc488016815dedb</id>
<content type='text'>
The get_thread_reg function is defined in the user code, and is
called by the kernel code. It should be declared in a shared header.

Fixes: dbba7f704aa0 ("um: stop polluting the namespace with registers.h contents")
Signed-off-by: Tiwei Bie &lt;tiwei.btw@antgroup.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Fix -Wmissing-prototypes warnings for __warp_* and foo</title>
<updated>2024-04-22T19:58:48Z</updated>
<author>
<name>Tiwei Bie</name>
<email>tiwei.btw@antgroup.com</email>
</author>
<published>2024-03-06T10:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.kobert.dev/pm24.git/commit/?id=49ff7d871242d7fd8adb8a2d8347c5d94dda808b'/>
<id>urn:sha1:49ff7d871242d7fd8adb8a2d8347c5d94dda808b</id>
<content type='text'>
These functions are not called explicitly. Let's just workaround
the -Wmissing-prototypes warnings by declaring them locally similar
to what was done in arch/x86/kernel/asm-offsets_32.c.

This will address below -Wmissing-prototypes warnings:

./arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes]
arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes]
arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes]

Signed-off-by: Tiwei Bie &lt;tiwei.btw@antgroup.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
</feed>
