Re: [PATCH] NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id

2024-01-18 Thread Shijie Huang
在 2024/1/19 12:42, Yury Norov 写道: Regardless, I don't think that the approach is correct. As per your description, some initialization functions erroneously call cpu_to_node() instead of early_cpu_to_node() which exists specifically for that case. I checked the code again. The sparc, mips

Re: [PATCH] NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id

2024-01-18 Thread Shijie Huang
在 2024/1/19 14:46, Shijie Huang 写道: 在 2024/1/19 12:42, Yury Norov 写道: This adds another level of indirection, I think. Currently cpu_to_node is a simple inliner. After the patch it would be a real function with all the associate overhead. Can you share a bloat-o-meter output here?

Re: [PATCH] NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id

2024-01-18 Thread Shijie Huang
在 2024/1/19 12:42, Yury Norov 写道: This adds another level of indirection, I think. Currently cpu_to_node is a simple inliner. After the patch it would be a real function with all the associate overhead. Can you share a bloat-o-meter output here? #./scripts/bloat-o-meter vmlinux vmlinux.new

Re: [PATCH] NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id

2024-01-18 Thread Greg KH
On Fri, Jan 19, 2024 at 11:32:27AM +0800, Huang Shijie wrote: > During the kernel booting, the generic cpu_to_node() is called too early in > arm64, powerpc and riscv when CONFIG_NUMA is enabled. > > There are at least four places in the common code where > the generic cpu_to_node() is called

Re: [PATCH] NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id

2024-01-18 Thread Yury Norov
On Fri, Jan 19, 2024 at 11:32:27AM +0800, Huang Shijie wrote: > hZ7bkEvc+Z19RHkS/HVG3KMg > X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR01MB7144 > Status: O > Content-Length: 3779 > Lines: 126 > > During the kernel booting, the generic cpu_to_node() is called too early in > arm64,

[PATCH] NUMA: Early use of cpu_to_node() returns 0 instead of the correct node id

2024-01-18 Thread Huang Shijie
During the kernel booting, the generic cpu_to_node() is called too early in arm64, powerpc and riscv when CONFIG_NUMA is enabled. There are at least four places in the common code where the generic cpu_to_node() is called before it is initialized: 1.) early_trace_init() in

Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM

2024-01-18 Thread Anup Patel
On Thu, Jan 18, 2024 at 11:10 PM Sean Christopherson wrote: > > On Thu, Jan 18, 2024, Anup Patel wrote: > > On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones wrote: > > > > > > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM > > > supporting architectures select HAVE_KVM and then their

Re: [RFC PATCH 2/3] fs: remove duplicate ifdefs

2024-01-18 Thread Darrick J. Wong
On Thu, Jan 18, 2024 at 01:33:25PM +0530, Shrikanth Hegde wrote: > when a ifdef is used in the below manner, second one could be considered as > duplicate. > > ifdef DEFINE_A > ...code block... > ifdef DEFINE_A > ...code block... > endif > ...code block... > endif > > There are few places in fs

[PATCH] KVM: PPC: Book3S HV: Fix L2 guest reboot failure due to empty 'arch_compat'

2024-01-18 Thread Amit Machhiwal
Currently, rebooting a pseries nested qemu-kvm guest (L2) results in below error as L1 qemu sends PVR value 'arch_compat' == 0 via ppc_set_compat ioctl. This triggers a condition failure in kvmppc_set_arch_compat() resulting in an EINVAL. qemu-system-ppc64: Unable to set CPU compatibility mode in

Re: [PATCH] init: refactor the generic cpu_to_node for NUMA

2024-01-18 Thread Shijie Huang
Hi Greg, 在 2024/1/18 17:27, Greg KH 写道: On Thu, Jan 18, 2024 at 11:14:12AM +0800, Huang Shijie wrote: (0) We list the ARCHs which support the NUMA: arm64, loongarch, powerpc, riscv, sparc, mips, s390, x86, I do not understand this format, what are you saying here? Sorry for

[RFC PATCH 2/3] fs: remove duplicate ifdefs

2024-01-18 Thread Shrikanth Hegde
when a ifdef is used in the below manner, second one could be considered as duplicate. ifdef DEFINE_A ...code block... ifdef DEFINE_A ...code block... endif ...code block... endif There are few places in fs code where above pattern was seen. No functional change is intended here. It only aims to

[RFC PATCH 0/3] remove duplicate ifdefs

2024-01-18 Thread Shrikanth Hegde
When going through the code observed a case in scheduler, where #ifdef CONFIG_SMP was used to inside an #ifdef CONFIG_SMP. That didn't make sense since first one is good enough and second one is a duplicate. This could improve code readability. No functional change is intended. Maybe this is not

[RFC PATCH 3/3] arch/powerpc: remove duplicate ifdefs

2024-01-18 Thread Shrikanth Hegde
when a ifdef is used in the below manner, second one could be considered as duplicate. ifdef DEFINE_A ...code block... ifdef DEFINE_A ...code block... endif ...code block... endif few places in arch/powerpc where this pattern was seen. In addition to that in paca.h, CONFIG_PPC_BOOK3S_64 was

[RFC PATCH 1/3] sched: remove duplicate ifdefs

2024-01-18 Thread Shrikanth Hegde
when a ifdef is used in the below manner, second one could be considered as duplicate. ifdef DEFINE_A ...code block... ifdef DEFINE_A ...code block... endif ...code block... endif In the scheduler code, there are two places where above pattern can be observed. Hence second ifdef is a duplicate

Re: [PATCH] powerpc/pseries/iommu: DLPAR ADD of pci device doesn't completely initialize pci_controller structure

2024-01-18 Thread Nathan Lynch
Hi Gaurav, A couple minor comments below. Gaurav Batra writes: > diff --git a/arch/powerpc/include/asm/ppc-pci.h > b/arch/powerpc/include/asm/ppc-pci.h > index ce2b1b5eebdd..55a2ba36e9c4 100644 > --- a/arch/powerpc/include/asm/ppc-pci.h > +++ b/arch/powerpc/include/asm/ppc-pci.h > @@ -29,6

Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM

2024-01-18 Thread Sean Christopherson
On Thu, Jan 18, 2024, Anup Patel wrote: > On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones wrote: > > > > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM > > supporting architectures select HAVE_KVM and then their KVM > > Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV

Re: [PATCH v6] powerpc/pseries/vas: Use usleep_range() to support HCALL delay

2024-01-18 Thread Nathan Lynch
Haren Myneni writes: > VAS allocate, modify and deallocate HCALLs returns > H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC for busy > delay and expects OS to reissue HCALL after that delay. But using > msleep() will often sleep at least 20 msecs even though the > hypervisor suggests OS

[PATCH RFC 0/5] dump_stack: Allow runtime updates of the hardware description

2024-01-18 Thread Nathan Lynch via B4 Relay
When the kernel emits a stack trace, typically it includes a hardware description string, e.g. Kernel panic - not syncing: sysrq triggered crash CPU: 6 PID: 46433 Comm: bash Tainted: GW 6.7.0-rc2+ #83 > Hardware name: IBM,9040-MR9 POWER9 (architected) 0x4e2102 0xf05 >

[PATCH RFC 5/5] powerpc/pseries: Update hardware description string after migration

2024-01-18 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch Introduce code that rebuilds the short hardware description printed by stack traces. This sort of duplicates some code from boot (prom.c mainly), but that code populates the string as early as possible using APIs that aren't available later. So sharing all the code between the

[PATCH RFC 2/5] dump_stack: Allow update of arch description string at runtime

2024-01-18 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch The IBM PowerVM platform (targeted by powerpc/pseries) exposes the physical machine model and firmware version to partitions (guests), and this information is used to populate the arch description string, e.g. IBM,8408-E8E POWER8E (raw) 0x4b0201 0xf04 \

[PATCH RFC 3/5] powerpc/prom: Add CPU info to hardware description string later

2024-01-18 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch cur_cpu_spec->cpu_name is appended to ppc_hw_desc before cur_cpu_spec has taken on its final value. This is illustrated on pseries by comparing the CPU name as reported at boot ("POWER8E (raw)") to the contents of /proc/cpuinfo ("POWER8 (architected)"): $ dmesg | grep

[PATCH RFC 4/5] powerpc/pseries: Prepare pseries_add_hw_description() for runtime use

2024-01-18 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch pseries_add_hw_description() will be used after boot to update the hardware description string emitted in stack dumps. Remove the __init and make it take a seq_buf * parameter instead of referencing ppc_hw_desc directly. Signed-off-by: Nathan Lynch ---

[PATCH RFC 1/5] dump_stack: Make arch description buffer __ro_after_init

2024-01-18 Thread Nathan Lynch via B4 Relay
From: Nathan Lynch The static hardware description buffer is populated by arch code during boot and should not change afterwards, so mark it __ro_after_init. Signed-off-by: Nathan Lynch --- lib/dump_stack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/dump_stack.c

Re: [PATCH v2 06/13] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing

2024-01-18 Thread Ryan Roberts
On 17/01/2024 13:22, Jason Gunthorpe wrote: > On Tue, Jan 16, 2024 at 06:32:32PM +, Christophe Leroy wrote: hugepd is a page directory dedicated to huge pages, where you have huge pages listed instead of regular pages. For instance, on powerpc 32 with each PGD entries covering

[PATCH v12 15/15] media: vim2m-audio: add virtual driver for audio memory to memory

2024-01-18 Thread Shengjiu Wang
Audio memory to memory virtual driver use video memory to memory virtual driver vim2m.c as example. The main difference is device type is VFL_TYPE_AUDIO and device cap type is V4L2_CAP_AUDIO_M2M. The device_run function is a dummy function, which is simply copy the data from input buffer to

[PATCH v12 14/15] media: imx-asrc: Add memory to memory driver

2024-01-18 Thread Shengjiu Wang
Implement the ASRC memory to memory function using the v4l2 framework, user can use this function with v4l2 ioctl interface. User send the output and capture buffer to driver and driver store the converted data to the capture buffer. This feature can be shared by ASRC and EASRC drivers

[PATCH v12 13/15] media: vivid: add fixed point test controls

2024-01-18 Thread Shengjiu Wang
Add fixed point test controls, one is for Q4.16 format another one is for Q63 format. Signed-off-by: Shengjiu Wang --- drivers/media/test-drivers/vivid/vivid-core.h | 2 ++ .../media/test-drivers/vivid/vivid-ctrls.c| 26 +++ include/media/v4l2-ctrls.h|

[PATCH v12 12/15] media: uapi: Add an entity type for audio resampler

2024-01-18 Thread Shengjiu Wang
Add and document a media entity type for an audio resampler. It is MEDIA_ENT_F_PROC_AUDIO_RESAMPLER. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/mediactl/media-types.rst | 6 ++ include/uapi/linux/media.h | 1 + 2 files changed, 7

[PATCH v12 11/15] media: uapi: Declare interface types for Audio

2024-01-18 Thread Shengjiu Wang
Declare the interface types that will be used by Audio. The type is MEDIA_INTF_T_V4L_AUDIO. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/mediactl/media-types.rst| 5 + drivers/media/v4l2-core/v4l2-dev.c | 4 drivers/media/v4l2-core/v4l2-mem2mem.c

[PATCH v12 10/15] media: uapi: Add audio rate controls support

2024-01-18 Thread Shengjiu Wang
Add V4L2_CID_M2M_AUDIO_SOURCE_RATE and V4L2_CID_M2M_AUDIO_DEST_RATE new IDs for rate control. Add V4L2_CID_M2M_AUDIO_SOURCE_RATE_OFFSET and V4L2_CID_M2M_AUDIO_DEST_RATE_OFFSET for clock drift. Signed-off-by: Shengjiu Wang --- .../media/v4l/ext-ctrls-audio-m2m.rst | 20

[PATCH v12 09/15] media: uapi: Add V4L2_CTRL_CLASS_M2M_AUDIO

2024-01-18 Thread Shengjiu Wang
The Audio M2M class includes controls for audio memory-to-memory use cases. The controls can be used for audio codecs, audio preprocessing, audio postprocessing. Signed-off-by: Shengjiu Wang --- .../userspace-api/media/v4l/common.rst| 1 + .../media/v4l/ext-ctrls-audio-m2m.rst

[PATCH v12 08/15] media: uapi: Define audio sample format fourcc type

2024-01-18 Thread Shengjiu Wang
The audio sample format definition is from alsa, the header file is include/uapi/sound/asound.h, but don't include this header file directly, because in user space, there is another copy in alsa-lib. There will be conflict in userspace for include videodev2.h & asound.h and asoundlib.h Here still

[PATCH v12 07/15] media: v4l2: Add audio capture and output support

2024-01-18 Thread Shengjiu Wang
Audio signal processing has the requirement for memory to memory similar as Video. This patch is to add this support in v4l2 framework, defined new buffer type V4L2_BUF_TYPE_AUDIO_CAPTURE and V4L2_BUF_TYPE_AUDIO_OUTPUT, defined new format v4l2_audio_format for audio case usage. The created audio

[PATCH v12 06/15] media: uapi: Add V4L2_CAP_AUDIO_M2M capability flag

2024-01-18 Thread Shengjiu Wang
V4L2_CAP_AUDIO_M2M is similar to V4L2_CAP_VIDEO_M2M flag. It is used for audio memory to memory case. Signed-off-by: Shengjiu Wang --- Documentation/userspace-api/media/v4l/vidioc-querycap.rst| 3 +++ Documentation/userspace-api/media/videodev2.h.rst.exceptions | 1 +

[PATCH v12 05/15] ASoC: fsl_easrc: register m2m platform device

2024-01-18 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index

[PATCH v12 04/15] ASoC: fsl_asrc: register m2m platform device

2024-01-18 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Defined platform data structure and platform driver name. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- include/sound/fsl_asrc_common.h | 23 +++ sound/soc/fsl/fsl_asrc.c| 18 ++ 2

[PATCH v12 03/15] ASoC: fsl_asrc: move fsl_asrc_common.h to include/sound

2024-01-18 Thread Shengjiu Wang
Move fsl_asrc_common.h to include/sound that it can be included from other drivers. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- {sound/soc/fsl => include/sound}/fsl_asrc_common.h | 0 sound/soc/fsl/fsl_asrc.h | 2 +- sound/soc/fsl/fsl_asrc_dma.c

[PATCH v12 02/15] ASoC: fsl_easrc: define functions for memory to memory usage

2024-01-18 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang Acked-by: Mark Brown --- sound/soc/fsl/fsl_easrc.c | 214 ++ sound/soc/fsl/fsl_easrc.h | 4 + 2 files

[PATCH v12 00/15] Add audio support in v4l2 framework

2024-01-18 Thread Shengjiu Wang
Audio signal processing also has the requirement for memory to memory similar as Video. This asrc memory to memory (memory ->asrc->memory) case is a non real time use case. User fills the input buffer to the asrc module, after conversion, then asrc sends back the output buffer to user. So it is

[PATCH v12 01/15] ASoC: fsl_asrc: define functions for memory to memory usage

2024-01-18 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage. m2m_prepare: prepare for the start step m2m_start: the start step m2m_unprepare: unprepare for stop step, optional m2m_stop: stop step m2m_check_format: check format is supported or not m2m_calc_out_len: calculate

Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM

2024-01-18 Thread Anup Patel
On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones wrote: > > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM > supporting architectures select HAVE_KVM and then their KVM > Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV > consistent with that approach which fixes

[PATCH 1/1] PCI/DPC: Fix TLP Prefix register reading offset

2024-01-18 Thread Ilpo Järvinen
The TLP Prefix Log Register consists of multiple DWORDs (PCIe r6.1 sec 7.9.14.13) but the loop in dpc_process_rp_pio_error() keeps reading from the first DWORD. Add the iteration count based offset calculation into the config read. Fixes: f20c4ea49ec4 ("PCI/DPC: Add eDPC support") Signed-off-by:

Re: [PATCH] init: refactor the generic cpu_to_node for NUMA

2024-01-18 Thread Greg KH
On Thu, Jan 18, 2024 at 11:14:12AM +0800, Huang Shijie wrote: > (0) We list the ARCHs which support the NUMA: >arm64, loongarch, powerpc, riscv, >sparc, mips, s390, x86, I do not understand this format, what are you saying here? Have you read the kernel documentation for how to

Re: [PATCH v11 15/15] media: vim2m-audio: add virtual driver for audio memory to memory

2024-01-18 Thread Shengjiu Wang
On Thu, Jan 18, 2024 at 3:56 PM Hans Verkuil wrote: > > On 18/01/2024 07:13, Shengjiu Wang wrote: > > On Wed, Jan 17, 2024 at 6:32 PM Hans Verkuil wrote: > >> > >> On 22/11/2023 08:23, Shengjiu Wang wrote: > >>> Audio memory to memory virtual driver use video memory to memory > >>> virtual