This change is adding DWARF (CFI) unwind information to the
hand-written assembly of the `__wine_syscall_dispatcher` function.
This enables unwinding through the dispatcher from the Linux stack
into (and through) the Windows stack.
The general idea is that the `syscall_frame` struct contains the
content of the callee-save registers before the function call
(in particular the stack pointer and the return address). At any
point of the execution, we have a pointer into the `syscall_frame`
in $rcx, $rbp or $rsp.
For the CFI codes the general idea is that we are defining the
computations of the callee-save registers based on the
`syscall_frame` using DWARF’s `breg` instruction, rather than
relative to CFA.
This change adds a bunch of convenience macros, to (hopefully)
improve readability of the CFI instructions.
Note: Those change was used with great success for unwinding through
the dispatcher using a modified LLDB shown in the
[“how-wine-works-101”](https://werat.dev/blog/how-wine-works-101/)
blog post as well as for in the [Orbit profiler](https://github.com/google/orbit),
that has mixed-callstack unwinding support.
Test: Inspect callstacks reported by the Orbit profiler while
running some Windows targets using the modified wine, as well as
verify debugging reports correct callstacks when stepping with our
modified LLDB through the dispatcher itself (so that we are able
to unwind through the dispatcher at any instruction).
--
v7: ntdll: Add CFI unwind info to __wine_syscall_dispatcher (x86_64)
https://gitlab.winehq.org/wine/wine/-/merge_requests/1065
On Tue Oct 18 23:34:47 2022 +0000, Rémi Bernon wrote:
> The cause of the failure was that we're using incorrect mutex names in
> some places for the `display_device_init` mutex. In some unlikely event,
> which becomes apparently more likely with the changes here,
> `D3DKMTOpenAdapterFromGdiDisplayName` was able to enter the mutex CS at
> the same time as the devices are refreshed, and fails to find the video
> device in `HKLM\\HARDWARE\\DEVICEMAP\\VIDEO`, returning an error which
> ultimately triggers an allocation failure.
> This should never happens as the device refresh should also be done
> while holding the same mutex, but because the names were wrong it was
> two different mutexes. I've opened
> https://gitlab.winehq.org/wine/wine/-/merge_requests/1099 to fix this.
> This is for the `d3drm` tests failure at least, I didn't look at the
> ddraw ones, hopefully it's the same problem.
Marvin reported the same `ddraw7` errors in !1099, so they may not be fixed. I'm not able to reproduce them locally so far, using the same kind of setup as Gitlab and running the tests in a loop.
These take a longer time, especially as I'm running the other d3d tests with ddraw in case they have an impact, so it's possible I'm simply being unlucky, or that they are somehow only happening on the testbot now. I'll probably stop looking for now and see how things improve with that MR.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/944#note_11293
On Wed Oct 19 09:30:52 2022 +0000, Patrick Hibbs wrote:
> changed this line in [version 5 of the diff](/wine/wine/-/merge_requests/979/diffs?diff_id=14510&start_sha=9be4873a7477520f0eb74837f2a269f864a9ac13#6af8d13245d87d86339fd93c308f9d2332f22092_9206_9250)
That was a leftover I missed from a previous iteration of the test. It's been removed in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11292
On Wed Oct 19 09:30:34 2022 +0000, Patrick Hibbs wrote:
> changed this line in [version 5 of the diff](/wine/wine/-/merge_requests/979/diffs?diff_id=14510&start_sha=9be4873a7477520f0eb74837f2a269f864a9ac13#6af8d13245d87d86339fd93c308f9d2332f22092_9089_9004)
The same issue with strings occurs with Texture and shader types.
I.e. Paramater is rendered irretrievable. Calling it's relevant GetXXX() function causes a crash if it's a scalar. Calling GetParamaterByName() will return an invalid handle.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11291
On Wed Oct 19 09:30:33 2022 +0000, Patrick Hibbs wrote:
> changed this line in [version 5 of the diff](/wine/wine/-/merge_requests/979/diffs?diff_id=14510&start_sha=9be4873a7477520f0eb74837f2a269f864a9ac13#6af8d13245d87d86339fd93c308f9d2332f22092_9077_9004)
Actually it seems that the strings are rendered irretrievable by the call to SetRawValue().
Calling GetString() on a scalar string after the destruction causes a crash in win10. While calling it with a string vector doesn't crash, but returns D3DERR_INVALIDCALL instead.
I've updated the tests in v3 of the patch to check for this.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11290
This seems to be more correct than what we previously had with fewer lines of code, so I like that. I still don't really like the extra flag I had to add for Nt{Create,Open}Key, but I couldn't find a way to make things work without it. I also checked that Windows doesn't use a similar flag (by iterating over all bit masks).
--
v3: wine.inf: Put the Clients key in the right place.
ntdll/tests: Factor out the NtEnumerateKey() tests.
kernelbase: Remove special Wow64 handling for HKEY_CLASSES_ROOT.
kernelbase: Remove special Wow6432Node handling from RegCreateKeyEx().
kernelbase: Remove special Wow6432Node handling from RegOpenKeyEx().
server: Don't return the actual 32-bit Software\Classes key.
ntdll/tests: Add some some Software\Classes query and enumerate tests.
ntdll/tests: Test that NtCreateKeyEx() also recursively obtains the Wow6432Node parent.
server: Recursively obtain the Wow6432Node parent.
https://gitlab.winehq.org/wine/wine/-/merge_requests/966
This is the first in a series of MRs to get rid of the `HTMLDocument` basedoc struct and separate the `HTMLDocumentNode` and `HTMLDocumentObj`, as suggested. The other interfaces and fields will be done in follow-up MRs. It should be a no-op in general.
Some of the things are ugly but temporary (e.g. the chunk in `HTMLDocument_put_designMode` on first commit) until the entire transition is done, then they will be cleaned up.
For most of the interfaces, they all deal with doc objects in most cases, so the implementation on HTMLDocumentNode tends to just forward to that. There are exceptions of course, but care has been taken to have them mostly no-ops ("mostly" because there's cases where the previous code did not check for e.g. NULL node, so it would crash instead, which is bad and should be fixed now).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1078