Thanks for the patch! Reading and following the instructions at https://wiki.winehq.org/Submitting_Patches will improve the chances of it being accepted.
Please use your real name in the Git commit, for example:
```
git config --global user.name "Your Name"
git commit --amend --reset-author
git push --force
```
Also, drop "See Bug 53960" and "This patch fixes that" from the commit message, wrap the paragraph of explanation to 72 characters per line, and add a new line `Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53960` at the end of the commit message.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5752#note_71951
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v4: virtual_get_min_large_page_size: initialize min_size to 0
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v3: create_memfd: Remove call to file_set_error, create with MFD_EXEC.
Add test_large_page_file_mapping to validate large page support.
NtCreateSection: Validate parameters if large pages are requested.
Check for LockMemoryPrivilege when creating large page mappings.
GetLargePageMinimum: use wine_unix_get_min_large_page_size.
Add functions for determining the minimum supported large page size.
Add SeLockMemoryPrivilege to the list of admin privileges.
create_temp_file: If available, use memfd for backing unnamed files.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## `ntdll`
* Add `virtual_get_min_large_page_size` and its exported wrapper `wine_unix_get_min_large_page_size`.
* On Linux, the minimum page size is determined by going through `/sys/kernel/mm/hugepages`. If hugepage support was not detected, `STATUS_NOT_SUPPORTED` is returned instead. On other platforms, the older hard-coded value of 2\*1024\*1024 is returned instead.
* `NtCreateSection` will validate certain parameters if large pages are requested. Specifically, it will return STATUS_INVALID_PARAMETER if the requested mapping is not anonymous/unnamed, or the size is not a multiple of the minimum supported page size.
## `kernelbase`
* `GetLargePageMinimum` will use `wine_unix_get_min_large_page_size`.
## `kernel32/tests`
* Add new test test_large_page_file_mapping, which validates privilege enforcements and parameter validation while creating large pages backed file mapping obejcts. The tests are skipped if `GetLargePageMinimum` returns 0.
--
v2: create_memfd: Remove call to file_set_error, create with MFD_EXEC.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
On Thu May 30 19:34:47 2024 +0000, Gabriel Ivăncescu wrote:
> > There is a difference between C/C++ and JS that we need to cover one
> way or another. C implementation is bound to a specific object type,
> which makes using `impl_from_*` possible. To keep that possibility in
> hooks, they need to be bound to a specific object type as well. More
> idiomatically: hooks are a part of C implementation of JS functions and
> C implementations are specific to object instance type.
> Well yes, of course they check for the object type compatibility, but in
> the end they should still preserve their "function identity" instead of
> being looked up from the object everytime, even if it's completely
> detached from it.
> > Do you have a branch where I could see it in action?
> I need to fix a couple things but I will update the branch tomorrow with
> the prototype chains most likely. (it's probably not 100% perfectly
> designed but I mean the general idea)
I've updated the branch with prototype chains; there's a lot of commits
in-between so please ignore them for now (some are split, some aren't
ready for upstream review), since order (same as from Proton) is like:
basic proxy impl->cycle collection integration->proper global host
window->basic prototypes (only one, no chains)->constructors->prototype
chains
Probably first commit of interest would be
`d672d8b44ef084106c59b30fa01952fe4daf9189` aka `mshtml: Copy the builtin
data to the proxy prototype on init.`
Or you can just run the tests and change the BuiltinFuncCall to use the
DISPID (no need to check IID for testing), proxy_prop_info should
already get the dispid anyway (for proxy props) and see why it fails.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5444#note_71942
This MR adds support for creating file mapping objects backed by large pages on Linux, by making the following changes:
## wineserver
* On Linux, `create_temp_file` will first attempt to use memfds as the backing fd. If it fails, it'll return to the current codepath, creating a temporary file in either the server or config directory.
* The created memfd will be sealed against writes, if the caller requesting the appropriate page protection flags.
* This removes the requirement that FDs be only created on filesystems/directories that aren't `noexec`.
* In the server method `create_mapping` , if large pages have been requested by the caller, hold that the calling thread's token holds `SeLockMemoryPrivilege` .
* Additionally, add `SeLockMemoryPrivilege` to the list of privileges enabled for the Administrator.
## ntdll
* Add `virtual_get_min_large_page_size` and its exported wrapper wine_unix_get_min_large_page_size
### `kernelbase.dll`
*
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/5769
--
v2: mshtml: Move IDispatchEx forwarding implementation to outer window object.
mshtml: Use macro for window object IDispatch functions implementation.
mshtml: Use DispatchEx vtbl for all window properties.
https://gitlab.winehq.org/wine/wine/-/merge_requests/5766