Re: [PATCH v3 4/8] PCI: replace pci_dev::driver usage that gets the driver name

2021-08-12 Thread Christoph Hellwig
On Wed, Aug 11, 2021 at 10:06:33AM +0200, Uwe Kleine-K??nig wrote: > static inline const char *eeh_driver_name(struct pci_dev *pdev) > { > - return (pdev && pdev->driver) ? pdev->driver->name : ""; > + const char *drvstr = pdev ? dev_driver_string(&pdev->dev) : ""; > + > + if (*drvstr

Re: [PATCH] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-12 Thread Michael Ellerman
Christophe Leroy writes: > Le 10/08/2021 à 06:53, Aneesh Kumar K.V a écrit : >> Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. >> >> Signed-off-by: Aneesh Kumar K.V >> --- >> arch/powerpc/mm/book3s64/radix_tlb.c | 48 >> 1 file chang

Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting TIan
在 2021/8/6 下午10:51, Arnd Bergmann 写道: On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian wrote: @@ -163,6 +155,13 @@ static void hvc_console_print(struct console *co, const char *b, if (vtermnos[index] == -1) return; + list_for_each_entry(hp, &hvc_structs, next) +

Re: [PATCH] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-12 Thread Aneesh Kumar K.V
On 8/12/21 12:58 PM, Michael Ellerman wrote: Christophe Leroy writes: Le 10/08/2021 à 06:53, Aneesh Kumar K.V a écrit : Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/radix_tlb.c | 48 +

Re: [PATCH v3 4/8] PCI: replace pci_dev::driver usage that gets the driver name

2021-08-12 Thread Uwe Kleine-König
On Thu, Aug 12, 2021 at 08:07:20AM +0100, Christoph Hellwig wrote: > On Wed, Aug 11, 2021 at 10:06:33AM +0200, Uwe Kleine-K??nig wrote: > > static inline const char *eeh_driver_name(struct pci_dev *pdev) > > { > > - return (pdev && pdev->driver) ? pdev->driver->name : ""; > > + const char *dr

[PATCH v5 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting Tian
As well known, hvc backend can register its opertions to hvc backend. the opertions contain put_chars(), get_chars() and so on. Some hvc backend may do dma in its opertions. eg, put_chars() of virtio-console. But in the code of hvc framework, it may pass DMA incapable memory to put_chars() under a

[PATCH v5 0/2] make hvc pass dma capable memory to its backend

2021-08-12 Thread Xianting Tian
Dear all, This patch series make hvc framework pass DMA capable memory to put_chars() of hvc backend(eg, virtio-console), and revert commit c4baad5029 ("virtio-console: avoid DMA from stack”) V1 virtio-console: avoid DMA from vmalloc area https://lkml.org/lkml/2021/7/27/494 For v1 patch, Arnd Be

[PATCH v5 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-12 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++-- 1 file c

Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Arnd Bergmann
On Thu, Aug 12, 2021 at 10:08 AM Xianting TIan wrote: > 在 2021/8/6 下午10:51, Arnd Bergmann 写道: > > On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian > >> +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long > > I think you need a higher alignment for DMA buffers, instead of > > sizeof(long),

Re: [PATCH v2 1/2] KVM: Refactor kvm_arch_vcpu_fault() to return a struct page pointer

2021-08-12 Thread David Hildenbrand
On 12.08.21 06:02, Hou Wenlong wrote: From: Sean Christopherson Refactor kvm_arch_vcpu_fault() to return 'struct page *' instead of 'vm_fault_t' to simplify architecture specific implementations that do more than return SIGBUS. Currently this only applies to s390, but a future patch will move

Re: [PATCH v4 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting TIan
在 2021/8/12 下午4:54, Arnd Bergmann 写道: On Thu, Aug 12, 2021 at 10:08 AM Xianting TIan wrote: 在 2021/8/6 下午10:51, Arnd Bergmann 写道: On Fri, Aug 6, 2021 at 5:01 AM Xianting Tian +#define __ALIGNED__ __attribute__((__aligned__(sizeof(long I think you need a higher alignment for DMA buffers

[PATCH v6 0/2] make hvc pass dma capable memory to its backend

2021-08-12 Thread Xianting Tian
Dear all, This patch series make hvc framework pass DMA capable memory to put_chars() of hvc backend(eg, virtio-console), and revert commit c4baad5029 ("virtio-console: avoid DMA from stack”) V1 virtio-console: avoid DMA from vmalloc area https://lkml.org/lkml/2021/7/27/494 For v1 patch, Arnd Be

[PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting Tian
As well known, hvc backend can register its opertions to hvc backend. the opertions contain put_chars(), get_chars() and so on. Some hvc backend may do dma in its opertions. eg, put_chars() of virtio-console. But in the code of hvc framework, it may pass DMA incapable memory to put_chars() under a

[PATCH v6 2/2] virtio-console: remove unnecessary kmemdup()

2021-08-12 Thread Xianting Tian
hvc framework will never pass stack memory to the put_chars() function, So the calling of kmemdup() is unnecessary, we can remove it. This revert commit c4baad5029 ("virtio-console: avoid DMA from stack") Signed-off-by: Xianting Tian --- drivers/char/virtio_console.c | 12 ++-- 1 file c

Re: [PATCH] powerpc/interrupt: Fix OOPS by not calling do_IRQ() from timer_interrupt()

2021-08-12 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of August 11, 2021 2:13 am: > An interrupt handler shall not be called from another interrupt > handler otherwise this leads to problems like the following: > > Kernel attempted to write user page (afd4fa84) - exploit attempt? (uid: > 1000) > -

Re: [PATCH] powerpc/interrupt: Do not call single_step_exception() from other exceptions

2021-08-12 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of August 11, 2021 2:13 am: > single_step_exception() is called by emulate_single_step() which > is called from (at least) alignment exception() handler and > program_check_exception() handler. > > Redefine it as a regular __single_step_exception() which is

Re: [PATCH 07/11] treewide: Replace the use of mem_encrypt_active() with prot_guest_has()

2021-08-12 Thread Kirill A. Shutemov
On Wed, Aug 11, 2021 at 10:52:55AM -0500, Tom Lendacky wrote: > On 8/11/21 7:19 AM, Kirill A. Shutemov wrote: > > On Tue, Aug 10, 2021 at 02:48:54PM -0500, Tom Lendacky wrote: > >> On 8/10/21 1:45 PM, Kuppuswamy, Sathyanarayanan wrote: > >>> > >>> > >>> On 7/27/21 3:26 PM, Tom Lendacky wrote: > >>>

Re: [PATCH] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-12 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > On 8/12/21 12:58 PM, Michael Ellerman wrote: >> Christophe Leroy writes: >>> Le 10/08/2021 à 06:53, Aneesh Kumar K.V a écrit : Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V ---

Re: [PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread kernel test robot
Hi Xianting, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on tty/tty-testing] [also build test WARNING on char-misc/char-misc-testing soc/for-next v5.14-rc5 next-20210812] [If your patch is applied to the wrong git tree, kindly drop us a note. And when

[PATCH -next] trap: Cleanup trap_init()

2021-08-12 Thread Kefeng Wang
There are some empty trap_init() in different ARCHs, introduce a new weak trap_init() function to cleanup them. Cc: Vineet Gupta Cc: Russell King Cc: Yoshinori Sato Cc: Ley Foon Tan Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: James E.J. Bottomley Cc: Helge Deller Cc: Mic

Re: [PATCH -next] trap: Cleanup trap_init()

2021-08-12 Thread Russell King (Oracle)
On Thu, Aug 12, 2021 at 08:36:02PM +0800, Kefeng Wang wrote: > There are some empty trap_init() in different ARCHs, introduce > a new weak trap_init() function to cleanup them. > > Cc: Vineet Gupta > Cc: Russell King > Cc: Yoshinori Sato > Cc: Ley Foon Tan > Cc: Jonas Bonn > Cc: Stefan Kristi

Re: [RFC PATCH] powerpc/book3s64/radix: Upgrade va tlbie to PID tlbie if we cross PMD_SIZE

2021-08-12 Thread Michael Ellerman
"Puvichakravarthy Ramachandran" writes: >> With shared mapping, even though we are unmapping a large range, the kernel >> will force a TLB flush with ptl lock held to avoid the race mentioned in >> commit 1cf35d47712d ("mm: split 'tlb_flush_mmu()' into tlb flushing and >> memory freeing parts") >

Re: [PATCH v2 5/9] powerpc/microwatt: Use standard 16550 UART for console

2021-08-12 Thread Christophe Leroy
Le 18/06/2021 à 05:46, Paul Mackerras a écrit : From: Benjamin Herrenschmidt This adds support to the Microwatt platform to use the standard 16550-style UART which available in the standalone Microwatt FPGA. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- arch/po

Re: [RFC PATCH] powerpc/book3s64/radix: Upgrade va tlbie to PID tlbie if we cross PMD_SIZE

2021-08-12 Thread Aneesh Kumar K.V
On 8/12/21 6:19 PM, Michael Ellerman wrote: "Puvichakravarthy Ramachandran" writes: With shared mapping, even though we are unmapping a large range, the kernel will force a TLB flush with ptl lock held to avoid the race mentioned in commit 1cf35d47712d ("mm: split 'tlb_flush_mmu()' into tlb flu

[PATCH v8 0/5] Add support for FORM2 associativity

2021-08-12 Thread Aneesh Kumar K.V
Form2 associativity adds a much more flexible NUMA topology layout than what is provided by Form1. More details can be found in patch 7. $ numactl -H ... node distances: node 0 1 2 3 0: 10 11 222 33 1: 44 10 55 66 2: 77 88 10 99 3: 101 121 132 10 $ After DAX k

[PATCH v8 1/5] powerpc/pseries: rename min_common_depth to primary_domain_index

2021-08-12 Thread Aneesh Kumar K.V
No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/numa.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index f2bf98bdcea

[PATCH v8 2/5] powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY

2021-08-12 Thread Aneesh Kumar K.V
Also make related code cleanup that will allow adding FORM2_AFFINITY in later patches. No functional change in this patch. Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/firmware.h | 4 +-- arch/powerpc/include/asm/prom.h | 2 +- arch/po

[PATCH v8 3/5] powerpc/pseries: Consolidate different NUMA distance update code paths

2021-08-12 Thread Aneesh Kumar K.V
The associativity details of the newly added resourced are collected from the hypervisor via "ibm,configure-connector" rtas call. Update the numa distance details of the newly added numa node after the above call. Instead of updating NUMA distance every time we lookup a node id from the associativ

[PATCH v8 4/5] powerpc/pseries: Add a helper for form1 cpu distance

2021-08-12 Thread Aneesh Kumar K.V
This helper is only used with the dispatch trace log collection. A later patch will add Form2 affinity support and this change helps in keeping that simpler. Also add a comment explaining we don't expect the code to be called with FORM0 Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V -

[PATCH v8 5/5] powerpc/pseries: Add support for FORM2 associativity

2021-08-12 Thread Aneesh Kumar K.V
PAPR interface currently supports two different ways of communicating resource grouping details to the OS. These are referred to as Form 0 and Form 1 associativity grouping. Form 0 is the older format and is now considered deprecated. This patch adds another resource grouping named FORM2. Signed-o

[PATCH v2 2/2] powerpc: rename powerpc_debugfs_root to arch_debugfs_dir

2021-08-12 Thread Aneesh Kumar K.V
No functional change in this patch. arch_debugfs_dir is the generic kernel name declared in linux/debugfs.h for arch-specific debugfs directory. Architectures like x86/s390 already use the name. Rename powerpc specific powerpc_debugfs_root to arch_debugfs_dir. Signed-off-by: Aneesh Kumar K.V ---

[PATCH v2 1/2] powerpc/book3s64/radix: make tlb_single_page_flush_ceiling a debugfs entry

2021-08-12 Thread Aneesh Kumar K.V
Similar to x86/s390 add a debugfs file to tune tlb_single_page_flush_ceiling. Also add a debugfs entry for tlb_local_single_page_flush_ceiling. Signed-off-by: Aneesh Kumar K.V --- Changes from v1: * switch to debugfs_create_u32 arch/powerpc/mm/book3s64/radix_tlb.c | 16 ++-- 1 file

Re: [PATCH v2 1/2] KVM: Refactor kvm_arch_vcpu_fault() to return a struct page pointer

2021-08-12 Thread Paolo Bonzini
On 12/08/21 11:04, David Hildenbrand wrote: Reviewed-by: David Hildenbrand But at the same time I wonder if we should just get rid of CONFIG_KVM_S390_UCONTROL and consequently kvm_arch_vcpu_fault(). In practice CONFIG_KVM_S390_UCONTROL, is never enabled in any reasonable kernel build and c

Re: [PATCH v2 5/9] powerpc/microwatt: Use standard 16550 UART for console

2021-08-12 Thread Segher Boessenkool
On Thu, Aug 12, 2021 at 03:14:44PM +0200, Christophe Leroy wrote: > Le 18/06/2021 à 05:46, Paul Mackerras a écrit : > >+static u8 udbg_uart_in_isa300_rm(unsigned int reg) > >+{ > >+uint64_t msr = mfmsr(); > >+uint8_t c; > >+ > >+mtmsr(msr & ~(MSR_EE|MSR_DR)); > >+isync(); > >+e

[PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-12 Thread Bill Wendling
The "-z notext" flag disables reporting an error if DT_TEXTREL is set on PPC with CONFIG=kdump: ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in t

Re: [PATCH -next] trap: Cleanup trap_init()

2021-08-12 Thread Vineet Gupta
On 8/12/21 5:36 AM, Kefeng Wang wrote: There are some empty trap_init() in different ARCHs, introduce a new weak trap_init() function to cleanup them. Cc: Vineet Gupta Cc: Russell King Cc: Yoshinori Sato Cc: Ley Foon Tan Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: James E.J. Bo

Re: [PATCH] ppc: add "-z notext" flag to disable diagnostic

2021-08-12 Thread Nick Desaulniers
On Thu, Aug 12, 2021 at 1:49 PM Bill Wendling wrote: > > The "-z notext" flag disables reporting an error if DT_TEXTREL is set on > PPC with CONFIG=kdump: > > ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against > local symbol in readonly segment; recompile object files with

Re: [PATCH -next] trap: Cleanup trap_init()

2021-08-12 Thread Michael Ellerman
Kefeng Wang writes: > There are some empty trap_init() in different ARCHs, introduce > a new weak trap_init() function to cleanup them. > > Cc: Vineet Gupta > Cc: Russell King > Cc: Yoshinori Sato > Cc: Ley Foon Tan > Cc: Jonas Bonn > Cc: Stefan Kristiansson > Cc: Stafford Horne > Cc: James

[powerpc:fixes-test] BUILD SUCCESS cbc06f051c524dcfe52ef0d1f30647828e226d30

2021-08-12 Thread kernel test robot
allmodconfig i386 randconfig-c001-20210812 i386 randconfig-c001-20210813 sh polaris_defconfig powerpc bamboo_defconfig powerpc holly_defconfig powerpc

[powerpc:next-test] BUILD REGRESSION aaf01a9f507c108cc8e86f420b0a81e21354be1b

2021-08-12 Thread kernel test robot
-...@intel.com Error/Warning in current branch: arch/powerpc/platforms/pseries/hotplug-cpu.c:1022:8: error: 'node_to_cpumask_map' undeclared (first use in this function) Error/Warning ids grouped by kconfigs: gcc_recent_errors `-- powerpc-randconfig-r005-20210812 `-- arch-powerpc-platfor

Re: [RFC PATCH v0 5/5] pseries: Asynchronous page fault support

2021-08-12 Thread Nicholas Piggin
Excerpts from Bharata B Rao's message of August 5, 2021 5:24 pm: > Add asynchronous page fault support for pseries guests. > > 1. Setup the guest to handle async-pf >- Issue H_REG_SNS hcall to register the SNS region. >- Setup the subvention interrupt irq. >- Enable async-pf by updatin

Re: [PATCH v1 17/55] KVM: PPC: Book3S HV P9: Implement PMU save/restore in C

2021-08-12 Thread Nicholas Piggin
Excerpts from Athira Rajeev's message of August 9, 2021 1:03 pm: > > >> On 26-Jul-2021, at 9:19 AM, Nicholas Piggin wrote: >> +static void freeze_pmu(unsigned long mmcr0, unsigned long mmcra) >> +{ >> +if (!(mmcr0 & MMCR0_FC)) >> +goto do_freeze; >> +if (mmcra & MMCRA_SAMPL

Re: [RFC PATCH v0 5/5] pseries: Asynchronous page fault support

2021-08-12 Thread Bharata B Rao
On Fri, Aug 13, 2021 at 02:06:40PM +1000, Nicholas Piggin wrote: > Excerpts from Bharata B Rao's message of August 5, 2021 5:24 pm: > > Add asynchronous page fault support for pseries guests. > > > > 1. Setup the guest to handle async-pf > >- Issue H_REG_SNS hcall to register the SNS region. >

Re: [PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Jiri Slaby
Hi, On 12. 08. 21, 14:26, kernel test robot wrote: drivers/tty/hvc/hvc_console.c:190:26: warning: variable 'hp' is uninitialized when used here [-Wuninitialized] spin_unlock_irqrestore(&hp->c_lock, flags); ^~ drivers/tty/hvc/hvc_console.c:149

Re: [PATCH v6 1/2] tty: hvc: pass DMA capable memory to put_chars()

2021-08-12 Thread Xianting TIan
在 2021/8/13 下午1:53, Jiri Slaby 写道: Hi, On 12. 08. 21, 14:26, kernel test robot wrote: drivers/tty/hvc/hvc_console.c:190:26: warning: variable 'hp' is uninitialized when used here [-Wuninitialized]     spin_unlock_irqrestore(&hp->c_lock, flags);     ^~

Re: [PATCH v2 1/2] powerpc/bug: Remove specific powerpc BUG_ON() and WARN_ON() on PPC32

2021-08-12 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of April 14, 2021 2:38 am: > powerpc BUG_ON() and WARN_ON() are based on using twnei instruction. > > For catching simple conditions like a variable having value 0, this > is efficient because it does the test and the trap at the same time. > But most condi

Re: [PATCH v2 2/2] powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto

2021-08-12 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of April 14, 2021 2:38 am: > Using asm goto in __WARN_FLAGS() and WARN_ON() allows more > flexibility to GCC. > > For that add an entry to the exception table so that > program_check_exception() knowns where to resume execution > after a WARNING. Nice idea