diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-09-05 18:21:22 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-09-05 18:21:22 -0400 |
commit | 2c910cb75e1fe6de52d95c8e32caedd1629a33a5 (patch) | |
tree | 94a0eea6f8cde689d11e7583ddd0a930b8785ab4 /arch/x86/kernel/alternative.c | |
parent | 627212c9d49ba2759b699450f5d8f45f73e062fa (diff) | |
parent | b53b1c08a23eb1091982daacb2122f90a7094a77 (diff) |
Merge branch 'uverbs_dev_cleanups' into rdma.git for-next
For dependencies, branch based on rdma.git 'for-rc' of
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/
Pull 'uverbs_dev_cleanups' from Leon Romanovsky:
====================
Reuse the char device code interfaces to simplify ib_uverbs_device
creation and destruction. As part of this series, we are sending fix to
cleanup path, which was discovered during internal review,
The fix definitely can go to -rc, but it means that this series will be
dependent on rdma-rc.
====================
* branch 'uverbs_dev_cleanups':
RDMA/uverbs: Use device.groups to initialize device attributes
RDMA/uverbs: Use cdev_device_add() instead of cdev_add()
RDMA/core: Depend on device_add() to add device attributes
RDMA/uverbs: Fix error cleanup path of ib_uverbs_add_one()
Resolved conflict in ib_device_unregister_sysfs()
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'arch/x86/kernel/alternative.c')
-rw-r--r-- | arch/x86/kernel/alternative.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 014f214da581..b9d5e7c9ef43 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -684,8 +684,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, | |||
684 | * It means the size must be writable atomically and the address must be aligned | 684 | * It means the size must be writable atomically and the address must be aligned |
685 | * in a way that permits an atomic write. It also makes sure we fit on a single | 685 | * in a way that permits an atomic write. It also makes sure we fit on a single |
686 | * page. | 686 | * page. |
687 | * | ||
688 | * Note: Must be called under text_mutex. | ||
689 | */ | 687 | */ |
690 | void *text_poke(void *addr, const void *opcode, size_t len) | 688 | void *text_poke(void *addr, const void *opcode, size_t len) |
691 | { | 689 | { |
@@ -700,6 +698,8 @@ void *text_poke(void *addr, const void *opcode, size_t len) | |||
700 | */ | 698 | */ |
701 | BUG_ON(!after_bootmem); | 699 | BUG_ON(!after_bootmem); |
702 | 700 | ||
701 | lockdep_assert_held(&text_mutex); | ||
702 | |||
703 | if (!core_kernel_text((unsigned long)addr)) { | 703 | if (!core_kernel_text((unsigned long)addr)) { |
704 | pages[0] = vmalloc_to_page(addr); | 704 | pages[0] = vmalloc_to_page(addr); |
705 | pages[1] = vmalloc_to_page(addr + PAGE_SIZE); | 705 | pages[1] = vmalloc_to_page(addr + PAGE_SIZE); |
@@ -782,8 +782,6 @@ int poke_int3_handler(struct pt_regs *regs) | |||
782 | * - replace the first byte (int3) by the first byte of | 782 | * - replace the first byte (int3) by the first byte of |
783 | * replacing opcode | 783 | * replacing opcode |
784 | * - sync cores | 784 | * - sync cores |
785 | * | ||
786 | * Note: must be called under text_mutex. | ||
787 | */ | 785 | */ |
788 | void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) | 786 | void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) |
789 | { | 787 | { |
@@ -792,6 +790,9 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) | |||
792 | bp_int3_handler = handler; | 790 | bp_int3_handler = handler; |
793 | bp_int3_addr = (u8 *)addr + sizeof(int3); | 791 | bp_int3_addr = (u8 *)addr + sizeof(int3); |
794 | bp_patching_in_progress = true; | 792 | bp_patching_in_progress = true; |
793 | |||
794 | lockdep_assert_held(&text_mutex); | ||
795 | |||
795 | /* | 796 | /* |
796 | * Corresponding read barrier in int3 notifier for making sure the | 797 | * Corresponding read barrier in int3 notifier for making sure the |
797 | * in_progress and handler are correctly ordered wrt. patching. | 798 | * in_progress and handler are correctly ordered wrt. patching. |