* Re: [PATCH] powerpc: remove old workaround for GCC < 4.9
From: Christophe Leroy @ 2021-04-08 4:39 UTC (permalink / raw)
To: Masahiro Yamada, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, linuxppc-dev
Cc: linux-kernel
In-Reply-To: <20210408030534.196347-1-masahiroy@kernel.org>
Le 08/04/2021 à 05:05, Masahiro Yamada a écrit :
> According to Documentation/process/changes.rst, the minimum supported
> GCC version is 4.9.
>
> This workaround is dead code.
This workaround is already on the way out, see
https://github.com/linuxppc/linux/commit/802b5560393423166e436c7914b565f3cda9e6b9
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> arch/powerpc/Makefile | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 5f8544cf724a..32dd693b4e42 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -181,12 +181,6 @@ CC_FLAGS_FTRACE := -pg
> ifdef CONFIG_MPROFILE_KERNEL
> CC_FLAGS_FTRACE += -mprofile-kernel
> endif
> -# Work around gcc code-gen bugs with -pg / -fno-omit-frame-pointer in gcc <= 4.8
> -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44199
> -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52828
> -ifndef CONFIG_CC_IS_CLANG
> -CC_FLAGS_FTRACE += $(call cc-ifversion, -lt, 0409, -mno-sched-epilog)
> -endif
> endif
>
> CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU))
>
^ permalink raw reply
* Re: [PATCH-next] powerpc/interrupt: Remove duplicate header file
From: Christophe Leroy @ 2021-04-08 4:57 UTC (permalink / raw)
To: johnny.chenyi, mpe, benh, paulus, npiggin, aneesh.kumar
Cc: yuehaibing, linuxppc-dev, linux-kernel, heying24
In-Reply-To: <20210408035644.2417002-1-johnny.chenyi@huawei.com>
Le 08/04/2021 à 05:56, johnny.chenyi@huawei.com a écrit :
> From: Chen Yi <johnny.chenyi@huawei.com>
>
> Delete one of the header files <asm/interrupt.h> that are included
> twice.
Guys, we have been flooded with such tiny patches over the last weeks, some changes being sent
several times by different people.
That one is included in
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210323062916.295346-1-wanjiabing@vivo.com/
And was already submitted a few hours earlier by someone else:
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/1616464656-59372-1-git-send-email-zhouchuangao@vivo.com/
Could you work all together and cook an overall patch including all duplicate removal from
arch/powerpc/ files ?
Best way would be I think to file an issue at https://github.com/linuxppc/issues/issues , then you
do a complete analysis and list in the issue all places to be modified, then once the analysis is
complete you send a full single patch.
Thanks
Christophe
>
> Signed-off-by: Chen Yi <johnny.chenyi@huawei.com>
> ---
> arch/powerpc/kernel/interrupt.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> index c4dd4b8f9cfa..f64ace0208b7 100644
> --- a/arch/powerpc/kernel/interrupt.c
> +++ b/arch/powerpc/kernel/interrupt.c
> @@ -7,7 +7,6 @@
> #include <asm/asm-prototypes.h>
> #include <asm/kup.h>
> #include <asm/cputime.h>
> -#include <asm/interrupt.h>
> #include <asm/hw_irq.h>
> #include <asm/interrupt.h>
> #include <asm/kprobes.h>
>
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: remove set but not used variable 'force_printk_to_btext'
From: Christophe Leroy @ 2021-04-08 5:01 UTC (permalink / raw)
To: Yu Kuai, mpe; +Cc: linuxppc-dev, linux-kernel, yi.zhang
In-Reply-To: <20210408011801.557004-2-yukuai3@huawei.com>
Le 08/04/2021 à 03:18, Yu Kuai a écrit :
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> arch/powerpc/kernel/btext.c:49:12: error: 'force_printk_to_btext'
> defined but not used.
You don't get this error as it is now.
You will get this error only if you make it 'static', which is what you did in your first patch
based on the 'sparse' report.
When removing a non static variable, you should explain that you can remove it after you have
verifier that it is nowhere used, neither in that file nor in any other one.
>
> It is never used, and so can be removed.
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
> arch/powerpc/kernel/btext.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
> index 803c2a45b22a..359d0f4ca532 100644
> --- a/arch/powerpc/kernel/btext.c
> +++ b/arch/powerpc/kernel/btext.c
> @@ -46,7 +46,6 @@ unsigned long disp_BAT[2] __initdata = {0, 0};
> static unsigned char vga_font[cmapsz];
>
> int boot_text_mapped __force_data = 0;
> -int force_printk_to_btext = 0;
>
> extern void rmci_on(void);
> extern void rmci_off(void);
>
^ permalink raw reply
* Re: [PATCH 2/2] powerpc: make 'boot_text_mapped' static
From: Christophe Leroy @ 2021-04-08 5:04 UTC (permalink / raw)
To: Yu Kuai, mpe; +Cc: linuxppc-dev, linux-kernel, yi.zhang
In-Reply-To: <20210408011801.557004-3-yukuai3@huawei.com>
Le 08/04/2021 à 03:18, Yu Kuai a écrit :
> The sparse tool complains as follow:
>
> arch/powerpc/kernel/btext.c:48:5: warning:
> symbol 'boot_text_mapped' was not declared. Should it be static?
>
> This symbol is not used outside of btext.c, so this commit make
> it static.
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
> arch/powerpc/kernel/btext.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
> index 359d0f4ca532..8df9230be6fa 100644
> --- a/arch/powerpc/kernel/btext.c
> +++ b/arch/powerpc/kernel/btext.c
> @@ -45,7 +45,7 @@ unsigned long disp_BAT[2] __initdata = {0, 0};
>
> static unsigned char vga_font[cmapsz];
>
> -int boot_text_mapped __force_data = 0;
> +static int boot_text_mapped __force_data;
Are you sure the initialisation to 0 can be removed ? Usually initialisation to 0 is not needed
because not initialised variables go in the BSS section which is zeroed at startup. But here the
variable is flagged with __force_data so it is not going in the BSS section.
>
> extern void rmci_on(void);
> extern void rmci_off(void);
>
^ permalink raw reply
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: Michael Ellerman @ 2021-04-08 5:37 UTC (permalink / raw)
To: Leonardo Bras, Benjamin Herrenschmidt, Paul Mackerras,
Alexey Kardashevskiy, Leonardo Bras, brking
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20210407195613.131140-1-leobras.c@gmail.com>
Leonardo Bras <leobras.c@gmail.com> writes:
> According to LoPAR, ibm,query-pe-dma-window output named "IO Page Sizes"
> will let the OS know all possible pagesizes that can be used for creating a
> new DDW.
>
> Currently Linux will only try using 3 of the 8 available options:
> 4K, 64K and 16M. According to LoPAR, Hypervisor may also offer 32M, 64M,
> 128M, 256M and 16G.
Do we know of any hardware & hypervisor combination that will actually
give us bigger pages?
> Enabling bigger pages would be interesting for direct mapping systems
> with a lot of RAM, while using less TCE entries.
>
> Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
> ---
> arch/powerpc/platforms/pseries/iommu.c | 49 ++++++++++++++++++++++----
> 1 file changed, 42 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> index 9fc5217f0c8e..6cda1c92597d 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -53,6 +53,20 @@ enum {
> DDW_EXT_QUERY_OUT_SIZE = 2
> };
A comment saying where the values come from would be good.
> +#define QUERY_DDW_PGSIZE_4K 0x01
> +#define QUERY_DDW_PGSIZE_64K 0x02
> +#define QUERY_DDW_PGSIZE_16M 0x04
> +#define QUERY_DDW_PGSIZE_32M 0x08
> +#define QUERY_DDW_PGSIZE_64M 0x10
> +#define QUERY_DDW_PGSIZE_128M 0x20
> +#define QUERY_DDW_PGSIZE_256M 0x40
> +#define QUERY_DDW_PGSIZE_16G 0x80
I'm not sure the #defines really gain us much vs just putting the
literal values in the array below?
> +struct iommu_ddw_pagesize {
> + u32 mask;
> + int shift;
> +};
> +
> static struct iommu_table_group *iommu_pseries_alloc_group(int node)
> {
> struct iommu_table_group *table_group;
> @@ -1099,6 +1113,31 @@ static void reset_dma_window(struct pci_dev *dev, struct device_node *par_dn)
> ret);
> }
>
> +/* Returns page shift based on "IO Page Sizes" output at ibm,query-pe-dma-window. See LoPAR */
> +static int iommu_get_page_shift(u32 query_page_size)
> +{
> + const struct iommu_ddw_pagesize ddw_pagesize[] = {
> + { QUERY_DDW_PGSIZE_16G, __builtin_ctz(SZ_16G) },
> + { QUERY_DDW_PGSIZE_256M, __builtin_ctz(SZ_256M) },
> + { QUERY_DDW_PGSIZE_128M, __builtin_ctz(SZ_128M) },
> + { QUERY_DDW_PGSIZE_64M, __builtin_ctz(SZ_64M) },
> + { QUERY_DDW_PGSIZE_32M, __builtin_ctz(SZ_32M) },
> + { QUERY_DDW_PGSIZE_16M, __builtin_ctz(SZ_16M) },
> + { QUERY_DDW_PGSIZE_64K, __builtin_ctz(SZ_64K) },
> + { QUERY_DDW_PGSIZE_4K, __builtin_ctz(SZ_4K) }
> + };
cheers
^ permalink raw reply
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: Leonardo Bras @ 2021-04-08 6:20 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Alexey Kardashevskiy, brking
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <87im4xe3pk.fsf@mpe.ellerman.id.au>
Hello Michael, thank you for this feedback!
Comments inline:
On Thu, 2021-04-08 at 15:37 +1000, Michael Ellerman wrote:
> Leonardo Bras <leobras.c@gmail.com> writes:
> > According to LoPAR, ibm,query-pe-dma-window output named "IO Page Sizes"
> > will let the OS know all possible pagesizes that can be used for creating a
> > new DDW.
> >
> > Currently Linux will only try using 3 of the 8 available options:
> > 4K, 64K and 16M. According to LoPAR, Hypervisor may also offer 32M, 64M,
> > 128M, 256M and 16G.
>
> Do we know of any hardware & hypervisor combination that will actually
> give us bigger pages?
>
> > Enabling bigger pages would be interesting for direct mapping systems
> > with a lot of RAM, while using less TCE entries.
> >
> > Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
> > ---
> > arch/powerpc/platforms/pseries/iommu.c | 49 ++++++++++++++++++++++----
> > 1 file changed, 42 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> > index 9fc5217f0c8e..6cda1c92597d 100644
> > --- a/arch/powerpc/platforms/pseries/iommu.c
> > +++ b/arch/powerpc/platforms/pseries/iommu.c
> > @@ -53,6 +53,20 @@ enum {
> > DDW_EXT_QUERY_OUT_SIZE = 2
> > };
>
> A comment saying where the values come from would be good.
Sure, I will add the information about LoPAR.
>
> > +#define QUERY_DDW_PGSIZE_4K 0x01
> > +#define QUERY_DDW_PGSIZE_64K 0x02
> > +#define QUERY_DDW_PGSIZE_16M 0x04
> > +#define QUERY_DDW_PGSIZE_32M 0x08
> > +#define QUERY_DDW_PGSIZE_64M 0x10
> > +#define QUERY_DDW_PGSIZE_128M 0x20
> > +#define QUERY_DDW_PGSIZE_256M 0x40
> > +#define QUERY_DDW_PGSIZE_16G 0x80
>
> I'm not sure the #defines really gain us much vs just putting the
> literal values in the array below?
My v1 did not use the define approach, what do you think of that?
http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210322190943.715368-1-leobras.c@gmail.com/
>
> > +struct iommu_ddw_pagesize {
> > + u32 mask;
> > + int shift;
> > +};
> > +
> > static struct iommu_table_group *iommu_pseries_alloc_group(int node)
> > {
> > struct iommu_table_group *table_group;
> > @@ -1099,6 +1113,31 @@ static void reset_dma_window(struct pci_dev *dev, struct device_node *par_dn)
> > ret);
> > }
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > +/* Returns page shift based on "IO Page Sizes" output at ibm,query-pe-dma-window. See LoPAR */
> > +static int iommu_get_page_shift(u32 query_page_size)
> > +{
> > + const struct iommu_ddw_pagesize ddw_pagesize[] = {
> > + { QUERY_DDW_PGSIZE_16G, __builtin_ctz(SZ_16G) },
> > + { QUERY_DDW_PGSIZE_256M, __builtin_ctz(SZ_256M) },
> > + { QUERY_DDW_PGSIZE_128M, __builtin_ctz(SZ_128M) },
> > + { QUERY_DDW_PGSIZE_64M, __builtin_ctz(SZ_64M) },
> > + { QUERY_DDW_PGSIZE_32M, __builtin_ctz(SZ_32M) },
> > + { QUERY_DDW_PGSIZE_16M, __builtin_ctz(SZ_16M) },
> > + { QUERY_DDW_PGSIZE_64K, __builtin_ctz(SZ_64K) },
> > + { QUERY_DDW_PGSIZE_4K, __builtin_ctz(SZ_4K) }
> > + };
>
>
> cheers
Best regards,
Leonardo Bras
^ permalink raw reply
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: Leonardo Bras @ 2021-04-08 6:35 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Alexey Kardashevskiy, brking
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <942acb9b23d87594d0b758cc0daf713be836f8e6.camel@gmail.com>
On Thu, 2021-04-08 at 03:20 -0300, Leonardo Bras wrote:
> > > +#define QUERY_DDW_PGSIZE_4K 0x01
> > > +#define QUERY_DDW_PGSIZE_64K 0x02
> > > +#define QUERY_DDW_PGSIZE_16M 0x04
> > > +#define QUERY_DDW_PGSIZE_32M 0x08
> > > +#define QUERY_DDW_PGSIZE_64M 0x10
> > > +#define QUERY_DDW_PGSIZE_128M 0x20
> > > +#define QUERY_DDW_PGSIZE_256M 0x40
> > > +#define QUERY_DDW_PGSIZE_16G 0x80
> >
> > I'm not sure the #defines really gain us much vs just putting the
> > literal values in the array below?
>
> My v1 did not use the define approach, what do you think of that?
> http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210322190943.715368-1-leobras.c@gmail.com/
>
>
(of course, it would be that without the pageshift defines also, using
the __builtin_ctz() approach suggested by Alexey.)
^ permalink raw reply
* [PATCH -next] powerpc/fadump: make symbol 'rtas_fadump_set_regval' static
From: Pu Lehui @ 2021-04-08 6:20 UTC (permalink / raw)
To: mpe, benh, paulus, joel, christophe.leroy
Cc: zhangjinhao2, yangjihong1, linuxppc-dev, linux-kernel, pulehui
Fix sparse warnings:
arch/powerpc/platforms/pseries/rtas-fadump.c:250:6: warning:
symbol 'rtas_fadump_set_regval' was not declared. Should it be static?
Signed-off-by: Pu Lehui <pulehui@huawei.com>
---
arch/powerpc/platforms/pseries/rtas-fadump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/rtas-fadump.c b/arch/powerpc/platforms/pseries/rtas-fadump.c
index 81343908ed33..f8f73b47b107 100644
--- a/arch/powerpc/platforms/pseries/rtas-fadump.c
+++ b/arch/powerpc/platforms/pseries/rtas-fadump.c
@@ -247,7 +247,7 @@ static inline int rtas_fadump_gpr_index(u64 id)
return i;
}
-void rtas_fadump_set_regval(struct pt_regs *regs, u64 reg_id, u64 reg_val)
+static void rtas_fadump_set_regval(struct pt_regs *regs, u64 reg_id, u64 reg_val)
{
int i;
--
2.17.1
^ permalink raw reply related
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: Alexey Kardashevskiy @ 2021-04-08 7:13 UTC (permalink / raw)
To: Michael Ellerman, Leonardo Bras, Benjamin Herrenschmidt,
Paul Mackerras, brking
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <87im4xe3pk.fsf@mpe.ellerman.id.au>
On 08/04/2021 15:37, Michael Ellerman wrote:
> Leonardo Bras <leobras.c@gmail.com> writes:
>> According to LoPAR, ibm,query-pe-dma-window output named "IO Page Sizes"
>> will let the OS know all possible pagesizes that can be used for creating a
>> new DDW.
>>
>> Currently Linux will only try using 3 of the 8 available options:
>> 4K, 64K and 16M. According to LoPAR, Hypervisor may also offer 32M, 64M,
>> 128M, 256M and 16G.
>
> Do we know of any hardware & hypervisor combination that will actually
> give us bigger pages?
On P8 16MB host pages and 16MB hardware iommu pages worked.
On P9, VM's 16MB IOMMU pages worked on top of 2MB host pages + 2MB
hardware IOMMU pages.
>
>> Enabling bigger pages would be interesting for direct mapping systems
>> with a lot of RAM, while using less TCE entries.
>>
>> Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
>> ---
>> arch/powerpc/platforms/pseries/iommu.c | 49 ++++++++++++++++++++++----
>> 1 file changed, 42 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
>> index 9fc5217f0c8e..6cda1c92597d 100644
>> --- a/arch/powerpc/platforms/pseries/iommu.c
>> +++ b/arch/powerpc/platforms/pseries/iommu.c
>> @@ -53,6 +53,20 @@ enum {
>> DDW_EXT_QUERY_OUT_SIZE = 2
>> };
>
> A comment saying where the values come from would be good.
>
>> +#define QUERY_DDW_PGSIZE_4K 0x01
>> +#define QUERY_DDW_PGSIZE_64K 0x02
>> +#define QUERY_DDW_PGSIZE_16M 0x04
>> +#define QUERY_DDW_PGSIZE_32M 0x08
>> +#define QUERY_DDW_PGSIZE_64M 0x10
>> +#define QUERY_DDW_PGSIZE_128M 0x20
>> +#define QUERY_DDW_PGSIZE_256M 0x40
>> +#define QUERY_DDW_PGSIZE_16G 0x80
>
> I'm not sure the #defines really gain us much vs just putting the
> literal values in the array below?
Then someone says "uuuuu magic values" :) I do not mind either way. Thanks,
>> +struct iommu_ddw_pagesize {
>> + u32 mask;
>> + int shift;
>> +};
>> +
>> static struct iommu_table_group *iommu_pseries_alloc_group(int node)
>> {
>> struct iommu_table_group *table_group;
>> @@ -1099,6 +1113,31 @@ static void reset_dma_window(struct pci_dev *dev, struct device_node *par_dn)
>> ret);
>> }
>>
>> +/* Returns page shift based on "IO Page Sizes" output at ibm,query-pe-dma-window. See LoPAR */
>> +static int iommu_get_page_shift(u32 query_page_size)
>> +{
>> + const struct iommu_ddw_pagesize ddw_pagesize[] = {
>> + { QUERY_DDW_PGSIZE_16G, __builtin_ctz(SZ_16G) },
>> + { QUERY_DDW_PGSIZE_256M, __builtin_ctz(SZ_256M) },
>> + { QUERY_DDW_PGSIZE_128M, __builtin_ctz(SZ_128M) },
>> + { QUERY_DDW_PGSIZE_64M, __builtin_ctz(SZ_64M) },
>> + { QUERY_DDW_PGSIZE_32M, __builtin_ctz(SZ_32M) },
>> + { QUERY_DDW_PGSIZE_16M, __builtin_ctz(SZ_16M) },
>> + { QUERY_DDW_PGSIZE_64K, __builtin_ctz(SZ_64K) },
>> + { QUERY_DDW_PGSIZE_4K, __builtin_ctz(SZ_4K) }
>> + };
>
>
> cheers
>
--
Alexey
^ permalink raw reply
* Re: [PATCH-next] powerpc/interrupt: Remove duplicate header file
From: Chenyi (Johnny) @ 2021-04-08 7:20 UTC (permalink / raw)
To: Christophe Leroy, mpe, benh, paulus, npiggin, aneesh.kumar
Cc: yuehaibing, linuxppc-dev, linux-kernel, heying24
In-Reply-To: <c42ebf38-c7ea-68bc-01ca-8352581bc33d@csgroup.eu>
在 2021/4/8 12:57, Christophe Leroy 写道:
>
>
> Le 08/04/2021 à 05:56, johnny.chenyi@huawei.com a écrit :
>> From: Chen Yi <johnny.chenyi@huawei.com>
>>
>> Delete one of the header files <asm/interrupt.h> that are included
>> twice.
>
> Guys, we have been flooded with such tiny patches over the last weeks,
> some changes being sent several times by different people.
>
> That one is included in
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210323062916.295346-1-wanjiabing@vivo.com/
>
>
> And was already submitted a few hours earlier by someone else:
> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/1616464656-59372-1-git-send-email-zhouchuangao@vivo.com/
>
>
> Could you work all together and cook an overall patch including all
> duplicate removal from arch/powerpc/ files ?
>
> Best way would be I think to file an issue at
> https://github.com/linuxppc/issues/issues , then you do a complete
> analysis and list in the issue all places to be modified, then once the
> analysis is complete you send a full single patch.
>
> Thanks
> Christophe
>
Dear Christophe,
Thanks for your reply, I have checked that thers is no header files
which has been included twice by mistake in arch/powerpc/.I would file
an issue next time.
Best regards,
Chen Yi
>>
>> Signed-off-by: Chen Yi <johnny.chenyi@huawei.com>
>> ---
>> arch/powerpc/kernel/interrupt.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/interrupt.c
>> b/arch/powerpc/kernel/interrupt.c
>> index c4dd4b8f9cfa..f64ace0208b7 100644
>> --- a/arch/powerpc/kernel/interrupt.c
>> +++ b/arch/powerpc/kernel/interrupt.c
>> @@ -7,7 +7,6 @@
>> #include <asm/asm-prototypes.h>
>> #include <asm/kup.h>
>> #include <asm/cputime.h>
>> -#include <asm/interrupt.h>
>> #include <asm/hw_irq.h>
>> #include <asm/interrupt.h>
>> #include <asm/kprobes.h>
>>
> .
^ permalink raw reply
* Re: [PATCH v6 00/48] KVM: PPC: Book3S: C-ify the P9 entry/exit code
From: Nicholas Piggin @ 2021-04-08 7:33 UTC (permalink / raw)
To: kvm-ppc; +Cc: linuxppc-dev
In-Reply-To: <20210405011948.675354-1-npiggin@gmail.com>
Excerpts from Nicholas Piggin's message of April 5, 2021 11:19 am:
> Git tree here
>
> https://github.com/npiggin/linux/tree/kvm-in-c-v6
>
In the interest of making things more managable, I would like to submit
some initial things for merge, which have mostly had pretty good review
(I'll repost them in a new series or set of series if there is no
objection, rather than pick from this series).
> Nicholas Piggin (48):
> KVM: PPC: Book3S HV: Nested move LPCR sanitising to sanitise_hv_regs
> KVM: PPC: Book3S HV: Add a function to filter guest LPCR bits
> KVM: PPC: Book3S HV: Disallow LPCR[AIL] to be set to 1 or 2
> KVM: PPC: Book3S HV: Prevent radix guests setting LPCR[TC]
> KVM: PPC: Book3S HV: Remove redundant mtspr PSPB
> KVM: PPC: Book3S HV: remove unused kvmppc_h_protect argument
> KVM: PPC: Book3S HV: Fix CONFIG_SPAPR_TCE_IOMMU=n default hcalls
> powerpc/64s: Remove KVM handler support from CBE_RAS interrupts
> powerpc/64s: remove KVM SKIP test from instruction breakpoint handler
> KVM: PPC: Book3S HV: Ensure MSR[ME] is always set in guest MSR
> KVM: PPC: Book3S HV: Ensure MSR[HV] is always clear in guest MSR
1-11 are pretty small, mostly isolated improvements.
> KVM: PPC: Book3S 64: move KVM interrupt entry to a common entry point
> KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVM
> KVM: PPC: Book3S 64: add hcall interrupt handler
> KVM: PPC: Book3S 64: Move hcall early register setup to KVM
> KVM: PPC: Book3S 64: Move interrupt early register setup to KVM
> KVM: PPC: Book3S 64: move bad_host_intr check to HV handler
> KVM: PPC: Book3S 64: Minimise hcall handler calling convention
> differences
12-18 includes all the exception-64s.S <-> KVM API changes required. I
think these changes are improvements in their own right, certainly the
exception-64s.S side is far nicer.
> KVM: PPC: Book3S HV P9: Move radix MMU switching instructions together
19 I would like to include because these MMU SPRs have a special
relationship that can't just be set in any order. This code is also much
better suited to sim and prototyping work for proposed changes to the
MMU context switching architecture.
> KVM: PPC: Book3S HV P9: implement kvmppc_xive_pull_vcpu in C
> KVM: PPC: Book3S HV P9: Move xive vcpu context management into
> kvmhv_p9_guest_entry
20-21 are stand-alone, I think they're good. Existing asm is duplicated
in C but the C documents it and anyway matches its inverse which is
already in C.
And I think it's better to be doing CI MMIOs while we're still mostly in
host context.
> KVM: PPC: Book3S HV P9: Stop handling hcalls in real-mode in the P9
> path
22 move down together with Implement the rest of the P9 path in C.
> KVM: PPC: Book3S HV P9: Move setting HDEC after switching to guest
> LPCR
> KVM: PPC: Book3S HV P9: Use large decrementer for HDEC
> KVM: PPC: Book3S HV P9: Use host timer accounting to avoid decrementer
> read
> KVM: PPC: Book3S HV P9: Reduce mftb per guest entry/exit
> KVM: PPC: Book3S HV P9: Reduce irq_work vs guest decrementer races
> KMV: PPC: Book3S HV: Use set_dec to set decrementer to host
> powerpc/time: add API for KVM to re-arm the host timer/decrementer
23-29 try to get all these timekeeping things in. They ended up being
mostly unrelated to the C conversion but the way I started out writing
the C conversion, these changes fell out and ended up collecting here. I
think they're generally improvements.
That leaves about 20 patches remaining. Of those, only about the first 5
are necessary to reimplement the existing P9 path functionality in C,
which is a lot less scary than nearly 50.
Thanks,
Nick
> KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C
> KVM: PPC: Book3S HV P9: inline kvmhv_load_hv_regs_and_go into
> __kvmhv_vcpu_entry_p9
> KVM: PPC: Book3S HV P9: Read machine check registers while MSR[RI] is
> 0
> KVM: PPC: Book3S HV P9: Improve exit timing accounting coverage
> KVM: PPC: Book3S HV P9: Move SPR loading after expiry time check
> KVM: PPC: Book3S HV P9: Add helpers for OS SPR handling
> KVM: PPC: Book3S HV P9: Switch to guest MMU context as late as
> possible
> KVM: PPC: Book3S HV: Implement radix prefetch workaround by disabling
> MMU
> KVM: PPC: Book3S HV: Remove support for dependent threads mode on P9
> KVM: PPC: Book3S HV: Remove radix guest support from P7/8 path
> KVM: PPC: Book3S HV: Remove virt mode checks from real mode handlers
> KVM: PPC: Book3S HV: Remove unused nested HV tests in XICS emulation
> KVM: PPC: Book3S HV P9: Allow all P9 processors to enable nested HV
> KVM: PPC: Book3S HV: small pseries_do_hcall cleanup
> KVM: PPC: Book3S HV: add virtual mode handlers for HPT hcalls and page
> faults
> KVM: PPC: Book3S HV P9: Reflect userspace hcalls to hash guests to
> support PR KVM
> KVM: PPC: Book3S HV P9: implement hash guest support
> KVM: PPC: Book3S HV P9: implement hash host / hash guest support
> KVM: PPC: Book3S HV: remove ISA v3.0 and v3.1 support from P7/8 path
>
> arch/powerpc/include/asm/asm-prototypes.h | 3 +-
> arch/powerpc/include/asm/exception-64s.h | 13 +
> arch/powerpc/include/asm/kvm_asm.h | 3 +-
> arch/powerpc/include/asm/kvm_book3s.h | 2 +
> arch/powerpc/include/asm/kvm_book3s_64.h | 8 +
> arch/powerpc/include/asm/kvm_host.h | 8 +-
> arch/powerpc/include/asm/kvm_ppc.h | 21 +-
> arch/powerpc/include/asm/mmu_context.h | 6 -
> arch/powerpc/include/asm/time.h | 11 +
> arch/powerpc/kernel/asm-offsets.c | 1 -
> arch/powerpc/kernel/exceptions-64s.S | 257 ++-----
> arch/powerpc/kernel/security.c | 5 +-
> arch/powerpc/kernel/time.c | 43 +-
> arch/powerpc/kvm/Makefile | 4 +
> arch/powerpc/kvm/book3s.c | 17 +-
> arch/powerpc/kvm/book3s_64_entry.S | 409 +++++++++++
> arch/powerpc/kvm/book3s_64_vio_hv.c | 12 -
> arch/powerpc/kvm/book3s_hv.c | 782 ++++++++++++----------
> arch/powerpc/kvm/book3s_hv_builtin.c | 138 +---
> arch/powerpc/kvm/book3s_hv_interrupt.c | 529 +++++++++++++++
> arch/powerpc/kvm/book3s_hv_interrupts.S | 9 +-
> arch/powerpc/kvm/book3s_hv_nested.c | 37 +-
> arch/powerpc/kvm/book3s_hv_ras.c | 2 +
> arch/powerpc/kvm/book3s_hv_rm_mmu.c | 15 +-
> arch/powerpc/kvm/book3s_hv_rm_xics.c | 15 -
> arch/powerpc/kvm/book3s_hv_rmhandlers.S | 682 +------------------
> arch/powerpc/kvm/book3s_segment.S | 3 +
> arch/powerpc/kvm/book3s_xive.c | 113 +++-
> arch/powerpc/kvm/book3s_xive.h | 7 -
> arch/powerpc/kvm/book3s_xive_native.c | 10 -
> arch/powerpc/mm/book3s64/radix_pgtable.c | 27 +-
> arch/powerpc/mm/book3s64/radix_tlb.c | 46 --
> arch/powerpc/mm/mmu_context.c | 4 +-
> arch/powerpc/platforms/powernv/idle.c | 52 +-
> 34 files changed, 1735 insertions(+), 1559 deletions(-)
> create mode 100644 arch/powerpc/kvm/book3s_64_entry.S
> create mode 100644 arch/powerpc/kvm/book3s_hv_interrupt.c
>
> --
> 2.23.0
>
>
^ permalink raw reply
* [PATCH 2/2] powerpc/perf: Add platform specific check_attr_config
From: Madhavan Srinivasan @ 2021-04-08 7:45 UTC (permalink / raw)
To: mpe; +Cc: Madhavan Srinivasan, linuxppc-dev
In-Reply-To: <20210408074504.248211-1-maddy@linux.ibm.com>
Add platform specific attr.config value checks. Patch
includes checks for both power9 and power10.
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
Changelog v3:
- No changes
Changelog v2:
- Changed function name as suggested.
- Added name of source document referred for reserved values
Changelog v1:
- No changes
arch/powerpc/perf/isa207-common.c | 42 +++++++++++++++++++++++++++++++
arch/powerpc/perf/isa207-common.h | 2 ++
arch/powerpc/perf/power10-pmu.c | 13 ++++++++++
arch/powerpc/perf/power9-pmu.c | 13 ++++++++++
4 files changed, 70 insertions(+)
diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c
index e4f577da33d8..358a0e95ba5f 100644
--- a/arch/powerpc/perf/isa207-common.c
+++ b/arch/powerpc/perf/isa207-common.c
@@ -694,3 +694,45 @@ int isa207_get_alternatives(u64 event, u64 alt[], int size, unsigned int flags,
return num_alt;
}
+
+int isa3XX_check_attr_config(struct perf_event *ev)
+{
+ u64 val, sample_mode;
+ u64 event = ev->attr.config;
+
+ val = (event >> EVENT_SAMPLE_SHIFT) & EVENT_SAMPLE_MASK;
+ sample_mode = val & 0x3;
+
+ /*
+ * MMCRA[61:62] is Random Sampling Mode (SM).
+ * value of 0b11 is reserved.
+ */
+ if (sample_mode == 0x3)
+ return -EINVAL;
+
+ /*
+ * Check for all reserved value
+ * Source: Performance Monitoring Unit User Guide
+ */
+ switch (val) {
+ case 0x5:
+ case 0x9:
+ case 0xD:
+ case 0x19:
+ case 0x1D:
+ case 0x1A:
+ case 0x1E:
+ return -EINVAL;
+ }
+
+ /*
+ * MMCRA[48:51]/[52:55]) Threshold Start/Stop
+ * Events Selection.
+ * 0b11110000/0b00001111 is reserved.
+ */
+ val = (event >> EVENT_THR_CTL_SHIFT) & EVENT_THR_CTL_MASK;
+ if (((val & 0xF0) == 0xF0) || ((val & 0xF) == 0xF))
+ return -EINVAL;
+
+ return 0;
+}
diff --git a/arch/powerpc/perf/isa207-common.h b/arch/powerpc/perf/isa207-common.h
index 1af0e8c97ac7..b4d2a2b2b346 100644
--- a/arch/powerpc/perf/isa207-common.h
+++ b/arch/powerpc/perf/isa207-common.h
@@ -280,4 +280,6 @@ void isa207_get_mem_data_src(union perf_mem_data_src *dsrc, u32 flags,
struct pt_regs *regs);
void isa207_get_mem_weight(u64 *weight);
+int isa3XX_check_attr_config(struct perf_event *ev);
+
#endif
diff --git a/arch/powerpc/perf/power10-pmu.c b/arch/powerpc/perf/power10-pmu.c
index a901c1348cad..f9d64c63bb4a 100644
--- a/arch/powerpc/perf/power10-pmu.c
+++ b/arch/powerpc/perf/power10-pmu.c
@@ -106,6 +106,18 @@ static int power10_get_alternatives(u64 event, unsigned int flags, u64 alt[])
return num_alt;
}
+static int power10_check_attr_config(struct perf_event *ev)
+{
+ u64 val;
+ u64 event = ev->attr.config;
+
+ val = (event >> EVENT_SAMPLE_SHIFT) & EVENT_SAMPLE_MASK;
+ if (val == 0x10 || isa3XX_check_attr_config(ev))
+ return -EINVAL;
+
+ return 0;
+}
+
GENERIC_EVENT_ATTR(cpu-cycles, PM_RUN_CYC);
GENERIC_EVENT_ATTR(instructions, PM_RUN_INST_CMPL);
GENERIC_EVENT_ATTR(branch-instructions, PM_BR_CMPL);
@@ -559,6 +571,7 @@ static struct power_pmu power10_pmu = {
.attr_groups = power10_pmu_attr_groups,
.bhrb_nr = 32,
.capabilities = PERF_PMU_CAP_EXTENDED_REGS,
+ .check_attr_config = power10_check_attr_config,
};
int init_power10_pmu(void)
diff --git a/arch/powerpc/perf/power9-pmu.c b/arch/powerpc/perf/power9-pmu.c
index 2a57e93a79dc..ff3382140d7e 100644
--- a/arch/powerpc/perf/power9-pmu.c
+++ b/arch/powerpc/perf/power9-pmu.c
@@ -151,6 +151,18 @@ static int power9_get_alternatives(u64 event, unsigned int flags, u64 alt[])
return num_alt;
}
+static int power9_check_attr_config(struct perf_event *ev)
+{
+ u64 val;
+ u64 event = ev->attr.config;
+
+ val = (event >> EVENT_SAMPLE_SHIFT) & EVENT_SAMPLE_MASK;
+ if (val == 0xC || isa3XX_check_attr_config(ev))
+ return -EINVAL;
+
+ return 0;
+}
+
GENERIC_EVENT_ATTR(cpu-cycles, PM_CYC);
GENERIC_EVENT_ATTR(stalled-cycles-frontend, PM_ICT_NOSLOT_CYC);
GENERIC_EVENT_ATTR(stalled-cycles-backend, PM_CMPLU_STALL);
@@ -437,6 +449,7 @@ static struct power_pmu power9_pmu = {
.attr_groups = power9_pmu_attr_groups,
.bhrb_nr = 32,
.capabilities = PERF_PMU_CAP_EXTENDED_REGS,
+ .check_attr_config = power9_check_attr_config,
};
int init_power9_pmu(void)
--
2.26.2
^ permalink raw reply related
* [PATCH v4 1/2] powerpc/perf: Infrastructure to support checking of attr.config*
From: Madhavan Srinivasan @ 2021-04-08 7:45 UTC (permalink / raw)
To: mpe; +Cc: Madhavan Srinivasan, linuxppc-dev
Introduce code to support the checking of attr.config* for
values which are reserved for a given platform.
Performance Monitoring Unit (PMU) configuration registers
have fields that are reserved and some specific values for
bit fields are reserved. For ex., MMCRA[61:62] is
Random Sampling Mode (SM) and value of 0b11 for this field
is reserved.
Writing non-zero or invalid values in these fields will
have unknown behaviours.
Patch adds a generic call-back function "check_attr_config"
in "struct power_pmu", to be called in event_init to
check for attr.config* values for a given platform.
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
Changelog v3:
-Made the check_attr_config() to be called for all event type of instead
only for raw event type.
Changelog v2:
-Fixed commit message
Changelog v1:
-Fixed commit message and in-code comments
arch/powerpc/include/asm/perf_event_server.h | 6 ++++++
arch/powerpc/perf/core-book3s.c | 11 +++++++++++
2 files changed, 17 insertions(+)
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index 00e7e671bb4b..dde97d7d9253 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -67,6 +67,12 @@ struct power_pmu {
* the pmu supports extended perf regs capability
*/
int capabilities;
+ /*
+ * Function to check event code for values which are
+ * reserved. Function takes struct perf_event as input,
+ * since event code could be spread in attr.config*
+ */
+ int (*check_attr_config)(struct perf_event *ev);
};
/*
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 766f064f00fb..b17358e8dc12 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -1963,6 +1963,17 @@ static int power_pmu_event_init(struct perf_event *event)
return -ENOENT;
}
+ /*
+ * PMU config registers have fields that are
+ * reserved and some specific values for bit fields are reserved.
+ * For ex., MMCRA[61:62] is Randome Sampling Mode (SM)
+ * and value of 0b11 to this field is reserved.
+ * Check for invalid values in attr.config.
+ */
+ if (ppmu->check_attr_config &&
+ ppmu->check_attr_config(event))
+ return -EINVAL;
+
event->hw.config_base = ev;
event->hw.idx = 0;
--
2.26.2
^ permalink raw reply related
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: kernel test robot @ 2021-04-08 7:48 UTC (permalink / raw)
To: Leonardo Bras, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Alexey Kardashevskiy, brking
Cc: linuxppc-dev, kbuild-all, linux-kernel
In-Reply-To: <20210407195613.131140-1-leobras.c@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5088 bytes --]
Hi Leonardo,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on v5.12-rc6 next-20210407]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Leonardo-Bras/powerpc-iommu-Enable-remaining-IOMMU-Pagesizes-present-in-LoPAR/20210408-035800
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-r016-20210407 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/faa8b10e5b9652dbd56ed8e759a1cc09b95805be
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Leonardo-Bras/powerpc-iommu-Enable-remaining-IOMMU-Pagesizes-present-in-LoPAR/20210408-035800
git checkout faa8b10e5b9652dbd56ed8e759a1cc09b95805be
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/vdso/const.h:5,
from include/linux/const.h:4,
from include/linux/bits.h:5,
from include/linux/bitops.h:6,
from include/linux/kernel.h:11,
from include/asm-generic/bug.h:20,
from arch/powerpc/include/asm/bug.h:109,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from arch/powerpc/platforms/pseries/iommu.c:15:
arch/powerpc/platforms/pseries/iommu.c: In function 'iommu_get_page_shift':
>> include/uapi/linux/const.h:20:19: error: conversion from 'long long unsigned int' to 'unsigned int' changes value from '17179869184' to '0' [-Werror=overflow]
20 | #define __AC(X,Y) (X##Y)
| ^~~~~~
include/uapi/linux/const.h:21:18: note: in expansion of macro '__AC'
21 | #define _AC(X,Y) __AC(X,Y)
| ^~~~
include/linux/sizes.h:48:19: note: in expansion of macro '_AC'
48 | #define SZ_16G _AC(0x400000000, ULL)
| ^~~
arch/powerpc/platforms/pseries/iommu.c:1120:42: note: in expansion of macro 'SZ_16G'
1120 | { QUERY_DDW_PGSIZE_16G, __builtin_ctz(SZ_16G) },
| ^~~~~~
cc1: all warnings being treated as errors
vim +20 include/uapi/linux/const.h
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 6
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 7 /* Some constant macros are used in both assembler and
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 8 * C code. Therefore we cannot annotate them always with
6df95fd7ad9a84 include/linux/const.h Randy Dunlap 2007-05-08 9 * 'UL' and other type specifiers unilaterally. We
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 10 * use the following macros to deal with this.
74ef649fe847fd include/linux/const.h Jeremy Fitzhardinge 2008-01-30 11 *
74ef649fe847fd include/linux/const.h Jeremy Fitzhardinge 2008-01-30 12 * Similarly, _AT() will cast an expression with a type in C, but
74ef649fe847fd include/linux/const.h Jeremy Fitzhardinge 2008-01-30 13 * leave it unchanged in asm.
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 14 */
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 15
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 16 #ifdef __ASSEMBLY__
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 17 #define _AC(X,Y) X
74ef649fe847fd include/linux/const.h Jeremy Fitzhardinge 2008-01-30 18 #define _AT(T,X) X
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 19 #else
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 @20 #define __AC(X,Y) (X##Y)
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 21 #define _AC(X,Y) __AC(X,Y)
74ef649fe847fd include/linux/const.h Jeremy Fitzhardinge 2008-01-30 22 #define _AT(T,X) ((T)(X))
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 23 #endif
9d291e787b2b71 include/asm-x86_64/const.h Vivek Goyal 2007-05-02 24
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37334 bytes --]
^ permalink raw reply
* Re: [PATCH v1 2/8] powerpc/mem: Remove address argument to flush_coherent_icache()
From: Aneesh Kumar K.V @ 2021-04-08 8:50 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <8cbdcfc4446154bd3323cc68827f114aa9bbc5e7.1617816138.git.christophe.leroy@csgroup.eu>
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> flush_coherent_icache() can use any valid address as mentionned
> by the comment.
>
> Use PAGE_OFFSET as base address. This allows removing the
> user access stuff.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/mm/mem.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index ce6c81ce4362..19f807b87697 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -342,10 +342,9 @@ void free_initmem(void)
>
> /**
> * flush_coherent_icache() - if a CPU has a coherent icache, flush it
> - * @addr: The base address to use (can be any valid address, the whole cache will be flushed)
> * Return true if the cache was flushed, false otherwise
> */
> -static inline bool flush_coherent_icache(unsigned long addr)
> +static inline bool flush_coherent_icache(void)
> {
> /*
> * For a snooping icache, we still need a dummy icbi to purge all the
> @@ -355,9 +354,7 @@ static inline bool flush_coherent_icache(unsigned long addr)
> */
> if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
> mb(); /* sync */
> - allow_read_from_user((const void __user *)addr, L1_CACHE_BYTES);
> - icbi((void *)addr);
> - prevent_read_from_user((const void __user *)addr, L1_CACHE_BYTES);
> + icbi((void *)PAGE_OFFSET);
> mb(); /* sync */
> isync();
> return true;
do we need that followup sync? Usermanual suggest sync; icbi(any address);
isync sequence.
-aneesh
^ permalink raw reply
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: Michael Ellerman @ 2021-04-08 9:04 UTC (permalink / raw)
To: Alexey Kardashevskiy, Leonardo Bras, Benjamin Herrenschmidt,
Paul Mackerras, brking
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <8e1ce7e9-415b-92ea-0437-a4331ed3c7f9@ozlabs.ru>
Alexey Kardashevskiy <aik@ozlabs.ru> writes:
> On 08/04/2021 15:37, Michael Ellerman wrote:
>> Leonardo Bras <leobras.c@gmail.com> writes:
>>> According to LoPAR, ibm,query-pe-dma-window output named "IO Page Sizes"
>>> will let the OS know all possible pagesizes that can be used for creating a
>>> new DDW.
>>>
>>> Currently Linux will only try using 3 of the 8 available options:
>>> 4K, 64K and 16M. According to LoPAR, Hypervisor may also offer 32M, 64M,
>>> 128M, 256M and 16G.
>>
>> Do we know of any hardware & hypervisor combination that will actually
>> give us bigger pages?
>
>
> On P8 16MB host pages and 16MB hardware iommu pages worked.
>
> On P9, VM's 16MB IOMMU pages worked on top of 2MB host pages + 2MB
> hardware IOMMU pages.
The current code already tries 16MB though.
I'm wondering if we're going to ask for larger sizes that have never
been tested and possibly expose bugs. But it sounds like this is mainly
targeted at future platforms.
>>> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
>>> index 9fc5217f0c8e..6cda1c92597d 100644
>>> --- a/arch/powerpc/platforms/pseries/iommu.c
>>> +++ b/arch/powerpc/platforms/pseries/iommu.c
>>> @@ -53,6 +53,20 @@ enum {
>>> DDW_EXT_QUERY_OUT_SIZE = 2
>>> };
>>
>> A comment saying where the values come from would be good.
>>
>>> +#define QUERY_DDW_PGSIZE_4K 0x01
>>> +#define QUERY_DDW_PGSIZE_64K 0x02
>>> +#define QUERY_DDW_PGSIZE_16M 0x04
>>> +#define QUERY_DDW_PGSIZE_32M 0x08
>>> +#define QUERY_DDW_PGSIZE_64M 0x10
>>> +#define QUERY_DDW_PGSIZE_128M 0x20
>>> +#define QUERY_DDW_PGSIZE_256M 0x40
>>> +#define QUERY_DDW_PGSIZE_16G 0x80
>>
>> I'm not sure the #defines really gain us much vs just putting the
>> literal values in the array below?
>
> Then someone says "uuuuu magic values" :) I do not mind either way. Thanks,
Yeah that's true. But #defining them doesn't make them less magic, if
you only use them in one place :)
cheers
^ permalink raw reply
* Re: [PATCH v2 1/1] powerpc/iommu: Enable remaining IOMMU Pagesizes present in LoPAR
From: Michael Ellerman @ 2021-04-08 9:08 UTC (permalink / raw)
To: Leonardo Bras, Benjamin Herrenschmidt, Paul Mackerras,
Alexey Kardashevskiy, brking
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <eed000bfa26686f616b91a7ac5a54ff8e3f2cbd0.camel@gmail.com>
Leonardo Bras <leobras.c@gmail.com> writes:
> On Thu, 2021-04-08 at 03:20 -0300, Leonardo Bras wrote:
>> > > +#define QUERY_DDW_PGSIZE_4K 0x01
>> > > +#define QUERY_DDW_PGSIZE_64K 0x02
>> > > +#define QUERY_DDW_PGSIZE_16M 0x04
>> > > +#define QUERY_DDW_PGSIZE_32M 0x08
>> > > +#define QUERY_DDW_PGSIZE_64M 0x10
>> > > +#define QUERY_DDW_PGSIZE_128M 0x20
>> > > +#define QUERY_DDW_PGSIZE_256M 0x40
>> > > +#define QUERY_DDW_PGSIZE_16G 0x80
>> >
>> > I'm not sure the #defines really gain us much vs just putting the
>> > literal values in the array below?
>>
>> My v1 did not use the define approach, what do you think of that?
>> http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210322190943.715368-1-leobras.c@gmail.com/
>>
>>
> (of course, it would be that without the pageshift defines also, using
> the __builtin_ctz() approach suggested by Alexey.)
Yeah I think I like that better.
cheers
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: remove set but not used variable 'force_printk_to_btext'
From: yukuai (C) @ 2021-04-08 9:30 UTC (permalink / raw)
To: Christophe Leroy, mpe; +Cc: linuxppc-dev, linux-kernel, yi.zhang
In-Reply-To: <b7636590-42ef-e588-59e1-b0591243d619@csgroup.eu>
On 2021/04/08 13:01, Christophe Leroy wrote:
>
>
> Le 08/04/2021 à 03:18, Yu Kuai a écrit :
>> Fixes gcc '-Wunused-but-set-variable' warning:
>>
>> arch/powerpc/kernel/btext.c:49:12: error: 'force_printk_to_btext'
>> defined but not used.
>
> You don't get this error as it is now.
> You will get this error only if you make it 'static', which is what you
> did in your first patch based on the 'sparse' report.
>
> When removing a non static variable, you should explain that you can
> remove it after you have verifier that it is nowhere used, neither in
> that file nor in any other one.
Hi,
I do use 'git grep force_printk_to_btext' to confirm that
'force_printk_to_btext' is not used anywhere. Maybe it's better to
metion it in commit message?
Thanks
Yu Kuai
>
>>
>> It is never used, and so can be removed.
>>
>> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
>> ---
>> arch/powerpc/kernel/btext.c | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
>> index 803c2a45b22a..359d0f4ca532 100644
>> --- a/arch/powerpc/kernel/btext.c
>> +++ b/arch/powerpc/kernel/btext.c
>> @@ -46,7 +46,6 @@ unsigned long disp_BAT[2] __initdata = {0, 0};
>> static unsigned char vga_font[cmapsz];
>> int boot_text_mapped __force_data = 0;
>> -int force_printk_to_btext = 0;
>> extern void rmci_on(void);
>> extern void rmci_off(void);
>>
> .
>
^ permalink raw reply
* Re: [PATCH 2/2] powerpc: make 'boot_text_mapped' static
From: yukuai (C) @ 2021-04-08 9:34 UTC (permalink / raw)
To: Christophe Leroy, mpe; +Cc: linuxppc-dev, linux-kernel, yi.zhang
In-Reply-To: <5b91cd3f-d171-f510-7dae-8cbabb13b23c@csgroup.eu>
On 2021/04/08 13:04, Christophe Leroy wrote:
>
>
> Le 08/04/2021 à 03:18, Yu Kuai a écrit :
>> The sparse tool complains as follow:
>>
>> arch/powerpc/kernel/btext.c:48:5: warning:
>> symbol 'boot_text_mapped' was not declared. Should it be static?
>>
>> This symbol is not used outside of btext.c, so this commit make
>> it static.
>>
>> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
>> ---
>> arch/powerpc/kernel/btext.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
>> index 359d0f4ca532..8df9230be6fa 100644
>> --- a/arch/powerpc/kernel/btext.c
>> +++ b/arch/powerpc/kernel/btext.c
>> @@ -45,7 +45,7 @@ unsigned long disp_BAT[2] __initdata = {0, 0};
>> static unsigned char vga_font[cmapsz];
>> -int boot_text_mapped __force_data = 0;
>> +static int boot_text_mapped __force_data;
>
> Are you sure the initialisation to 0 can be removed ? Usually
> initialisation to 0 is not needed because not initialised variables go
> in the BSS section which is zeroed at startup. But here the variable is
> flagged with __force_data so it is not going in the BSS section.
Hi,
I removed the initialisation to 0 because checkpatch complained about
it, I do not familiar with '__force_data', thanks for pointing it out.
Thanks,
Yu Kuai
>
>
>> extern void rmci_on(void);
>> extern void rmci_off(void);
>>
> .
>
^ permalink raw reply
* Re: [PATCH 1/1] powerpc/smp: Set numa node before updating mask
From: Srikar Dronamraju @ 2021-04-08 11:11 UTC (permalink / raw)
To: Nathan Lynch
Cc: Gautham R Shenoy, Peter Zijlstra, Scott Cheloha,
Geetika Moolchandani, Valentin Schneider, Laurent Dufour,
linuxppc-dev, Ingo Molnar
In-Reply-To: <878s5tlvxr.fsf@linux.ibm.com>
* Nathan Lynch <nathanl@linux.ibm.com> [2021-04-07 14:46:24]:
> Srikar Dronamraju <srikar@linux.vnet.ibm.com> writes:
>
> > * Nathan Lynch <nathanl@linux.ibm.com> [2021-04-07 07:19:10]:
> >
> >> Sorry for the delay in following up here.
> >>
> >
> > No issues.
> >
> >> >> So I'd suggest that pseries_add_processor() be made to update
> >> >> these things when the CPUs are marked present, before onlining them.
> >> >
> >> > In pseries_add_processor, we are only marking the cpu as present. i.e
> >> > I believe numa_setup_cpu() would not have been called. So we may not have a
> >> > way to associate the CPU to the node. Otherwise we will have to call
> >> > numa_setup_cpu() or the hcall_vphn.
> >> >
> >> > We could try calling numa_setup_cpu() immediately after we set the
> >> > CPU to be present, but that would be one more extra hcall + I dont know if
> >> > there are any more steps needed before CPU being made present and
> >> > associating the CPU to the node.
> >>
> >> An additional hcall in this path doesn't seem too expensive.
> >>
> >> > Are we sure the node is already online?
> >>
> >> I see that dlpar_online_cpu() calls find_and_online_cpu_nid(), so yes I
> >> think that's covered.
> >
> > Okay,
> >
> > Can we just call set_cpu_numa_node() at the end of map_cpu_to_node().
> > The advantage would be the update to numa_cpu_lookup_table and cpu_to_node
> > would happen at the same time and would be in sync.
>
> I don't know. I guess this question just makes me wonder whether powerpc
> needs to have the additional lookup table. How is it different from the
> generic per_cpu numa_node?
lookup table is for early cpu to node i.e when per_cpu variables may not be
available. This would mean that calling set_numa_node/set_cpu_numa_node from
map_cpu_to_node() may not always be an option, since map_cpu_to_node() does
end up getting called very early in the system.
--
Thanks and Regards
Srikar Dronamraju
^ permalink raw reply
* Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers
From: Rasmus Villemoes @ 2021-04-08 12:45 UTC (permalink / raw)
To: Andy Shevchenko, Michael Ellerman, Joerg Roedel, Wei Liu,
Michael Kelley, Mike Rapoport, Corey Minyard, Bjorn Andersson,
Mathieu Poirier, Andrew Morton, Tetsuo Handa, Vlastimil Babka,
Paul E. McKenney, Steven Rostedt (VMware), linuxppc-dev,
linux-kernel, linux-hyperv, openipmi-developer, linux-remoteproc,
linux-arch, kexec, rcu, linux-fsdevel
Cc: Ohad Ben-Cohen, Iurii Zaikin, Stephen Hemminger, Arnd Bergmann,
Corey Minyard, Haiyang Zhang, x86, Lai Jiangshan, Josh Triplett,
Joel Fernandes, Luis Chamberlain, Ingo Molnar, Borislav Petkov,
Eric Biederman, H. Peter Anvin, Mathieu Desnoyers, Paul Mackerras,
Thomas Gleixner, K. Y. Srinivasan, Kees Cook
In-Reply-To: <20210406133158.73700-1-andriy.shevchenko@linux.intel.com>
On 06/04/2021 15.31, Andy Shevchenko wrote:
> kernel.h is being used as a dump for all kinds of stuff for a long time.
> Here is the attempt to start cleaning it up by splitting out panic and
> oops helpers.
Yay.
Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> At the same time convert users in header and lib folder to use new header.
> Though for time being include new header back to kernel.h to avoid twisted
> indirected includes for existing users.
I think it would be good to have some place to note that "This #include
is just for backwards compatibility, it will go away RealSoonNow, so if
you rely on something from linux/panic.h, include that explicitly
yourself TYVM. And if you're looking for a janitorial task, write a
script to check that every file that uses some identifier defined in
panic.h actually includes that file. When all offenders are found and
dealt with, remove the #include and this note.".
> +
> +struct taint_flag {
> + char c_true; /* character printed when tainted */
> + char c_false; /* character printed when not tainted */
> + bool module; /* also show as a per-module taint flag */
> +};
> +
> +extern const struct taint_flag taint_flags[TAINT_FLAGS_COUNT];
While you're doing this, nothing outside of kernel/panic.c cares about
the definition of struct taint_flag or use the taint_flags array, so
could you make the definition private to that file and make the array
static? (Another patch, of course.)
> +enum lockdep_ok {
> + LOCKDEP_STILL_OK,
> + LOCKDEP_NOW_UNRELIABLE,
> +};
> +
> +extern const char *print_tainted(void);
> +extern void add_taint(unsigned flag, enum lockdep_ok);
> +extern int test_taint(unsigned flag);
> +extern unsigned long get_taint(void);
I know you're just moving code, but it would be a nice opportunity to
drop the redundant externs.
Rasmus
^ permalink raw reply
* Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers
From: Andy Shevchenko @ 2021-04-08 13:29 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Corey Minyard, linux-hyperv, Tetsuo Handa, linux-remoteproc,
Michael Kelley, Paul Mackerras, H. Peter Anvin, Joel Fernandes,
K. Y. Srinivasan, Thomas Gleixner, linux-arch, Wei Liu,
Stephen Hemminger, Corey Minyard, x86, Ingo Molnar, Iurii Zaikin,
Ohad Ben-Cohen, Joerg Roedel, Kees Cook, Paul E. McKenney,
Lai Jiangshan, Haiyang Zhang, Josh Triplett,
Steven Rostedt (VMware), rcu, Borislav Petkov, openipmi-developer,
Bjorn Andersson, Vlastimil Babka, Mathieu Poirier, kexec,
linux-kernel, Luis Chamberlain, Arnd Bergmann, Eric Biederman,
linux-fsdevel, Mathieu Desnoyers, Andrew Morton, linuxppc-dev,
Mike Rapoport
In-Reply-To: <03be4ed9-8e8d-e2c2-611d-ac09c61d84f9@rasmusvillemoes.dk>
On Thu, Apr 08, 2021 at 02:45:12PM +0200, Rasmus Villemoes wrote:
> On 06/04/2021 15.31, Andy Shevchenko wrote:
> > kernel.h is being used as a dump for all kinds of stuff for a long time.
> > Here is the attempt to start cleaning it up by splitting out panic and
> > oops helpers.
>
> Yay.
>
> Acked-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Thanks!
> > At the same time convert users in header and lib folder to use new header.
> > Though for time being include new header back to kernel.h to avoid twisted
> > indirected includes for existing users.
>
> I think it would be good to have some place to note that "This #include
> is just for backwards compatibility, it will go away RealSoonNow, so if
> you rely on something from linux/panic.h, include that explicitly
> yourself TYVM. And if you're looking for a janitorial task, write a
> script to check that every file that uses some identifier defined in
> panic.h actually includes that file. When all offenders are found and
> dealt with, remove the #include and this note.".
Good and...
> > +struct taint_flag {
> > + char c_true; /* character printed when tainted */
> > + char c_false; /* character printed when not tainted */
> > + bool module; /* also show as a per-module taint flag */
> > +};
> > +
> > +extern const struct taint_flag taint_flags[TAINT_FLAGS_COUNT];
>
> While you're doing this, nothing outside of kernel/panic.c cares about
> the definition of struct taint_flag or use the taint_flags array, so
> could you make the definition private to that file and make the array
> static? (Another patch, of course.)
...according to the above if *you are looking for a janitorial task*... :-))
> > +enum lockdep_ok {
> > + LOCKDEP_STILL_OK,
> > + LOCKDEP_NOW_UNRELIABLE,
> > +};
> > +
> > +extern const char *print_tainted(void);
> > +extern void add_taint(unsigned flag, enum lockdep_ok);
> > +extern int test_taint(unsigned flag);
> > +extern unsigned long get_taint(void);
>
> I know you're just moving code, but it would be a nice opportunity to
> drop the redundant externs.
As above. But for all these I have heard you. So, I'll keep this response
as part of my always only growing TODO list.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH v2 0/5] powerpc/rtas: miscellaneous cleanups
From: Nathan Lynch @ 2021-04-08 14:06 UTC (permalink / raw)
To: linuxppc-dev; +Cc: tyreld, ajd, aik, aneesh.kumar, npiggin, brking
This is a reroll of the series posted here:
https://lore.kernel.org/linuxppc-dev/20210114220004.1138993-1-nathanl@linux.ibm.com/
Originally this work was prompted by failures on radix MMU PowerVM
guests when passing buffers to RTAS that lay outside of its idea of
the RMA. In v1 I approached this as a problem to be solved in Linux,
but RTAS development has since decided to change their code so that
the RMA restriction does not apply with radix.
So in v2 I retain the cleanups and discard the more significant change
which accommodated the misbehaving RTAS versions.
Changes since v1:
- Correct missing conversion of RTAS_RMOBUF_MAX ->
RTAS_USER_REGION_SIZE in in_rmo_buf().
- Remove unnecessary braces in rtas_syscall_filter_init().
- Leave expression of RTAS_WORK_AREA_SIZE as-is instead of changing
the factors in a confusing way, per discussion with Alexey.
- Drop "powerpc/rtas: constrain user region allocation to RMA"
Nathan Lynch (5):
powerpc/rtas: improve ppc_rtas_rmo_buf_show documentation
powerpc/rtas-proc: remove unused RMO_READ_BUF_MAX
powerpc/rtas: remove ibm_suspend_me_token
powerpc/rtas: move syscall filter setup into separate function
powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE
arch/powerpc/include/asm/rtas.h | 6 +++---
arch/powerpc/kernel/rtas-proc.c | 15 +++++++++++----
arch/powerpc/kernel/rtas.c | 34 +++++++++++++++++----------------
3 files changed, 32 insertions(+), 23 deletions(-)
--
2.30.2
^ permalink raw reply
* [PATCH v2 1/5] powerpc/rtas: improve ppc_rtas_rmo_buf_show documentation
From: Nathan Lynch @ 2021-04-08 14:06 UTC (permalink / raw)
To: linuxppc-dev; +Cc: tyreld, ajd, aik, aneesh.kumar, npiggin, brking
In-Reply-To: <20210408140630.205502-1-nathanl@linux.ibm.com>
Add kerneldoc for ppc_rtas_rmo_buf_show(), the callback for
/proc/powerpc/rtas/rmo_buffer, explaining its expected use.
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/kernel/rtas-proc.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 2d33f342a293..e0f8329966d6 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -757,7 +757,16 @@ static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v)
#define RMO_READ_BUF_MAX 30
-/* RTAS Userspace access */
+/**
+ * ppc_rtas_rmo_buf_show() - Describe RTAS-addressable region for user space.
+ *
+ * Base + size description of a range of RTAS-addressable memory set
+ * aside for user space to use as work area(s) for certain RTAS
+ * functions. User space accesses this region via /dev/mem. Apart from
+ * security policies, the kernel does not arbitrate or serialize
+ * access to this region, and user space must ensure that concurrent
+ * users do not interfere with each other.
+ */
static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v)
{
seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX);
--
2.30.2
^ permalink raw reply related
* [PATCH v2 5/5] powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE
From: Nathan Lynch @ 2021-04-08 14:06 UTC (permalink / raw)
To: linuxppc-dev; +Cc: tyreld, ajd, aik, aneesh.kumar, npiggin, brking
In-Reply-To: <20210408140630.205502-1-nathanl@linux.ibm.com>
RTAS_RMOBUF_MAX doesn't actually describe a "maximum" value in any
sense. It represents the size of an area of memory set aside for user
space to use as work areas for certain RTAS calls.
Rename it to RTAS_USER_REGION_SIZE.
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
arch/powerpc/include/asm/rtas.h | 6 +++---
arch/powerpc/kernel/rtas-proc.c | 2 +-
arch/powerpc/kernel/rtas.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 658448ca5b8a..9dc97d2f9d27 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -19,8 +19,8 @@
#define RTAS_UNKNOWN_SERVICE (-1)
#define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */
-/* Buffer size for ppc_rtas system call. */
-#define RTAS_RMOBUF_MAX (64 * 1024)
+/* Memory set aside for sys_rtas to use with calls that need a work area. */
+#define RTAS_USER_REGION_SIZE (64 * 1024)
/* RTAS return status codes */
#define RTAS_BUSY -2 /* RTAS Busy */
@@ -357,7 +357,7 @@ extern void rtas_take_timebase(void);
static inline int page_is_rtas_user_buf(unsigned long pfn)
{
unsigned long paddr = (pfn << PAGE_SHIFT);
- if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_RMOBUF_MAX))
+ if (paddr >= rtas_rmo_buf && paddr < (rtas_rmo_buf + RTAS_USER_REGION_SIZE))
return 1;
return 0;
}
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index d2b0d99824a4..6857a5b0a1c3 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -767,6 +767,6 @@ static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v)
*/
static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v)
{
- seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX);
+ seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_USER_REGION_SIZE);
return 0;
}
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 24dc7bc463a8..6bada744402b 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -987,10 +987,10 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
static bool in_rmo_buf(u32 base, u32 end)
{
return base >= rtas_rmo_buf &&
- base < (rtas_rmo_buf + RTAS_RMOBUF_MAX) &&
+ base < (rtas_rmo_buf + RTAS_USER_REGION_SIZE) &&
base <= end &&
end >= rtas_rmo_buf &&
- end < (rtas_rmo_buf + RTAS_RMOBUF_MAX);
+ end < (rtas_rmo_buf + RTAS_USER_REGION_SIZE);
}
static bool block_rtas_call(int token, int nargs,
@@ -1202,7 +1202,7 @@ void __init rtas_initialize(void)
if (firmware_has_feature(FW_FEATURE_LPAR))
rtas_region = min(ppc64_rma_size, RTAS_INSTANTIATE_MAX);
#endif
- rtas_rmo_buf = memblock_phys_alloc_range(RTAS_RMOBUF_MAX, PAGE_SIZE,
+ rtas_rmo_buf = memblock_phys_alloc_range(RTAS_USER_REGION_SIZE, PAGE_SIZE,
0, rtas_region);
if (!rtas_rmo_buf)
panic("ERROR: RTAS: Failed to allocate %lx bytes below %pa\n",
--
2.30.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox