Currently it is vm-$currentpid which works as long as there is just one
VM per the userspace (99.99% cases) but produces a bunch
of "debugfs: Directory 'vm16679' with parent 'kvm' already present!"
when syzkaller (syscall fuzzer) is running so only one VM is present in
the debugfs for a given process.
This changes the debugfs node to include the LPID which alone should be
system wide unique. This leaves the existing pid for the convenience of
matching the VM's debugfs with the running userspace process (QEMU).
Signed-off-by: Alexey Kardashevskiy <redacted>
---
arch/powerpc/kvm/book3s_hv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Currently it is vm-$currentpid which works as long as there is just one
VM per the userspace (99.99% cases) but produces a bunch
of "debugfs: Directory 'vm16679' with parent 'kvm' already present!"
when syzkaller (syscall fuzzer) is running so only one VM is present in
the debugfs for a given process.
This changes the debugfs node to include the LPID which alone should be
system wide unique. This leaves the existing pid for the convenience of
matching the VM's debugfs with the running userspace process (QEMU).
Signed-off-by: Alexey Kardashevskiy <redacted>
Currently it is vm-$currentpid which works as long as there is just one
VM per the userspace (99.99% cases) but produces a bunch
of "debugfs: Directory 'vm16679' with parent 'kvm' already present!"
when syzkaller (syscall fuzzer) is running so only one VM is present in
the debugfs for a given process.
This changes the debugfs node to include the LPID which alone should be
system wide unique. This leaves the existing pid for the convenience of
matching the VM's debugfs with the running userspace process (QEMU).
Signed-off-by: Alexey Kardashevskiy <redacted>
Reviewed-by: Fabiano Rosas <redacted>
thanks.
Strangely it also fixes a bunch of
BUG: unable to handle kernel NULL pointer dereference in corrupted
BUG: unable to handle kernel paging request in corrupted
I was having 3 of these for every hour of running syzkaller and not
anymore with this patch.
Currently it is vm-$currentpid which works as long as there is just one
VM per the userspace (99.99% cases) but produces a bunch
of "debugfs: Directory 'vm16679' with parent 'kvm' already present!"
when syzkaller (syscall fuzzer) is running so only one VM is present in
the debugfs for a given process.
This changes the debugfs node to include the LPID which alone should be
system wide unique. This leaves the existing pid for the convenience of
matching the VM's debugfs with the running userspace process (QEMU).
Signed-off-by: Alexey Kardashevskiy <redacted>
Looks like this is not enough as syzkaller still manages to cause the
error message, I need more robust approach as in
https://lore.kernel.org/patchwork/patch/1472025/ or alternatively
move this debugfs stuff under the platform-independent directory, how
about that?
alternatively move this debugfs stuff under the platform-independent
directory, how about that?
That's a good idea. I only now realized we have two separate directories
for the same guest:
$ ls /sys/kernel/debug/kvm/ | grep $pid
19062-11
vm19062
Looks like we would have to implement kvm_arch_create_vcpu_debugfs for
the vcpu information and add a similar hook for the vm.
alternatively move this debugfs stuff under the platform-independent
directory, how about that?
That's a good idea. I only now realized we have two separate directories
for the same guest:
$ ls /sys/kernel/debug/kvm/ | grep $pid
19062-11
vm19062
Looks like we would have to implement kvm_arch_create_vcpu_debugfs for
the vcpu information and add a similar hook for the vm.
Something like that. From the git history, it looks like the ppc folder
was added first and then the generic kvm folder was added but apparently
they did not notice the ppc one due to natural reasons :)
If you are not too busy, can you please merge the ppc one into the
generic one and post the patch, so we won't need to fix these
duplication warnings again? Thanks,
alternatively move this debugfs stuff under the platform-independent
directory, how about that?
That's a good idea. I only now realized we have two separate directories
for the same guest:
$ ls /sys/kernel/debug/kvm/ | grep $pid
19062-11
vm19062
Looks like we would have to implement kvm_arch_create_vcpu_debugfs for
the vcpu information and add a similar hook for the vm.
Something like that. From the git history, it looks like the ppc folder
was added first and then the generic kvm folder was added but apparently
they did not notice the ppc one due to natural reasons :)
If you are not too busy, can you please merge the ppc one into the
generic one and post the patch, so we won't need to fix these
duplication warnings again? Thanks,
Turns out it is not that straight forward as I thought as the common KVM
debugfs entry is created after PPC HV KVM created its own and there is
no obvious way to change the order (no "post init" hook in kvmppc_ops).
Also, unlike the common KVM debugfs setup, we do not allocate structures
to support debugfs nodes so we do not leak anything to bother with a
mutex like 85cd39af14f4 did.
So I'd stick to the original patch to reduce the noise in the dmesg, and
it also exposes lpid which I find rather useful for finding the right
partition scope tree in partition_tb.
Michael?
alternatively move this debugfs stuff under the platform-independent
directory, how about that?
That's a good idea. I only now realized we have two separate directories
for the same guest:
$ ls /sys/kernel/debug/kvm/ | grep $pid
19062-11
vm19062
Looks like we would have to implement kvm_arch_create_vcpu_debugfs for
the vcpu information and add a similar hook for the vm.
Something like that. From the git history, it looks like the ppc folder
was added first and then the generic kvm folder was added but apparently
they did not notice the ppc one due to natural reasons :)
If you are not too busy, can you please merge the ppc one into the
generic one and post the patch, so we won't need to fix these
duplication warnings again? Thanks,
Turns out it is not that straight forward as I thought as the common KVM
debugfs entry is created after PPC HV KVM created its own and there is
no obvious way to change the order (no "post init" hook in
kvmppc_ops).
That is why I mentioned creating a hook similar to
kvm_create_vcpu_debugfs in the common KVM code. kvm_create_vm_debugfs or
something.
Alternatively, maybe kvm_create_vm_debugfs could be moved earlier into
kvm_create_vm, before kvm_arch_post_init_vm and we could move our code
into kvm_arch_post_init_vm.
Also, unlike the common KVM debugfs setup, we do not allocate structures
to support debugfs nodes so we do not leak anything to bother with a
mutex like 85cd39af14f4 did.
So I'd stick to the original patch to reduce the noise in the dmesg, and
it also exposes lpid which I find rather useful for finding the right
partition scope tree in partition_tb.
Michael?
alternatively move this debugfs stuff under the platform-independent
directory, how about that?
That's a good idea. I only now realized we have two separate directories
for the same guest:
$ ls /sys/kernel/debug/kvm/ | grep $pid
19062-11
vm19062
Looks like we would have to implement kvm_arch_create_vcpu_debugfs for
the vcpu information and add a similar hook for the vm.
Something like that. From the git history, it looks like the ppc folder
was added first and then the generic kvm folder was added but apparently
they did not notice the ppc one due to natural reasons :)
If you are not too busy, can you please merge the ppc one into the
generic one and post the patch, so we won't need to fix these
duplication warnings again? Thanks,
Turns out it is not that straight forward as I thought as the common KVM
debugfs entry is created after PPC HV KVM created its own and there is
no obvious way to change the order (no "post init" hook in
kvmppc_ops).
That is why I mentioned creating a hook similar to
kvm_create_vcpu_debugfs in the common KVM code. kvm_create_vm_debugfs or
something.
ah sorry I missed that :-/
Alternatively, maybe kvm_create_vm_debugfs could be moved earlier into
kvm_create_vm, before kvm_arch_post_init_vm and we could move our code
into kvm_arch_post_init_vm.
kvm_arch_create_vcpu_debugfs() or kvm_arch_post_init_vm() will still
require hooks in kvmppc_ops and such bikeshedding may take a while :)
quoted
Also, unlike the common KVM debugfs setup, we do not allocate structures
to support debugfs nodes so we do not leak anything to bother with a
mutex like 85cd39af14f4 did.
So I'd stick to the original patch to reduce the noise in the dmesg, and
it also exposes lpid which I find rather useful for finding the right
partition scope tree in partition_tb.
Michael?