1. 22 Aug, 2023 7 commits
  2. 31 Jul, 2023 2 commits
    • Ajay Kaher's avatar
      test: ftrace: Fix kprobe test for eventfs · 7c1130ea
      Ajay Kaher authored
      kprobe_args_char.tc, kprobe_args_string.tc has validation check
      for tracefs_create_dir, for eventfs it should be eventfs_create_dir.
      
      Link: https://lkml.kernel.org/r/1690568452-46553-11-git-send-email-akaher@vmware.comSigned-off-by: default avatarAjay Kaher <akaher@vmware.com>
      Co-developed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Tested-by: default avatarChing-lin Yu <chinglinyu@google.com>
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      7c1130ea
    • Ajay Kaher's avatar
      eventfs: Move tracing/events to eventfs · 27152bce
      Ajay Kaher authored
      Up until now, /sys/kernel/tracing/events was no different than any other
      part of tracefs. The files and directories within the events directory was
      created when the tracefs was mounted, and also created for the instances in
      /sys/kernel/tracing/instances/<instance>/events. Most of these files and
      directories will never be referenced. Since there are thousands of these
      files and directories they spend their time wasting precious memory
      resources.
      
      Move the "events" directory to the new eventfs. The eventfs will take the
      meta data of the events that they represent and store that. When the files
      in the events directory are referenced, the dentry and inodes to represent
      them are then created. When the files are no longer referenced, they are
      freed. This saves the precious memory resources that were wasted on these
      seldom referenced dentries and inodes.
      
      Running the following:
      
       ~# cat /proc/meminfo /proc/slabinfo  > before.out
       ~# mkdir /sys/kernel/tracing/instances/foo
       ~# cat /proc/meminfo /proc/slabinfo  > after.out
      
      to test the changes produces the following deltas:
      
      Before this change:
      
       Before after deltas for meminfo:
      
         MemFree: -32260
         MemAvailable: -21496
         KReclaimable: 21528
         Slab: 22440
         SReclaimable: 21528
         SUnreclaim: 912
         VmallocUsed: 16
      
       Before after deltas for slabinfo:
      
         <slab>:		<objects>	[ * <size> = <total>]
      
         tracefs_inode_cache:	14472		[* 1184 = 17134848]
         buffer_head:		24		[* 168 = 4032]
         hmem_inode_cache:	28		[* 1480 = 41440]
         dentry:		14450		[* 312 = 4508400]
         lsm_inode_cache:	14453		[* 32 = 462496]
         vma_lock:		11		[* 152 = 1672]
         vm_area_struct:	2		[* 184 = 368]
         trace_event_file:	1748		[* 88 = 153824]
         kmalloc-256:		1072		[* 256 = 274432]
         kmalloc-64:		2842		[* 64 = 181888]
      
       Total slab additions in size: 22,763,400 bytes
      
      With this change:
      
       Before after deltas for meminfo:
      
         MemFree: -12600
         MemAvailable: -12580
         Cached: 24
         Active: 12
         Inactive: 68
         Inactive(anon): 48
         Active(file): 12
         Inactive(file): 20
         Dirty: -4
         AnonPages: 68
         KReclaimable: 12
         Slab: 1856
         SReclaimable: 12
         SUnreclaim: 1844
         KernelStack: 16
         PageTables: 36
         VmallocUsed: 16
      
       Before after deltas for slabinfo:
      
         <slab>:		<objects>	[ * <size> = <total>]
      
         tracefs_inode_cache:	108		[* 1184 = 127872]
         buffer_head:		24		[* 168 = 4032]
         hmem_inode_cache:	18		[* 1480 = 26640]
         dentry:		127		[* 312 = 39624]
         lsm_inode_cache:	152		[* 32 = 4864]
         vma_lock:		67		[* 152 = 10184]
         vm_area_struct:	-12		[* 184 = -2208]
         trace_event_file: 	1764		[* 96 = 169344]
         kmalloc-96:		14322		[* 96 = 1374912]
         kmalloc-64:		2814		[* 64 = 180096]
         kmalloc-32:		1103		[* 32 = 35296]
         kmalloc-16:		2308		[* 16 = 36928]
         kmalloc-8:		12800		[* 8 = 102400]
      
       Total slab additions in size: 2,109,984 bytes
      
      Which is a savings of 20,653,416 bytes (20 MB) per tracing instance.
      
      Link: https://lkml.kernel.org/r/1690568452-46553-10-git-send-email-akaher@vmware.comSigned-off-by: default avatarAjay Kaher <akaher@vmware.com>
      Co-developed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Tested-by: default avatarChing-lin Yu <chinglinyu@google.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      27152bce
  3. 30 Jul, 2023 27 commits
  4. 29 Jul, 2023 4 commits
    • Sven Joachim's avatar
      arch/*/configs/*defconfig: Replace AUTOFS4_FS by AUTOFS_FS · 1f2190d6
      Sven Joachim authored
      Commit a2225d93 ("autofs: remove left-over autofs4 stubs")
      promised the removal of the fs/autofs/Kconfig fragment for AUTOFS4_FS
      within a couple of releases, but five years later this still has not
      happened yet, and AUTOFS4_FS is still enabled in 63 defconfigs.
      
      Get rid of it mechanically:
      
         git grep -l CONFIG_AUTOFS4_FS -- '*defconfig' |
             xargs sed -i 's/AUTOFS4_FS/AUTOFS_FS/'
      
      Also just remove the AUTOFS4_FS config option stub.  Anybody who hasn't
      regenerated their config file in the last five years will need to just
      get the new name right when they do.
      Signed-off-by: default avatarSven Joachim <svenjoac@gmx.de>
      Acked-by: default avatarIan Kent <raven@themaw.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1f2190d6
    • Linus Torvalds's avatar
      Merge tag 'loongarch-fixes-6.5-1' of... · 12214540
      Linus Torvalds authored
      Merge tag 'loongarch-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
      
      Pull LoongArch fixes from Huacai Chen:
       "Some bug fixes for build system, builtin cmdline handling, bpf and
        {copy, clear}_user, together with a trivial cleanup"
      
      * tag 'loongarch-fixes-6.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
        LoongArch: Cleanup __builtin_constant_p() checking for cpu_has_*
        LoongArch: BPF: Fix check condition to call lu32id in move_imm()
        LoongArch: BPF: Enable bpf_probe_read{, str}() on LoongArch
        LoongArch: Fix return value underflow in exception path
        LoongArch: Fix CMDLINE_EXTEND and CMDLINE_BOOTLOADER handling
        LoongArch: Fix module relocation error with binutils 2.41
        LoongArch: Only fiddle with CHECKFLAGS if `need-compiler'
      12214540
    • Sean Christopherson's avatar
      KVM: selftests: Expand x86's sregs test to cover illegal CR0 values · 5a759117
      Sean Christopherson authored
      Add coverage to x86's set_sregs_test to verify KVM rejects vendor-agnostic
      illegal CR0 values, i.e. CR0 values whose legality doesn't depend on the
      current VMX mode.  KVM historically has neglected to reject bad CR0s from
      userspace, i.e. would happily accept a completely bogus CR0 via
      KVM_SET_SREGS{2}.
      
      Punt VMX specific subtests to future work, as they would require quite a
      bit more effort, and KVM gets coverage for CR0 checks in general through
      other means, e.g. KVM-Unit-Tests.
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20230613203037.1968489-4-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5a759117
    • Sean Christopherson's avatar
      KVM: VMX: Don't fudge CR0 and CR4 for restricted L2 guest · c4abd735
      Sean Christopherson authored
      Stuff CR0 and/or CR4 to be compliant with a restricted guest if and only
      if KVM itself is not configured to utilize unrestricted guests, i.e. don't
      stuff CR0/CR4 for a restricted L2 that is running as the guest of an
      unrestricted L1.  Any attempt to VM-Enter a restricted guest with invalid
      CR0/CR4 values should fail, i.e. in a nested scenario, KVM (as L0) should
      never observe a restricted L2 with incompatible CR0/CR4, since nested
      VM-Enter from L1 should have failed.
      
      And if KVM does observe an active, restricted L2 with incompatible state,
      e.g. due to a KVM bug, fudging CR0/CR4 instead of letting VM-Enter fail
      does more harm than good, as KVM will often neglect to undo the side
      effects, e.g. won't clear rmode.vm86_active on nested VM-Exit, and thus
      the damage can easily spill over to L1.  On the other hand, letting
      VM-Enter fail due to bad guest state is more likely to contain the damage
      to L2 as KVM relies on hardware to perform most guest state consistency
      checks, i.e. KVM needs to be able to reflect a failed nested VM-Enter into
      L1 irrespective of (un)restricted guest behavior.
      
      Cc: Jim Mattson <jmattson@google.com>
      Cc: stable@vger.kernel.org
      Fixes: bddd82d1 ("KVM: nVMX: KVM needs to unset "unrestricted guest" VM-execution control in vmcs02 if vmcs12 doesn't set it")
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20230613203037.1968489-3-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c4abd735