integration/ubuntu1604: remove shadow-variable patches

The kernel used in ubuntu1604 vagrant image does not have shadow
variable API.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
This commit is contained in:
Artem Savkov 2019-01-09 10:41:27 +01:00
parent 14f7367e45
commit 77304f60ce
3 changed files with 0 additions and 96 deletions

View File

@ -1,24 +0,0 @@
diff -Nupr src.orig/arch/x86/kvm/vmx.c src/arch/x86/kvm/vmx.c
--- src.orig/arch/x86/kvm/vmx.c 2016-12-15 19:55:57.436000000 +0000
+++ src/arch/x86/kvm/vmx.c 2016-12-15 19:57:39.592000000 +0000
@@ -10558,10 +10558,20 @@ static void vmx_leave_nested(struct kvm_
* It should only be called before L2 actually succeeded to run, and when
* vmcs01 is current (it doesn't leave_guest_mode() or switch vmcss).
*/
+#include "kpatch.h"
static void nested_vmx_entry_failure(struct kvm_vcpu *vcpu,
struct vmcs12 *vmcs12,
u32 reason, unsigned long qualification)
{
+ int *kpatch;
+
+ kpatch = kpatch_shadow_alloc(vcpu, "kpatch", sizeof(*kpatch),
+ GFP_KERNEL);
+ if (kpatch) {
+ kpatch_shadow_get(vcpu, "kpatch");
+ kpatch_shadow_free(vcpu, "kpatch");
+ }
+
load_vmcs12_host_state(vcpu, vmcs12);
vmcs12->vm_exit_reason = reason | VMX_EXIT_REASONS_FAILED_VMENTRY;
vmcs12->exit_qualification = qualification;

View File

@ -1,3 +0,0 @@
#!/bin/bash
grep -q newpid: /proc/$$/status

View File

@ -1,69 +0,0 @@
diff -Nupr src.orig/fs/proc/array.c src/fs/proc/array.c
--- src.orig/fs/proc/array.c 2016-12-15 19:55:39.080000000 +0000
+++ src/fs/proc/array.c 2016-12-15 19:58:00.840000000 +0000
@@ -334,13 +334,20 @@ static inline void task_seccomp(struct s
#endif
}
+#include "kpatch.h"
static inline void task_context_switch_counts(struct seq_file *m,
struct task_struct *p)
{
+ int *newpid;
+
seq_printf(m, "voluntary_ctxt_switches:\t%lu\n"
"nonvoluntary_ctxt_switches:\t%lu\n",
p->nvcsw,
p->nivcsw);
+
+ newpid = kpatch_shadow_get(p, "newpid");
+ if (newpid)
+ seq_printf(m, "newpid:\t%d\n", *newpid);
}
static void task_cpus_allowed(struct seq_file *m, struct task_struct *task)
diff -Nupr src.orig/kernel/exit.c src/kernel/exit.c
--- src.orig/kernel/exit.c 2016-12-15 19:56:00.184000000 +0000
+++ src/kernel/exit.c 2016-12-15 19:58:00.840000000 +0000
@@ -650,6 +650,7 @@ static void check_stack_usage(void)
static inline void check_stack_usage(void) {}
#endif
+#include "kpatch.h"
void do_exit(long code)
{
struct task_struct *tsk = current;
@@ -758,6 +759,8 @@ void do_exit(long code)
cgroup_exit(tsk);
+ kpatch_shadow_free(tsk, "newpid");
+
/*
* FIXME: do that only when needed, using sched_exit tracepoint
*/
diff -Nupr src.orig/kernel/fork.c src/kernel/fork.c
--- src.orig/kernel/fork.c 2016-12-15 19:56:00.184000000 +0000
+++ src/kernel/fork.c 2016-12-15 19:58:00.840000000 +0000
@@ -1726,6 +1726,7 @@ struct task_struct *fork_idle(int cpu)
* It copies the process, and if successful kick-starts
* it and waits for it to finish using the VM if required.
*/
+#include "kpatch.h"
long _do_fork(unsigned long clone_flags,
unsigned long stack_start,
unsigned long stack_size,
@@ -1764,6 +1765,13 @@ long _do_fork(unsigned long clone_flags,
if (!IS_ERR(p)) {
struct completion vfork;
struct pid *pid;
+ int *newpid;
+ static int ctr = 0;
+
+ newpid = kpatch_shadow_alloc(p, "newpid", sizeof(*newpid),
+ GFP_KERNEL);
+ if (newpid)
+ *newpid = ctr++;
trace_sched_process_fork(current, p);