[PATCH v2 35/44] cpuidle,omap3: Push RCU-idle into omap_sram_idle()

2022-09-19 Thread Peter Zijlstra
OMAP3 uses full SoC suspend modes as idle states, as such it needs the whole power-domain and clock-domain code from the idle path. All that code is not suitable to run with RCU disabled, as such push RCU-idle deeper still. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tony Lindgren

[PATCH v2 18/44] cpuidle, intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE *again*

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_irq+0x10c: call to trace_hardirqs_off() leaves .noinstr.text section As per commit 32d4fd5751ea ("cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE"): "must not have tracing in idle functions" Clearly people can't read and tinker along until splat

[PATCH v2 20/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IBRS

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_ibrs+0x17: call to spec_ctrl_current() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_ibrs+0x27: call to wrmsrl.constprop.0() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/kernel/cpu/bugs.c |2

[PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- arch/arm/mach-imx/cpuidle-imx6sx.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) ---

[PATCH v2 01/44] x86/perf/amd: Remove tracing from perf_lopwr_cb()

2022-09-19 Thread Peter Zijlstra
The perf_lopwr_cb() is called from the idle routines; there is no RCU there, we must not enter tracing. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/events/amd/brs.c | 13 + arch/x86/include/asm/perf_event.h |2 +- 2 files changed, 6 insertions(+), 9 deletions(-)

[PATCH v2 19/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_INIT_XSTATE

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_s2idle+0xd5: call to fpu_idle_fpregs() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_xstate+0x11: call to fpu_idle_fpregs() leaves .noinstr.text section vmlinux.o: warning: objtool: fpu_idle_fpregs+0x9: call to xfeatures_in_use()

[PATCH v2 26/44] time/tick-broadcast: Remove RCU_NONIDLE usage

2022-09-19 Thread Peter Zijlstra
No callers left that have already disabled RCU. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland --- kernel/time/tick-broadcast-hrtimer.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) --- a/kernel/time/tick-broadcast-hrtimer.c +++

[PATCH v2 00/44] cpuidle,rcu: Clean up the mess

2022-09-19 Thread Peter Zijlstra
Hi All! At long last, a respin of the cpuidle vs rcu cleanup patches. v1: https://lkml.kernel.org/r/20220608142723.103523...@infradead.org These here patches clean up the mess that is cpuidle vs rcuidle. At the end of the ride there's only on RCU_NONIDLE user left:

[PATCH v2 40/44] ubsan: Fix objtool UACCESS warns

2022-09-19 Thread Peter Zijlstra
clang-14 allyesconfig gives: vmlinux.o: warning: objtool: emulator_cmpxchg_emulated+0x705: call to __ubsan_handle_load_invalid_value() with UACCESS enabled vmlinux.o: warning: objtool: paging64_update_accessed_dirty_bits+0x39e: call to __ubsan_handle_load_invalid_value() with UACCESS enabled

[PATCH v2 04/44] cpuidle: Move IRQ state validation

2022-09-19 Thread Peter Zijlstra
Make cpuidle_enter_state() consistent with the s2idle variant and verify ->enter() always returns with interrupts disabled. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/cpuidle/cpuidle.c +++

[PATCH v2 29/44] cpuidle,tdx: Make tdx noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: __halt+0x2c: call to hcall_func.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: __halt+0x3f: call to __tdx_hypercall() leaves .noinstr.text section vmlinux.o: warning: objtool: __tdx_hypercall+0x66: call to __tdx_hypercall_failed() leaves

[PATCH v2 24/44] arm64,smp: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Peter Zijlstra
Ever since commit d3afc7f12987 ("arm64: Allow IPIs to be handled as normal interrupts") this function is called in regular IRQ context. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Acked-by: Marc Zyngier --- arch/arm64/kernel/smp.c |4 ++-- 1 file changed, 2 insertions(+),

Re: [PATCH v2 09/44] cpuidle,omap3: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:31:42PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:48AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then teporarily enable it > > again before going idle is daft. > > That doesn't tell where those calls are.

[PATCH v2 21/44] arch/idle: Change arch_cpu_idle() IRQ behaviour

2022-09-19 Thread Peter Zijlstra
Current arch_cpu_idle() is called with IRQs disabled, but will return with IRQs enabled. However, the very first thing the generic code does after calling arch_cpu_idle() is raw_local_irq_disable(). This means that architectures that can idle with IRQs disabled end up doing a pointless

Re: [PATCH v2 00/44] cpuidle,rcu: Clean up the mess

2022-09-19 Thread Rafael J. Wysocki
On Mon, Sep 19, 2022 at 12:17 PM Peter Zijlstra wrote: > > Hi All! > > At long last, a respin of the cpuidle vs rcu cleanup patches. > > v1: https://lkml.kernel.org/r/20220608142723.103523...@infradead.org > > These here patches clean up the mess that is cpuidle vs rcuidle. > > At the end of the

[PATCH v2 11/44] cpuidle,omap4: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, some *four* times, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- arch/arm/mach-omap2/cpuidle44xx.c | 29 ++--- 1

[PATCH v2 03/44] cpuidle/poll: Ensure IRQ state is invariant

2022-09-19 Thread Peter Zijlstra
cpuidle_state::enter() methods should be IRQ invariant Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rafael J. Wysocki --- drivers/cpuidle/poll_state.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@

[PATCH v2 07/44] cpuidle,psci: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-psci.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) ---

[PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-riscv-sbi.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) ---

[PATCH v2 06/44] cpuidle,tegra: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-tegra.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) ---

[PATCH v2 10/44] cpuidle,armada: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-mvebu-v7.c |7 +++ 1 file changed, 7 insertions(+) --- a/drivers/cpuidle/cpuidle-mvebu-v7.c +++

[PATCH v2 02/44] x86/idle: Replace x86_idle with a static_call

2022-09-19 Thread Peter Zijlstra
Typical boot time setup; no need to suffer an indirect call for that. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Frederic Weisbecker Reviewed-by: Rafael J. Wysocki --- arch/x86/kernel/process.c | 50 +- 1 file changed, 28 insertions(+), 22

Re: [PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver

2022-09-19 Thread Anup Patel
On Mon, Sep 19, 2022 at 3:47 PM Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Looks good to me. For RISC-V cpuidle: Reviewed-by: Anup Patel Regards,

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:21:23PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > > again, at least twice, before going idle is daft. > > Hmm, what ends up calling

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:49:41PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > > again, at least twice, before going idle is daft. > > > > Signed-off-by: Peter

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:49:41PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > > again, at least twice, before going idle is daft. > > > > Signed-off-by: Peter

[PATCH v2 25/44] printk: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Peter Zijlstra
The problem, per commit fc98c3c8c9dc ("printk: use rcuidle console tracepoint"), was printk usage from the cpuidle path where RCU was already disabled. Per the patches earlier in this series, this is no longer the case. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Sergey Senozhatsky

[PATCH v2 31/44] cpuidle,nospec: Make noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: mwait_idle+0x47: call to mds_idle_clear_cpu_buffers() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_processor_ffh_cstate_enter+0xa2: call to mds_idle_clear_cpu_buffers() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle+0x91: call

[PATCH v2 32/44] cpuidle,acpi: Make noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: io_idle+0xc: call to __inb.isra.0() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_idle_enter+0xfe: call to num_online_cpus() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_idle_enter+0x115: call to acpi_idle_fallback_to_c1.isra.0()

[PATCH v2 33/44] ftrace: WARN on rcuidle

2022-09-19 Thread Peter Zijlstra
CONFIG_GENERIC_ENTRY disallows any and all tracing when RCU isn't enabled. XXX if s390 (the only other GENERIC_ENTRY user as of this writing) isn't comfortable with this, we could switch to HAVE_NOINSTR_VALIDATION which is x86_64 only atm. Signed-off-by: Peter Zijlstra (Intel) ---

[PATCH v2 17/44] objtool/idle: Validate __cpuidle code as noinstr

2022-09-19 Thread Peter Zijlstra
Idle code is very like entry code in that RCU isn't available. As such, add a little validation. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Geert Uytterhoeven --- arch/alpha/kernel/vmlinux.lds.S |1 - arch/arc/kernel/vmlinux.lds.S|1 -

[PATCH v2 43/44] sched: Always inline __this_cpu_preempt_check()

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: in_entry_stack+0x9: call to __this_cpu_preempt_check() leaves .noinstr.text section vmlinux.o: warning: objtool: default_do_nmi+0x10: call to __this_cpu_preempt_check() leaves .noinstr.text section vmlinux.o: warning: objtool: fpu_idle_fpregs+0x41: call to

[PATCH v2 37/44] arm,omap2: Use WFI for omap2_pm_idle()

2022-09-19 Thread Peter Zijlstra
arch_cpu_idle() is a very simple idle interface and exposes only a single idle state and is expected to not require RCU and not do any tracing/instrumentation. As such, omap2_pm_idle() is not a valid implementation. Replace it with a simple (shallow) omap2_do_wfi() call. Omap2 doesn't have a

[PATCH v2 09/44] cpuidle,omap3: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then teporarily enable it again before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- arch/arm/mach-omap2/cpuidle34xx.c | 16 1 file changed, 16 insertions(+) ---

[PATCH v2 12/44] cpuidle,dt: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again before going idle is daft. Notably: this converts all dt_init_idle_driver() and __CPU_PM_CPU_IDLE_ENTER() users for they are inextrably intertwined. Signed-off-by: Peter Zijlstra (Intel) ---

[PATCH v2 42/44] entry, kasan, x86: Disallow overriding mem*() functions

2022-09-19 Thread Peter Zijlstra
KASAN cannot just hijack the mem*() functions, it needs to emit __asan_mem*() variants if it wants instrumentation (other sanitizers already do this). vmlinux.o: warning: objtool: sync_regs+0x24: call to memcpy() leaves .noinstr.text section vmlinux.o: warning: objtool: vc_switch_off_ist+0xbe:

[PATCH v2 44/44] arm64,riscv,perf: Remove RCU_NONIDLE() usage

2022-09-19 Thread Peter Zijlstra
The PM notifiers should no longer be ran with RCU disabled (per the previous patches), as such this hack is no longer required either. Signed-off-by: Peter Zijlstra (Intel) --- drivers/perf/arm_pmu.c | 11 +-- drivers/perf/riscv_pmu_sbi.c |8 +--- 2 files changed, 2

[PATCH v2 14/44] cpuidle, cpu_pm: Remove RCU fiddling from cpu_pm_{enter, exit}()

2022-09-19 Thread Peter Zijlstra
All callers should still have RCU enabled. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland --- kernel/cpu_pm.c |9 - 1 file changed, 9 deletions(-) --- a/kernel/cpu_pm.c +++ b/kernel/cpu_pm.c @@ -30,16 +30,9 @@ static int cpu_pm_notify(enum cpu_pm_eve { int

[PATCH v2 38/44] cpuidle,powerdomain: Remove trace_.*_rcuidle()

2022-09-19 Thread Peter Zijlstra
OMAP was the one and only user. Signed-off-by: Peter Zijlstra (Intel) --- arch/arm/mach-omap2/powerdomain.c | 10 +- drivers/base/power/runtime.c | 24 2 files changed, 17 insertions(+), 17 deletions(-) --- a/arch/arm/mach-omap2/powerdomain.c +++

[PATCH v2 27/44] cpuidle, sched: Remove annotations from TIF_{POLLING_NRFLAG, NEED_RESCHED}

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: mwait_idle+0x5: call to current_set_polling_and_test() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_processor_ffh_cstate_enter+0xc5: call to current_set_polling_and_test() leaves .noinstr.text section vmlinux.o: warning: objtool:

[PATCH v2 13/44] cpuidle: Fix ct_idle_*() usage

2022-09-19 Thread Peter Zijlstra
The whole disable-RCU, enable-IRQS dance is very intricate since changing IRQ state is traced, which depends on RCU. Add two helpers for the cpuidle case that mirror the entry code. Signed-off-by: Peter Zijlstra (Intel) --- arch/arm/mach-imx/cpuidle-imx6q.c|4 +--

[PATCH v2 39/44] cpuidle,clk: Remove trace_.*_rcuidle()

2022-09-19 Thread Peter Zijlstra
OMAP was the one and only user. Signed-off-by: Peter Zijlstra (Intel) --- drivers/clk/clk.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -978,12 +978,12 @@ static void clk_core_disable(struct clk_ if

[PATCH v2 34/44] cpuidle,omap3: Use WFI for omap3_pm_idle()

2022-09-19 Thread Peter Zijlstra
arch_cpu_idle() is a very simple idle interface and exposes only a single idle state and is expected to not require RCU and not do any tracing/instrumentation. As such, omap_sram_idle() is not a valid implementation. Replace it with the simple (shallow) omap3_do_wfi() call. Leaving the more

[PATCH v2 22/44] x86/tdx: Remove TDX_HCALL_ISSUE_STI

2022-09-19 Thread Peter Zijlstra
Now that arch_cpu_idle() is expected to return with IRQs disabled, avoid the useless STI/CLI dance. Per the specs this is supposed to work, but nobody has yet relied up this behaviour so broken implementations are possible. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/coco/tdx/tdcall.S

[PATCH v2 15/44] acpi_idle: Remove tracing

2022-09-19 Thread Peter Zijlstra
All the idle routines are called with RCU disabled, as such there must not be any tracing inside. While there; clean-up the io-port idle thing. Signed-off-by: Peter Zijlstra (Intel) --- drivers/acpi/processor_idle.c | 24 +--- 1 file changed, 13 insertions(+), 11

[PATCH v2 36/44] cpuidle, omap4: Push RCU-idle into omap4_enter_lowpower()

2022-09-19 Thread Peter Zijlstra
From: Tony Lindgren OMAP4 uses full SoC suspend modes as idle states, as such it needs the whole power-domain and clock-domain code from the idle path. All that code is not suitable to run with RCU disabled, as such push RCU-idle deeper still. Signed-off-by: Tony Lindgren Signed-off-by: Peter

[PATCH v2 30/44] cpuidle,xenpv: Make more PARAVIRT_XXL noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: acpi_idle_enter_s2idle+0xde: call to wbinvd() leaves .noinstr.text section vmlinux.o: warning: objtool: default_idle+0x4: call to arch_safe_halt() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_safe_halt+0xa: call to HYPERVISOR_sched_op.constprop.0()

[PATCH v2 16/44] cpuidle: Annotate poll_idle()

2022-09-19 Thread Peter Zijlstra
The __cpuidle functions will become a noinstr class, as such they need explicit annotations. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rafael J. Wysocki --- drivers/cpuidle/poll_state.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/cpuidle/poll_state.c

[PATCH v2 23/44] arm,smp: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Peter Zijlstra
None of these functions should ever be ran with RCU disabled anymore. Specifically, do_handle_IPI() is only called from handle_IPI() which explicitly does irq_enter()/irq_exit() which ensures RCU is watching. The problem with smp_cross_call() was, per commit 7c64cc0531fa ("arm: Use _rcuidle for

[PATCH v2 41/44] intel_idle: Add force_irq_on module param

2022-09-19 Thread Peter Zijlstra
For testing purposes. Signed-off-by: Peter Zijlstra (Intel) --- drivers/idle/intel_idle.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -1787,6 +1787,9 @@ static bool __init intel_idle_verify_cst return

[PATCH v2 28/44] cpuidle,mwait: Make noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_s2idle+0x6e: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_irq+0x8c: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle+0x73: call to

Re: [PATCH v2 30/44] cpuidle,xenpv: Make more PARAVIRT_XXL noinstr clean

2022-09-19 Thread Juergen Gross via Virtualization
On 19.09.22 12:00, Peter Zijlstra wrote: vmlinux.o: warning: objtool: acpi_idle_enter_s2idle+0xde: call to wbinvd() leaves .noinstr.text section vmlinux.o: warning: objtool: default_idle+0x4: call to arch_safe_halt() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_safe_halt+0xa:

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-19 Thread Alvaro Karsz
Thanks for the reply. > This can be simplified with min_not_zero(). Ok, I will do it in the next version. > It's worth including a comment here that the discard and secure erase > limits are combined because the Linux block layer only has one limit > value. If the block layer supported

Re: [PATCH v2] jailhouse: Hold reference returned from of_find_xxx API

2022-09-19 Thread Bjorn Helgaas
On Fri, Sep 16, 2022 at 10:25:31PM -0700, Srivatsa S. Bhat wrote: > [ Adding author and reviewers of commit 63338a38db95 again ] > > On 9/16/22 2:00 AM, Liang He wrote: > > In jailhouse_paravirt(), we should hold the reference returned from > > of_find_compatible_node() which has increased the

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-19 Thread Stefan Hajnoczi
On Mon, Aug 29, 2022 at 11:23:13AM +0300, Alvaro Karsz wrote: > @@ -1075,6 +1068,57 @@ static int virtblk_probe(struct virtio_device *vdev) > blk_queue_max_write_zeroes_sectors(q, v ? v : UINT_MAX); > } > > + if (virtio_has_feature(vdev, VIRTIO_BLK_F_SECURE_ERASE)) { > +

Re: [dm-devel] [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage

2022-09-19 Thread Stefan Hajnoczi
On Sat, Sep 17, 2022 at 12:46:33PM -0700, Sarthak Kukreti wrote: > On Fri, Sep 16, 2022 at 8:03 PM Darrick J. Wong wrote: > > > > On Thu, Sep 15, 2022 at 09:48:18AM -0700, Sarthak Kukreti wrote: > > > From: Sarthak Kukreti > > > > > > Hi, > > > > > > This patch series is an RFC of a mechanism to

Re: [PATCH v2] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-19 Thread Chia-I Wu
On Sun, Sep 18, 2022 at 11:36 PM Dan Carpenter wrote: > > The ->ring_idx_mask variable is a u64 so static checkers, Smatch in > this case, complain if the BIT() is not also a u64. > > drivers/gpu/drm/virtio/virtgpu_ioctl.c:50 virtio_gpu_fence_event_create() > warn: should '(1 << ring_idx)' be a

Re: [PATCH 1/4] vDPA: allow userspace to query features of a vDPA device

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > This commit adds a new vDPA netlink attribution > VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES. Userspace can query > features of vDPA devices through this new attr. > > This commit invokes vdpa_config_ops.get_config() than >

Re: [PATCH 3/3] vp_vdpa: support feature provisioning

2022-09-19 Thread Jason Wang
On Mon, Sep 19, 2022 at 3:05 PM Eli Cohen wrote: > > > From: Jason Wang > > Sent: Thursday, 15 September 2022 11:51 > > To: m...@redhat.com; jasow...@redhat.com > > Cc: Eli Cohen ; si-wei@oracle.com; Parav Pandit > > ; wuzongy...@linux.alibaba.com; > >

Re: [PATCH 4/4] vDPA: Conditionally read MTU and MAC in dev cfg space

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > The spec says: > mtu only exists if VIRTIO_NET_F_MTU is set > The mac address field always exists (though > is only valid if VIRTIO_NET_F_MAC is set) > > So vdpa_dev_net_config_fill() should read MTU and MAC > conditionally on the feature

Re: [PATCH 3/4] vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > virtio 1.2 spec says: > max_virtqueue_pairs only exists if VIRTIO_NET_F_MQ or > VIRTIO_NET_F_RSS is set. > > So when reporint MQ to userspace, it should check both > VIRTIO_NET_F_MQ and VIRTIO_NET_F_RSS. > > This commit also fixes: > 1) a

Re: [PATCH 2/4] vDPA: only report driver features if FEATURES_OK is set

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > vdpa_dev_net_config_fill() should only report driver features > to userspace after features negotiation is done. > > Signed-off-by: Zhu Lingshan > --- > drivers/vdpa/vdpa.c | 13 + > 1 file changed, 9 insertions(+), 4

[PATCH v2] virtio-gpu: fix shift wrapping bug in virtio_gpu_fence_event_create()

2022-09-19 Thread Dan Carpenter
The ->ring_idx_mask variable is a u64 so static checkers, Smatch in this case, complain if the BIT() is not also a u64. drivers/gpu/drm/virtio/virtgpu_ioctl.c:50 virtio_gpu_fence_event_create() warn: should '(1 << ring_idx)' be a 64 bit type? Fixes: cd7f5ca33585 ("drm/virtio: implement context