Skip to content

Commit

Permalink
todo
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoimboe committed Mar 20, 2024
1 parent e0ab9f5 commit 1d93eaf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions test/integration/linux-6.2.0/module.patch
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ index 90a77cd3ebad..f65df90ae8e1 100644
+ /* Test static branches: */
+ static DEFINE_STATIC_KEY_TRUE(kpatch_key);
+
+ if (static_branch_unlikely(&memcg_kmem_enabled_key))
+ printk("kpatch: memcg_kmem_enabled_key\n");
+ if (static_branch_unlikely(&memcg_kmem_online_key))
+ printk("kpatch: memcg_kmem_online_key\n");
+
+ BUG_ON(!static_branch_likely(&kpatch_key));
+ static_branch_disable(&kpatch_key);
Expand Down
18 changes: 10 additions & 8 deletions test/integration/linux-6.2.0/new-function.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
diff -Nupr src.orig/drivers/tty/n_tty.c src/drivers/tty/n_tty.c
--- src.orig/drivers/tty/n_tty.c 2023-01-12 11:20:06.978709342 -0500
+++ src/drivers/tty/n_tty.c 2023-01-12 11:20:54.149989024 -0500
@@ -2315,7 +2315,7 @@ more_to_be_read:
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index f252d0b5a434..8f00ed3529b4 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2345,7 +2345,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, u8 *kbuf,
* (note that the process_output*() functions take this lock themselves)
*/

-static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
+static ssize_t noinline kpatch_n_tty_write(struct tty_struct *tty, struct file *file,
const unsigned char *buf, size_t nr)
const u8 *buf, size_t nr)
{
const unsigned char *b = buf;
@@ -2402,6 +2402,12 @@ break_out:
const u8 *b = buf;
@@ -2430,6 +2430,13 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
return (b - buf) ? b - buf : retval;
}

+static ssize_t __attribute__((optimize("-fno-optimize-sibling-calls"))) n_tty_write(struct tty_struct *tty, struct file *file,
+ const unsigned char *buf, size_t nr)
+ const unsigned char *buf, size_t nr)
+{
+ return kpatch_n_tty_write(tty, file, buf, nr);
+}
+
+
/**
* n_tty_poll - poll method for N_TTY
Expand Down
26 changes: 12 additions & 14 deletions test/integration/linux-6.2.0/symvers-disagreement-FAIL.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,24 @@ See "Exported symbol versioning" of the patch author guide for more
detail.

---
drivers/base/core.c | 2 ++
drivers/usb/core/usb.c | 2 ++
2 files changed, 4 insertions(+)

diff -Nupr src.orig/drivers/base/core.c src/drivers/base/core.c
--- src.orig/drivers/base/core.c 2023-01-12 11:20:06.403705933 -0500
+++ src/drivers/base/core.c 2023-01-12 11:21:27.466186559 -0500
diff --git a/drivers/base/core.c b/drivers/base/core.c
index b93f3c5716ae..3bb9dd5d8d74 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -36,6 +36,8 @@
#include "physical_location.h"
#include "power/power.h"

+#include <linux/blktrace_api.h>
+
#ifdef CONFIG_SYSFS_DEPRECATED
#ifdef CONFIG_SYSFS_DEPRECATED_V2
long sysfs_deprecated = 1;
diff -Nupr src.orig/drivers/usb/core/usb.c src/drivers/usb/core/usb.c
--- src.orig/drivers/usb/core/usb.c 2023-01-12 11:20:06.490706448 -0500
+++ src/drivers/usb/core/usb.c 2023-01-12 11:21:27.468186571 -0500
@@ -697,6 +697,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev);
/* Device links support. */
static LIST_HEAD(deferred_sync);
static unsigned int defer_sync_state_count = 1;
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index a0c432b14b20..da6de67451f0 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -761,6 +761,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_dev);
*/
struct usb_device *usb_get_dev(struct usb_device *dev)
{
Expand Down

0 comments on commit 1d93eaf

Please sign in to comment.