<feed xmlns='http://www.w3.org/2005/Atom'>
<title>yuzu/src/video_core/query_cache.h, branch main</title>
<subtitle>Nintendo Switch emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/'/>
<entry>
<title>VideoCore: Move Slot Vector to Common</title>
<updated>2024-02-04T19:01:47+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2024-02-03T21:51:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=4841dc0b745389fb03edbf900f25511bee4b3d88'/>
<id>4841dc0b745389fb03edbf900f25511bee4b3d88</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Core: Eliminate core/memory dependancies.</title>
<updated>2024-01-19T02:12:30+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2024-01-07T04:33:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=23430e67724d803184b6a861e4bcb3cac0e38cb0'/>
<id>23430e67724d803184b6a861e4bcb3cac0e38cb0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>SMMU: Initial adaptation to video_core.</title>
<updated>2024-01-19T02:12:30+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-12-25T06:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=0a2536a0df1f4aea406f2132d3edda0430acc9d1'/>
<id>0a2536a0df1f4aea406f2132d3edda0430acc9d1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>OpenGL: Add GL_PRIMITIVES_GENERATED and GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries</title>
<updated>2023-12-19T22:32:31+00:00</updated>
<author>
<name>Ameer J</name>
<email>52414509+ameerj@users.noreply.github.com</email>
</author>
<published>2023-12-19T22:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=db8a601cf82cd4797c32931f13a585c64527780d'/>
<id>db8a601cf82cd4797c32931f13a585c64527780d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Query Cachge: Fully rework Vulkan's query cache</title>
<updated>2023-09-23T21:05:29+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-08-04T01:32:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=f1a2e367113518b277f34ffbb04499882c3b6051'/>
<id>f1a2e367113518b277f34ffbb04499882c3b6051</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes and workarounds to make UBSan happier on macOS</title>
<updated>2023-07-15T19:00:28+00:00</updated>
<author>
<name>comex</name>
<email>comexk@gmail.com</email>
</author>
<published>2023-07-01T22:00:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=d7c532d8894ce806c9af13b8dd3eec975642b348'/>
<id>d7c532d8894ce806c9af13b8dd3eec975642b348</id>
<content type='text'>
There are still some other issues not addressed here, but it's a start.

Workarounds for false-positive reports:

- `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`,
  because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp)
  of how big it thinks objects can be, specifically when dealing with
  offset-to-top values used with multiple inheritance.  Hopefully this
  doesn't have a performance impact.

- `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks
  is UB even though it at least arguably isn't.  See the link in the
  comment for more information.

Fixes for correct reports:

- `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to
  avoid UB from pointer overflow (when pointer arithmetic wraps around
  the address space).

- `KScheduler::Reload`: `thread-&gt;GetOwnerProcess()` can be `nullptr`;
  avoid calling methods on it in this case.  (The existing code returns
  a garbage reference to a field, which is then passed into
  `LoadWatchpointArray`, and apparently it's never used, so it's
  harmless in practice but still triggers UBSan.)

- `KAutoObject::Close`: This function calls `this-&gt;Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this-&gt;UnregisterWithKernel()`.  UBSan
  complains about a type mismatch because the vtable has been
  overwritten, and I believe this is indeed UB.  `UnregisterWithKernel`
  also loads `m_kernel` from the 'freed' object, which seems to be
  technically safe (the overwriting doesn't extend as far as that
  field), but seems dubious.  Switch to a `static` method and load
  `m_kernel` in advance.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are still some other issues not addressed here, but it's a start.

Workarounds for false-positive reports:

- `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`,
  because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp)
  of how big it thinks objects can be, specifically when dealing with
  offset-to-top values used with multiple inheritance.  Hopefully this
  doesn't have a performance impact.

- `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks
  is UB even though it at least arguably isn't.  See the link in the
  comment for more information.

Fixes for correct reports:

- `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to
  avoid UB from pointer overflow (when pointer arithmetic wraps around
  the address space).

- `KScheduler::Reload`: `thread-&gt;GetOwnerProcess()` can be `nullptr`;
  avoid calling methods on it in this case.  (The existing code returns
  a garbage reference to a field, which is then passed into
  `LoadWatchpointArray`, and apparently it's never used, so it's
  harmless in practice but still triggers UBSan.)

- `KAutoObject::Close`: This function calls `this-&gt;Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this-&gt;UnregisterWithKernel()`.  UBSan
  complains about a type mismatch because the vtable has been
  overwritten, and I believe this is indeed UB.  `UnregisterWithKernel`
  also loads `m_kernel` from the 'freed' object, which seems to be
  technically safe (the overwriting doesn't extend as far as that
  field), but seems dubious.  Switch to a `static` method and load
  `m_kernel` in advance.
</pre>
</div>
</content>
</entry>
<entry>
<title>Query cache: stop updating pages as it's not affected by cpu writes</title>
<updated>2023-05-07T21:46:12+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-05-04T00:36:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=ab0c0a469c29900314847520f30d6edb914fa028'/>
<id>ab0c0a469c29900314847520f30d6edb914fa028</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>QueryCache: Fix write invalidation.</title>
<updated>2023-04-28T21:53:46+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-04-28T21:53:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=2f158765240623d5aea916cafca71b86be2d6fd4'/>
<id>2f158765240623d5aea916cafca71b86be2d6fd4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Clang format and ddress feedback</title>
<updated>2023-04-24T10:38:47+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-04-23T21:47:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=e4dc73f61e2546c07280abbd9bc098358a204c49'/>
<id>e4dc73f61e2546c07280abbd9bc098358a204c49</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>QueryCache: rework async downloads.</title>
<updated>2023-04-23T20:04:14+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-04-23T19:55:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=e29ced29fa54bf36a06545c53d1d523f3a31f883'/>
<id>e29ced29fa54bf36a06545c53d1d523f3a31f883</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
