lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 22 Oct 2018 10:13:48 -0700
From:   Dan Williams <dan.j.williams@...el.com>
To:     sebhtml@...eotron.qc.ca
Cc:     Steven Rostedt <rostedt@...dmis.org>, acme@...hat.com,
        tz.stoyanov@...il.com, Namhyung Kim <namhyung@...nel.org>,
        zwisler@...nel.org, arangradient@...il.com,
        linux-perf-users@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] pfn_t: force '~' to be parsed as an unary operator

[ added Andrew ]

Patch here: https://lore.kernel.org/patchwork/patch/1002234/

On Sun, Oct 21, 2018 at 8:00 AM Sebastien Boisvert
<sebhtml@...eotron.qc.ca> wrote:
>
> Tracing the event "fs_dax:dax_pmd_insert_mapping" with perf produces this
> warning:
>       [fs_dax:dax_pmd_insert_mapping] unknown op '~'
>
> It is printed in process_op (tools/lib/traceevent/event-parse.c) because '~'
> is parsed as a binary operator.
>
> perf reads the format of fs_dax:dax_pmd_insert_mapping ("print fmt") from
> /sys/kernel/debug/tracing/events/fs_dax/dax_pmd_insert_mapping/format .
>
> The format contains:
>
> ~(((u64) ~(~(((1UL) << 12)-1)))
>          ^
>          \ interpreted as a binary operator by process_op().
>
> This part is generated in the declaration of the event class
> dax_pmd_insert_mapping_class in include/trace/events/fs_dax.h :
>
>                 __print_flags_u64(__entry->pfn_val & PFN_FLAGS_MASK, "|",
>                         PFN_FLAGS_TRACE),
>
> This patch adds a pair of parentheses in the declaration of PFN_FLAGS_MASK to
> make sure that '~' is parsed as a unary operator by perf.
>
> The part of the format that was problematic is now:
>
> ~(((u64) (~(~(((1UL) << 12)-1))))
>
> Now, all the '~' are parsed as unary operators.
>
> Cc: Dan Williams <dan.j.williams@...el.com>


Acked-by: Dan Williams <dan.j.williams@...el.com>


> Cc: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
> Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
> Cc: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@...il.com>
> Cc: Namhyung Kim <namhyung@...nel.org>
> Cc: Ross Zwisler <zwisler@...nel.org>
> Cc: Elenie Godzaridis <arangradient@...il.com>
> Cc: linux-perf-users@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
> Signed-off-by: Sebastien Boisvert <sebhtml@...eotron.qc.ca>
> ---
>  include/linux/pfn_t.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/pfn_t.h b/include/linux/pfn_t.h
> index 21713dc14ce2..673546ba7342 100644
> --- a/include/linux/pfn_t.h
> +++ b/include/linux/pfn_t.h
> @@ -10,7 +10,7 @@
>   * PFN_DEV - pfn is not covered by system memmap by default
>   * PFN_MAP - pfn has a dynamic page mapping established by a device driver
>   */
> -#define PFN_FLAGS_MASK (((u64) ~PAGE_MASK) << (BITS_PER_LONG_LONG - PAGE_SHIFT))
> +#define PFN_FLAGS_MASK (((u64) (~PAGE_MASK)) << (BITS_PER_LONG_LONG - PAGE_SHIFT))
>  #define PFN_SG_CHAIN (1ULL << (BITS_PER_LONG_LONG - 1))
>  #define PFN_SG_LAST (1ULL << (BITS_PER_LONG_LONG - 2))
>  #define PFN_DEV (1ULL << (BITS_PER_LONG_LONG - 3))
> --
> 2.17.1
>

Powered by blists - more mailing lists