{"action":"created","issue":{"url":"https://api.github.com/repos/dynup/kpatch/issues/442","repository_url":"https://api.github.com/repos/dynup/kpatch","labels_url":"https://api.github.com/repos/dynup/kpatch/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/dynup/kpatch/issues/442/comments","events_url":"https://api.github.com/repos/dynup/kpatch/issues/442/events","html_url":"https://github.com/dynup/kpatch/issues/442","id":44723258,"number":442,"title":"can't access module-created percpu variables","user":{"login":"jpoimboe","id":1750978,"avatar_url":"https://avatars0.githubusercontent.com/u/1750978?v=3","gravatar_id":"","url":"https://api.github.com/users/jpoimboe","html_url":"https://github.com/jpoimboe","followers_url":"https://api.github.com/users/jpoimboe/followers","following_url":"https://api.github.com/users/jpoimboe/following{/other_user}","gists_url":"https://api.github.com/users/jpoimboe/gists{/gist_id}","starred_url":"https://api.github.com/users/jpoimboe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpoimboe/subscriptions","organizations_url":"https://api.github.com/users/jpoimboe/orgs","repos_url":"https://api.github.com/users/jpoimboe/repos","events_url":"https://api.github.com/users/jpoimboe/events{/privacy}","received_events_url":"https://api.github.com/users/jpoimboe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2014-10-02T18:52:03Z","updated_at":"2017-05-16T14:04:51Z","closed_at":null,"body":"When patching a module, the dynamic relocation code can't find percpu variables that were created by modules.  The following patch:\n\n```\n$ cat /tmp/percpu.patch\nIndex: src/arch/x86/kvm/vmx.c\n===================================================================\n--- src.orig/arch/x86/kvm/vmx.c\n+++ src/arch/x86/kvm/vmx.c\n@@ -7538,6 +7538,8 @@ static struct kvm_vcpu *vmx_create_vcpu(\n    struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);\n    int cpu;\n\n+   printk(\"foo\\n\");\n+\n    if (!vmx)\n        return ERR_PTR(-ENOMEM);\n\n```\n\nResults in the following error when loading:\n\n```\n[ 2825.026626] kpatch: unable to find symbol 'vmxarea'\n```\n\nUnlike vmlinux-created percpu variables, module-created percpu variable offsets are apparently not added to kallsyms.\n"},"comment":{"url":"https://api.github.com/repos/dynup/kpatch/issues/comments/301792796","html_url":"https://github.com/dynup/kpatch/issues/442#issuecomment-301792796","issue_url":"https://api.github.com/repos/dynup/kpatch/issues/442","id":301792796,"user":{"login":"euspectre","id":4547435,"avatar_url":"https://avatars2.githubusercontent.com/u/4547435?v=3","gravatar_id":"","url":"https://api.github.com/users/euspectre","html_url":"https://github.com/euspectre","followers_url":"https://api.github.com/users/euspectre/followers","following_url":"https://api.github.com/users/euspectre/following{/other_user}","gists_url":"https://api.github.com/users/euspectre/gists{/gist_id}","starred_url":"https://api.github.com/users/euspectre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euspectre/subscriptions","organizations_url":"https://api.github.com/users/euspectre/orgs","repos_url":"https://api.github.com/users/euspectre/repos","events_url":"https://api.github.com/users/euspectre/events{/privacy}","received_events_url":"https://api.github.com/users/euspectre/received_events","type":"User","site_admin":false},"created_at":"2017-05-16T14:04:51Z","updated_at":"2017-05-16T14:04:51Z","body":"It might be because, it seems, neither mainline kernel nor RHEL7 kernels have that percpu variable in inode.c, so you did not hit the problem. Unfortunately, the custom kernel I worked with, does have it."}}
{"actor":{"display_login":"euspectre"}}