Bobby R. Bruce
d42eeb6b68
cpu: Explicitly define cache_line_size -> 64-bit unsigned int ( #329 )
...
While it's plausible to define the cache_line_size as a 32-bit unsigned
int, the use of cache_line_size is way out of its original scope.
cache_line_size has been used to produce an address mask, which masking
out the offset bits from an address. For example, [1], [2], [3], and
[4]. However, since the cache_line_size is an "unsigned int", the type
of the value is not guaranteed to be 64-bit long. Subsequently, the bit
twiddling hacks in [1], [2], [3], and [4] produce 32-bit mask, i.e.,
0x00000000FFFFFFC0.
This behavior at least caused a problem in LLSC in RISC-V [5], where the
load reservation (LR) relies on the mask to produce the cache block
address. Two distinct 64-bit addresses can be mapped to the same cache
block using the above mask.
This patch explicitly defines cache_line_size as a 64-bit unsigned int
so the cache block mask can be produced correctly for 64-bit addresses.
[1]
3bdcfd6f7a/src/cpu/simple/atomic.hh (L147)
[2]
3bdcfd6f7a/src/cpu/simple/timing.hh (L224)
[3]
3bdcfd6f7a/src/cpu/o3/lsq_unit.cc (L241)
[4]
3bdcfd6f7a/src/cpu/minor/lsq.cc (L1425)
[5]
3bdcfd6f7a/src/arch/riscv/isa.cc (L787)
2023-10-16 07:50:35 -07:00
..
2023-01-17 09:16:20 +00:00
2023-10-10 21:47:07 -07:00
2023-09-25 08:51:00 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-12-11 04:00:56 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-02-26 09:56:26 +00:00
2022-02-26 09:56:26 +00:00
2022-03-02 08:19:58 +00:00
2021-07-28 01:48:03 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2023-10-10 14:01:58 -07:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-08-03 09:10:41 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-01-13 05:21:41 +00:00
2022-01-13 05:21:41 +00:00
2022-01-13 05:21:41 +00:00
2021-07-01 19:08:24 +00:00
2022-11-03 05:34:09 +00:00
2022-11-03 05:34:09 +00:00
2021-07-07 23:18:59 +00:00
2022-08-24 21:47:07 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2023-10-10 14:01:58 -07:00
2021-07-01 19:08:24 +00:00
2023-01-13 05:58:51 +00:00
2023-03-13 06:47:09 +00:00
2022-11-22 10:45:30 +00:00
2021-10-01 04:57:56 +00:00
2023-09-07 08:52:24 -07:00
2023-09-07 08:52:24 -07:00
2021-12-11 04:00:56 +00:00
2021-12-11 04:00:56 +00:00
2021-07-01 19:08:24 +00:00
2022-06-03 07:23:18 +00:00
2021-07-01 19:08:24 +00:00
2021-07-06 09:59:11 +00:00
2022-11-29 18:54:12 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-02-09 10:24:54 +00:00
2021-07-01 19:08:24 +00:00
2023-01-17 09:16:20 +00:00
2023-05-26 04:42:25 +00:00
2021-07-01 19:08:24 +00:00
2021-12-16 01:57:26 +00:00
2021-12-16 01:57:26 +00:00
2022-10-02 16:30:15 +00:00
2022-10-02 16:30:15 +00:00
2021-07-01 19:08:24 +00:00
2021-11-18 07:09:00 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2023-07-10 23:00:31 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-03-29 07:13:44 +00:00
2021-12-11 04:00:56 +00:00
2023-10-06 20:39:57 +00:00
2023-10-06 20:39:57 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2023-03-13 06:47:09 +00:00
2021-07-06 09:59:11 +00:00
2021-07-06 09:59:11 +00:00
2023-10-10 14:01:58 -07:00
2023-10-10 14:01:58 -07:00
2021-07-01 19:08:24 +00:00
2023-09-07 08:52:24 -07:00
2023-01-17 09:16:20 +00:00
2022-08-03 09:10:41 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-08-24 21:47:07 +00:00
2021-07-31 18:06:52 +00:00
2021-07-01 19:08:24 +00:00
2023-10-10 14:01:58 -07:00
2023-02-02 01:01:56 +00:00
2022-10-18 12:11:25 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-03-29 07:13:44 +00:00
2022-03-29 07:13:44 +00:00
2021-07-28 01:48:03 +00:00
2022-09-13 08:46:56 +00:00
2023-07-19 08:45:29 -07:00
2021-08-28 04:18:12 +00:00
2021-09-22 05:31:01 +00:00
2023-09-07 11:54:56 +08:00
2023-02-02 01:01:56 +00:00
2021-07-01 19:08:24 +00:00
2022-11-22 16:02:53 +00:00
2021-07-01 19:08:24 +00:00
2023-03-21 06:53:55 +00:00
2023-03-21 06:53:55 +00:00
2023-02-08 00:28:02 +00:00
2022-12-06 18:04:46 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2023-01-17 09:16:20 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2023-10-10 14:01:58 -07:00
2023-01-17 09:16:20 +00:00
2020-02-18 03:34:31 +00:00
2021-12-17 05:45:26 +00:00
2021-12-17 05:45:26 +00:00
2021-07-01 19:08:24 +00:00
2023-09-07 03:18:58 +00:00
2023-09-12 08:33:42 -07:00
2021-07-01 19:08:24 +00:00
2023-02-03 06:11:45 +00:00
2023-09-20 14:00:45 -07:00
2022-11-29 23:44:38 +00:00
2021-07-01 19:08:24 +00:00
2021-07-01 19:08:24 +00:00
2022-08-03 09:10:41 +00:00
2022-12-15 21:38:01 +00:00
2022-12-15 21:38:01 +00:00
2021-08-21 00:54:54 +00:00
2021-08-21 00:54:54 +00:00
2022-08-03 09:10:41 +00:00
2023-03-29 03:05:06 +00:00
2022-11-22 10:45:30 +00:00
2023-04-12 02:18:22 +00:00