summaryrefslogtreecommitdiff
path: root/kernel/static_call.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2021-03-18 16:43:11 +0100
committerBorislav Petkov <bp@suse.de>2021-03-18 16:43:11 +0100
commitafb4a37778491eae010a43edebea32ff2d45f01c (patch)
treec40bcc6143e5542134477dd96a108d24b1f9074f /kernel/static_call.c
parent229164175ff0c61ff581e6bf37fbfcb608b6e9bb (diff)
parent1e28eed17697bcf343c6743f0028cc3b5dd88bf0 (diff)
Merge tag 'v5.12-rc3' into x86/seves
Pick up dependent SEV-ES urgent changes which went into -rc3 to base new work ontop. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'kernel/static_call.c')
-rw-r--r--kernel/static_call.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/static_call.c b/kernel/static_call.c
index 6906c6ec4c97..ae825295cf68 100644
--- a/kernel/static_call.c
+++ b/kernel/static_call.c
@@ -349,7 +349,8 @@ static int static_call_add_module(struct module *mod)
struct static_call_site *site;
for (site = start; site != stop; site++) {
- unsigned long addr = (unsigned long)static_call_key(site);
+ unsigned long s_key = (long)site->key + (long)&site->key;
+ unsigned long addr = s_key & ~STATIC_CALL_SITE_FLAGS;
unsigned long key;
/*
@@ -373,8 +374,8 @@ static int static_call_add_module(struct module *mod)
return -EINVAL;
}
- site->key = (key - (long)&site->key) |
- (site->key & STATIC_CALL_SITE_FLAGS);
+ key |= s_key & STATIC_CALL_SITE_FLAGS;
+ site->key = key - (long)&site->key;
}
return __static_call_init(mod, start, stop);