From c799ecc55fdf2c4131fb396d5809d5ecb6e7abc5 Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Mon, 6 Oct 2014 16:52:52 -0500 Subject: [PATCH] make _rs a special static local The _rs variable is used for printk ratelimiting, similar to __warned, which makes it a logical candidate to be "special": don't correlate it, yet don't mark a function as changed just because it references it. --- kpatch-build/create-diff-object.c | 1 + test/integration/special-static-2.patch | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/integration/special-static-2.patch diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c index 815465d..572c31b 100644 --- a/kpatch-build/create-diff-object.c +++ b/kpatch-build/create-diff-object.c @@ -527,6 +527,7 @@ static int is_special_static(struct symbol *sym) "__warned.", "descriptor.", "__func__.", + "_rs.", NULL, }; char **prefix; diff --git a/test/integration/special-static-2.patch b/test/integration/special-static-2.patch new file mode 100644 index 0000000..98b45a4 --- /dev/null +++ b/test/integration/special-static-2.patch @@ -0,0 +1,25 @@ +Index: src/arch/x86/kvm/x86.c +=================================================================== +--- src.orig/arch/x86/kvm/x86.c ++++ src/arch/x86/kvm/x86.c +@@ -2011,12 +2011,20 @@ static void record_steal_time(struct kvm + &vcpu->arch.st.steal, sizeof(struct kvm_steal_time)); + } + ++void kpatch_kvm_x86_foo(void) ++{ ++ if (!jiffies) ++ printk("kpatch kvm x86 foo\n"); ++} ++ + int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) + { + bool pr = false; + u32 msr = msr_info->index; + u64 data = msr_info->data; + ++ kpatch_kvm_x86_foo(); ++ + switch (msr) { + case MSR_AMD64_NB_CFG: + case MSR_IA32_UCODE_REV: