{"id":15357425,"url":"https://github.com/thorio/pat-dealloc","last_synced_at":"2026-04-17T09:32:17.892Z","repository":{"id":230936381,"uuid":"780509880","full_name":"thorio/pat-dealloc","owner":"thorio","description":"Stupid kernel module and userspace helper to free PAT memtypes","archived":false,"fork":false,"pushed_at":"2025-01-05T16:55:00.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-12-08T01:40:46.883Z","etag":null,"topics":["command-line-tool","linux-kernel","x86-pat"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thorio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-01T16:24:43.000Z","updated_at":"2025-01-05T16:54:40.000Z","dependencies_parsed_at":"2024-04-05T17:40:21.440Z","dependency_job_id":"cbfebb6f-8821-42e3-9d78-d695abcee38b","html_url":"https://github.com/thorio/pat-dealloc","commit_stats":null,"previous_names":["thorio/pat_dealloc","thorio/pat-dealloc"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thorio/pat-dealloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorio%2Fpat-dealloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorio%2Fpat-dealloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorio%2Fpat-dealloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorio%2Fpat-dealloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thorio","download_url":"https://codeload.github.com/thorio/pat-dealloc/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorio%2Fpat-dealloc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31923134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T09:10:15.403Z","status":"ssl_error","status_checked_at":"2026-04-17T09:10:14.455Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","linux-kernel","x86-pat"],"created_at":"2024-10-01T12:35:01.259Z","updated_at":"2026-04-17T09:32:17.868Z","avatar_url":"https://github.com/thorio.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pat-dealloc\n\n![GitHub License](https://img.shields.io/github/license/thorio/pat-dealloc?style=flat-square)\n![GitHub last commit](https://img.shields.io/github/last-commit/thorio/pat-dealloc?style=flat-square)\n[![AUR Version](https://img.shields.io/aur/version/pat-dealloc-dkms?style=flat-square)](https://aur.archlinux.org/packages/pat-dealloc-dkms)\n\nA kernel module and helper utility to remove PAT entries. May cause issues if used incorrectly, so proceed with caution.  \nIntended as a less dodgy workaround for this issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2794\n\nAlso my first kernel module and first (sort of) useful thing written in C.\n\n## Usage\n\n### WARNING\nThe kernel module **DOES NOT CARE** what you give it: as long as it parses it will try to `memtype_free` the address range(s) you supply, even if that memory is still in use by a driver. Doing this while anything is actively using that memory *might* result in memory corruption. **USE AT YOUR OWN RISK**.\n\nBest to unload/stop relevant drivers before running this.\n\n### Standalone\nWrite a string like this `0x000000f81c650000-0x000000f81c651000` to `/dev/pat_dealloc` in a single write call, without a newline. The module will stupidly attempt to free the given range, check kernel logs.\n\n### With the helper\nRun `pat-dealloc raw --start 0x000000f81c650000 --end 0x000000f81c651000` to accomplish the same as the example above.\n\nAlternatively, run `pat-dealloc pci --address 0000:01:00.0` to free all reserved PAT entries for the given PCI device.\n\nYou can append `--load` to either of these to automatically load the kernel module for you.\n\n## Building\n\nYou will need rust set up and linux headers installed. The makefile was written for arch and might need tweaking on other distros (PRs welcome).  \nYou will also need to re-compile the module for every new kernel you run, which can be automated with [dkms](https://wiki.archlinux.org/title/Dynamic_Kernel_Module_Support) or similar.\n\n`cargo build` to compile the userspace helper. `./target/debug/pat-dealloc` as root to run it.\n\n`cd` into `module` and run `make` to compile the kernel module. Then `insmod pat_dealloc.ko` as root.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorio%2Fpat-dealloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthorio%2Fpat-dealloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorio%2Fpat-dealloc/lists"}