* [PATCH 3/4] powerpc: convert to generic builtin command line
From: Daniel Walker @ 2019-03-19 23:24 UTC (permalink / raw)
To: Andrew Morton, Christophe Leroy, Michael Ellerman, Rob Herring,
xe-linux-external, linuxppc-dev, Benjamin Herrenschmidt,
Paul Mackerras
Cc: Daniel Walker, linux-kernel, Maksym Kokhan
This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE
option.
[maksym.kokhan@globallogic.com: add strlcat to prom_init_check.sh
whitelist]
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Daniel Walker <danielwa@cisco.com>
Cc: xe-linux-external@cisco.com
Signed-off-by: Daniel Walker <danielwa@cisco.com>
Signed-off-by: Maksym Kokhan <maksym.kokhan@globallogic.com>
---
arch/powerpc/Kconfig | 23 +----------------------
arch/powerpc/kernel/prom_init.c | 8 ++++----
arch/powerpc/kernel/prom_init_check.sh | 2 +-
3 files changed, 6 insertions(+), 27 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index def41a06377b..385120ff0236 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -173,6 +173,7 @@ config PPC
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select GENERIC_TIME_VSYSCALL
+ select GENERIC_CMDLINE
select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_JUMP_LABEL
select HAVE_ARCH_KGDB
@@ -780,28 +781,6 @@ config PPC_DENORMALISATION
Add support for handling denormalisation of single precision
values. Useful for bare metal only. If unsure say Y here.
-config CMDLINE_BOOL
- bool "Default bootloader kernel arguments"
-
-config CMDLINE
- string "Initial kernel command string"
- depends on CMDLINE_BOOL
- default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
- help
- On some platforms, there is currently no way for the boot loader to
- pass arguments to the kernel. For these platforms, you can supply
- some command-line options at build time by entering them here. In
- most cases you will need to specify the root device here.
-
-config CMDLINE_FORCE
- bool "Always use the default kernel command string"
- depends on CMDLINE_BOOL
- help
- Always use the default kernel command string, even if the boot
- loader passes other arguments to the kernel.
- This is useful if you cannot or don't want to change the
- command-line options your boot loader passes to the kernel.
-
config EXTRA_TARGETS
string "Additional default image types"
help
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index f33ff4163a51..e8e9fca22470 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -30,6 +30,7 @@
#include <linux/delay.h>
#include <linux/initrd.h>
#include <linux/bitops.h>
+#include <linux/cmdline.h>
#include <asm/prom.h>
#include <asm/rtas.h>
#include <asm/page.h>
@@ -637,11 +638,10 @@ static void __init early_cmdline_parse(void)
p = prom_cmd_line;
if ((long)prom.chosen > 0)
l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1);
-#ifdef CONFIG_CMDLINE
+
if (l <= 0 || p[0] == '\0') /* dbl check */
- strlcpy(prom_cmd_line,
- CONFIG_CMDLINE, sizeof(prom_cmd_line));
-#endif /* CONFIG_CMDLINE */
+ cmdline_add_builtin_section(prom_cmd_line, NULL, sizeof(prom_cmd_line), __prombss);
+
prom_printf("command line: %s\n", prom_cmd_line);
#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index 667df97d2595..ab2acc8d8b5a 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -18,7 +18,7 @@
WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
_end enter_prom memcpy memset reloc_offset __secondary_hold
-__secondary_hold_acknowledge __secondary_hold_spinloop __start
+__secondary_hold_acknowledge __secondary_hold_spinloop __start strlcat
strcmp strcpy strlcpy strlen strncmp strstr kstrtobool logo_linux_clut224
reloc_got2 kernstart_addr memstart_addr linux_banner _stext
__prom_init_toc_start __prom_init_toc_end btext_setup_display TOC."
--
2.19.1
^ permalink raw reply related
* Generic command line -v2
From: Daniel Walker @ 2019-03-19 23:24 UTC (permalink / raw)
To: Andrew Morton, Christophe Leroy, Michael Ellerman, Rob Herring,
xe-linux-external, linuxppc-dev
Hi all,
new in -v2
* Updated with some changes to adding spaces from Christophe Leroy.
* Added OF support with comments from Rob on my 2015 submission which he reviewed.
(https://lore.kernel.org/patchwork/patch/604997/)
Christophe and Rob suggested to have support for this inside the OF code.
* Powerpc was made to use the OF parts instead of having changes into it's code.
* Removed trim effect from powerpc config files. sed only was used to convert.
requested by Michael Ellerman.
That's basically it. Otherwise the same changes.
Daniel
^ permalink raw reply
* Re: [RESEND PATCH 0/7] Add FOLL_LONGTERM to GUP fast and use it
From: Andrew Morton @ 2019-03-19 22:19 UTC (permalink / raw)
To: ira.weiny
Cc: Michal Hocko, linux-sh, Peter Zijlstra, James Hogan,
Heiko Carstens, linux-mips, linux-mm, Rich Felker, Paul Mackerras,
sparclinux, Dan Williams, linux-s390, Yoshinori Sato, linux-rdma,
Jason Gunthorpe, Ingo Molnar, John Hubbard, Borislav Petkov,
Thomas Gleixner, netdev, linux-kernel, Ralf Baechle,
Martin Schwidefsky, linuxppc-dev, David S. Miller,
Kirill A. Shutemov
In-Reply-To: <20190317183438.2057-1-ira.weiny@intel.com>
On Sun, 17 Mar 2019 11:34:31 -0700 ira.weiny@intel.com wrote:
> Resending after rebasing to the latest mm tree.
>
> HFI1, qib, and mthca, use get_user_pages_fast() due to it performance
> advantages. These pages can be held for a significant time. But
> get_user_pages_fast() does not protect against mapping FS DAX pages.
>
> Introduce FOLL_LONGTERM and use this flag in get_user_pages_fast() which
> retains the performance while also adding the FS DAX checks. XDP has also
> shown interest in using this functionality.[1]
>
> In addition we change get_user_pages() to use the new FOLL_LONGTERM flag and
> remove the specialized get_user_pages_longterm call.
It would be helpful to include your response to Christoph's question
(http://lkml.kernel.org/r/20190220180255.GA12020@iweiny-DESK2.sc.intel.com)
in the changelog. Because if one person was wondering about this,
others will likely do so.
We have no record of acks or reviewed-by's. At least one was missed
(http://lkml.kernel.org/r/CAOg9mSTTcD-9bCSDfC0WRYqfVrNB4TwOzL0c4+6QXi-N_Y43Vw@mail.gmail.com),
but that is very very partial.
This patchset is fairly DAX-centered, but Dan wasn't cc'ed!
So ho hum. I'll scoop them up and shall make the above changes to the
[1/n] changelog, but we still have some work to do.
^ permalink raw reply
* Re: [PATCH net-next] ibmveth: Make array ibmveth_stats static
From: David Miller @ 2019-03-19 21:10 UTC (permalink / raw)
To: yuehaibing; +Cc: linux-kernel, tlfalcon, paulus, netdev, linuxppc-dev
In-Reply-To: <20190319144237.19288-1-yuehaibing@huawei.com>
From: Yue Haibing <yuehaibing@huawei.com>
Date: Tue, 19 Mar 2019 22:42:37 +0800
> From: YueHaibing <yuehaibing@huawei.com>
>
> Fix sparse warning:
> drivers/net/ethernet/ibm/ibmveth.c:96:21:
> warning: symbol 'ibmveth_stats' was not declared. Should it be static?
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/3] powerpc: convert to generic builtin command line
From: Daniel Walker @ 2019-03-19 18:58 UTC (permalink / raw)
To: Christophe Leroy
Cc: xe-linux-external, linux-kernel, Paul Mackerras, Maksym Kokhan,
Daniel Walker, Andrew Morton, linuxppc-dev
In-Reply-To: <e6dc6500-0e33-da0c-c975-0d9125e38c0e@c-s.fr>
On Mon, Mar 04, 2019 at 03:26:59PM +0100, Christophe Leroy wrote:
>
>
> Le 01/03/2019 à 20:44, Daniel Walker a écrit :
> > This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE
> > option.
>
> Please explain more in details how each powerpc option is replaced by one of
> the generic options.
CMDLINE is replace by two options to either which allow static options to either
be appended or prepended to the boot loader arguemnts. If you wanted a lateral
changes you would only fill in CONFIG_CMDLINE_PREPEND. CONFIG_CMDLINE_OVERRIDE
does the same as CMDLINE_FORCE, only with the append and prepend arguemnts
merged without the boot loader arguments.
> > --- a/arch/powerpc/kernel/prom.c
> > +++ b/arch/powerpc/kernel/prom.c
> > @@ -34,6 +34,7 @@
> > #include <linux/of_fdt.h>
> > #include <linux/libfdt.h>
> > #include <linux/cpu.h>
> > +#include <linux/cmdline.h>
> > #include <asm/prom.h>
> > #include <asm/rtas.h>
> > @@ -716,6 +717,9 @@ void __init early_init_devtree(void *params)
> > */
> > of_scan_flat_dt(early_init_dt_scan_chosen_ppc, boot_command_line);
> > + /* append and prepend any arguments built into the kernel. */
> > + cmdline_add_builtin(boot_command_line, NULL, COMMAND_LINE_SIZE);
> > +
>
> I don't think it is worth an implementation as complex as in the previous
> patch just for the above line.
> Could easily define the temporary buffer in this file directely, then just
> locally do:
>
> strlcpy(temp_buff, CONFIG_CMDLINE_PREPEND, COMMAND_LINE_SIZE);
> strlcat(temp_buff, boot_command_line, COMMAND_LINE_SIZE);
> strlcat(temp_buff, CONFIG_CMDLINE_APPEND, COMMAND_LINE_SIZE);
> strlcpy(boot_command_line, temp_buff, COMMAND_LINE_SIZE);
The point of the code is to have an implementation that other architecture can
use. If we open code it in powerpc we're no better off.
>
>
> > /* Scan memory nodes and rebuild MEMBLOCKs */
> > of_scan_flat_dt(early_init_dt_scan_root, NULL);
> > of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
> > diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> > index f33ff4163a51..e8e9fca22470 100644
> > --- a/arch/powerpc/kernel/prom_init.c
> > +++ b/arch/powerpc/kernel/prom_init.c
> > @@ -30,6 +30,7 @@
> > #include <linux/delay.h>
> > #include <linux/initrd.h>
> > #include <linux/bitops.h>
> > +#include <linux/cmdline.h>
> > #include <asm/prom.h>
> > #include <asm/rtas.h>
> > #include <asm/page.h>
> > @@ -637,11 +638,10 @@ static void __init early_cmdline_parse(void)
> > p = prom_cmd_line;
> > if ((long)prom.chosen > 0)
> > l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1);
> > -#ifdef CONFIG_CMDLINE
> > +
> > if (l <= 0 || p[0] == '\0') /* dbl check */
> > - strlcpy(prom_cmd_line,
> > - CONFIG_CMDLINE, sizeof(prom_cmd_line));
> > -#endif /* CONFIG_CMDLINE */
> > + cmdline_add_builtin_section(prom_cmd_line, NULL, sizeof(prom_cmd_line), __prombss);
> > +
>
> You don't need something as complex as what your generic code does for that.
> It could be done with the following simple line:
>
> strlcpy(prom_cmd_line, CONFIG_CMDLINE_PREPEND " " CONFIG_CMDLINE_APPEND,
> sizeof(prom_cmd_line));
>
> > prom_printf("command line: %s\n", prom_cmd_line);
> > #ifdef CONFIG_PPC64
> > diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
> > index 667df97d2595..ab2acc8d8b5a 100644
> > --- a/arch/powerpc/kernel/prom_init_check.sh
> > +++ b/arch/powerpc/kernel/prom_init_check.sh
> > @@ -18,7 +18,7 @@
> > WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
> > _end enter_prom memcpy memset reloc_offset __secondary_hold
> > -__secondary_hold_acknowledge __secondary_hold_spinloop __start
> > +__secondary_hold_acknowledge __secondary_hold_spinloop __start strlcat
>
> The above is a big issue. In the scope of KASAN implementation, we are
> getting rid of generic string functions from prom_init because they are
> KASAN instrumented and that's far too early for prom_init. See series
> https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=94949 and
> especially patch [v9,03/11] powerpc/prom_init: don't use string functions
> from lib/
You already re-implemented a number of string functions, seem easy enough to add
another one.
What your doing here is exactly what I'm trying to prevent in my implementation.
Say there is a small, but horrific defect in one of the string functions. Some
other architecture fixes it in lib/strings.c , woops , you just missed it and
now prom_init.c is stuck with it unless powerpc maintainers are watching closely
to keep up with the fixes to the string functions.
You could move these functions into the include/linux/string.h as static
inlines, then use them in lib/strings.c and in prom_init.c. Then you have a
unified implementation. I assume you would regard that as ugly tho.
Something else you would regard as ugly , your not adding an #ifdef on KASAN in
prom_init.c for the string functions. If you have that then any buggy string
functions which you may add (or forget to update) would only cause problems
if you had KASAN enabled. That then isolates any problems you cause to only
debug kernels with KASAN enabled, instead of unilaterally all platforms which
use prom_init.c. That would also only increase the size if KASAN is enabled.
Very desirable, but ugly. I think most of us kernel hackers will take the ugly.
#ifdef CONFIG_KASAN
...
#else
#define prom_strcmp strcmp
...
#endif /* !CONFIG_KASAN */
(you would have to change arch/powerpc/kernel/prom_init_check.sh , but that
shouldn't be too hard)
Daniel
^ permalink raw reply
* Re: [PULL REQUEST] powerpc generic command line
From: Daniel Walker @ 2019-03-19 18:00 UTC (permalink / raw)
To: Christophe Leroy; +Cc: Andrew Morton, Paul Mackerras, linuxppc-dev
In-Reply-To: <3739e843-0fe4-1295-bd9b-e4a6df614147@c-s.fr>
On Tue, Mar 19, 2019 at 06:42:35PM +0100, Christophe Leroy wrote:
> Well, that's what I started with, but at the end my main worry has been that
> you bring a non exciting set of complicated macros and code to replace
> simple code, and you break something out of generic OF code to a new brand
> new generic one, instead of updating the existing generic OF code.
Even if we update the generic OF code it only changes the powerpc changes slightly.
Because in arch/powerpc/kernel/prom_init.c there is a second version of the same
thing, which doesn't use OF.
We're not replacing simple macro's in powerpc with in-kind replacements, we're
adding a feature which we want. So yes our macros are more complicated, but in
the grand scheme of things they are very simple macros. If you think my stuff is
complicated, you haven't seen complicated.
I didn't see anyplace in your comments when you found code which would cause a
problem ? Did you find breakage which I missed?
> I like the idea behind your series very much, but I don't like too much the
> way it is proposed to be implemented. If you give me one week or two, I will
> come with a lighter proposal that should achieve the same goal.
It's fine with us, we just want the feature set. We'll continue with our version
tho, unless you decide to submit something.
I will incorporate your comments now, but immediately prior to a pull request I
couldn't add them.
Daniel
^ permalink raw reply
* Re: [PULL REQUEST] powerpc generic command line
From: Christophe Leroy @ 2019-03-19 17:42 UTC (permalink / raw)
To: Daniel Walker, Michael Ellerman
Cc: linuxppc-dev, Andrew Morton, Paul Mackerras
In-Reply-To: <20190319153842.vgrm5dc7wwc4u44l@zorba>
Hi Daniel,
Le 19/03/2019 à 16:38, Daniel Walker a écrit :
> On Tue, Mar 19, 2019 at 12:18:03PM +1100, Michael Ellerman wrote:
>> Hi Daniel,
>>
>> Daniel Walker <danielwa@cisco.com> writes:
>>> Here are the generic command line changes for powerpc.
>>>
>>> These changes have been in linux-next for two cycles, with few problems reported.
>>> It's also been used at Cisco Systems, Inc. in production products for many many
>>> years with no problems.
>>>
>>> Please pull these changes.
>>
>> Sorry I didn't reply to this earlier, have been busy with merge window
>> bugs and so on.
>>
>> As I imagine you noticed, I didn't pull this. There are a few reasons.
>>
>> Firstly you sent it a bit late, about a day before the 5.0 release, and
>> at 6am Saturday my time :) In future if you want me to merge something
>> please send a pull at least the ~Wednesday before the release.
>
> Ok .. It was Friday morning my time.
>
>> Secondly I had no idea this code was even in linux-next. I'm not sure if
>> I was Cc'ed at some point when you added it, if so sorry I missed it,
>> but I get lots of email. If you're going to add changes to arch/powerpc
>> in your next tree I'd appreciate some notice, or preferably an explicit
>> ack.
>
> Can I have an ack now ? Since your looking at it. Do you think this has no use,
> certainly Cisco has use for it. It's still in linux-next as of now.
>
>> The main reason I didn't merge it is that it's adding a bunch of code
>> outside of arch/powerpc, into files which I'm not the maintainer for,
>> and the patches doing so have no acks or reviews from anyone.
>
> With the exception of the Kconfig the header file is brand new, so I'm not sure
> who would ack that. From a maintainer perspective I think you could add new
> files without issues from other maintainers.
>
>> It's also adding a generic implementation with no indication that any
>> other arches are willing/able to use the generic implementation, which
>> begs the question whether it will actually used.
>
> It would have been used by powerpc ;) I've gotten feedback in the past from
> Ralf Baechle who thought this was useful, however that was years ago when
> this was first submitted and the code around this area in mips has changed and
> it would require a fair amount of new work to function properly on mips.
>
> Also , no other platforms need to use this. Powerpc could be the only user of
> it. This isn't really a question of a new exciting implementation of
> something. This is really simple, it's just consolidation across architectures.
> The implementation is vanilla, non-exciting stuff.
>
>> I appreciate it's hard to get these sort of cross architecture changes
>> into mainline, but I don't think this is the way to do it.
>>
>> I'd suggest you post a patch series to linux-arch with the generic
>> changes and as many architecture conversions as you can manage, then get
>> some review/acks for the generic changes and chase arch maintainers for
>> some acks.
>
> I didn't post to linux-arch , but the code has been around for years, submitted
> multiple times with more architectures than powerpc. It was scaled down to just
> powerpc to simplify it's submission.
>
> It's really a simple set of changes, I don't think it needs as much thought as
> other cross architecture changes.
>
>> I realise you have posted the series before, it may require some
>> persistence. There were also quite a few comments from Christophe, so
>> replying to those would be a good place to start.
>
> I've looked at his comments, but I think he was more worried about conflicts with
> his debugging enablement, not something to stop a pull request.
Well, that's what I started with, but at the end my main worry has been
that you bring a non exciting set of complicated macros and code to
replace simple code, and you break something out of generic OF code to a
new brand new generic one, instead of updating the existing generic OF code.
I like the idea behind your series very much, but I don't like too much
the way it is proposed to be implemented. If you give me one week or
two, I will come with a lighter proposal that should achieve the same goal.
Christophe
>
>>> The following changes since commit ccda4af0f4b92f7b4c308d3acc262f4a7e3affad:
>>>
>>> Linux 4.20-rc2 (2018-11-11 17:12:31 -0600)
>>>
>>> are available in the git repository at:
>>>
>>> https://github.com/daniel-walker/cisco-linux.git for-powerpc
>>>
>>> for you to fetch changes up to 5d4514a9c291ecf19b0626695161673d35e5d549:
>>>
>>> powerpc: convert config files to generic cmdline (2018-11-16 07:32:26 -0800)
>>>
>>> ----------------------------------------------------------------
>>> Daniel Walker (3):
>>> add generic builtin command line
>>> powerpc: convert to generic builtin command line
>>> powerpc: convert config files to generic cmdline
>>>
>>> arch/powerpc/Kconfig | 23 +--------
>>> arch/powerpc/configs/44x/fsp2_defconfig | 29 ++++++-----
>>> arch/powerpc/configs/44x/iss476-smp_defconfig | 24 ++++-----
>>> arch/powerpc/configs/44x/warp_defconfig | 12 ++---
>>> arch/powerpc/configs/holly_defconfig | 12 ++---
>>> arch/powerpc/configs/mvme5100_defconfig | 25 +++++-----
>>> arch/powerpc/configs/skiroot_defconfig | 48 +++++++++---------
>>> arch/powerpc/configs/storcenter_defconfig | 15 +++---
>>
>> Also if you're updating defconfigs please don't include any unrelated
>> changes. Trimming the defconfigs can silently drop symbols and break
>> people's setups so needs to be done carefully.
>
>> It's safer to just sed the defconfig files directly, rather than running
>> savedefconfig on them.
>
> Ok.
>
> Daniel
>
^ permalink raw reply
* Re: [PATCH v2 4/6] powerpc: use common ptrace_syscall_enter hook to handle _TIF_SYSCALL_EMU
From: Oleg Nesterov @ 2019-03-19 17:32 UTC (permalink / raw)
To: Sudeep Holla
Cc: Haibo Xu, Steve Capper, Catalin Marinas, jdike, x86, Will Deacon,
linux-kernel, Bin Lu, Richard Weinberger, Ingo Molnar,
Paul Mackerras, Andy Lutomirski, Thomas Gleixner, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <20190319170804.GA11525@redhat.com>
On 03/19, Oleg Nesterov wrote:
>
> Well, personally I see no point... Again, after the trivial simplification
> x86 does
>
> if (work & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
> ret = tracehook_report_syscall_entry(regs);
> if (ret || (work & _TIF_SYSCALL_EMU))
> return -1L;
> }
>
> this looks simple enough for copy-and-paste.
>
> > If there's a better way to achieve the same
>
> I can only say that if we add a common helper, I think it should absorb
> tracehook_report_syscall_entry() and handle both TIF's just like the code
> above does. Not sure this makes any sense.
this won't work, looking at 6/6 I see that arm64 needs to distinguish
_TRACE and _EMU ... I don't understand this code, but it looks suspicious.
If tracehook_report_syscall_entry() returns nonzero the tracee was killed,
syscall_trace_enter() should just return.
To me this is another indication that consolidation makes no sense ;)
Oleg.
^ permalink raw reply
* Re: [PATCH v2 4/6] powerpc: use common ptrace_syscall_enter hook to handle _TIF_SYSCALL_EMU
From: Oleg Nesterov @ 2019-03-19 17:08 UTC (permalink / raw)
To: Sudeep Holla
Cc: Haibo Xu, Steve Capper, Catalin Marinas, jdike, x86, Will Deacon,
linux-kernel, Bin Lu, Richard Weinberger, Ingo Molnar,
Paul Mackerras, Andy Lutomirski, Thomas Gleixner, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <20190318174028.GE18196@e107155-lin>
On 03/18, Sudeep Holla wrote:
>
> On Mon, Mar 18, 2019 at 06:33:41PM +0100, Oleg Nesterov wrote:
> > On 03/18, Sudeep Holla wrote:
> > >
> > > On Mon, Mar 18, 2019 at 06:20:24PM +0100, Oleg Nesterov wrote:
> > > >
> > > > Again, to me this patch just makes the code look worse. Honestly, I don't
> > > > think that the new (badly named) ptrace_syscall_enter() hook makes any sense.
> > > >
> > >
> > > Worse because we end up reading current_thread_info->flags twice ?
> >
> > Mostly because in my opinion ptrace_syscall_enter() buys nothing but makes
> > the caller's code less readable/understandable.
> >
> > Sure, this is subjective.
> >
>
> Based on what we have in that function today, I tend to agree. Will and
> Richard were in the opinion to consolidate SYSEMU handling
Well, personally I see no point... Again, after the trivial simplification
x86 does
if (work & (_TIF_SYSCALL_EMU | _TIF_SYSCALL_TRACE)) {
ret = tracehook_report_syscall_entry(regs);
if (ret || (work & _TIF_SYSCALL_EMU))
return -1L;
}
this looks simple enough for copy-and-paste.
> If there's a better way to achieve the same
I can only say that if we add a common helper, I think it should absorb
tracehook_report_syscall_entry() and handle both TIF's just like the code
above does. Not sure this makes any sense.
Oleg.
^ permalink raw reply
* Re: [PATCH kernel RFC 2/2] vfio-pci-nvlink2: Implement interconnect isolation
From: Alex Williamson @ 2019-03-19 16:36 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Jose Ricardo Ziviani, Daniel Henrique Barboza, kvm-ppc,
Piotr Jaroszynski, Leonardo Augusto Guimarães Garcia,
linuxppc-dev, David Gibson
In-Reply-To: <20190315081835.14083-3-aik@ozlabs.ru>
On Fri, 15 Mar 2019 19:18:35 +1100
Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> The NVIDIA V100 SXM2 GPUs are connected to the CPU via PCIe links and
> (on POWER9) NVLinks. In addition to that, GPUs themselves have direct
> peer to peer NVLinks in groups of 2 to 4 GPUs. At the moment the POWERNV
> platform puts all interconnected GPUs to the same IOMMU group.
>
> However the user may want to pass individual GPUs to the userspace so
> in order to do so we need to put them into separate IOMMU groups and
> cut off the interconnects.
>
> Thankfully V100 GPUs implement an interface to do by programming link
> disabling mask to BAR0 of a GPU. Once a link is disabled in a GPU using
> this interface, it cannot be re-enabled until the secondary bus reset is
> issued to the GPU.
>
> This defines a reset_done() handler for V100 NVlink2 device which
> determines what links need to be disabled. This relies on presence
> of the new "ibm,nvlink-peers" device tree property of a GPU telling which
> PCI peers it is connected to (which includes NVLink bridges or peer GPUs).
>
> This does not change the existing behaviour and instead adds
> a new "isolate_nvlink" kernel parameter to allow such isolation.
>
> The alternative approaches would be:
>
> 1. do this in the system firmware (skiboot) but for that we would need
> to tell skiboot via an additional OPAL call whether or not we want this
> isolation - skiboot is unaware of IOMMU groups.
>
> 2. do this in the secondary bus reset handler in the POWERNV platform -
> the problem with that is at that point the device is not enabled, i.e.
> config space is not restored so we need to enable the device (i.e. MMIO
> bit in CMD register + program valid address to BAR0) in order to disable
> links and then perhaps undo all this initialization to bring the device
> back to the state where pci_try_reset_function() expects it to be.
The trouble seems to be that this approach only maintains the isolation
exposed by the IOMMU group when vfio-pci is the active driver for the
device. IOMMU groups can be used by any driver and the IOMMU core is
incorporating groups in various ways. So, if there's a device specific
way to configure the isolation reported in the group, which requires
some sort of active management against things like secondary bus
resets, then I think we need to manage it above the attached endpoint
driver. Ideally I'd see this as a set of PCI quirks so that we might
leverage it beyond POWER platforms. I'm not sure how we get past the
reliance on device tree properties that we won't have on other
platforms though, if only NVIDIA could at least open a spec addressing
the discovery and configuration of NVLink registers on their
devices :-\ Thanks,
Alex
^ permalink raw reply
* Re: [PATCH v3 06/17] KVM: PPC: Book3S HV: XIVE: add controls for the EQ configuration
From: Cédric Le Goater @ 2019-03-19 15:47 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev, Paul Mackerras, kvm, kvm-ppc
In-Reply-To: <20190319045455.GB31018@umbus.fritz.box>
On 3/19/19 5:54 AM, David Gibson wrote:
> On Mon, Mar 18, 2019 at 03:12:10PM +0100, Cédric Le Goater wrote:
>> On 3/18/19 4:23 AM, David Gibson wrote:
>>> On Fri, Mar 15, 2019 at 01:05:58PM +0100, Cédric Le Goater wrote:
>>>> These controls will be used by the H_INT_SET_QUEUE_CONFIG and
>>>> H_INT_GET_QUEUE_CONFIG hcalls from QEMU to configure the underlying
>>>> Event Queue in the XIVE IC. They will also be used to restore the
>>>> configuration of the XIVE EQs and to capture the internal run-time
>>>> state of the EQs. Both 'get' and 'set' rely on an OPAL call to access
>>>> the EQ toggle bit and EQ index which are updated by the XIVE IC when
>>>> event notifications are enqueued in the EQ.
>>>>
>>>> The value of the guest physical address of the event queue is saved in
>>>> the XIVE internal xive_q structure for later use. That is when
>>>> migration needs to mark the EQ pages dirty to capture a consistent
>>>> memory state of the VM.
>>>>
>>>> To be noted that H_INT_SET_QUEUE_CONFIG does not require the extra
>>>> OPAL call setting the EQ toggle bit and EQ index to configure the EQ,
>>>> but restoring the EQ state will.
>>>>
>>>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>>>> ---
>>>>
>>>> Changes since v2 :
>>>>
>>>> - fixed comments on the KVM device attribute definitions
>>>> - fixed check on supported EQ size to restrict to 64K pages
>>>> - checked kvm_eq.flags that need to be zero
>>>> - removed the OPAL call when EQ qtoggle bit and index are zero.
>>>>
>>>> arch/powerpc/include/asm/xive.h | 2 +
>>>> arch/powerpc/include/uapi/asm/kvm.h | 21 ++
>>>> arch/powerpc/kvm/book3s_xive.h | 2 +
>>>> arch/powerpc/kvm/book3s_xive.c | 15 +-
>>>> arch/powerpc/kvm/book3s_xive_native.c | 232 +++++++++++++++++++++
>>>> Documentation/virtual/kvm/devices/xive.txt | 31 +++
>>>> 6 files changed, 297 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h
>>>> index b579a943407b..46891f321606 100644
>>>> --- a/arch/powerpc/include/asm/xive.h
>>>> +++ b/arch/powerpc/include/asm/xive.h
>>>> @@ -73,6 +73,8 @@ struct xive_q {
>>>> u32 esc_irq;
>>>> atomic_t count;
>>>> atomic_t pending_count;
>>>> + u64 guest_qpage;
>>>> + u32 guest_qsize;
>>>> };
>>>>
>>>> /* Global enable flags for the XIVE support */
>>>> diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h
>>>> index 12bb01baf0ae..1cd728c87d7c 100644
>>>> --- a/arch/powerpc/include/uapi/asm/kvm.h
>>>> +++ b/arch/powerpc/include/uapi/asm/kvm.h
>>>> @@ -679,6 +679,7 @@ struct kvm_ppc_cpu_char {
>>>> #define KVM_DEV_XIVE_GRP_CTRL 1
>>>> #define KVM_DEV_XIVE_GRP_SOURCE 2 /* 64-bit source identifier */
>>>> #define KVM_DEV_XIVE_GRP_SOURCE_CONFIG 3 /* 64-bit source identifier */
>>>> +#define KVM_DEV_XIVE_GRP_EQ_CONFIG 4 /* 64-bit EQ identifier */
>>>>
>>>> /* Layout of 64-bit XIVE source attribute values */
>>>> #define KVM_XIVE_LEVEL_SENSITIVE (1ULL << 0)
>>>> @@ -694,4 +695,24 @@ struct kvm_ppc_cpu_char {
>>>> #define KVM_XIVE_SOURCE_EISN_SHIFT 33
>>>> #define KVM_XIVE_SOURCE_EISN_MASK 0xfffffffe00000000ULL
>>>>
>>>> +/* Layout of 64-bit EQ identifier */
>>>> +#define KVM_XIVE_EQ_PRIORITY_SHIFT 0
>>>> +#define KVM_XIVE_EQ_PRIORITY_MASK 0x7
>>>> +#define KVM_XIVE_EQ_SERVER_SHIFT 3
>>>> +#define KVM_XIVE_EQ_SERVER_MASK 0xfffffff8ULL
>>>> +
>>>> +/* Layout of EQ configuration values (64 bytes) */
>>>> +struct kvm_ppc_xive_eq {
>>>> + __u32 flags;
>>>> + __u32 qsize;
>>>> + __u64 qpage;
>>>> + __u32 qtoggle;
>>>> + __u32 qindex;
>>>> + __u8 pad[40];
>>>> +};
>>>> +
>>>> +#define KVM_XIVE_EQ_FLAG_ENABLED 0x00000001
>>>> +#define KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY 0x00000002
>>>> +#define KVM_XIVE_EQ_FLAG_ESCALATE 0x00000004
>>>> +
>>>> #endif /* __LINUX_KVM_POWERPC_H */
>>>> diff --git a/arch/powerpc/kvm/book3s_xive.h b/arch/powerpc/kvm/book3s_xive.h
>>>> index ae26fe653d98..622f594d93e1 100644
>>>> --- a/arch/powerpc/kvm/book3s_xive.h
>>>> +++ b/arch/powerpc/kvm/book3s_xive.h
>>>> @@ -272,6 +272,8 @@ struct kvmppc_xive_src_block *kvmppc_xive_create_src_block(
>>>> struct kvmppc_xive *xive, int irq);
>>>> void kvmppc_xive_free_sources(struct kvmppc_xive_src_block *sb);
>>>> int kvmppc_xive_select_target(struct kvm *kvm, u32 *server, u8 prio);
>>>> +int kvmppc_xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio,
>>>> + bool single_escalation);
>>>>
>>>> #endif /* CONFIG_KVM_XICS */
>>>> #endif /* _KVM_PPC_BOOK3S_XICS_H */
>>>> diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
>>>> index e09f3addffe5..c1b7aa7dbc28 100644
>>>> --- a/arch/powerpc/kvm/book3s_xive.c
>>>> +++ b/arch/powerpc/kvm/book3s_xive.c
>>>> @@ -166,7 +166,8 @@ static irqreturn_t xive_esc_irq(int irq, void *data)
>>>> return IRQ_HANDLED;
>>>> }
>>>>
>>>> -static int xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio)
>>>> +int kvmppc_xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio,
>>>> + bool single_escalation)
>>>> {
>>>> struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
>>>> struct xive_q *q = &xc->queues[prio];
>>>> @@ -185,7 +186,7 @@ static int xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio)
>>>> return -EIO;
>>>> }
>>>>
>>>> - if (xc->xive->single_escalation)
>>>> + if (single_escalation)
>>>> name = kasprintf(GFP_KERNEL, "kvm-%d-%d",
>>>> vcpu->kvm->arch.lpid, xc->server_num);
>>>> else
>>>> @@ -217,7 +218,7 @@ static int xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio)
>>>> * interrupt, thus leaving it effectively masked after
>>>> * it fires once.
>>>> */
>>>> - if (xc->xive->single_escalation) {
>>>> + if (single_escalation) {
>>>> struct irq_data *d = irq_get_irq_data(xc->esc_virq[prio]);
>>>> struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
>>>>
>>>> @@ -291,7 +292,8 @@ static int xive_check_provisioning(struct kvm *kvm, u8 prio)
>>>> continue;
>>>> rc = xive_provision_queue(vcpu, prio);
>>>> if (rc == 0 && !xive->single_escalation)
>>>> - xive_attach_escalation(vcpu, prio);
>>>> + kvmppc_xive_attach_escalation(vcpu, prio,
>>>> + xive->single_escalation);
>>>> if (rc)
>>>> return rc;
>>>> }
>>>> @@ -1214,7 +1216,8 @@ int kvmppc_xive_connect_vcpu(struct kvm_device *dev,
>>>> if (xive->qmap & (1 << i)) {
>>>> r = xive_provision_queue(vcpu, i);
>>>> if (r == 0 && !xive->single_escalation)
>>>> - xive_attach_escalation(vcpu, i);
>>>> + kvmppc_xive_attach_escalation(
>>>> + vcpu, i, xive->single_escalation);
>>>> if (r)
>>>> goto bail;
>>>> } else {
>>>> @@ -1229,7 +1232,7 @@ int kvmppc_xive_connect_vcpu(struct kvm_device *dev,
>>>> }
>>>>
>>>> /* If not done above, attach priority 0 escalation */
>>>> - r = xive_attach_escalation(vcpu, 0);
>>>> + r = kvmppc_xive_attach_escalation(vcpu, 0, xive->single_escalation);
>>>> if (r)
>>>> goto bail;
>>>>
>>>> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
>>>> index b841d339f674..42e824658a30 100644
>>>> --- a/arch/powerpc/kvm/book3s_xive_native.c
>>>> +++ b/arch/powerpc/kvm/book3s_xive_native.c
>>>> @@ -340,6 +340,226 @@ static int kvmppc_xive_native_set_source_config(struct kvmppc_xive *xive,
>>>> priority, masked, eisn);
>>>> }
>>>>
>>>> +static int xive_native_validate_queue_size(u32 qsize)
>>>> +{
>>>> + /*
>>>> + * We only support 64K pages for the moment. This is also
>>>> + * advertised in the DT property "ibm,xive-eq-sizes"
>>>
>>> IIUC, that won't work properly if you had a guest using 4kiB pages.
>>
>>> That's fine, but do we have somewhere that checks for that case and
>>> throws a suitable error?
>>
>> Not in the device.
>>
>> So, we should check the current page_size of the guest ? Is there a way
>> to do that simply from KVM ?
>
> Not really. But I think I know where to make the necessary test, see
> comment below..
>
>>>> + */
>>>> + switch (qsize) {
>>>> + case 0: /* EQ reset */
>>>> + case 16:
>>>> + return 0;
>>>> + case 12:
>>>> + case 21:
>>>> + case 24:
>>>> + default:
>>>> + return -EINVAL;
>>>> + }
>>>> +}
>>>> +
>>>> +static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
>>>> + long eq_idx, u64 addr)
>>>> +{
>>>> + struct kvm *kvm = xive->kvm;
>>>> + struct kvm_vcpu *vcpu;
>>>> + struct kvmppc_xive_vcpu *xc;
>>>> + void __user *ubufp = (u64 __user *) addr;
>>>
>>> Nit: that should be (void __user *) on the right, shouldn't it?
>>
>> yes.
>>
>>>
>>>> + u32 server;
>>>> + u8 priority;
>>>> + struct kvm_ppc_xive_eq kvm_eq;
>>>> + int rc;
>>>> + __be32 *qaddr = 0;
>>>> + struct page *page;
>>>> + struct xive_q *q;
>>>> +
>>>> + /*
>>>> + * Demangle priority/server tuple from the EQ identifier
>>>> + */
>>>> + priority = (eq_idx & KVM_XIVE_EQ_PRIORITY_MASK) >>
>>>> + KVM_XIVE_EQ_PRIORITY_SHIFT;
>>>> + server = (eq_idx & KVM_XIVE_EQ_SERVER_MASK) >>
>>>> + KVM_XIVE_EQ_SERVER_SHIFT;
>>>> +
>>>> + if (copy_from_user(&kvm_eq, ubufp, sizeof(kvm_eq)))
>>>> + return -EFAULT;
>>>> +
>>>> + vcpu = kvmppc_xive_find_server(kvm, server);
>>>> + if (!vcpu) {
>>>> + pr_err("Can't find server %d\n", server);
>>>> + return -ENOENT;
>>>> + }
>>>> + xc = vcpu->arch.xive_vcpu;
>>>> +
>>>> + if (priority != xive_prio_from_guest(priority)) {
>>>> + pr_err("Trying to restore invalid queue %d for VCPU %d\n",
>>>> + priority, server);
>>>> + return -EINVAL;
>>>> + }
>>>> + q = &xc->queues[priority];
>>>> +
>>>> + pr_devel("%s VCPU %d priority %d fl:%x sz:%d addr:%llx g:%d idx:%d\n",
>>>> + __func__, server, priority, kvm_eq.flags,
>>>> + kvm_eq.qsize, kvm_eq.qpage, kvm_eq.qtoggle, kvm_eq.qindex);
>>>> +
>>>> + /*
>>>> + * We can not tune the EQ configuration from user space. All
>>>> + * is done in OPAL.
>>>> + */
>>>> + if (kvm_eq.flags != 0) {
>>>> + pr_err("invalid flags %d\n", kvm_eq.flags);
>>>> + return -EINVAL;
>>>> + }
>>>> +
>>>> + rc = xive_native_validate_queue_size(kvm_eq.qsize);
>>>> + if (rc) {
>>>> + pr_err("invalid queue size %d\n", kvm_eq.qsize);
>>>> + return rc;
>>>> + }
>>>> +
>>>> + /* reset queue and disable queueing */
>>>> + if (!kvm_eq.qsize) {
>>>> + q->guest_qpage = 0;
>>>> + q->guest_qsize = 0;
>>>> +
>>>> + rc = xive_native_configure_queue(xc->vp_id, q, priority,
>>>> + NULL, 0, true);
>>>> + if (rc) {
>>>> + pr_err("Failed to reset queue %d for VCPU %d: %d\n",
>>>> + priority, xc->server_num, rc);
>>>> + return rc;
>>>> + }
>>>> +
>>>> + if (q->qpage) {
>>>> + put_page(virt_to_page(q->qpage));
>>>> + q->qpage = NULL;
>>>> + }
>>>> +
>>>> + return 0;
>>>> + }
>>>> +
>>>> +
>>>> + page = gfn_to_page(kvm, gpa_to_gfn(kvm_eq.qpage));
>>>> + if (is_error_page(page)) {
>>>> + pr_warn("Couldn't get guest page for %llx!\n", kvm_eq.qpage);
>>>> + return -EINVAL;
>>>> + }
>>>
>>> Yeah.. for the case of a 4kiB page host (these days weird, but not
>>> actually prohibited, AFAIK) you need to check that the qsize selected
>>> actually fits within the page.
>>
>> Ah yes. sure.
>
> I think the pagesize test belongs here. Rather than thinking about
> the pagesize of the guest overall, you can check that this specific
> page (possibly compound) is large enough to take the requested queue
> size.
OK. It think kvm_host_page_size() is what we need. It returns the page
size of the underlying VMA of the memblock holding the gfn. So I am going
to add :
+ page_size = kvm_host_page_size(kvm, gfn);
+ if (1ull << kvm_eq.qshift > page_size) {
+ pr_warn("Incompatible host page size %lx!\n", page_size);
+ return -EINVAL;
+ }
+
Also I am renaming 'qsize' in 'qshift' and renaming 'qpage' to 'qaddr'.
> That should be enough to protect the host - it ensures that userspace
> owns a suitable contiguous chunk of memory for the XIVE to write the
> queue into.
>
> It's possible there are weirder edge cases with a large page that's
> not fully mapped into the guest - if necessary we can add tests for
> that on the qemu side.
>
> Oh.. it occurs to me that we might need to pin the queue page to make
> sure it doesn't get swapped out or page-migrated while the XIVE holds
> a pointer to it
That is what gfn_to_page() ends up doing by calling hva_to_pfn().
>>>> + qaddr = page_to_virt(page) + (kvm_eq.qpage & ~PAGE_MASK);
>>>> +
>>>> + /* Backup queue page guest address for migration */
>>>
>>> Hm.. KVM itself shouldn't generally need to know about migration.
>>> IIUC these values won't change from what qemu set them to be, so it
>>> should be able to store and migrate them without have to get them back
>>> from the kernel.
>>
>> Euh. You are completely right. I don't know why I kept those around.
>>>> + q->guest_qpage = kvm_eq.qpage;
>>>> + q->guest_qsize = kvm_eq.qsize;
>>>> +
>>>> + rc = xive_native_configure_queue(xc->vp_id, q, priority,
>>>> + (__be32 *) qaddr, kvm_eq.qsize, true);
>>>> + if (rc) {
>>>> + pr_err("Failed to configure queue %d for VCPU %d: %d\n",
>>>> + priority, xc->server_num, rc);
>>>> + put_page(page);
>>>> + return rc;
>>>> + }
>>>> +
>>>> + /*
>>>> + * Only restore the queue state when needed. When doing the
>>>> + * H_INT_SET_SOURCE_CONFIG hcall, it should not.
>>>> + */
>>>> + if (kvm_eq.qtoggle != 0 || kvm_eq.qindex != 0) {
>>>> + rc = xive_native_set_queue_state(xc->vp_id, priority,
>>>> + kvm_eq.qtoggle,
>>>> + kvm_eq.qindex);
>>>> + if (rc)
>>>> + goto error;
>>>> + }
>>>> +
>>>> + rc = kvmppc_xive_attach_escalation(vcpu, priority,
>>>> + xive->single_escalation);
>>>> +error:
>>>> + if (rc)
>>>> + kvmppc_xive_native_cleanup_queue(vcpu, priority);
>>>> + return rc;
>>>> +}
>>>> +
>>>> +static int kvmppc_xive_native_get_queue_config(struct kvmppc_xive *xive,
>>>> + long eq_idx, u64 addr)
>>>> +{
>>>> + struct kvm *kvm = xive->kvm;
>>>> + struct kvm_vcpu *vcpu;
>>>> + struct kvmppc_xive_vcpu *xc;
>>>> + struct xive_q *q;
>>>> + void __user *ubufp = (u64 __user *) addr;
>>>> + u32 server;
>>>> + u8 priority;
>>>> + struct kvm_ppc_xive_eq kvm_eq;
>>>> + u64 qpage;
>>>> + u64 qsize;
>>>> + u64 qeoi_page;
>>>> + u32 escalate_irq;
>>>> + u64 qflags;
>>>> + int rc;
>>>> +
>>>> + /*
>>>> + * Demangle priority/server tuple from the EQ identifier
>>>> + */
>>>> + priority = (eq_idx & KVM_XIVE_EQ_PRIORITY_MASK) >>
>>>> + KVM_XIVE_EQ_PRIORITY_SHIFT;
>>>> + server = (eq_idx & KVM_XIVE_EQ_SERVER_MASK) >>
>>>> + KVM_XIVE_EQ_SERVER_SHIFT;
>>>> +
>>>> + vcpu = kvmppc_xive_find_server(kvm, server);
>>>> + if (!vcpu) {
>>>> + pr_err("Can't find server %d\n", server);
>>>> + return -ENOENT;
>>>> + }
>>>> + xc = vcpu->arch.xive_vcpu;
>>>> +
>>>> + if (priority != xive_prio_from_guest(priority)) {
>>>> + pr_err("invalid priority for queue %d for VCPU %d\n",
>>>> + priority, server);
>>>> + return -EINVAL;
>>>> + }
>>>> + q = &xc->queues[priority];
>>>> +
>>>> + memset(&kvm_eq, 0, sizeof(kvm_eq));
>>>> +
>>>> + if (!q->qpage)
>>>> + return 0;
>>>> +
>>>> + rc = xive_native_get_queue_info(xc->vp_id, priority, &qpage, &qsize,
>>>> + &qeoi_page, &escalate_irq, &qflags);
>>>> + if (rc)
>>>> + return rc;
>>>> +
>>>> + /*
>>>> + * Return some information on the EQ configuration in
>>>> + * OPAL. This is purely informative for now as we can't really
>>>> + * tune the EQ configuration from user space.
>>>> + */
>>>> + kvm_eq.flags = 0;
>>>> + if (qflags & OPAL_XIVE_EQ_ENABLED)
>>>> + kvm_eq.flags |= KVM_XIVE_EQ_FLAG_ENABLED;
>>>> + if (qflags & OPAL_XIVE_EQ_ALWAYS_NOTIFY)
>>>> + kvm_eq.flags |= KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY;
>>>> + if (qflags & OPAL_XIVE_EQ_ESCALATE)
>>>> + kvm_eq.flags |= KVM_XIVE_EQ_FLAG_ESCALATE;
>>>
>>> If there's not really anything it can do about it, does it make sense
>>> to even expose this info to userspace?
>>
>> Hmm, good question.
>>
>> - KVM_XIVE_EQ_FLAG_ENABLED
>> may be uselessly obvious.
>
> What's it controlled by?
OPAL only. It's equivalent to the VALID bit in the XIVE END structure.
We can drop this one.
>
>> - KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY
>> means we do not use the END ESBs to coalesce the events at the END
>> level. This flag is reflected by the XIVE_EQ_ALWAYS_NOTIFY option
>> in the sPAPR specs. We don't support the END ESBs but we might one
>> day.
>
> Since the guest isn't currently permitted to set this, it should never
> be set here either, no?
The OS does not support the END ESBs so this flag is always set in the
Linux XIVE driver. END ESBs are supported in the emulated device but not
in KVM/OPAL.
>
>> - KVM_XIVE_EQ_FLAG_ESCALATE
>> means the EQ is an escalation. QEMU doesn't really care for now
>> but it's an important information I think.
>
> Likewise this one, yes?
That is an hypervisor information on the nature of the EQ, so it is
for QEMU and not the guest. I am not sure it is important today as
we don't support escalation in QEMU. May be drop ?
>> I tried not to add too many of the END flags, only the relevant ones which
>> could have an impact in the future modeling.
>>
>> I think KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY is important. I was setting it from
>> QEMU in the hcall but as OPAL does the same blindly I removed it in
>> v3.
>
> So, I might have misinterpreted this a bit the first time around. Am
> I correct in thinking that these bits all correspond to defined
> options in the PAPR hcall
Yes for KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY which is the only flag defined
in sPAPR.
> - but that for now we don't allow guests to
> set them (because we haven't implemented support so far).
It's a bit more complex.
KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY is a "required" flag as the OS does not
support END ESBs. END ESBs are not supported in KVM/OPAL but they are
in the QEMU device.
I think it would be good for consistency to set KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY
when calling kvmppc_xive_native_get_queue_config() from QEMU, as I did
in v2. But as OPAL forces the same behavior without any flag, it is not
really needed at the KVM level ...
Please tell me.
C.
>>
>>>> + kvm_eq.qsize = q->guest_qsize;
>>>> + kvm_eq.qpage = q->guest_qpage;
>>>
>>>> + rc = xive_native_get_queue_state(xc->vp_id, priority, &kvm_eq.qtoggle,
>>>> + &kvm_eq.qindex);
>>>> + if (rc)
>>>> + return rc;
>>>> +
>>>> + pr_devel("%s VCPU %d priority %d fl:%x sz:%d addr:%llx g:%d idx:%d\n",
>>>> + __func__, server, priority, kvm_eq.flags,
>>>> + kvm_eq.qsize, kvm_eq.qpage, kvm_eq.qtoggle, kvm_eq.qindex);
>>>> +
>>>> + if (copy_to_user(ubufp, &kvm_eq, sizeof(kvm_eq)))
>>>> + return -EFAULT;
>>>> +
>>>> + return 0;
>>>> +}
>>>> +
>>>> static int kvmppc_xive_native_set_attr(struct kvm_device *dev,
>>>> struct kvm_device_attr *attr)
>>>> {
>>>> @@ -354,6 +574,9 @@ static int kvmppc_xive_native_set_attr(struct kvm_device *dev,
>>>> case KVM_DEV_XIVE_GRP_SOURCE_CONFIG:
>>>> return kvmppc_xive_native_set_source_config(xive, attr->attr,
>>>> attr->addr);
>>>> + case KVM_DEV_XIVE_GRP_EQ_CONFIG:
>>>> + return kvmppc_xive_native_set_queue_config(xive, attr->attr,
>>>> + attr->addr);
>>>> }
>>>> return -ENXIO;
>>>> }
>>>> @@ -361,6 +584,13 @@ static int kvmppc_xive_native_set_attr(struct kvm_device *dev,
>>>> static int kvmppc_xive_native_get_attr(struct kvm_device *dev,
>>>> struct kvm_device_attr *attr)
>>>> {
>>>> + struct kvmppc_xive *xive = dev->private;
>>>> +
>>>> + switch (attr->group) {
>>>> + case KVM_DEV_XIVE_GRP_EQ_CONFIG:
>>>> + return kvmppc_xive_native_get_queue_config(xive, attr->attr,
>>>> + attr->addr);
>>>> + }
>>>> return -ENXIO;
>>>> }
>>>>
>>>> @@ -376,6 +606,8 @@ static int kvmppc_xive_native_has_attr(struct kvm_device *dev,
>>>> attr->attr < KVMPPC_XIVE_NR_IRQS)
>>>> return 0;
>>>> break;
>>>> + case KVM_DEV_XIVE_GRP_EQ_CONFIG:
>>>> + return 0;
>>>> }
>>>> return -ENXIO;
>>>> }
>>>> diff --git a/Documentation/virtual/kvm/devices/xive.txt b/Documentation/virtual/kvm/devices/xive.txt
>>>> index 33c64b2cdbe8..a4de64f6e79c 100644
>>>> --- a/Documentation/virtual/kvm/devices/xive.txt
>>>> +++ b/Documentation/virtual/kvm/devices/xive.txt
>>>> @@ -53,3 +53,34 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
>>>> -ENXIO: CPU event queues not configured or configuration of the
>>>> underlying HW interrupt failed
>>>> -EBUSY: No CPU available to serve interrupt
>>>> +
>>>> + 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
>>>> + Configures an event queue of a CPU
>>>> + Attributes:
>>>> + EQ descriptor identifier (64-bit)
>>>> + The EQ descriptor identifier is a tuple (server, priority) :
>>>> + bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
>>>> + values: | unused | server | priority
>>>> + The kvm_device_attr.addr points to :
>>>> + struct kvm_ppc_xive_eq {
>>>> + __u32 flags;
>>>> + __u32 qsize;
>>>> + __u64 qpage;
>>>> + __u32 qtoggle;
>>>> + __u32 qindex;
>>>> + __u8 pad[40];
>>>> + };
>>>> + - flags: queue flags
>>>> + - qsize: queue size (power of 2)
>>>> + - qpage: real address of queue
>>>> + - qtoggle: current queue toggle bit
>>>> + - qindex: current queue index
>>>> + - pad: reserved for future use
>>>> + Errors:
>>>> + -ENOENT: Invalid CPU number
>>>> + -EINVAL: Invalid priority
>>>> + -EINVAL: Invalid flags
>>>> + -EINVAL: Invalid queue size
>>>> + -EINVAL: Invalid queue address
>>>> + -EFAULT: Invalid user pointer for attr->addr.
>>>> + -EIO: Configuration of the underlying HW failed
>>>
>>
>
^ permalink raw reply
* Re: [PULL REQUEST] powerpc generic command line
From: Daniel Walker @ 2019-03-19 15:38 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Andrew Morton, Paul Mackerras, linuxppc-dev
In-Reply-To: <878sxb7jck.fsf@concordia.ellerman.id.au>
On Tue, Mar 19, 2019 at 12:18:03PM +1100, Michael Ellerman wrote:
> Hi Daniel,
>
> Daniel Walker <danielwa@cisco.com> writes:
> > Here are the generic command line changes for powerpc.
> >
> > These changes have been in linux-next for two cycles, with few problems reported.
> > It's also been used at Cisco Systems, Inc. in production products for many many
> > years with no problems.
> >
> > Please pull these changes.
>
> Sorry I didn't reply to this earlier, have been busy with merge window
> bugs and so on.
>
> As I imagine you noticed, I didn't pull this. There are a few reasons.
>
> Firstly you sent it a bit late, about a day before the 5.0 release, and
> at 6am Saturday my time :) In future if you want me to merge something
> please send a pull at least the ~Wednesday before the release.
Ok .. It was Friday morning my time.
> Secondly I had no idea this code was even in linux-next. I'm not sure if
> I was Cc'ed at some point when you added it, if so sorry I missed it,
> but I get lots of email. If you're going to add changes to arch/powerpc
> in your next tree I'd appreciate some notice, or preferably an explicit
> ack.
Can I have an ack now ? Since your looking at it. Do you think this has no use,
certainly Cisco has use for it. It's still in linux-next as of now.
> The main reason I didn't merge it is that it's adding a bunch of code
> outside of arch/powerpc, into files which I'm not the maintainer for,
> and the patches doing so have no acks or reviews from anyone.
With the exception of the Kconfig the header file is brand new, so I'm not sure
who would ack that. From a maintainer perspective I think you could add new
files without issues from other maintainers.
> It's also adding a generic implementation with no indication that any
> other arches are willing/able to use the generic implementation, which
> begs the question whether it will actually used.
It would have been used by powerpc ;) I've gotten feedback in the past from
Ralf Baechle who thought this was useful, however that was years ago when
this was first submitted and the code around this area in mips has changed and
it would require a fair amount of new work to function properly on mips.
Also , no other platforms need to use this. Powerpc could be the only user of
it. This isn't really a question of a new exciting implementation of
something. This is really simple, it's just consolidation across architectures.
The implementation is vanilla, non-exciting stuff.
> I appreciate it's hard to get these sort of cross architecture changes
> into mainline, but I don't think this is the way to do it.
>
> I'd suggest you post a patch series to linux-arch with the generic
> changes and as many architecture conversions as you can manage, then get
> some review/acks for the generic changes and chase arch maintainers for
> some acks.
I didn't post to linux-arch , but the code has been around for years, submitted
multiple times with more architectures than powerpc. It was scaled down to just
powerpc to simplify it's submission.
It's really a simple set of changes, I don't think it needs as much thought as
other cross architecture changes.
> I realise you have posted the series before, it may require some
> persistence. There were also quite a few comments from Christophe, so
> replying to those would be a good place to start.
I've looked at his comments, but I think he was more worried about conflicts with
his debugging enablement, not something to stop a pull request.
> > The following changes since commit ccda4af0f4b92f7b4c308d3acc262f4a7e3affad:
> >
> > Linux 4.20-rc2 (2018-11-11 17:12:31 -0600)
> >
> > are available in the git repository at:
> >
> > https://github.com/daniel-walker/cisco-linux.git for-powerpc
> >
> > for you to fetch changes up to 5d4514a9c291ecf19b0626695161673d35e5d549:
> >
> > powerpc: convert config files to generic cmdline (2018-11-16 07:32:26 -0800)
> >
> > ----------------------------------------------------------------
> > Daniel Walker (3):
> > add generic builtin command line
> > powerpc: convert to generic builtin command line
> > powerpc: convert config files to generic cmdline
> >
> > arch/powerpc/Kconfig | 23 +--------
> > arch/powerpc/configs/44x/fsp2_defconfig | 29 ++++++-----
> > arch/powerpc/configs/44x/iss476-smp_defconfig | 24 ++++-----
> > arch/powerpc/configs/44x/warp_defconfig | 12 ++---
> > arch/powerpc/configs/holly_defconfig | 12 ++---
> > arch/powerpc/configs/mvme5100_defconfig | 25 +++++-----
> > arch/powerpc/configs/skiroot_defconfig | 48 +++++++++---------
> > arch/powerpc/configs/storcenter_defconfig | 15 +++---
>
> Also if you're updating defconfigs please don't include any unrelated
> changes. Trimming the defconfigs can silently drop symbols and break
> people's setups so needs to be done carefully.
> It's safer to just sed the defconfig files directly, rather than running
> savedefconfig on them.
Ok.
Daniel
^ permalink raw reply
* Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default
From: Dan Williams @ 2019-03-19 15:36 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Jan Kara, linux-nvdimm, Aneesh Kumar K.V,
Linux Kernel Mailing List, Linux MM, Oliver, Ross Zwisler,
Andrew Morton, Michal Suchánek, linuxppc-dev,
Kirill A . Shutemov
In-Reply-To: <20190319084439.eya2pisiirattuil@kshutemo-mobl1>
On Tue, Mar 19, 2019 at 1:45 AM Kirill A. Shutemov <kirill@shutemov.name> wrote:
>
> On Wed, Mar 13, 2019 at 09:07:13AM -0700, Dan Williams wrote:
> > On Wed, Mar 6, 2019 at 4:46 AM Aneesh Kumar K.V
> > <aneesh.kumar@linux.ibm.com> wrote:
> > >
> > > On 3/6/19 5:14 PM, Michal Suchánek wrote:
> > > > On Wed, 06 Mar 2019 14:47:33 +0530
> > > > "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> > > >
> > > >> Dan Williams <dan.j.williams@intel.com> writes:
> > > >>
> > > >>> On Thu, Feb 28, 2019 at 1:40 AM Oliver <oohall@gmail.com> wrote:
> > > >>>>
> > > >>>> On Thu, Feb 28, 2019 at 7:35 PM Aneesh Kumar K.V
> > > >>>> <aneesh.kumar@linux.ibm.com> wrote:
> > > >
> > > >> Also even if the user decided to not use THP, by
> > > >> echo "never" > transparent_hugepage/enabled , we should continue to map
> > > >> dax fault using huge page on platforms that can support huge pages.
> > > >
> > > > Is this a good idea?
> > > >
> > > > This knob is there for a reason. In some situations having huge pages
> > > > can severely impact performance of the system (due to host-guest
> > > > interaction or whatever) and the ability to really turn off all THP
> > > > would be important in those cases, right?
> > > >
> > >
> > > My understanding was that is not true for dax pages? These are not
> > > regular memory that got allocated. They are allocated out of /dev/dax/
> > > or /dev/pmem*. Do we have a reason not to use hugepages for mapping
> > > pages in that case?
> >
> > The problem with the transparent_hugepage/enabled interface is that it
> > conflates performing compaction work to produce THP-pages with the
> > ability to map huge pages at all.
>
> That's not [entirely] true. transparent_hugepage/defrag gates heavy-duty
> compaction. We do only very limited compaction if it's not advised by
> transparent_hugepage/defrag.
>
> I believe DAX has to respect transparent_hugepage/enabled. Or not
> advertise its huge pages as THP. It's confusing for user.
What does "advertise its huge pages as THP" mean in practice? I think
it's confusing that DAX, a facility that bypasses System RAM, is
affected by a transparent_hugepage flag which is a feature for
combining System RAM pages into larger pages. For the same reason that
transparent_hugepage does not gate / control hugetlb operation is the
same reason that transparent_hugepage should not gate / control DAX. A
global setting to disable opportunistic large page mappings of
System-RAM makes sense, but I don't see why that should read on DAX?
^ permalink raw reply
* [PATCH -next] rtc: opal: Make opal_tpo_alarm_irq_enable static
From: Yue Haibing @ 2019-03-19 15:25 UTC (permalink / raw)
To: benh, paulus, mpe, a.zummo, alexandre.belloni
Cc: linux-rtc, YueHaibing, linuxppc-dev, linux-kernel
From: YueHaibing <yuehaibing@huawei.com>
Fix sparse warning:
drivers/rtc/rtc-opal.c:227:5:
warning: symbol 'opal_tpo_alarm_irq_enable' was not declared. Should it be static?
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/rtc/rtc-opal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c
index 60f2250..3dd9d26 100644
--- a/drivers/rtc/rtc-opal.c
+++ b/drivers/rtc/rtc-opal.c
@@ -224,7 +224,7 @@ static int opal_set_tpo_time(struct device *dev, struct rtc_wkalrm *alarm)
return rc;
}
-int opal_tpo_alarm_irq_enable(struct device *dev, unsigned int enabled)
+static int opal_tpo_alarm_irq_enable(struct device *dev, unsigned int enabled)
{
struct rtc_wkalrm alarm = { .enabled = 0 };
--
2.7.4
^ permalink raw reply related
* [PATCH net-next] ibmveth: Make array ibmveth_stats static
From: Yue Haibing @ 2019-03-19 14:42 UTC (permalink / raw)
To: benh, paulus, mpe, tlfalcon, davem
Cc: netdev, YueHaibing, linuxppc-dev, linux-kernel
From: YueHaibing <yuehaibing@huawei.com>
Fix sparse warning:
drivers/net/ethernet/ibm/ibmveth.c:96:21:
warning: symbol 'ibmveth_stats' was not declared. Should it be static?
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/net/ethernet/ibm/ibmveth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index dd71d5d..d86b0e5 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -93,7 +93,7 @@ struct ibmveth_stat {
#define IBMVETH_STAT_OFF(stat) offsetof(struct ibmveth_adapter, stat)
#define IBMVETH_GET_STAT(a, off) *((u64 *)(((unsigned long)(a)) + off))
-struct ibmveth_stat ibmveth_stats[] = {
+static struct ibmveth_stat ibmveth_stats[] = {
{ "replenish_task_cycles", IBMVETH_STAT_OFF(replenish_task_cycles) },
{ "replenish_no_mem", IBMVETH_STAT_OFF(replenish_no_mem) },
{ "replenish_add_buff_failure",
--
2.7.4
^ permalink raw reply related
* Re: [PATCH v2] kmemleak: skip scanning holes in the .bss section
From: Catalin Marinas @ 2019-03-19 11:57 UTC (permalink / raw)
To: Qian Cai; +Cc: linux-kernel, kvm-ppc, linux-mm, akpm, linuxppc-dev
In-Reply-To: <20190313145717.46369-1-cai@lca.pw>
Hi Qian,
On Wed, Mar 13, 2019 at 10:57:17AM -0400, Qian Cai wrote:
> @@ -1531,7 +1547,14 @@ static void kmemleak_scan(void)
>
> /* data/bss scanning */
> scan_large_block(_sdata, _edata);
> - scan_large_block(__bss_start, __bss_stop);
> +
> + if (bss_hole_start) {
> + scan_large_block(__bss_start, bss_hole_start);
> + scan_large_block(bss_hole_stop, __bss_stop);
> + } else {
> + scan_large_block(__bss_start, __bss_stop);
> + }
> +
> scan_large_block(__start_ro_after_init, __end_ro_after_init);
I'm not a fan of this approach but I couldn't come up with anything
better. I was hoping we could check for PageReserved() in scan_block()
but on arm64 it ends up not scanning the .bss at all.
Until another user appears, I'm ok with this patch.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
^ permalink raw reply
* Re: Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds
From: Cédric Le Goater @ 2019-03-19 10:21 UTC (permalink / raw)
To: Christophe Leroy, Mark Cave-Ayland, linuxppc-dev; +Cc: paulus
In-Reply-To: <a02885b8-e865-bbbf-90b8-9db6e279d760@c-s.fr>
On 3/19/19 9:45 AM, Christophe Leroy wrote:
> Hi,
>
> Le 19/03/2019 à 08:10, Mark Cave-Ayland a écrit :
>> Hi all,
>>
>> Whilst building the latest git master on my G4 I noticed the following shift overflow
>> warnings in the build log for arch/powerpc/boot/addnote.c:
>
> I guess the problem must have been there for some time. I get the exact same on 4.14.106
>
> When reverting 284b52c4c6e3 ("powerpc/boot: Add 64bit and little endian support to addnote"), the warnings disappear.
Ouh. This is from the little-endian days. I suppose we are missing a u64
cast somewhere ? The L suffix seems wrong also.
C.
> Christophe
>
>
>>
>>
>> arch/powerpc/boot/addnote.c: In function ‘main’:
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>>
>>
>>
>> CURRENT HEAD 2019-03-19:
>>
>> HOSTCC arch/powerpc/boot/addnote
>> arch/powerpc/boot/addnote.c: In function ‘main’:
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_OFFSET, ns);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
>> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~
>> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
>> buf[(off) + 1] = (v) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
>> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
>> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
>> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
>> [-Wshift-count-overflow]
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~
>> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
>> buf[(off) + 1] = ((v) >> 8) & 0xff)
>> ^
>> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
>> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
>> PUT_64LE(off, v))
>> ^~~~~~~~
>> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
>> PUT_64(ph + PH_FILESZ, nnote2);
>> ^~~~~~
>> HOSTCC arch/powerpc/boot/hack-coff
>>
>>
>>
>> ATB,
>>
>> Mark.
>>
^ permalink raw reply
* Re: [RESEND PATCH v2] powerpc: mute unused-but-set-variable warnings
From: Qian Cai @ 2019-03-19 10:21 UTC (permalink / raw)
To: Christophe Leroy, mpe, benh, paulus; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <1ffdc5ae-2d5f-6c81-3997-0e6c81c67516@c-s.fr>
On 3/19/19 5:21 AM, Christophe Leroy wrote:
> Is there a reason for resending ? AFAICS, both are identical and still marked
> new in patchwork:
> https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=76055
>
"RESEND" because of no maintainer response for more than one week.
> Indeed, the resend has an issue in the commit log and fails the checkpatch (a ::
> in Reviewed-by::)
Yes, my bad for a copy-and-paste error.
^ permalink raw reply
* Re: [RESEND PATCH v2] powerpc: mute unused-but-set-variable warnings
From: Christophe Leroy @ 2019-03-19 9:21 UTC (permalink / raw)
To: Qian Cai, mpe, benh, paulus; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20190317220516.92654-1-cai@lca.pw>
Is there a reason for resending ? AFAICS, both are identical and still
marked new in patchwork:
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=76055
Indeed, the resend has an issue in the commit log and fails the
checkpatch (a :: in Reviewed-by::)
Christophe
Le 17/03/2019 à 23:05, Qian Cai a écrit :
> pte_unmap() compiles away on some powerpc platforms, so silence the
> warnings below by making it a static inline function.
>
> mm/memory.c: In function 'copy_pte_range':
> mm/memory.c:820:24: warning: variable 'orig_dst_pte' set but not used
> [-Wunused-but-set-variable]
> mm/memory.c:820:9: warning: variable 'orig_src_pte' set but not used
> [-Wunused-but-set-variable]
> mm/madvise.c: In function 'madvise_free_pte_range':
> mm/madvise.c:318:9: warning: variable 'orig_pte' set but not used
> [-Wunused-but-set-variable]
> mm/swap_state.c: In function 'swap_ra_info':
> mm/swap_state.c:634:15: warning: variable 'orig_pte' set but not used
> [-Wunused-but-set-variable]
>
> Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Reviewed-by:: Christophe Leroy <christophe.leroy@c-s.fr>
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>
> v2: make it a static inline function.
>
> arch/powerpc/include/asm/book3s/64/pgtable.h | 3 ++-
> arch/powerpc/include/asm/nohash/64/pgtable.h | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index 868fcaf56f6b..d798e33a0c86 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -1006,7 +1006,8 @@ extern struct page *pgd_page(pgd_t pgd);
> (((pte_t *) pmd_page_vaddr(*(dir))) + pte_index(addr))
>
> #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
> -#define pte_unmap(pte) do { } while(0)
> +
> +static inline void pte_unmap(pte_t *pte) { }
>
> /* to find an entry in a kernel page-table-directory */
> /* This now only contains the vmalloc pages */
> diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h
> index e77ed9761632..0384a3302fb6 100644
> --- a/arch/powerpc/include/asm/nohash/64/pgtable.h
> +++ b/arch/powerpc/include/asm/nohash/64/pgtable.h
> @@ -205,7 +205,8 @@ static inline void pgd_set(pgd_t *pgdp, unsigned long val)
> (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
>
> #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr))
> -#define pte_unmap(pte) do { } while(0)
> +
> +static inline void pte_unmap(pte_t *pte) { }
>
> /* to find an entry in a kernel page-table-directory */
> /* This now only contains the vmalloc pages */
>
^ permalink raw reply
* Re: [PATCH v3] powerpc/mm: move warning from resize_hpt_for_hotplug()
From: Laurent Vivier @ 2019-03-19 9:08 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, linux-kernel, David Gibson
In-Reply-To: <20190313102528.4632-1-lvivier@redhat.com>
Hi Michael,
as it seems good now, could you pick up this patch for merging?
Thanks,
Laurent
On 13/03/2019 11:25, Laurent Vivier wrote:
> resize_hpt_for_hotplug() reports a warning when it cannot
> resize the hash page table ("Unable to resize hash page
> table to target order") but in some cases it's not a problem
> and can make user thinks something has not worked properly.
>
> This patch moves the warning to arch_remove_memory() to
> only report the problem when it is needed.
>
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>
> Notes:
> v3: move "||" to above line and remove parenthesis
> v2: add warning messages for H_PARAMETER and H_RESOURCE
>
> arch/powerpc/include/asm/sparsemem.h | 4 ++--
> arch/powerpc/mm/hash_utils_64.c | 19 +++++++------------
> arch/powerpc/mm/mem.c | 3 ++-
> arch/powerpc/platforms/pseries/lpar.c | 3 ++-
> 4 files changed, 13 insertions(+), 16 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/sparsemem.h b/arch/powerpc/include/asm/sparsemem.h
> index 68da49320592..3192d454a733 100644
> --- a/arch/powerpc/include/asm/sparsemem.h
> +++ b/arch/powerpc/include/asm/sparsemem.h
> @@ -17,9 +17,9 @@ extern int create_section_mapping(unsigned long start, unsigned long end, int ni
> extern int remove_section_mapping(unsigned long start, unsigned long end);
>
> #ifdef CONFIG_PPC_BOOK3S_64
> -extern void resize_hpt_for_hotplug(unsigned long new_mem_size);
> +extern int resize_hpt_for_hotplug(unsigned long new_mem_size);
> #else
> -static inline void resize_hpt_for_hotplug(unsigned long new_mem_size) { }
> +static inline int resize_hpt_for_hotplug(unsigned long new_mem_size) { return 0; }
> #endif
>
> #ifdef CONFIG_NUMA
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index 0cc7fbc3bd1c..5aa7594ee71b 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -755,12 +755,12 @@ static unsigned long __init htab_get_table_size(void)
> }
>
> #ifdef CONFIG_MEMORY_HOTPLUG
> -void resize_hpt_for_hotplug(unsigned long new_mem_size)
> +int resize_hpt_for_hotplug(unsigned long new_mem_size)
> {
> unsigned target_hpt_shift;
>
> if (!mmu_hash_ops.resize_hpt)
> - return;
> + return 0;
>
> target_hpt_shift = htab_shift_for_mem_size(new_mem_size);
>
> @@ -772,16 +772,11 @@ void resize_hpt_for_hotplug(unsigned long new_mem_size)
> * reduce unless the target shift is at least 2 below the
> * current shift
> */
> - if ((target_hpt_shift > ppc64_pft_size)
> - || (target_hpt_shift < (ppc64_pft_size - 1))) {
> - int rc;
> -
> - rc = mmu_hash_ops.resize_hpt(target_hpt_shift);
> - if (rc && (rc != -ENODEV))
> - printk(KERN_WARNING
> - "Unable to resize hash page table to target order %d: %d\n",
> - target_hpt_shift, rc);
> - }
> + if (target_hpt_shift > ppc64_pft_size ||
> + target_hpt_shift < ppc64_pft_size - 1)
> + return mmu_hash_ops.resize_hpt(target_hpt_shift);
> +
> + return 0;
> }
>
> int hash__create_section_mapping(unsigned long start, unsigned long end, int nid)
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 33cc6f676fa6..0d40d970cf4a 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -169,7 +169,8 @@ int __meminit arch_remove_memory(int nid, u64 start, u64 size,
> */
> vm_unmap_aliases();
>
> - resize_hpt_for_hotplug(memblock_phys_mem_size());
> + if (resize_hpt_for_hotplug(memblock_phys_mem_size()) == -ENOSPC)
> + pr_warn("Hash collision while resizing HPT\n");
>
> return ret;
> }
> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
> index f2a9f0adc2d3..1034ef1fe2b4 100644
> --- a/arch/powerpc/platforms/pseries/lpar.c
> +++ b/arch/powerpc/platforms/pseries/lpar.c
> @@ -901,8 +901,10 @@ static int pseries_lpar_resize_hpt(unsigned long shift)
> break;
>
> case H_PARAMETER:
> + pr_warn("Invalid argument from H_RESIZE_HPT_PREPARE\n");
> return -EINVAL;
> case H_RESOURCE:
> + pr_warn("Operation not permitted from H_RESIZE_HPT_PREPARE\n");
> return -EPERM;
> default:
> pr_warn("Unexpected error %d from H_RESIZE_HPT_PREPARE\n", rc);
> @@ -918,7 +920,6 @@ static int pseries_lpar_resize_hpt(unsigned long shift)
> if (rc != 0) {
> switch (state.commit_rc) {
> case H_PTEG_FULL:
> - pr_warn("Hash collision while resizing HPT\n");
> return -ENOSPC;
>
> default:
>
^ permalink raw reply
* Re: Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds
From: Christophe Leroy @ 2019-03-19 8:45 UTC (permalink / raw)
To: Mark Cave-Ayland, linuxppc-dev, Cédric Le Goater; +Cc: paulus
In-Reply-To: <c6ba8992-a3f3-2c99-6d6d-7ee9d41a22c5@ilande.co.uk>
Hi,
Le 19/03/2019 à 08:10, Mark Cave-Ayland a écrit :
> Hi all,
>
> Whilst building the latest git master on my G4 I noticed the following shift overflow
> warnings in the build log for arch/powerpc/boot/addnote.c:
I guess the problem must have been there for some time. I get the exact
same on 4.14.106
When reverting 284b52c4c6e3 ("powerpc/boot: Add 64bit and little endian
support to addnote"), the warnings disappear.
Christophe
>
>
> arch/powerpc/boot/addnote.c: In function ‘main’:
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
>
>
>
> CURRENT HEAD 2019-03-19:
>
> HOSTCC arch/powerpc/boot/addnote
> arch/powerpc/boot/addnote.c: In function ‘main’:
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_OFFSET, ns);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
> #define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~
> arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
> buf[(off) + 1] = (v) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
> #define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
> #define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
> #define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
> [-Wshift-count-overflow]
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~
> arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
> buf[(off) + 1] = ((v) >> 8) & 0xff)
> ^
> arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
> #define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
> PUT_64LE(off, v))
> ^~~~~~~~
> arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
> PUT_64(ph + PH_FILESZ, nnote2);
> ^~~~~~
> HOSTCC arch/powerpc/boot/hack-coff
>
>
>
> ATB,
>
> Mark.
>
^ permalink raw reply
* Re: [PATCH 2/2] mm/dax: Don't enable huge dax mapping by default
From: Kirill A. Shutemov @ 2019-03-19 8:44 UTC (permalink / raw)
To: Dan Williams
Cc: Jan Kara, linux-nvdimm, Aneesh Kumar K.V,
Linux Kernel Mailing List, Linux MM, Oliver, Ross Zwisler,
Andrew Morton, Michal Suchánek, linuxppc-dev,
Kirill A . Shutemov
In-Reply-To: <CAPcyv4iLm09DSiF3niFprP3PTFrgB5pZPp9AysBpRa-m725tmw@mail.gmail.com>
On Wed, Mar 13, 2019 at 09:07:13AM -0700, Dan Williams wrote:
> On Wed, Mar 6, 2019 at 4:46 AM Aneesh Kumar K.V
> <aneesh.kumar@linux.ibm.com> wrote:
> >
> > On 3/6/19 5:14 PM, Michal Suchánek wrote:
> > > On Wed, 06 Mar 2019 14:47:33 +0530
> > > "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> wrote:
> > >
> > >> Dan Williams <dan.j.williams@intel.com> writes:
> > >>
> > >>> On Thu, Feb 28, 2019 at 1:40 AM Oliver <oohall@gmail.com> wrote:
> > >>>>
> > >>>> On Thu, Feb 28, 2019 at 7:35 PM Aneesh Kumar K.V
> > >>>> <aneesh.kumar@linux.ibm.com> wrote:
> > >
> > >> Also even if the user decided to not use THP, by
> > >> echo "never" > transparent_hugepage/enabled , we should continue to map
> > >> dax fault using huge page on platforms that can support huge pages.
> > >
> > > Is this a good idea?
> > >
> > > This knob is there for a reason. In some situations having huge pages
> > > can severely impact performance of the system (due to host-guest
> > > interaction or whatever) and the ability to really turn off all THP
> > > would be important in those cases, right?
> > >
> >
> > My understanding was that is not true for dax pages? These are not
> > regular memory that got allocated. They are allocated out of /dev/dax/
> > or /dev/pmem*. Do we have a reason not to use hugepages for mapping
> > pages in that case?
>
> The problem with the transparent_hugepage/enabled interface is that it
> conflates performing compaction work to produce THP-pages with the
> ability to map huge pages at all.
That's not [entirely] true. transparent_hugepage/defrag gates heavy-duty
compaction. We do only very limited compaction if it's not advised by
transparent_hugepage/defrag.
I believe DAX has to respect transparent_hugepage/enabled. Or not
advertise its huge pages as THP. It's confusing for user.
--
Kirill A. Shutemov
^ permalink raw reply
* Shift overflow warnings in arch/powerpc/boot/addnote.c on 32-bit builds
From: Mark Cave-Ayland @ 2019-03-19 7:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: paulus
Hi all,
Whilst building the latest git master on my G4 I noticed the following shift overflow
warnings in the build log for arch/powerpc/boot/addnote.c:
arch/powerpc/boot/addnote.c: In function ‘main’:
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
CURRENT HEAD 2019-03-19:
HOSTCC arch/powerpc/boot/addnote
arch/powerpc/boot/addnote.c: In function ‘main’:
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:183:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:188:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:206:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_OFFSET, ns);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:72:39: note: in definition of macro ‘PUT_16BE’
#define PUT_16BE(off, v)(buf[off] = ((v) >> 8) & 0xff, \
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:75:47: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~
arch/powerpc/boot/addnote.c:73:23: note: in definition of macro ‘PUT_16BE’
buf[(off) + 1] = (v) & 0xff)
^
arch/powerpc/boot/addnote.c:75:27: note: in expansion of macro ‘PUT_32BE’
#define PUT_64BE(off, v)((PUT_32BE((off), (v) >> 32L), \
^~~~~~~~
arch/powerpc/boot/addnote.c:94:50: note: in expansion of macro ‘PUT_64BE’
#define PUT_64(off, v) (e_data == ELFDATA2MSB ? PUT_64BE(off, v) : \
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:82:39: note: in definition of macro ‘PUT_16LE’
#define PUT_16LE(off, v) (buf[off] = (v) & 0xff, \
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
arch/powerpc/boot/addnote.c:85:73: warning: right shift count >= width of type
[-Wshift-count-overflow]
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~
arch/powerpc/boot/addnote.c:83:25: note: in definition of macro ‘PUT_16LE’
buf[(off) + 1] = ((v) >> 8) & 0xff)
^
arch/powerpc/boot/addnote.c:85:49: note: in expansion of macro ‘PUT_32LE’
#define PUT_64LE(off, v) (PUT_32LE((off), (v)), PUT_32LE((off) + 4, (v) >> 32L))
^~~~~~~~
arch/powerpc/boot/addnote.c:95:5: note: in expansion of macro ‘PUT_64LE’
PUT_64LE(off, v))
^~~~~~~~
arch/powerpc/boot/addnote.c:211:3: note: in expansion of macro ‘PUT_64’
PUT_64(ph + PH_FILESZ, nnote2);
^~~~~~
HOSTCC arch/powerpc/boot/hack-coff
ATB,
Mark.
^ permalink raw reply
* Re: [PATCH v3 14/17] KVM: PPC: Book3S HV: XIVE: add passthrough support
From: David Gibson @ 2019-03-19 5:22 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: linuxppc-dev, Paul Mackerras, kvm, kvm-ppc
In-Reply-To: <20190315120609.25910-15-clg@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 9677 bytes --]
On Fri, Mar 15, 2019 at 01:06:06PM +0100, Cédric Le Goater wrote:
> The KVM XICS-over-XIVE device and the proposed KVM XIVE native device
> implement an IRQ space for the guest using the generic IPI interrupts
> of the XIVE IC controller. These interrupts are allocated at the OPAL
> level and "mapped" into the guest IRQ number space in the range 0-0x1FFF.
> Interrupt management is performed in the XIVE way: using loads and
> stores on the addresses of the XIVE IPI interrupt ESB pages.
>
> Both KVM devices share the same internal structure caching information
> on the interrupts, among which the xive_irq_data struct containing the
> addresses of the IPI ESB pages and an extra one in case of pass-through.
> The later contains the addresses of the ESB pages of the underlying HW
> controller interrupts, PHB4 in all cases for now.
>
> A guest, when running in the XICS legacy interrupt mode, lets the KVM
> XICS-over-XIVE device "handle" interrupt management, that is to
> perform the loads and stores on the addresses of the ESB pages of the
> guest interrupts. However, when running in XIVE native exploitation
> mode, the KVM XIVE native device exposes the interrupt ESB pages to
> the guest and lets the guest perform directly the loads and stores.
>
> The VMA exposing the ESB pages make use of a custom VM fault handler
> which role is to populate the VMA with appropriate pages. When a fault
> occurs, the guest IRQ number is deduced from the offset, and the ESB
> pages of associated XIVE IPI interrupt are inserted in the VMA (using
> the internal structure caching information on the interrupts).
>
> Supporting device passthrough in the guest running in XIVE native
> exploitation mode adds some extra refinements because the ESB pages
> of a different HW controller (PHB4) need to be exposed to the guest
> along with the initial IPI ESB pages of the XIVE IC controller. But
> the overall mechanic is the same.
>
> When the device HW irqs are mapped into or unmapped from the guest
> IRQ number space, the passthru_irq helpers, kvmppc_xive_set_mapped()
> and kvmppc_xive_clr_mapped(), are called to record or clear the
> passthrough interrupt information and to perform the switch.
>
> The approach taken by this patch is to clear the ESB pages of the
> guest IRQ number being mapped and let the VM fault handler repopulate.
> The handler will insert the ESB page corresponding to the HW interrupt
> of the device being passed-through or the initial IPI ESB page if the
> device is being removed.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>
> Changes since v2 :
>
> - extra comment in documentation
>
> arch/powerpc/kvm/book3s_xive.h | 9 +++++
> arch/powerpc/kvm/book3s_xive.c | 15 ++++++++
> arch/powerpc/kvm/book3s_xive_native.c | 41 ++++++++++++++++++++++
> Documentation/virtual/kvm/devices/xive.txt | 19 ++++++++++
> 4 files changed, 84 insertions(+)
>
> diff --git a/arch/powerpc/kvm/book3s_xive.h b/arch/powerpc/kvm/book3s_xive.h
> index 622f594d93e1..e011622dc038 100644
> --- a/arch/powerpc/kvm/book3s_xive.h
> +++ b/arch/powerpc/kvm/book3s_xive.h
> @@ -94,6 +94,11 @@ struct kvmppc_xive_src_block {
> struct kvmppc_xive_irq_state irq_state[KVMPPC_XICS_IRQ_PER_ICS];
> };
>
> +struct kvmppc_xive;
> +
> +struct kvmppc_xive_ops {
> + int (*reset_mapped)(struct kvm *kvm, unsigned long guest_irq);
> +};
>
> struct kvmppc_xive {
> struct kvm *kvm;
> @@ -132,6 +137,10 @@ struct kvmppc_xive {
>
> /* Flags */
> u8 single_escalation;
> +
> + struct kvmppc_xive_ops *ops;
> + struct address_space *mapping;
> + struct mutex mapping_lock;
> };
>
> #define KVMPPC_XIVE_Q_COUNT 8
> diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
> index c1b7aa7dbc28..480a3fc6b9fd 100644
> --- a/arch/powerpc/kvm/book3s_xive.c
> +++ b/arch/powerpc/kvm/book3s_xive.c
> @@ -937,6 +937,13 @@ int kvmppc_xive_set_mapped(struct kvm *kvm, unsigned long guest_irq,
> /* Turn the IPI hard off */
> xive_vm_esb_load(&state->ipi_data, XIVE_ESB_SET_PQ_01);
>
> + /*
> + * Reset ESB guest mapping. Needed when ESB pages are exposed
> + * to the guest in XIVE native mode
> + */
> + if (xive->ops && xive->ops->reset_mapped)
> + xive->ops->reset_mapped(kvm, guest_irq);
> +
> /* Grab info about irq */
> state->pt_number = hw_irq;
> state->pt_data = irq_data_get_irq_handler_data(host_data);
> @@ -1022,6 +1029,14 @@ int kvmppc_xive_clr_mapped(struct kvm *kvm, unsigned long guest_irq,
> state->pt_number = 0;
> state->pt_data = NULL;
>
> + /*
> + * Reset ESB guest mapping. Needed when ESB pages are exposed
> + * to the guest in XIVE native mode
> + */
> + if (xive->ops && xive->ops->reset_mapped) {
> + xive->ops->reset_mapped(kvm, guest_irq);
> + }
> +
> /* Reconfigure the IPI */
> xive_native_configure_irq(state->ipi_number,
> kvmppc_xive_vp(xive, state->act_server),
> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> index e465d4c53f5c..67a1bb26a4cc 100644
> --- a/arch/powerpc/kvm/book3s_xive_native.c
> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> @@ -14,6 +14,7 @@
> #include <linux/delay.h>
> #include <linux/percpu.h>
> #include <linux/cpumask.h>
> +#include <linux/file.h>
> #include <asm/uaccess.h>
> #include <asm/kvm_book3s.h>
> #include <asm/kvm_ppc.h>
> @@ -170,6 +171,35 @@ int kvmppc_xive_native_connect_vcpu(struct kvm_device *dev,
> return rc;
> }
>
> +/*
> + * Device passthrough support
> + */
> +static int kvmppc_xive_native_reset_mapped(struct kvm *kvm, unsigned long irq)
> +{
> + struct kvmppc_xive *xive = kvm->arch.xive;
> +
> + if (irq >= KVMPPC_XIVE_NR_IRQS)
> + return -EINVAL;
> +
> + /*
> + * Clear the ESB pages of the IRQ number being mapped (or
> + * unmapped) into the guest and let the the VM fault handler
> + * repopulate with the appropriate ESB pages (device or IC)
> + */
> + pr_debug("clearing esb pages for girq 0x%lx\n", irq);
> + mutex_lock(&xive->mapping_lock);
> + if (xive->mapping)
> + unmap_mapping_range(xive->mapping,
> + irq * (2ull << PAGE_SHIFT),
> + 2ull << PAGE_SHIFT, 1);
> + mutex_unlock(&xive->mapping_lock);
> + return 0;
> +}
> +
> +static struct kvmppc_xive_ops kvmppc_xive_native_ops = {
> + .reset_mapped = kvmppc_xive_native_reset_mapped,
> +};
> +
> static int xive_native_esb_fault(struct vm_fault *vmf)
> {
> struct vm_area_struct *vma = vmf->vma;
> @@ -247,6 +277,8 @@ static const struct vm_operations_struct xive_native_tima_vmops = {
> static int kvmppc_xive_native_mmap(struct kvm_device *dev,
> struct vm_area_struct *vma)
> {
> + struct kvmppc_xive *xive = dev->private;
> +
> /* We only allow mappings at fixed offset for now */
> if (vma->vm_pgoff == KVM_XIVE_TIMA_PAGE_OFFSET) {
> if (vma_pages(vma) > 4)
> @@ -262,6 +294,13 @@ static int kvmppc_xive_native_mmap(struct kvm_device *dev,
>
> vma->vm_flags |= VM_IO | VM_PFNMAP;
> vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot);
> +
> + /*
> + * Grab the KVM device file address_space to be able to clear
> + * the ESB pages mapping when a device is passed-through into
> + * the guest.
> + */
> + xive->mapping = vma->vm_file->f_mapping;
> return 0;
> }
>
> @@ -959,6 +998,7 @@ static int kvmppc_xive_native_create(struct kvm_device *dev, u32 type)
> xive->dev = dev;
> xive->kvm = kvm;
> kvm->arch.xive = xive;
> + mutex_init(&xive->mapping_lock);
>
> /*
> * Allocate a bunch of VPs. KVM_MAX_VCPUS is a large value for
> @@ -972,6 +1012,7 @@ static int kvmppc_xive_native_create(struct kvm_device *dev, u32 type)
> ret = -ENXIO;
>
> xive->single_escalation = xive_native_has_single_escalation();
> + xive->ops = &kvmppc_xive_native_ops;
>
> if (ret)
> kfree(xive);
> diff --git a/Documentation/virtual/kvm/devices/xive.txt b/Documentation/virtual/kvm/devices/xive.txt
> index 686cca450f9f..9aa48efca1cb 100644
> --- a/Documentation/virtual/kvm/devices/xive.txt
> +++ b/Documentation/virtual/kvm/devices/xive.txt
> @@ -43,6 +43,25 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
> manage the source: to trigger, to EOI, to turn off the source for
> instance.
>
> + 3. Device pass-through
> +
> + When a device is passed-through into the guest, the source
> + interrupts are from a different HW controller (PHB4) and the ESB
> + pages exposed to the guest should accommadate this change.
> +
> + The passthru_irq helpers, kvmppc_xive_set_mapped() and
> + kvmppc_xive_clr_mapped() are called when the device HW irqs are
> + mapped into or unmapped from the guest IRQ number space. The KVM
> + device extends these helpers to clear the ESB pages of the guest IRQ
> + number being mapped and then lets the VM fault handler repopulate.
> + The handler will insert the ESB page corresponding to the HW
> + interrupt of the device being passed-through or the initial IPI ESB
> + page if the device has being removed.
> +
> + The ESB remapping is fully transparent to the guest and the OS
> + device driver. All handling is done within VFIO and the above
> + helpers in KVM-PPC.
> +
> * Groups:
>
> 1. KVM_DEV_XIVE_GRP_CTRL
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v3 06/17] KVM: PPC: Book3S HV: XIVE: add controls for the EQ configuration
From: David Gibson @ 2019-03-19 4:54 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: linuxppc-dev, Paul Mackerras, kvm, kvm-ppc
In-Reply-To: <8b3caeef-8750-b8db-d516-c722bc08c535@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 20680 bytes --]
On Mon, Mar 18, 2019 at 03:12:10PM +0100, Cédric Le Goater wrote:
> On 3/18/19 4:23 AM, David Gibson wrote:
> > On Fri, Mar 15, 2019 at 01:05:58PM +0100, Cédric Le Goater wrote:
> >> These controls will be used by the H_INT_SET_QUEUE_CONFIG and
> >> H_INT_GET_QUEUE_CONFIG hcalls from QEMU to configure the underlying
> >> Event Queue in the XIVE IC. They will also be used to restore the
> >> configuration of the XIVE EQs and to capture the internal run-time
> >> state of the EQs. Both 'get' and 'set' rely on an OPAL call to access
> >> the EQ toggle bit and EQ index which are updated by the XIVE IC when
> >> event notifications are enqueued in the EQ.
> >>
> >> The value of the guest physical address of the event queue is saved in
> >> the XIVE internal xive_q structure for later use. That is when
> >> migration needs to mark the EQ pages dirty to capture a consistent
> >> memory state of the VM.
> >>
> >> To be noted that H_INT_SET_QUEUE_CONFIG does not require the extra
> >> OPAL call setting the EQ toggle bit and EQ index to configure the EQ,
> >> but restoring the EQ state will.
> >>
> >> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> >> ---
> >>
> >> Changes since v2 :
> >>
> >> - fixed comments on the KVM device attribute definitions
> >> - fixed check on supported EQ size to restrict to 64K pages
> >> - checked kvm_eq.flags that need to be zero
> >> - removed the OPAL call when EQ qtoggle bit and index are zero.
> >>
> >> arch/powerpc/include/asm/xive.h | 2 +
> >> arch/powerpc/include/uapi/asm/kvm.h | 21 ++
> >> arch/powerpc/kvm/book3s_xive.h | 2 +
> >> arch/powerpc/kvm/book3s_xive.c | 15 +-
> >> arch/powerpc/kvm/book3s_xive_native.c | 232 +++++++++++++++++++++
> >> Documentation/virtual/kvm/devices/xive.txt | 31 +++
> >> 6 files changed, 297 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h
> >> index b579a943407b..46891f321606 100644
> >> --- a/arch/powerpc/include/asm/xive.h
> >> +++ b/arch/powerpc/include/asm/xive.h
> >> @@ -73,6 +73,8 @@ struct xive_q {
> >> u32 esc_irq;
> >> atomic_t count;
> >> atomic_t pending_count;
> >> + u64 guest_qpage;
> >> + u32 guest_qsize;
> >> };
> >>
> >> /* Global enable flags for the XIVE support */
> >> diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h
> >> index 12bb01baf0ae..1cd728c87d7c 100644
> >> --- a/arch/powerpc/include/uapi/asm/kvm.h
> >> +++ b/arch/powerpc/include/uapi/asm/kvm.h
> >> @@ -679,6 +679,7 @@ struct kvm_ppc_cpu_char {
> >> #define KVM_DEV_XIVE_GRP_CTRL 1
> >> #define KVM_DEV_XIVE_GRP_SOURCE 2 /* 64-bit source identifier */
> >> #define KVM_DEV_XIVE_GRP_SOURCE_CONFIG 3 /* 64-bit source identifier */
> >> +#define KVM_DEV_XIVE_GRP_EQ_CONFIG 4 /* 64-bit EQ identifier */
> >>
> >> /* Layout of 64-bit XIVE source attribute values */
> >> #define KVM_XIVE_LEVEL_SENSITIVE (1ULL << 0)
> >> @@ -694,4 +695,24 @@ struct kvm_ppc_cpu_char {
> >> #define KVM_XIVE_SOURCE_EISN_SHIFT 33
> >> #define KVM_XIVE_SOURCE_EISN_MASK 0xfffffffe00000000ULL
> >>
> >> +/* Layout of 64-bit EQ identifier */
> >> +#define KVM_XIVE_EQ_PRIORITY_SHIFT 0
> >> +#define KVM_XIVE_EQ_PRIORITY_MASK 0x7
> >> +#define KVM_XIVE_EQ_SERVER_SHIFT 3
> >> +#define KVM_XIVE_EQ_SERVER_MASK 0xfffffff8ULL
> >> +
> >> +/* Layout of EQ configuration values (64 bytes) */
> >> +struct kvm_ppc_xive_eq {
> >> + __u32 flags;
> >> + __u32 qsize;
> >> + __u64 qpage;
> >> + __u32 qtoggle;
> >> + __u32 qindex;
> >> + __u8 pad[40];
> >> +};
> >> +
> >> +#define KVM_XIVE_EQ_FLAG_ENABLED 0x00000001
> >> +#define KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY 0x00000002
> >> +#define KVM_XIVE_EQ_FLAG_ESCALATE 0x00000004
> >> +
> >> #endif /* __LINUX_KVM_POWERPC_H */
> >> diff --git a/arch/powerpc/kvm/book3s_xive.h b/arch/powerpc/kvm/book3s_xive.h
> >> index ae26fe653d98..622f594d93e1 100644
> >> --- a/arch/powerpc/kvm/book3s_xive.h
> >> +++ b/arch/powerpc/kvm/book3s_xive.h
> >> @@ -272,6 +272,8 @@ struct kvmppc_xive_src_block *kvmppc_xive_create_src_block(
> >> struct kvmppc_xive *xive, int irq);
> >> void kvmppc_xive_free_sources(struct kvmppc_xive_src_block *sb);
> >> int kvmppc_xive_select_target(struct kvm *kvm, u32 *server, u8 prio);
> >> +int kvmppc_xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio,
> >> + bool single_escalation);
> >>
> >> #endif /* CONFIG_KVM_XICS */
> >> #endif /* _KVM_PPC_BOOK3S_XICS_H */
> >> diff --git a/arch/powerpc/kvm/book3s_xive.c b/arch/powerpc/kvm/book3s_xive.c
> >> index e09f3addffe5..c1b7aa7dbc28 100644
> >> --- a/arch/powerpc/kvm/book3s_xive.c
> >> +++ b/arch/powerpc/kvm/book3s_xive.c
> >> @@ -166,7 +166,8 @@ static irqreturn_t xive_esc_irq(int irq, void *data)
> >> return IRQ_HANDLED;
> >> }
> >>
> >> -static int xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio)
> >> +int kvmppc_xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio,
> >> + bool single_escalation)
> >> {
> >> struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu;
> >> struct xive_q *q = &xc->queues[prio];
> >> @@ -185,7 +186,7 @@ static int xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio)
> >> return -EIO;
> >> }
> >>
> >> - if (xc->xive->single_escalation)
> >> + if (single_escalation)
> >> name = kasprintf(GFP_KERNEL, "kvm-%d-%d",
> >> vcpu->kvm->arch.lpid, xc->server_num);
> >> else
> >> @@ -217,7 +218,7 @@ static int xive_attach_escalation(struct kvm_vcpu *vcpu, u8 prio)
> >> * interrupt, thus leaving it effectively masked after
> >> * it fires once.
> >> */
> >> - if (xc->xive->single_escalation) {
> >> + if (single_escalation) {
> >> struct irq_data *d = irq_get_irq_data(xc->esc_virq[prio]);
> >> struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
> >>
> >> @@ -291,7 +292,8 @@ static int xive_check_provisioning(struct kvm *kvm, u8 prio)
> >> continue;
> >> rc = xive_provision_queue(vcpu, prio);
> >> if (rc == 0 && !xive->single_escalation)
> >> - xive_attach_escalation(vcpu, prio);
> >> + kvmppc_xive_attach_escalation(vcpu, prio,
> >> + xive->single_escalation);
> >> if (rc)
> >> return rc;
> >> }
> >> @@ -1214,7 +1216,8 @@ int kvmppc_xive_connect_vcpu(struct kvm_device *dev,
> >> if (xive->qmap & (1 << i)) {
> >> r = xive_provision_queue(vcpu, i);
> >> if (r == 0 && !xive->single_escalation)
> >> - xive_attach_escalation(vcpu, i);
> >> + kvmppc_xive_attach_escalation(
> >> + vcpu, i, xive->single_escalation);
> >> if (r)
> >> goto bail;
> >> } else {
> >> @@ -1229,7 +1232,7 @@ int kvmppc_xive_connect_vcpu(struct kvm_device *dev,
> >> }
> >>
> >> /* If not done above, attach priority 0 escalation */
> >> - r = xive_attach_escalation(vcpu, 0);
> >> + r = kvmppc_xive_attach_escalation(vcpu, 0, xive->single_escalation);
> >> if (r)
> >> goto bail;
> >>
> >> diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
> >> index b841d339f674..42e824658a30 100644
> >> --- a/arch/powerpc/kvm/book3s_xive_native.c
> >> +++ b/arch/powerpc/kvm/book3s_xive_native.c
> >> @@ -340,6 +340,226 @@ static int kvmppc_xive_native_set_source_config(struct kvmppc_xive *xive,
> >> priority, masked, eisn);
> >> }
> >>
> >> +static int xive_native_validate_queue_size(u32 qsize)
> >> +{
> >> + /*
> >> + * We only support 64K pages for the moment. This is also
> >> + * advertised in the DT property "ibm,xive-eq-sizes"
> >
> > IIUC, that won't work properly if you had a guest using 4kiB pages.
>
> > That's fine, but do we have somewhere that checks for that case and
> > throws a suitable error?
>
> Not in the device.
>
> So, we should check the current page_size of the guest ? Is there a way
> to do that simply from KVM ?
Not really. But I think I know where to make the necessary test, see
comment below..
> >> + */
> >> + switch (qsize) {
> >> + case 0: /* EQ reset */
> >> + case 16:
> >> + return 0;
> >> + case 12:
> >> + case 21:
> >> + case 24:
> >> + default:
> >> + return -EINVAL;
> >> + }
> >> +}
> >> +
> >> +static int kvmppc_xive_native_set_queue_config(struct kvmppc_xive *xive,
> >> + long eq_idx, u64 addr)
> >> +{
> >> + struct kvm *kvm = xive->kvm;
> >> + struct kvm_vcpu *vcpu;
> >> + struct kvmppc_xive_vcpu *xc;
> >> + void __user *ubufp = (u64 __user *) addr;
> >
> > Nit: that should be (void __user *) on the right, shouldn't it?
>
> yes.
>
> >
> >> + u32 server;
> >> + u8 priority;
> >> + struct kvm_ppc_xive_eq kvm_eq;
> >> + int rc;
> >> + __be32 *qaddr = 0;
> >> + struct page *page;
> >> + struct xive_q *q;
> >> +
> >> + /*
> >> + * Demangle priority/server tuple from the EQ identifier
> >> + */
> >> + priority = (eq_idx & KVM_XIVE_EQ_PRIORITY_MASK) >>
> >> + KVM_XIVE_EQ_PRIORITY_SHIFT;
> >> + server = (eq_idx & KVM_XIVE_EQ_SERVER_MASK) >>
> >> + KVM_XIVE_EQ_SERVER_SHIFT;
> >> +
> >> + if (copy_from_user(&kvm_eq, ubufp, sizeof(kvm_eq)))
> >> + return -EFAULT;
> >> +
> >> + vcpu = kvmppc_xive_find_server(kvm, server);
> >> + if (!vcpu) {
> >> + pr_err("Can't find server %d\n", server);
> >> + return -ENOENT;
> >> + }
> >> + xc = vcpu->arch.xive_vcpu;
> >> +
> >> + if (priority != xive_prio_from_guest(priority)) {
> >> + pr_err("Trying to restore invalid queue %d for VCPU %d\n",
> >> + priority, server);
> >> + return -EINVAL;
> >> + }
> >> + q = &xc->queues[priority];
> >> +
> >> + pr_devel("%s VCPU %d priority %d fl:%x sz:%d addr:%llx g:%d idx:%d\n",
> >> + __func__, server, priority, kvm_eq.flags,
> >> + kvm_eq.qsize, kvm_eq.qpage, kvm_eq.qtoggle, kvm_eq.qindex);
> >> +
> >> + /*
> >> + * We can not tune the EQ configuration from user space. All
> >> + * is done in OPAL.
> >> + */
> >> + if (kvm_eq.flags != 0) {
> >> + pr_err("invalid flags %d\n", kvm_eq.flags);
> >> + return -EINVAL;
> >> + }
> >> +
> >> + rc = xive_native_validate_queue_size(kvm_eq.qsize);
> >> + if (rc) {
> >> + pr_err("invalid queue size %d\n", kvm_eq.qsize);
> >> + return rc;
> >> + }
> >> +
> >> + /* reset queue and disable queueing */
> >> + if (!kvm_eq.qsize) {
> >> + q->guest_qpage = 0;
> >> + q->guest_qsize = 0;
> >> +
> >> + rc = xive_native_configure_queue(xc->vp_id, q, priority,
> >> + NULL, 0, true);
> >> + if (rc) {
> >> + pr_err("Failed to reset queue %d for VCPU %d: %d\n",
> >> + priority, xc->server_num, rc);
> >> + return rc;
> >> + }
> >> +
> >> + if (q->qpage) {
> >> + put_page(virt_to_page(q->qpage));
> >> + q->qpage = NULL;
> >> + }
> >> +
> >> + return 0;
> >> + }
> >> +
> >> +
> >> + page = gfn_to_page(kvm, gpa_to_gfn(kvm_eq.qpage));
> >> + if (is_error_page(page)) {
> >> + pr_warn("Couldn't get guest page for %llx!\n", kvm_eq.qpage);
> >> + return -EINVAL;
> >> + }
> >
> > Yeah.. for the case of a 4kiB page host (these days weird, but not
> > actually prohibited, AFAIK) you need to check that the qsize selected
> > actually fits within the page.
>
> Ah yes. sure.
I think the pagesize test belongs here. Rather than thinking about
the pagesize of the guest overall, you can check that this specific
page (possibly compound) is large enough to take the requested queue
size.
That should be enough to protect the host - it ensures that userspace
owns a suitable contiguous chunk of memory for the XIVE to write the
queue into.
It's possible there are weirder edge cases with a large page that's
not fully mapped into the guest - if necessary we can add tests for
that on the qemu side.
Oh.. it occurs to me that we might need to pin the queue page to make
sure it doesn't get swapped out or page-migrated while the XIVE holds
a pointer to it
> >> + qaddr = page_to_virt(page) + (kvm_eq.qpage & ~PAGE_MASK);
> >> +
> >> + /* Backup queue page guest address for migration */
> >
> > Hm.. KVM itself shouldn't generally need to know about migration.
> > IIUC these values won't change from what qemu set them to be, so it
> > should be able to store and migrate them without have to get them back
> > from the kernel.
>
> Euh. You are completely right. I don't know why I kept those around.
> >> + q->guest_qpage = kvm_eq.qpage;
> >> + q->guest_qsize = kvm_eq.qsize;
> >> +
> >> + rc = xive_native_configure_queue(xc->vp_id, q, priority,
> >> + (__be32 *) qaddr, kvm_eq.qsize, true);
> >> + if (rc) {
> >> + pr_err("Failed to configure queue %d for VCPU %d: %d\n",
> >> + priority, xc->server_num, rc);
> >> + put_page(page);
> >> + return rc;
> >> + }
> >> +
> >> + /*
> >> + * Only restore the queue state when needed. When doing the
> >> + * H_INT_SET_SOURCE_CONFIG hcall, it should not.
> >> + */
> >> + if (kvm_eq.qtoggle != 0 || kvm_eq.qindex != 0) {
> >> + rc = xive_native_set_queue_state(xc->vp_id, priority,
> >> + kvm_eq.qtoggle,
> >> + kvm_eq.qindex);
> >> + if (rc)
> >> + goto error;
> >> + }
> >> +
> >> + rc = kvmppc_xive_attach_escalation(vcpu, priority,
> >> + xive->single_escalation);
> >> +error:
> >> + if (rc)
> >> + kvmppc_xive_native_cleanup_queue(vcpu, priority);
> >> + return rc;
> >> +}
> >> +
> >> +static int kvmppc_xive_native_get_queue_config(struct kvmppc_xive *xive,
> >> + long eq_idx, u64 addr)
> >> +{
> >> + struct kvm *kvm = xive->kvm;
> >> + struct kvm_vcpu *vcpu;
> >> + struct kvmppc_xive_vcpu *xc;
> >> + struct xive_q *q;
> >> + void __user *ubufp = (u64 __user *) addr;
> >> + u32 server;
> >> + u8 priority;
> >> + struct kvm_ppc_xive_eq kvm_eq;
> >> + u64 qpage;
> >> + u64 qsize;
> >> + u64 qeoi_page;
> >> + u32 escalate_irq;
> >> + u64 qflags;
> >> + int rc;
> >> +
> >> + /*
> >> + * Demangle priority/server tuple from the EQ identifier
> >> + */
> >> + priority = (eq_idx & KVM_XIVE_EQ_PRIORITY_MASK) >>
> >> + KVM_XIVE_EQ_PRIORITY_SHIFT;
> >> + server = (eq_idx & KVM_XIVE_EQ_SERVER_MASK) >>
> >> + KVM_XIVE_EQ_SERVER_SHIFT;
> >> +
> >> + vcpu = kvmppc_xive_find_server(kvm, server);
> >> + if (!vcpu) {
> >> + pr_err("Can't find server %d\n", server);
> >> + return -ENOENT;
> >> + }
> >> + xc = vcpu->arch.xive_vcpu;
> >> +
> >> + if (priority != xive_prio_from_guest(priority)) {
> >> + pr_err("invalid priority for queue %d for VCPU %d\n",
> >> + priority, server);
> >> + return -EINVAL;
> >> + }
> >> + q = &xc->queues[priority];
> >> +
> >> + memset(&kvm_eq, 0, sizeof(kvm_eq));
> >> +
> >> + if (!q->qpage)
> >> + return 0;
> >> +
> >> + rc = xive_native_get_queue_info(xc->vp_id, priority, &qpage, &qsize,
> >> + &qeoi_page, &escalate_irq, &qflags);
> >> + if (rc)
> >> + return rc;
> >> +
> >> + /*
> >> + * Return some information on the EQ configuration in
> >> + * OPAL. This is purely informative for now as we can't really
> >> + * tune the EQ configuration from user space.
> >> + */
> >> + kvm_eq.flags = 0;
> >> + if (qflags & OPAL_XIVE_EQ_ENABLED)
> >> + kvm_eq.flags |= KVM_XIVE_EQ_FLAG_ENABLED;
> >> + if (qflags & OPAL_XIVE_EQ_ALWAYS_NOTIFY)
> >> + kvm_eq.flags |= KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY;
> >> + if (qflags & OPAL_XIVE_EQ_ESCALATE)
> >> + kvm_eq.flags |= KVM_XIVE_EQ_FLAG_ESCALATE;
> >
> > If there's not really anything it can do about it, does it make sense
> > to even expose this info to userspace?
>
> Hmm, good question.
>
> - KVM_XIVE_EQ_FLAG_ENABLED
> may be uselessly obvious.
What's it controlled by?
> - KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY
> means we do not use the END ESBs to coalesce the events at the END
> level. This flag is reflected by the XIVE_EQ_ALWAYS_NOTIFY option
> in the sPAPR specs. We don't support the END ESBs but we might one
> day.
Since the guest isn't currently permitted to set this, it should never
be set here either, no?
> - KVM_XIVE_EQ_FLAG_ESCALATE
> means the EQ is an escalation. QEMU doesn't really care for now
> but it's an important information I think.
Likewise this one, yes?
>
> I tried not to add too many of the END flags, only the relevant ones which
> could have an impact in the future modeling.
>
> I think KVM_XIVE_EQ_FLAG_ALWAYS_NOTIFY is important. I was setting it from
> QEMU in the hcall but as OPAL does the same blindly I removed it in
> v3.
So, I might have misinterpreted this a bit the first time around. Am
I correct in thinking that these bits all correspond to defined
options in the PAPR hcall - but that for now we don't allow guests to
set them (because we haven't implemented support so far).
>
> >> + kvm_eq.qsize = q->guest_qsize;
> >> + kvm_eq.qpage = q->guest_qpage;
> >
> >> + rc = xive_native_get_queue_state(xc->vp_id, priority, &kvm_eq.qtoggle,
> >> + &kvm_eq.qindex);
> >> + if (rc)
> >> + return rc;
> >> +
> >> + pr_devel("%s VCPU %d priority %d fl:%x sz:%d addr:%llx g:%d idx:%d\n",
> >> + __func__, server, priority, kvm_eq.flags,
> >> + kvm_eq.qsize, kvm_eq.qpage, kvm_eq.qtoggle, kvm_eq.qindex);
> >> +
> >> + if (copy_to_user(ubufp, &kvm_eq, sizeof(kvm_eq)))
> >> + return -EFAULT;
> >> +
> >> + return 0;
> >> +}
> >> +
> >> static int kvmppc_xive_native_set_attr(struct kvm_device *dev,
> >> struct kvm_device_attr *attr)
> >> {
> >> @@ -354,6 +574,9 @@ static int kvmppc_xive_native_set_attr(struct kvm_device *dev,
> >> case KVM_DEV_XIVE_GRP_SOURCE_CONFIG:
> >> return kvmppc_xive_native_set_source_config(xive, attr->attr,
> >> attr->addr);
> >> + case KVM_DEV_XIVE_GRP_EQ_CONFIG:
> >> + return kvmppc_xive_native_set_queue_config(xive, attr->attr,
> >> + attr->addr);
> >> }
> >> return -ENXIO;
> >> }
> >> @@ -361,6 +584,13 @@ static int kvmppc_xive_native_set_attr(struct kvm_device *dev,
> >> static int kvmppc_xive_native_get_attr(struct kvm_device *dev,
> >> struct kvm_device_attr *attr)
> >> {
> >> + struct kvmppc_xive *xive = dev->private;
> >> +
> >> + switch (attr->group) {
> >> + case KVM_DEV_XIVE_GRP_EQ_CONFIG:
> >> + return kvmppc_xive_native_get_queue_config(xive, attr->attr,
> >> + attr->addr);
> >> + }
> >> return -ENXIO;
> >> }
> >>
> >> @@ -376,6 +606,8 @@ static int kvmppc_xive_native_has_attr(struct kvm_device *dev,
> >> attr->attr < KVMPPC_XIVE_NR_IRQS)
> >> return 0;
> >> break;
> >> + case KVM_DEV_XIVE_GRP_EQ_CONFIG:
> >> + return 0;
> >> }
> >> return -ENXIO;
> >> }
> >> diff --git a/Documentation/virtual/kvm/devices/xive.txt b/Documentation/virtual/kvm/devices/xive.txt
> >> index 33c64b2cdbe8..a4de64f6e79c 100644
> >> --- a/Documentation/virtual/kvm/devices/xive.txt
> >> +++ b/Documentation/virtual/kvm/devices/xive.txt
> >> @@ -53,3 +53,34 @@ the legacy interrupt mode, referred as XICS (POWER7/8).
> >> -ENXIO: CPU event queues not configured or configuration of the
> >> underlying HW interrupt failed
> >> -EBUSY: No CPU available to serve interrupt
> >> +
> >> + 4. KVM_DEV_XIVE_GRP_EQ_CONFIG (read-write)
> >> + Configures an event queue of a CPU
> >> + Attributes:
> >> + EQ descriptor identifier (64-bit)
> >> + The EQ descriptor identifier is a tuple (server, priority) :
> >> + bits: | 63 .... 32 | 31 .. 3 | 2 .. 0
> >> + values: | unused | server | priority
> >> + The kvm_device_attr.addr points to :
> >> + struct kvm_ppc_xive_eq {
> >> + __u32 flags;
> >> + __u32 qsize;
> >> + __u64 qpage;
> >> + __u32 qtoggle;
> >> + __u32 qindex;
> >> + __u8 pad[40];
> >> + };
> >> + - flags: queue flags
> >> + - qsize: queue size (power of 2)
> >> + - qpage: real address of queue
> >> + - qtoggle: current queue toggle bit
> >> + - qindex: current queue index
> >> + - pad: reserved for future use
> >> + Errors:
> >> + -ENOENT: Invalid CPU number
> >> + -EINVAL: Invalid priority
> >> + -EINVAL: Invalid flags
> >> + -EINVAL: Invalid queue size
> >> + -EINVAL: Invalid queue address
> >> + -EFAULT: Invalid user pointer for attr->addr.
> >> + -EIO: Configuration of the underlying HW failed
> >
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
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