Re: [RFC PATCH v2 1/1] x86/sgx: Explicitly give up the CPU in EDMM's ioctl() to avoid softlockup

2024-04-28 Thread Bojun Zhu
Hi Dave, Appreciate for your review! > On Apr 27, 2024, at 01:06, Dave Hansen wrote: > > On 4/26/24 07:18, Bojun Zhu wrote: >> for (c = 0 ; c < modp->length; c += PAGE_SIZE) { >> +if (sgx_check_signal_and_resched()) { >> +if (!c) >> +

Re: [PATCH] tracing: Fix uaf issue in tracing_open_file_tr

2024-04-28 Thread Steven Rostedt
On Fri, 26 Apr 2024 15:34:08 +0800 Tze-nan wu wrote: > "tracing_event_file" is at the risk of use-after-free due to the race of > two functions "tracing_open_file_tr" and "synth_event_release". > Specifically, it could be freed by synth_event_release before > tracing_open_file_tr has the

Re: [PATCH v9 00/36] tracing: fprobe: function_graph: Multi-function graph and fprobe on fgraph

2024-04-28 Thread Steven Rostedt
On Thu, 25 Apr 2024 13:31:53 -0700 Andrii Nakryiko wrote: I'm just coming back from Japan (work and then a vacation), and catching up on my email during the 6 hour layover in Detroit. > Hey Masami, > > I can't really review most of that code as I'm completely unfamiliar > with all those inner

Re: [RFC PATCH v2 1/1] x86/sgx: Explicitly give up the CPU in EDMM's ioctl() to avoid softlockup

2024-04-28 Thread Jarkko Sakkinen
On Fri Apr 26, 2024 at 5:18 PM EEST, Bojun Zhu wrote: > EDMM's ioctl()s support batch operations, which may be > time-consuming. Try to explicitly give up the CPU as the prefix > operation at the every begin of "for loop" in > sgx_enclave_{ modify_types | restrict_permissions | remove_pages} > to

Re: [PATCH v12 14/14] selftests/sgx: Add scripts for EPC cgroup testing

2024-04-28 Thread Jarkko Sakkinen
On Fri Apr 26, 2024 at 5:28 PM EEST, Dave Hansen wrote: > On 4/16/24 07:15, Jarkko Sakkinen wrote: > > On Tue Apr 16, 2024 at 8:42 AM EEST, Huang, Kai wrote: > > Yes, exactly. I'd take one week break and cycle the kselftest part > > internally a bit as I said my previous response. I'm sure that

Re: [PATCH v3 0/2] riscv: fix patching with IPI

2024-04-28 Thread patchwork-bot+linux-riscv
Hello: This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt : On Thu, 29 Feb 2024 13:10:54 +0100 you wrote: > patch 1 removes a useless memory barrier and patch 2 actually fixes the > issue with IPI in the patching code. > > Changes in v3: > - Remove wrong cleanup as noted by

Re: [PATCH v20 2/5] ring-buffer: Introducing ring-buffer mapping functions

2024-04-28 Thread Steven Rostedt
On Tue, 23 Apr 2024 12:04:15 -0400 "Liam R. Howlett" wrote: > > Nit: For all labels, please add a space before them. Otherwise, diffs will > > show "unlock" as the function and not "ring_buffer_map", making it harder > > to find where the change is. > > > > Isn't the inclusion of a space

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-28 Thread Jonathan Cameron
On Tue, 23 Apr 2024 18:33:05 -0400 Aren Moynihan wrote: > From: Ondrej Jirman > > VDD power input can be used to completely power off the chip during > system suspend. Do so if available. > > Signed-off-by: Ondrej Jirman > Signed-off-by: Aren Moynihan Suggestions inline. Key thing is take

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-28 Thread Jonathan Cameron
On Wed, 24 Apr 2024 18:20:41 +0300 Andy Shevchenko wrote: > On Wed, Apr 24, 2024 at 3:59 PM Ondřej Jirman wrote: > > On Wed, Apr 24, 2024 at 02:16:06AM GMT, Andy Shevchenko wrote: > > > On Wed, Apr 24, 2024 at 1:41 AM Aren Moynihan > > > wrote: > > ... > > > > > ret =

Re: [PATCH v8 3/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-04-28 Thread kernel test robot
Hi Bibo, kernel test robot noticed the following build warnings: [auto build test WARNING on 5eb4573ea63d0c83bf58fb7c243fc2c2b6966c02] url: https://github.com/intel-lab-lkp/linux/commits/Bibo-Mao/LoongArch-smp-Refine-some-ipi-functions-on-LoongArch-platform/20240428-180850 base

Re: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend

2024-04-28 Thread Jonathan Cameron
On Wed, 24 Apr 2024 02:16:06 +0300 Andy Shevchenko wrote: > On Wed, Apr 24, 2024 at 1:41 AM Aren Moynihan wrote: > > > > From: Ondrej Jirman > > > > VDD power input can be used to completely power off the chip during > > system suspend. Do so if available. > > ... > > > ret =

[PATCH v8 6/6] LoongArch: Add pv ipi support on guest kernel side

2024-04-28 Thread Bibo Mao
PARAVIRT option and pv ipi is added on guest kernel side, function pv_ipi_init() is to add ipi sending and ipi receiving hooks. This function firstly checks whether system runs on VM mode. If kernel runs on VM mode, it will call function kvm_para_available() to detect current hypervirsor type. Now

[PATCH v8 5/6] LoongArch: KVM: Add pv ipi support on kvm side

2024-04-28 Thread Bibo Mao
On LoongArch system, ipi hw uses iocsr registers, there is one iocsr register access on ipi sending, and two iocsr access on ipi receiving which is ipi interrupt handler. On VM mode all iocsr accessing will cause VM to trap into hypervisor. So with one ipi hw notification there will be three times

[PATCH v8 3/6] LoongArch: KVM: Add cpucfg area for kvm hypervisor

2024-04-28 Thread Bibo Mao
Instruction cpucfg can be used to get processor features. And there is trap exception when it is executed in VM mode, and also it is to provide cpu features to VM. On real hardware cpucfg area 0 - 20 is used. Here one specified area 0x4000 -- 0x40ff is used for KVM hypervisor to privide

[PATCH v8 4/6] LoongArch: KVM: Add vcpu search support from physical cpuid

2024-04-28 Thread Bibo Mao
Physical cpuid is used for interrupt routing for irqchips such as ipi/msi/extioi interrupt controller. And physical cpuid is stored at CSR register LOONGARCH_CSR_CPUID, it can not be changed once vcpu is created and physical cpuid of two vcpus cannot be the same. Different irqchips have different

[PATCH v8 2/6] LoongArch: KVM: Add hypercall instruction emulation support

2024-04-28 Thread Bibo Mao
On LoongArch system, there is hypercall instruction special for virtualization. When system executes this instruction on host side, there is illegal instruction exception reported, however it will trap into host when it is executed in VM mode. When hypercall is emulated, A0 register is set with

[PATCH v8 0/6] LoongArch: Add pv ipi support on LoongArch VM

2024-04-28 Thread Bibo Mao
On physical machine, ipi HW uses IOCSR registers, however there is trap into hypervisor when vcpu accesses IOCSR registers if system is in VM mode. SWI is a interrupt mechanism like SGI on ARM, software can send interrupt to CPU, only that on LoongArch SWI can only be sent to local CPU now. So SWI

[PATCH v8 1/6] LoongArch/smp: Refine some ipi functions on LoongArch platform

2024-04-28 Thread Bibo Mao
It is code refine about ipi handling on LoongArch platform, there are three modifications. 1. Add generic function get_percpu_irq(), replacing some percpu irq functions such as get_ipi_irq()/get_pmc_irq()/get_timer_irq() with get_percpu_irq(). 2. Change definition about parameter action called by

Re: [PATCH v6 08/16] mm/execmem, arch: convert remaining overrides of module_alloc to execmem

2024-04-28 Thread Mike Rapoport
On Fri, Apr 26, 2024 at 12:01:34PM -0700, Song Liu wrote: > On Fri, Apr 26, 2024 at 1:30 AM Mike Rapoport wrote: > > > > From: "Mike Rapoport (IBM)" > > > > Extend execmem parameters to accommodate more complex overrides of > > module_alloc() by architectures. > > > > This includes specification