| .. | .. |
|---|
| 38 | 38 | #include <linux/errno.h> |
|---|
| 39 | 39 | #include <linux/string.h> |
|---|
| 40 | 40 | #include <linux/types.h> |
|---|
| 41 | +#include <linux/pgtable.h> |
|---|
| 41 | 42 | |
|---|
| 42 | 43 | #include <trace/events/xen.h> |
|---|
| 43 | 44 | |
|---|
| 44 | 45 | #include <asm/page.h> |
|---|
| 45 | | -#include <asm/pgtable.h> |
|---|
| 46 | 46 | #include <asm/smap.h> |
|---|
| 47 | 47 | #include <asm/nospec-branch.h> |
|---|
| 48 | 48 | |
|---|
| .. | .. |
|---|
| 82 | 82 | * - clobber the rest |
|---|
| 83 | 83 | * |
|---|
| 84 | 84 | * The result certainly isn't pretty, and it really shows up cpp's |
|---|
| 85 | | - * weakness as as macro language. Sorry. (But let's just give thanks |
|---|
| 85 | + * weakness as a macro language. Sorry. (But let's just give thanks |
|---|
| 86 | 86 | * there aren't more than 5 arguments...) |
|---|
| 87 | 87 | */ |
|---|
| 88 | 88 | |
|---|
| .. | .. |
|---|
| 217 | 217 | return (long)__res; |
|---|
| 218 | 218 | } |
|---|
| 219 | 219 | |
|---|
| 220 | +static __always_inline void __xen_stac(void) |
|---|
| 221 | +{ |
|---|
| 222 | + /* |
|---|
| 223 | + * Suppress objtool seeing the STAC/CLAC and getting confused about it |
|---|
| 224 | + * calling random code with AC=1. |
|---|
| 225 | + */ |
|---|
| 226 | + asm volatile(ANNOTATE_IGNORE_ALTERNATIVE |
|---|
| 227 | + ASM_STAC ::: "memory", "flags"); |
|---|
| 228 | +} |
|---|
| 229 | + |
|---|
| 230 | +static __always_inline void __xen_clac(void) |
|---|
| 231 | +{ |
|---|
| 232 | + asm volatile(ANNOTATE_IGNORE_ALTERNATIVE |
|---|
| 233 | + ASM_CLAC ::: "memory", "flags"); |
|---|
| 234 | +} |
|---|
| 235 | + |
|---|
| 220 | 236 | static inline long |
|---|
| 221 | 237 | privcmd_call(unsigned int call, |
|---|
| 222 | 238 | unsigned long a1, unsigned long a2, |
|---|
| .. | .. |
|---|
| 225 | 241 | { |
|---|
| 226 | 242 | long res; |
|---|
| 227 | 243 | |
|---|
| 228 | | - stac(); |
|---|
| 244 | + __xen_stac(); |
|---|
| 229 | 245 | res = xen_single_call(call, a1, a2, a3, a4, a5); |
|---|
| 230 | | - clac(); |
|---|
| 246 | + __xen_clac(); |
|---|
| 231 | 247 | |
|---|
| 232 | 248 | return res; |
|---|
| 233 | 249 | } |
|---|
| .. | .. |
|---|
| 335 | 351 | return _hypercall4(int, update_va_mapping, va, |
|---|
| 336 | 352 | new_val.pte, new_val.pte >> 32, flags); |
|---|
| 337 | 353 | } |
|---|
| 338 | | -extern int __must_check xen_event_channel_op_compat(int, void *); |
|---|
| 339 | 354 | |
|---|
| 340 | 355 | static inline int |
|---|
| 341 | 356 | HYPERVISOR_event_channel_op(int cmd, void *arg) |
|---|
| 342 | 357 | { |
|---|
| 343 | | - int rc = _hypercall2(int, event_channel_op, cmd, arg); |
|---|
| 344 | | - if (unlikely(rc == -ENOSYS)) |
|---|
| 345 | | - rc = xen_event_channel_op_compat(cmd, arg); |
|---|
| 346 | | - return rc; |
|---|
| 358 | + return _hypercall2(int, event_channel_op, cmd, arg); |
|---|
| 347 | 359 | } |
|---|
| 348 | 360 | |
|---|
| 349 | 361 | static inline int |
|---|
| .. | .. |
|---|
| 358 | 370 | return _hypercall3(int, console_io, cmd, count, str); |
|---|
| 359 | 371 | } |
|---|
| 360 | 372 | |
|---|
| 361 | | -extern int __must_check xen_physdev_op_compat(int, void *); |
|---|
| 362 | | - |
|---|
| 363 | 373 | static inline int |
|---|
| 364 | 374 | HYPERVISOR_physdev_op(int cmd, void *arg) |
|---|
| 365 | 375 | { |
|---|
| 366 | | - int rc = _hypercall2(int, physdev_op, cmd, arg); |
|---|
| 367 | | - if (unlikely(rc == -ENOSYS)) |
|---|
| 368 | | - rc = xen_physdev_op_compat(cmd, arg); |
|---|
| 369 | | - return rc; |
|---|
| 376 | + return _hypercall2(int, physdev_op, cmd, arg); |
|---|
| 370 | 377 | } |
|---|
| 371 | 378 | |
|---|
| 372 | 379 | static inline int |
|---|
| .. | .. |
|---|
| 433 | 440 | domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs) |
|---|
| 434 | 441 | { |
|---|
| 435 | 442 | int ret; |
|---|
| 436 | | - stac(); |
|---|
| 443 | + __xen_stac(); |
|---|
| 437 | 444 | ret = _hypercall3(int, dm_op, dom, nr_bufs, bufs); |
|---|
| 438 | | - clac(); |
|---|
| 445 | + __xen_clac(); |
|---|
| 439 | 446 | return ret; |
|---|
| 440 | 447 | } |
|---|
| 441 | 448 | |
|---|