tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PT32_[GS]ETXMMREGS for amd64 (Was: netbsd32_{,u}int64 in sys/types.h for compat/sys/siginfo.h)



Hi, thank you for your review!

On 2019/11/22 0:48, Kamil Rytarowski wrote:
On 21.11.2019 10:49, Rin Okuyama wrote:
...
I wrote a draft version of patch which adds PT32_[GS]ETXMMREGS support:

http://www.netbsd.org/~rin/amd64-PT32_GSETXMMREGS-20191121.patch

With this patch, XMM-related tests pass for COMPAT_NETBSD32 on amd64.

Some remarks:

(1) PT_[GS]ETXMMREGS ptrace(2) commands are added to <machine/ptrace.h>.
     These are only used for COMPAT_NETBSD32, and not exposed to userland.


This is correct.
We don't want to export XMMREGS to amd64 users.

Pleae remove /* */ from this part:

+/*
+	"PT_GETXMMREGS", \
+	"PT_SETXMMREGS"
+ */

Yes, I will.

This will allow ktruss and related software to have meaningful form for
compat32 ptracing.

(2) COMPAT_NETBSD32 codes are called from process_machdep.c via
     module_hook framework. This may be too much though...


I have no opinion here.

Now, Paul and I are discussed how to improve the usage of module_hook.
I will update this part in accordance with his advice.

Comments?


I will leave this to be reviewed by mgorny@. Adding him to CC.

I see. Hi, mgorny@. Please look into it!
http://www.netbsd.org/~rin/amd64-PT32_GSETXMMREGS-20191121.patch

Also, it seems that some COMPAT_NETBSD32 related codes for amd64 need to
be cleaned up. For example, there remain COMPAT_NETBSD32 codes in
amd64/process_machdep.c, that are no longer used:

https://nxr.netbsd.org/xref/src/sys/arch/amd64/amd64/process_machdep.c#129

https://nxr.netbsd.org/xref/src/sys/arch/amd64/amd64/process_machdep.c#183

...

I will examine them too.

This was my misunderstanding. These codes are used when tracer is 64-bit
and traced is 32-bit. Don't know whether this is useful though...

Thanks,
rin

Maxime added it. If you want to change it, please consult with maxv@.

OK. It must be useful for a tracer capable for both 64- and 32-bit
processes (although, we also need to provide x87-style fpregs for
64-bit tracer in some way).

Thanks,
rin


Home | Main Index | Thread Index | Old Index