On Wed Oct 19 09:30:41 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_9180_9216)
Done in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11306
On Wed Oct 19 09:30:44 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_9185_9222)
Done in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11305
On Wed Oct 19 09:30:46 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_9196_9222)
Done in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11304
On Wed Oct 19 09:30:48 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_9004_9004)
Done in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11303
On Wed Oct 19 09:30:54 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_9210_9259)
Done in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11302
On Wed Oct 19 09:30:56 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_9225_9259)
Done in v3 of the patch.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11301
On Wed Oct 19 09:30:58 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_9265_9259)
Done in v3 of the patch.
Should I respond to all of these if I think it's been done?
Should I mark the thread resolved if I think it's been done, or is that something the reviewer should do?
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11300
On Tue Oct 18 10:04:52 2022 +0000, Matteo Bruni wrote:
> First of all, sorry for the delay.
> These are some good tests, in principle. They already show that the
> implementation is not correct (e.g. it doesn't sanitize D3DXPT_BOOL
> values to 0/1) but I guess you already knew that.
> Actually, in regard to that point specifically: assuming that
> SetRawValue() does in fact do what it says, it suggests that BOOL values
> are stored unchanged and are instead sanitized on use (or e.g. by
> GetValue()). That's probably something that we want to fix in our
> implementation, separately from SetRawValue() itself. Marking the
> relevant tests as todo_wine initially and fixing them afterwards is an option.
> The expected results used by the tests are muddied quite a bit by the
> fact that the parameter value is not cleared to 0 (or any other value)
> between individual tests. That also makes it more complicated than
> necessary to add more tests. I'd fix that by explicitly clearing the
> tested parameter before each test.
> WRT your questions:
> 1. I think you can simply compute the expected results beforehand and
> put them into static const variables. You can certainly e.g. use your
> test_effect_setrawvalue_init_floats() function with some additional
> traces to figure out what those values are supposed to be, but I don't
> see any reason to recalculate the expected results at runtime in the
> final tests. It might make sense to have a comment in the test
> explaining what those "weird" expected results actually mean, hard to
> say at this point.
> 2. If I understand the test correctly, there is no evidence that
> SetRawValue() can "overflow" the current parameter. Either way, I think
> it's a matter of cutting the value size to the maximum of bytes and
> param->bytes or something like that.
> 3. For sure :smile:. I think we used the /Fx output parameter to get
> DWORD data.
> 4. Testing that SetRawValue() doesn't affect the "next" parameter when
> used with larger offsets / sizes is probably interesting. I also have a
> bunch of comments that I'll mention inline. There's most likely more,
> it's not an exhaustive list.
> One more thing. I saw you just pushed a new version of the patches,
> fixing a couple issues I had noticed. Nice, but generally please wait to
> push updates while I have the MR assigned to me, it means I'm actively
> reviewing it and changing stuff at that time can be somewhat disruptive
> for me.
Sorry about the unexpected push, I'll be more careful next time.
With regards to the bool fixups, are we sure we want to just write the raw data given to us? I ask because I've also noticed that SetRawValue() has a tendency to promote datatypes when given a single value and a vector / matrix paramater. I.e. float and int become a float4 and int4 respectively for both vectors and matrices. (MSDN calls this behavior a "cast.") This results in the next 3 values in the paramater's buffer being set to zero.
Assuming SetRawValue() shouldn't fix the bool values itself, should it also avoid fixing the ints and floats? If so, how should we indicate the need for a fixup to other functions? There doesn't seem to be any infrastructure to support that in wine currently. (We could abuse the paramater block support for that, but see the speculation below.)
The float and int promotions were the reason I didn't clear the paramater after each test. As doing so would cause us to miss the writes to the next 3 values in the paramater. As they would already be set to zero before the call. Should I still go ahead and clear the paramaters after each test anyway?
As a dirty hack, I added a call to zero out the paramaters after each test with a 4x4 matrix of zero ints in v3 of the test. That call is commented out in the push, but if you enable it it will succeed for most of the tests under win10. (I disabled it before I fixed the string test crashes. So it may work fine now, I haven't checked.) I haven't tried checking the paramaters after the current one for alterations. I was going to put that in it's own set of tests.
This part is speculation but, if it is a valid use of SetRawValue() to set adjacent paramaters regardless of type with one call, then the entire set of paramaters for a given effect needs to be in the same memory block. (Which seems to be not the case in wine, as there are plenty of calls to heap_alloc() / heap_realloc() using the param->data pointer in effect.c.) That would also imply that there is a specific ordering of paramaters in memory as well. Which would need to be tested for. If this behavior is combined with the bool assumption above, then we'd also need to test for order of operations too.
Assuming all of that needs to be done, how do we split this up? Because I have a feeling that this patchset is going to be rather large in scope. (If all of the assumptions and speculation are true that is.)
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/979#note_11299
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