.. | .. |
---|
312 | 312 | |
---|
313 | 313 | static inline long plpar_set_watchpoint0(unsigned long dawr0, unsigned long dawrx0) |
---|
314 | 314 | { |
---|
315 | | - return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_DAWR, dawr0, dawrx0); |
---|
| 315 | + return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_DAWR0, dawr0, dawrx0); |
---|
| 316 | +} |
---|
| 317 | + |
---|
| 318 | +static inline long plpar_set_watchpoint1(unsigned long dawr1, unsigned long dawrx1) |
---|
| 319 | +{ |
---|
| 320 | + return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_DAWR1, dawr1, dawrx1); |
---|
316 | 321 | } |
---|
317 | 322 | |
---|
318 | 323 | static inline long plpar_signal_sys_reset(long cpu) |
---|
.. | .. |
---|
334 | 339 | return rc; |
---|
335 | 340 | } |
---|
336 | 341 | |
---|
| 342 | +/* |
---|
| 343 | + * Wrapper to H_RPT_INVALIDATE hcall that handles return values appropriately |
---|
| 344 | + * |
---|
| 345 | + * - Returns H_SUCCESS on success |
---|
| 346 | + * - For H_BUSY return value, we retry the hcall. |
---|
| 347 | + * - For any other hcall failures, attempt a full flush once before |
---|
| 348 | + * resorting to BUG(). |
---|
| 349 | + * |
---|
| 350 | + * Note: This hcall is expected to fail only very rarely. The correct |
---|
| 351 | + * error recovery of killing the process/guest will be eventually |
---|
| 352 | + * needed. |
---|
| 353 | + */ |
---|
| 354 | +static inline long pseries_rpt_invalidate(u32 pid, u64 target, u64 type, |
---|
| 355 | + u64 page_sizes, u64 start, u64 end) |
---|
| 356 | +{ |
---|
| 357 | + long rc; |
---|
| 358 | + unsigned long all; |
---|
| 359 | + |
---|
| 360 | + while (true) { |
---|
| 361 | + rc = plpar_hcall_norets(H_RPT_INVALIDATE, pid, target, type, |
---|
| 362 | + page_sizes, start, end); |
---|
| 363 | + if (rc == H_BUSY) { |
---|
| 364 | + cpu_relax(); |
---|
| 365 | + continue; |
---|
| 366 | + } else if (rc == H_SUCCESS) |
---|
| 367 | + return rc; |
---|
| 368 | + |
---|
| 369 | + /* Flush request failed, try with a full flush once */ |
---|
| 370 | + if (type & H_RPTI_TYPE_NESTED) |
---|
| 371 | + all = H_RPTI_TYPE_NESTED | H_RPTI_TYPE_NESTED_ALL; |
---|
| 372 | + else |
---|
| 373 | + all = H_RPTI_TYPE_ALL; |
---|
| 374 | +retry: |
---|
| 375 | + rc = plpar_hcall_norets(H_RPT_INVALIDATE, pid, target, |
---|
| 376 | + all, page_sizes, 0, -1UL); |
---|
| 377 | + if (rc == H_BUSY) { |
---|
| 378 | + cpu_relax(); |
---|
| 379 | + goto retry; |
---|
| 380 | + } else if (rc == H_SUCCESS) |
---|
| 381 | + return rc; |
---|
| 382 | + |
---|
| 383 | + BUG(); |
---|
| 384 | + } |
---|
| 385 | +} |
---|
| 386 | + |
---|
337 | 387 | #else /* !CONFIG_PPC_PSERIES */ |
---|
338 | 388 | |
---|
339 | 389 | static inline long plpar_set_ciabr(unsigned long ciabr) |
---|
340 | 390 | { |
---|
341 | 391 | return 0; |
---|
342 | 392 | } |
---|
| 393 | + |
---|
| 394 | +static inline long plpar_pte_read_4(unsigned long flags, unsigned long ptex, |
---|
| 395 | + unsigned long *ptes) |
---|
| 396 | +{ |
---|
| 397 | + return 0; |
---|
| 398 | +} |
---|
| 399 | + |
---|
| 400 | +static inline long pseries_rpt_invalidate(u32 pid, u64 target, u64 type, |
---|
| 401 | + u64 page_sizes, u64 start, u64 end) |
---|
| 402 | +{ |
---|
| 403 | + return 0; |
---|
| 404 | +} |
---|
| 405 | + |
---|
343 | 406 | #endif /* CONFIG_PPC_PSERIES */ |
---|
344 | 407 | |
---|
345 | 408 | #endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */ |
---|