By: anon2 (anon.delete@this.anon.com), September 16, 2021 5:16 pm
Room: Moderated Discussions
Carson (carson.delete@this.example.edu) on September 16, 2021 1:12 pm wrote:
> anon (anon.delete@this.ymous.org) on September 14, 2021 3:17 am wrote:
> > I have one question regarding not doing a TLB check on each load though. What is the safety net when
> > you have an inflight store to VA A and an inflight load from VA B and A and B are aliased ?
> >
> > Let's assume you enforce only one alias in the L1D. If currently the resident alias is A, the load
> > will return L1D data and miss the dependency with the store (since A != B, and so far we are not
> > getting a translation for the load because it hit in L1D). If currently the resident alias is B,
> > then the load will miss and go get a translation, to realize that there is aliasing going on, and
> > then it is not obvious that it would not still get the L1D data rather than the store data.
> >
> > So, basically, how do you do memory disambiguation without having each load
> > get a translation just so it can compare to stores in the PA space ? I suppose
> > you could do a pessimistic check with just the set and offset bits ?
>
> I'm confuzzled. You say the store is to VA A and the load is from VA B. So
> if the resident alias is A, the load will miss in L1 and not return L1 data.
>
> It's also not totally clear what the program order of the two accesses is. I assume A is first, but if I start
> assuming you got something backward and try to infer what you really meant, that assumption gets shaky.
>
> Basically, the same problem arises in store buffers. If I have "store A", "store B", "load A",
> the load will be satisfied from the first store based on a VA match. If it later turns out that
> B is an alias for A, the load must be unwound and retried. (This doesn't increase the amount
> of state storage required, because the load also has to be unwound if the store B faults.)
>
> Let me enumerate the four cases for a load and a store to virtual aliases:
>
>
> The solution to the last case also suffices for the store buffer aliasing problem: the load remains
> speculative until all preceding accesses are resolved and the cache line is still valid in L1.
>
> It's also not unlike the "load linked/store conditional" mechanism.
>
> But this whole situation shows how nightmarish it is preventing Meltdown attacks in the presence of virtual
> aliasing. Because the store could take a long time (page table walking) to be fully resolved, and the load
> does not alias nine-nines of the time, we really can't afford to wait before proceeding speculatively.
It's not really bad. It is somewhat like spectre variant 4. This is no problem with such speculation within a privilege domain. Between domains like a system call then you need to ensure prior stores are executed at least to a point where speculative data would not be used.
> anon (anon.delete@this.ymous.org) on September 14, 2021 3:17 am wrote:
> > I have one question regarding not doing a TLB check on each load though. What is the safety net when
> > you have an inflight store to VA A and an inflight load from VA B and A and B are aliased ?
> >
> > Let's assume you enforce only one alias in the L1D. If currently the resident alias is A, the load
> > will return L1D data and miss the dependency with the store (since A != B, and so far we are not
> > getting a translation for the load because it hit in L1D). If currently the resident alias is B,
> > then the load will miss and go get a translation, to realize that there is aliasing going on, and
> > then it is not obvious that it would not still get the L1D data rather than the store data.
> >
> > So, basically, how do you do memory disambiguation without having each load
> > get a translation just so it can compare to stores in the PA space ? I suppose
> > you could do a pessimistic check with just the set and offset bits ?
>
> I'm confuzzled. You say the store is to VA A and the load is from VA B. So
> if the resident alias is A, the load will miss in L1 and not return L1 data.
>
> It's also not totally clear what the program order of the two accesses is. I assume A is first, but if I start
> assuming you got something backward and try to infer what you really meant, that assumption gets shaky.
>
> Basically, the same problem arises in store buffers. If I have "store A", "store B", "load A",
> the load will be satisfied from the first store based on a VA match. If it later turns out that
> B is an alias for A, the load must be unwound and retried. (This doesn't increase the amount
> of state storage required, because the load also has to be unwound if the store B faults.)
>
> Let me enumerate the four cases for a load and a store to virtual aliases:
>
- Store first, store hits in L1. When the load misses, it will go through to the L2, which will detect
> the aliasing and force a write-back of the stored data before satisfying the load. - Load first, load hits
> in L1. Very similar, but the write-back is simpler because L1 is clean. - Load first, load misses in L1.
> Normally, the store is simply held in store buffers until all preceding loads complete, to avoid the
> problem of having to unwind a store if the load faults. The load forces an L1 alias swap, and by the
> time the store reaches L1, it misses and proceeds like the preceding case. - Store first, store misses
> in L1. Unlike the preceding case, we really do want the load to proceed speculatively because performance
> will suck if we don't. We satisfy the load from L1, but place a watchpoint on the corresponding L1 cache
> line until earlier accesses are resolved. (This is probably implemented as a "load buffer" CAM of speculative
> loads which is matched to incoming invalidates, as that it smaller than having space for multiple pending
> loads in each cache line.) If the L1 cache line is evicted while it is being watched, the oldest speculative
> load satisfied from that cache line is unwound and retried.
>
> The solution to the last case also suffices for the store buffer aliasing problem: the load remains
> speculative until all preceding accesses are resolved and the cache line is still valid in L1.
>
> It's also not unlike the "load linked/store conditional" mechanism.
>
> But this whole situation shows how nightmarish it is preventing Meltdown attacks in the presence of virtual
> aliasing. Because the store could take a long time (page table walking) to be fully resolved, and the load
> does not alias nine-nines of the time, we really can't afford to wait before proceeding speculatively.
It's not really bad. It is somewhat like spectre variant 4. This is no problem with such speculation within a privilege domain. Between domains like a system call then you need to ensure prior stores are executed at least to a point where speculative data would not be used.
Topic | Posted By | Date |
---|---|---|
POWER10 SAP SD benchmark | anon2 | 2021/09/06 03:36 PM |
POWER10 SAP SD benchmark | Daniel B | 2021/09/07 02:31 AM |
"Cores" (and SPEC) | Rayla | 2021/09/07 07:51 AM |
"Cores" (and SPEC) | anon | 2021/09/07 03:56 PM |
POWER10 SAP SD benchmark | Anon | 2021/09/07 03:24 PM |
POWER10 SAP SD benchmark | Anon | 2021/09/07 03:27 PM |
Virtually tagged L1-caches | sr | 2021/09/08 05:49 AM |
Virtually tagged L1-caches | dmcq | 2021/09/08 08:22 AM |
Virtually tagged L1-caches | sr | 2021/09/08 08:56 AM |
Virtually tagged L1-caches | Hugo Décharnes | 2021/09/08 08:58 AM |
Virtually tagged L1-caches | sr | 2021/09/08 10:09 AM |
Virtually tagged L1-caches | Hugo Décharnes | 2021/09/08 10:46 AM |
Virtually tagged L1-caches | sr | 2021/09/08 11:35 AM |
Virtually tagged L1-caches | Hugo Décharnes | 2021/09/08 12:23 PM |
Virtually tagged L1-caches | sr | 2021/09/08 12:40 PM |
Virtually tagged L1-caches | anon | 2021/09/09 03:16 AM |
Virtually tagged L1-caches | Konrad Schwarz | 2021/09/10 05:19 AM |
Virtually tagged L1-caches | Hugo Décharnes | 2021/09/10 06:59 AM |
Virtually tagged L1-caches | anon | 2021/09/14 03:17 AM |
Virtually tagged L1-caches | dmcq | 2021/09/14 09:34 AM |
Or use a PLB (NT) | Paul A. Clayton | 2021/09/14 09:45 AM |
Or use a PLB | Linus Torvalds | 2021/09/14 03:27 PM |
Or use a PLB | anon | 2021/09/15 12:15 AM |
Or use a PLB | Michael S | 2021/09/15 03:21 AM |
Or use a PLB | dmcq | 2021/09/15 03:42 PM |
Or use a PLB | Konrad Schwarz | 2021/09/16 04:24 AM |
Or use a PLB | Michael S | 2021/09/16 10:13 AM |
Or use a PLB | --- | 2021/09/16 01:02 PM |
PLB reference | Paul A. Clayton | 2021/09/18 02:35 PM |
PLB reference | Michael S | 2021/09/18 04:14 PM |
Demand paging/translation orthogonal | Paul A. Clayton | 2021/09/19 07:33 AM |
Demand paging/translation orthogonal | Michael S | 2021/09/19 09:10 AM |
PLB reference | Carson | 2021/09/20 10:19 PM |
PLB reference | sr | 2021/09/20 06:02 AM |
PLB reference | Michael S | 2021/09/20 07:03 AM |
PLB reference | Linus Torvalds | 2021/09/20 12:10 PM |
Or use a PLB | sr | 2021/09/20 04:32 AM |
Or use a PLB | sr | 2021/09/21 09:36 AM |
Or use a PLB | Linus Torvalds | 2021/09/21 10:04 AM |
Or use a PLB | sr | 2021/09/21 10:48 AM |
Or use a PLB | Linus Torvalds | 2021/09/21 01:55 PM |
Or use a PLB | sr | 2021/09/22 06:55 AM |
Or use a PLB | rwessel | 2021/09/22 07:09 AM |
Or use a PLB | Linus Torvalds | 2021/09/22 11:50 AM |
Or use a PLB | sr | 2021/09/22 01:00 PM |
Or use a PLB | dmcq | 2021/09/22 04:07 PM |
Or use a PLB | Etienne Lorrain | 2021/09/23 08:50 AM |
Or use a PLB | anon2 | 2021/09/22 04:09 PM |
Or use a PLB | dmcq | 2021/09/23 02:35 AM |
Or use a PLB | ⚛ | 2021/09/23 09:37 AM |
Or use a PLB | Linus Torvalds | 2021/09/23 12:01 PM |
Or use a PLB | gpd | 2021/09/24 03:59 AM |
Or use a PLB | Linus Torvalds | 2021/09/24 10:45 AM |
Or use a PLB | dmcq | 2021/09/24 12:43 PM |
Or use a PLB | sr | 2021/09/25 10:19 AM |
Or use a PLB | Linus Torvalds | 2021/09/25 10:44 AM |
Or use a PLB | sr | 2021/09/25 11:11 AM |
Or use a PLB | Linus Torvalds | 2021/09/25 11:31 AM |
Or use a PLB | sr | 2021/09/25 11:52 AM |
Or use a PLB | Linus Torvalds | 2021/09/25 12:05 PM |
Or use a PLB | sr | 2021/09/25 12:23 PM |
Or use a PLB | rwessel | 2021/09/25 03:29 PM |
Or use a PLB | sr | 2021/10/01 12:22 AM |
Or use a PLB | rwessel | 2021/10/01 06:19 AM |
Or use a PLB | David Hess | 2021/10/01 10:35 AM |
Or use a PLB | rwessel | 2021/10/02 04:47 AM |
Or use a PLB | sr | 2021/10/02 11:16 AM |
Or use a PLB | rwessel | 2021/10/02 11:53 AM |
Or use a PLB | Linus Torvalds | 2021/09/25 11:57 AM |
Or use a PLB | sr | 2021/09/25 12:07 PM |
Or use a PLB | Linus Torvalds | 2021/09/25 12:21 PM |
Or use a PLB | sr | 2021/09/25 12:40 PM |
Or use a PLB | nksingh | 2021/09/27 09:07 AM |
Or use a PLB | ⚛ | 2021/09/27 09:02 AM |
Or use a PLB | Linus Torvalds | 2021/09/27 10:20 AM |
Or use a PLB | Linus Torvalds | 2021/09/27 12:58 PM |
Or use a PLB | dmcq | 2021/09/28 10:59 AM |
Or use a PLB | sr | 2021/09/25 10:34 AM |
Or use a PLB | rwessel | 2021/09/25 03:44 PM |
Or use a PLB | sr | 2021/10/01 01:04 AM |
Or use a PLB | rwessel | 2021/10/01 06:33 AM |
I386 segmentation highlights | sr | 2021/10/04 07:53 AM |
I386 segmentation highlights | Adrian | 2021/10/04 09:53 AM |
I386 segmentation highlights | sr | 2021/10/04 10:19 AM |
I386 segmentation highlights | rwessel | 2021/10/04 04:57 PM |
I386 segmentation highlights | sr | 2021/10/05 11:16 AM |
I386 segmentation highlights | Michael S | 2021/10/05 12:27 PM |
I386 segmentation highlights | rwessel | 2021/10/05 04:20 PM |
Or use a PLB | JohnG | 2021/09/25 10:18 PM |
Or use a PLB | ⚛ | 2021/09/27 07:37 AM |
Or use a PLB | Heikki Kultala | 2021/09/28 03:53 AM |
Or use a PLB | rwessel | 2021/09/28 07:29 AM |
Or use a PLB | David Hess | 2021/09/23 06:00 PM |
Or use a PLB | Adrian | 2021/09/24 01:21 AM |
Or use a PLB | dmcq | 2021/09/25 12:41 PM |
Or use a PLB | blaine | 2021/09/26 11:19 PM |
Or use a PLB | David Hess | 2021/09/27 11:35 AM |
Or use a PLB | blaine | 2021/09/27 05:19 PM |
Or use a PLB | Adrian | 2021/09/27 10:40 PM |
Or use a PLB | Adrian | 2021/09/27 10:59 PM |
Or use a PLB | dmcq | 2021/09/28 07:45 AM |
Or use a PLB | rwessel | 2021/09/28 07:45 AM |
Or use a PLB | David Hess | 2021/09/28 12:50 PM |
Or use a PLB | Etienne Lorrain | 2021/09/30 01:25 AM |
Or use a PLB | David Hess | 2021/10/01 10:40 AM |
MMU privileges | sr | 2021/09/21 11:07 AM |
MMU privileges | Linus Torvalds | 2021/09/21 01:49 PM |
Virtually tagged L1-caches | Konrad Schwarz | 2021/09/16 04:18 AM |
Virtually tagged L1-caches | Carson | 2021/09/16 01:12 PM |
Virtually tagged L1-caches | anon2 | 2021/09/16 05:16 PM |
Virtually tagged L1-caches | rwessel | 2021/09/16 06:29 PM |
Virtually tagged L1-caches | sr | 2021/09/20 04:20 AM |
Virtually tagged L1-caches | --- | 2021/09/08 02:28 PM |
Virtually tagged L1-caches | anonymou5 | 2021/09/08 08:28 PM |
Virtually tagged L1-caches | anonymou5 | 2021/09/08 08:34 PM |
Virtually tagged L1-caches | --- | 2021/09/09 10:14 AM |
Virtually tagged L1-caches | anonymou5 | 2021/09/09 10:44 PM |
Multi-threading? | David Kanter | 2021/09/09 09:32 PM |
Multi-threading? | --- | 2021/09/10 09:19 AM |
Virtually tagged L1-caches | sr | 2021/09/11 01:19 AM |
Virtually tagged L1-caches | sr | 2021/09/11 01:36 AM |
Virtually tagged L1-caches | --- | 2021/09/11 09:53 AM |
Virtually tagged L1-caches | sr | 2021/09/12 12:43 AM |
Virtually tagged L1-caches | Linus Torvalds | 2021/09/12 11:10 AM |
Virtually tagged L1-caches | sr | 2021/09/12 11:57 AM |
Virtually tagged L1-caches | dmcq | 2021/09/13 08:31 AM |
Virtually tagged L1-caches | sr | 2021/09/20 04:11 AM |
Virtually tagged L1-caches | sr | 2021/09/11 02:49 AM |
Virtually tagged L1-caches | Linus Torvalds | 2021/09/08 12:34 PM |
Virtually tagged L1-caches | dmcq | 2021/09/09 02:46 AM |
Virtually tagged L1-caches | dmcq | 2021/09/09 02:58 AM |
Virtually tagged L1-caches | sr | 2021/09/11 01:29 AM |
Virtually tagged L1-caches | dmcq | 2021/09/11 08:59 AM |
Virtually tagged L1-caches | sr | 2021/09/12 12:57 AM |
Virtually tagged L1-caches | dmcq | 2021/09/12 08:44 AM |
Virtually tagged L1-caches | sr | 2021/09/12 09:48 AM |
Virtually tagged L1-caches | dmcq | 2021/09/12 01:22 PM |
Virtually tagged L1-caches | sr | 2021/09/20 04:40 AM |
Where do you see this information? (NT) | anon2 | 2021/09/09 02:45 AM |
Where do you see this information? | sr | 2021/09/11 01:40 AM |
Where do you see this information? | anon2 | 2021/09/11 01:53 AM |
Where do you see this information? | sr | 2021/09/11 02:08 AM |
Thank you (NT) | anon2 | 2021/09/11 04:31 PM |