Commit 2f83fca
AOSCOS: MIPS: Loongson: Prevent o32 vDSO from using constant timer
HWR $30 (Loongson64 constant timer) is 64 bits wide. However, some
hardware doesn't properly sign-extend its value before copying it into a
GPR in o32 mode (Status.UX==1). This "shadow" on the higher half breaks
most subsequent instructions relying on the GPR.
Aside from the HW bug, it is never possible to retrieve the higher half
of the constant timer in o32 mode, which implies that the masks of timer
cycles differentiate in o32 versus n32/n64 modes. Considering that a
clocksource can only have a single mask, we are unable to make the o32
vDSO parse the timer delta properly anyway.
Moreover, the timer frequency is simply too high that 32-bit timer
cycles wrap crazily -- it's fundamentally unreliable without the higher
half.
Fix this by preventing o32 vDSO from using the constant timer.
Fixes: "AOSCOS: MIPS: Loongson: Add constant timer support"
Signed-off-by: Rong Zhang <i@rong.moe>1 parent f803fa8 commit 2f83fca
1 file changed
Lines changed: 33 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
232 | 264 | | |
233 | 265 | | |
234 | 266 | | |
| |||
0 commit comments