linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gen-insn-attr-x86.awk: Fix regexp warnings
@ 2019-09-21 11:37 Alexander Kapshuk
  2019-09-22  8:33 ` kbuild test robot
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kapshuk @ 2019-09-21 11:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, mingo, bp, hpa, x86, Alexander Kapshuk

This patch fixes the regexp warnings shown below:
  GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator

The ':' and '&' characters need not escaping when used in string constants
as part of regular expressions.

[Test-run]
awk -f /home/sasha/torvalds/arch/x86/tools/gen-insn-attr-x86.awk \
	/home/sasha/torvalds/arch/x86/lib/x86-opcode-map.txt >tmp/inat-tables.c

diff -U0 /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c \
tmp/inat-tables.c; echo $?
0

[Debugging output]
DBG:ext:(66&F2)
DBG:match(ext, ...):(66&F2)
DBG:match(..., lprefix3_expr):\((F2|!F3|66&F2)\)

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
---
 arch/x86/tools/gen-insn-attr-x86.awk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b2c14f..a42015b305f4 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {

 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4

@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }

-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index
--
2.23.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-21 11:37 [PATCH] gen-insn-attr-x86.awk: Fix regexp warnings Alexander Kapshuk
@ 2019-09-22  8:33 ` kbuild test robot
  2019-09-22 15:03   ` [PATCH RESEND] " Alexander Kapshuk
  0 siblings, 1 reply; 13+ messages in thread
From: kbuild test robot @ 2019-09-22  8:33 UTC (permalink / raw)
  To: Alexander Kapshuk
  Cc: kbuild-all, linux-kernel, tglx, mingo, bp, hpa, x86, Alexander Kapshuk

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

Hi Alexander,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3 next-20190920]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alexander-Kapshuk/gen-insn-attr-x86-awk-Fix-regexp-warnings/20190921-194307
config: x86_64-lkp (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 
:::::: branch date: 73 minutes ago
:::::: commit date: 73 minutes ago

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> Warning: Kernel ABI header at 'tools/arch/x86/tools/gen-insn-attr-x86.awk' differs from latest version at 'arch/x86/tools/gen-insn-attr-x86.awk'
   55 real  10 user  5 sys  29.61% cpu 	make prepare

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28715 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-22  8:33 ` kbuild test robot
@ 2019-09-22 15:03   ` Alexander Kapshuk
  2019-09-23  9:19     ` Borislav Petkov
  2019-09-23 10:31     ` Borislav Petkov
  0 siblings, 2 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2019-09-22 15:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: tglx, mingo, bp, hpa, x86, Alexander Kapshuk, kbuild test robot

This patch fixes the regexp warnings shown below:
GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator

The ':' and '&' characters need not escaping when used in string constants
as part of regular expressions.

[Test-run]
awk -f arch/x86/tools/gen-insn-attr-x86.awk \
	arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c

diff arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
0

awk -f tools/arch/x86/tools/gen-insn-attr-x86.awk \
	tools/arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c

diff tools/objtool/arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
0

[Debugging output]
DBG:ext:(66&F2)
DBG:match(ext, ...):(66&F2)
DBG:match(..., lprefix3_expr):\((F2|!F3|66&F2)\)

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
 arch/x86/tools/gen-insn-attr-x86.awk       | 4 ++--
 tools/arch/x86/tools/gen-insn-attr-x86.awk | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b2c14f..a42015b305f4 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {

 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4

@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }

-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index
diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b2c14f..a42015b305f4 100644
--- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {

 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4

@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }

-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index
--
2.23.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-22 15:03   ` [PATCH RESEND] " Alexander Kapshuk
@ 2019-09-23  9:19     ` Borislav Petkov
  2019-09-23  9:56       ` Alexander Kapshuk
  2019-09-23 10:31     ` Borislav Petkov
  1 sibling, 1 reply; 13+ messages in thread
From: Borislav Petkov @ 2019-09-23  9:19 UTC (permalink / raw)
  To: Alexander Kapshuk; +Cc: linux-kernel, tglx, mingo, hpa, x86, kbuild test robot

On Sun, Sep 22, 2019 at 06:03:28PM +0300, Alexander Kapshuk wrote:
> This patch fixes the regexp warnings shown below:
> GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> 
> The ':' and '&' characters need not escaping when used in string constants
> as part of regular expressions.

How do you trigger this?

I don't see it in my builds so it looks like environment thing. What
flavor of awk is yours?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-23  9:19     ` Borislav Petkov
@ 2019-09-23  9:56       ` Alexander Kapshuk
  2019-09-23 10:27         ` Borislav Petkov
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kapshuk @ 2019-09-23  9:56 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: linux-kernel, tglx, mingo, hpa, x86, kbuild test robot

On Mon, Sep 23, 2019 at 12:19 PM Borislav Petkov <bp@alien8.de> wrote:
>
> On Sun, Sep 22, 2019 at 06:03:28PM +0300, Alexander Kapshuk wrote:
> > This patch fixes the regexp warnings shown below:
> > GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> >
> > The ':' and '&' characters need not escaping when used in string constants
> > as part of regular expressions.
>
> How do you trigger this?
>
> I don't see it in my builds so it looks like environment thing. What
> flavor of awk is yours?
>
> Thx.
>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

gawk 5.0.1-1 on Arch Linux.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-23  9:56       ` Alexander Kapshuk
@ 2019-09-23 10:27         ` Borislav Petkov
  0 siblings, 0 replies; 13+ messages in thread
From: Borislav Petkov @ 2019-09-23 10:27 UTC (permalink / raw)
  To: Alexander Kapshuk; +Cc: linux-kernel, tglx, mingo, hpa, x86, kbuild test robot

On Mon, Sep 23, 2019 at 12:56:14PM +0300, Alexander Kapshuk wrote:
> On Mon, Sep 23, 2019 at 12:19 PM Borislav Petkov <bp@alien8.de> wrote:
> >
> > On Sun, Sep 22, 2019 at 06:03:28PM +0300, Alexander Kapshuk wrote:
> > > This patch fixes the regexp warnings shown below:
> > > GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> > > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> > > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> > >
> > > The ':' and '&' characters need not escaping when used in string constants
> > > as part of regular expressions.
> >
> > How do you trigger this?
> >
> > I don't see it in my builds so it looks like environment thing. What
> > flavor of awk is yours?
> >
> > Thx.
> >
> > --
> > Regards/Gruss,
> >     Boris.
> >
> > https://people.kernel.org/tglx/notes-about-netiquette
> 
> gawk 5.0.1-1 on Arch Linux.

Ok, looks like they're enforcing it in v5 as v4 which I have doesn't
complain. Please add that fact to the commit message.

More review as a reply to your second patch.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-22 15:03   ` [PATCH RESEND] " Alexander Kapshuk
  2019-09-23  9:19     ` Borislav Petkov
@ 2019-09-23 10:31     ` Borislav Petkov
  2019-09-23 10:54       ` Alexander Kapshuk
  2019-09-23 18:49       ` Masami Hiramatsu
  1 sibling, 2 replies; 13+ messages in thread
From: Borislav Petkov @ 2019-09-23 10:31 UTC (permalink / raw)
  To: Alexander Kapshuk
  Cc: linux-kernel, tglx, mingo, hpa, x86, kbuild test robot, Masami Hiramatsu

+ Masami.

On Sun, Sep 22, 2019 at 06:03:28PM +0300, Alexander Kapshuk wrote:
> This patch fixes the regexp warnings shown below:

Avoid having "This patch" or "This commit" in the commit message. It is
tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

> GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> 
> The ':' and '&' characters need not escaping when used in string constants
> as part of regular expressions.

I could use a reasoning here, as in, "gawk manual doesn't have those two
characters in the list here:

https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html"

or so.

> 
> [Test-run]
> awk -f arch/x86/tools/gen-insn-attr-x86.awk \
> 	arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c
> 
> diff arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
> 0
> 
> awk -f tools/arch/x86/tools/gen-insn-attr-x86.awk \
> 	tools/arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c
> 
> diff tools/objtool/arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
> 0

No need for that - just say that diffing the output before and after
shows no changes.

> [Debugging output]
> DBG:ext:(66&F2)
> DBG:match(ext, ...):(66&F2)
> DBG:match(..., lprefix3_expr):\((F2|!F3|66&F2)\)

That is supposed to say what exactly? That it still does what it is
expected to do?

Leaving in the rest for Masami.

Thx.

> Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> ---
>  arch/x86/tools/gen-insn-attr-x86.awk       | 4 ++--
>  tools/arch/x86/tools/gen-insn-attr-x86.awk | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
> index b02a36b2c14f..a42015b305f4 100644
> --- a/arch/x86/tools/gen-insn-attr-x86.awk
> +++ b/arch/x86/tools/gen-insn-attr-x86.awk
> @@ -69,7 +69,7 @@ BEGIN {
> 
>  	lprefix1_expr = "\\((66|!F3)\\)"
>  	lprefix2_expr = "\\(F3\\)"
> -	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
> +	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
>  	lprefix_expr = "\\((66|F2|F3)\\)"
>  	max_lprefix = 4
> 
> @@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
>  	return add_flags(imm, mod)
>  }
> 
> -/^[0-9a-f]+\:/ {
> +/^[0-9a-f]+:/ {
>  	if (NR == 1)
>  		next
>  	# get index
> diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
> index b02a36b2c14f..a42015b305f4 100644
> --- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
> +++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
> @@ -69,7 +69,7 @@ BEGIN {
> 
>  	lprefix1_expr = "\\((66|!F3)\\)"
>  	lprefix2_expr = "\\(F3\\)"
> -	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
> +	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
>  	lprefix_expr = "\\((66|F2|F3)\\)"
>  	max_lprefix = 4
> 
> @@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
>  	return add_flags(imm, mod)
>  }
> 
> -/^[0-9a-f]+\:/ {
> +/^[0-9a-f]+:/ {
>  	if (NR == 1)
>  		next
>  	# get index
> --
> 2.23.0
> 

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-23 10:31     ` Borislav Petkov
@ 2019-09-23 10:54       ` Alexander Kapshuk
  2019-09-23 18:49       ` Masami Hiramatsu
  1 sibling, 0 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2019-09-23 10:54 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-kernel, tglx, mingo, hpa, x86, kbuild test robot, Masami Hiramatsu

On Mon, Sep 23, 2019 at 1:31 PM Borislav Petkov <bp@alien8.de> wrote:
>
> + Masami.
>
> On Sun, Sep 22, 2019 at 06:03:28PM +0300, Alexander Kapshuk wrote:
> > This patch fixes the regexp warnings shown below:
>
> Avoid having "This patch" or "This commit" in the commit message. It is
> tautologically useless.
>
> Also, do
>
> $ git grep 'This patch' Documentation/process
>
> for more details.
>
> > GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> >
> > The ':' and '&' characters need not escaping when used in string constants
> > as part of regular expressions.
>
> I could use a reasoning here, as in, "gawk manual doesn't have those two
> characters in the list here:
>
> https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html"
>
> or so.
>
> >
> > [Test-run]
> > awk -f arch/x86/tools/gen-insn-attr-x86.awk \
> >       arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c
> >
> > diff arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
> > 0
> >
> > awk -f tools/arch/x86/tools/gen-insn-attr-x86.awk \
> >       tools/arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c
> >
> > diff tools/objtool/arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
> > 0
>
> No need for that - just say that diffing the output before and after
> shows no changes.
>
> > [Debugging output]
> > DBG:ext:(66&F2)
> > DBG:match(ext, ...):(66&F2)
> > DBG:match(..., lprefix3_expr):\((F2|!F3|66&F2)\)
>
> That is supposed to say what exactly? That it still does what it is
> expected to do?

That was the intention.

Thanks for reviewing the patch.
I'll wait to hear from Masami before resending the patch.

>
> Leaving in the rest for Masami.
>
> Thx.
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-23 10:31     ` Borislav Petkov
  2019-09-23 10:54       ` Alexander Kapshuk
@ 2019-09-23 18:49       ` Masami Hiramatsu
  2019-09-24  4:46         ` Alexander Kapshuk
  1 sibling, 1 reply; 13+ messages in thread
From: Masami Hiramatsu @ 2019-09-23 18:49 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Alexander Kapshuk, linux-kernel, tglx, mingo, hpa, x86,
	kbuild test robot, Masami Hiramatsu

On Mon, 23 Sep 2019 12:31:39 +0200
Borislav Petkov <bp@alien8.de> wrote:

> + Masami.
> 
> On Sun, Sep 22, 2019 at 06:03:28PM +0300, Alexander Kapshuk wrote:
> > This patch fixes the regexp warnings shown below:
> 
> Avoid having "This patch" or "This commit" in the commit message. It is
> tautologically useless.
> 
> Also, do
> 
> $ git grep 'This patch' Documentation/process
> 
> for more details.
> 
> > GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> > 
> > The ':' and '&' characters need not escaping when used in string constants
> > as part of regular expressions.
> 
> I could use a reasoning here, as in, "gawk manual doesn't have those two
> characters in the list here:
> 
> https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html"

Thank you for pointing it out. It is good to refer this page as the
reason of this patch.

I couldn't remember why I added those escapes on those... (maybe for
compatibility with mawk? anyway, nowadays there seems no problem)

> 
> or so.
> 
> > 
> > [Test-run]
> > awk -f arch/x86/tools/gen-insn-attr-x86.awk \
> > 	arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c
> > 
> > diff arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
> > 0
> > 
> > awk -f tools/arch/x86/tools/gen-insn-attr-x86.awk \
> > 	tools/arch/x86/lib/x86-opcode-map.txt >../tmp/inat-tables.c
> > 
> > diff tools/objtool/arch/x86/lib/inat-tables.c ~/tmp/inat-tables.c; echo $?
> > 0
> 
> No need for that - just say that diffing the output before and after
> shows no changes.
> 
> > [Debugging output]
> > DBG:ext:(66&F2)
> > DBG:match(ext, ...):(66&F2)
> > DBG:match(..., lprefix3_expr):\((F2|!F3|66&F2)\)
> 
> That is supposed to say what exactly? That it still does what it is
> expected to do?
> 
> Leaving in the rest for Masami.

This looks good to me, except for the description pointed above.
So feel free to add my ack on your patch on next version.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you,
> 
> Thx.
> 
> > Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> > Reported-by: kbuild test robot <lkp@intel.com>
> > ---
> >  arch/x86/tools/gen-insn-attr-x86.awk       | 4 ++--
> >  tools/arch/x86/tools/gen-insn-attr-x86.awk | 4 ++--
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
> > index b02a36b2c14f..a42015b305f4 100644
> > --- a/arch/x86/tools/gen-insn-attr-x86.awk
> > +++ b/arch/x86/tools/gen-insn-attr-x86.awk
> > @@ -69,7 +69,7 @@ BEGIN {
> > 
> >  	lprefix1_expr = "\\((66|!F3)\\)"
> >  	lprefix2_expr = "\\(F3\\)"
> > -	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
> > +	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
> >  	lprefix_expr = "\\((66|F2|F3)\\)"
> >  	max_lprefix = 4
> > 
> > @@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
> >  	return add_flags(imm, mod)
> >  }
> > 
> > -/^[0-9a-f]+\:/ {
> > +/^[0-9a-f]+:/ {
> >  	if (NR == 1)
> >  		next
> >  	# get index
> > diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
> > index b02a36b2c14f..a42015b305f4 100644
> > --- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
> > +++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
> > @@ -69,7 +69,7 @@ BEGIN {
> > 
> >  	lprefix1_expr = "\\((66|!F3)\\)"
> >  	lprefix2_expr = "\\(F3\\)"
> > -	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
> > +	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
> >  	lprefix_expr = "\\((66|F2|F3)\\)"
> >  	max_lprefix = 4
> > 
> > @@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
> >  	return add_flags(imm, mod)
> >  }
> > 
> > -/^[0-9a-f]+\:/ {
> > +/^[0-9a-f]+:/ {
> >  	if (NR == 1)
> >  		next
> >  	# get index
> > --
> > 2.23.0
> > 
> 
> -- 
> Regards/Gruss,
>     Boris.
> 
> https://people.kernel.org/tglx/notes-about-netiquette


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-23 18:49       ` Masami Hiramatsu
@ 2019-09-24  4:46         ` Alexander Kapshuk
  2019-09-30  5:34           ` Borislav Petkov
  2019-10-01 10:19           ` [tip: core/objtool] x86/insn: Fix awk " tip-bot2 for Alexander Kapshuk
  0 siblings, 2 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2019-09-24  4:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: tglx, mingo, bp, hpa, x86, mhiramat, Alexander Kapshuk,
	kbuild test robot

gawk 5.0.1 generates the regexp warnings shown below:
GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator

Ealier versions of gawk are not known to generate these warnings.

The gawk manual referenced below does not list characters ':' and '&'
as needing escaping, so 'unescape' them.
https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html

Running diff on the output generated by the script before and after
applying the patch reported no differences.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Reported-by: kbuild test robot <lkp@intel.com>
Reviewed-by: Borislav Petkov <bp@alien8.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 arch/x86/tools/gen-insn-attr-x86.awk       | 4 ++--
 tools/arch/x86/tools/gen-insn-attr-x86.awk | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b2c14f..a42015b305f4 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {

 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4

@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }

-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index
diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b2c14f..a42015b305f4 100644
--- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {

 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4

@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }

-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index
--
2.23.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-24  4:46         ` Alexander Kapshuk
@ 2019-09-30  5:34           ` Borislav Petkov
  2019-09-30  5:48             ` Alexander Kapshuk
  2019-10-01 10:19           ` [tip: core/objtool] x86/insn: Fix awk " tip-bot2 for Alexander Kapshuk
  1 sibling, 1 reply; 13+ messages in thread
From: Borislav Petkov @ 2019-09-30  5:34 UTC (permalink / raw)
  To: Alexander Kapshuk
  Cc: linux-kernel, tglx, mingo, hpa, x86, mhiramat, kbuild test robot

On Tue, Sep 24, 2019 at 07:46:59AM +0300, Alexander Kapshuk wrote:
> gawk 5.0.1 generates the regexp warnings shown below:
> GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> 
> Ealier versions of gawk are not known to generate these warnings.
> 
> The gawk manual referenced below does not list characters ':' and '&'
> as needing escaping, so 'unescape' them.
> https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html
> 
> Running diff on the output generated by the script before and after
> applying the patch reported no differences.
> 
> Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> Reviewed-by: Borislav Petkov <bp@alien8.de>

This is not how Reviewed-by works. Read here:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes

for future reference. I fixed it up now.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH RESEND] gen-insn-attr-x86.awk: Fix regexp warnings
  2019-09-30  5:34           ` Borislav Petkov
@ 2019-09-30  5:48             ` Alexander Kapshuk
  0 siblings, 0 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2019-09-30  5:48 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-kernel, tglx, mingo, hpa, x86, Masami Hiramatsu, kbuild test robot

On Mon, Sep 30, 2019 at 8:35 AM Borislav Petkov <bp@alien8.de> wrote:
>
> On Tue, Sep 24, 2019 at 07:46:59AM +0300, Alexander Kapshuk wrote:
> > gawk 5.0.1 generates the regexp warnings shown below:
> > GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
> > awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is not a known regexp operator
> >
> > Ealier versions of gawk are not known to generate these warnings.
> >
> > The gawk manual referenced below does not list characters ':' and '&'
> > as needing escaping, so 'unescape' them.
> > https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html
> >
> > Running diff on the output generated by the script before and after
> > applying the patch reported no differences.
> >
> > Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Reviewed-by: Borislav Petkov <bp@alien8.de>
>
> This is not how Reviewed-by works. Read here:
>
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes
>
> for future reference. I fixed it up now.
>
> Thx.
>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

Thank you for taking in the patch and clarifying my misunderstanding
about the use of 'Reviewed-by'.
Point taken.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [tip: core/objtool] x86/insn: Fix awk regexp warnings
  2019-09-24  4:46         ` Alexander Kapshuk
  2019-09-30  5:34           ` Borislav Petkov
@ 2019-10-01 10:19           ` tip-bot2 for Alexander Kapshuk
  1 sibling, 0 replies; 13+ messages in thread
From: tip-bot2 for Alexander Kapshuk @ 2019-10-01 10:19 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: kbuild test robot, Alexander Kapshuk, Borislav Petkov,
	Masami Hiramatsu, H. Peter Anvin, Peter Zijlstra (Intel),
	Arnaldo Carvalho de Melo, Ingo Molnar, Josh Poimboeuf,
	Thomas Gleixner, x86-ml, Ingo Molnar, Borislav Petkov,
	linux-kernel

The following commit has been merged into the core/objtool branch of tip:

Commit-ID:     700c1018b86d0d4b3f1f2d459708c0cdf42b521d
Gitweb:        https://git.kernel.org/tip/700c1018b86d0d4b3f1f2d459708c0cdf42b521d
Author:        Alexander Kapshuk <alexander.kapshuk@gmail.com>
AuthorDate:    Tue, 24 Sep 2019 07:46:59 +03:00
Committer:     Borislav Petkov <bp@suse.de>
CommitterDate: Tue, 01 Oct 2019 12:13:16 +02:00

x86/insn: Fix awk regexp warnings

gawk 5.0.1 generates the following regexp warnings:

  GEN      /home/sasha/torvalds/tools/objtool/arch/x86/lib/inat-tables.c
  awk: ../arch/x86/tools/gen-insn-attr-x86.awk:260: warning: regexp escape sequence `\:' is not a known regexp operator
  awk: ../arch/x86/tools/gen-insn-attr-x86.awk:350: (FILENAME=../arch/x86/lib/x86-opcode-map.txt FNR=41) warning: regexp escape sequence `\&' is  not a known regexp operator

Ealier versions of gawk are not known to generate these warnings. The
gawk manual referenced below does not list characters ':' and '&' as
needing escaping, so 'unescape' them. See

  https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html

for more info.

Running diff on the output generated by the script before and after
applying the patch reported no differences.

 [ bp: Massage commit message. ]

[ Caught the respective tools header discrepancy. ]
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20190924044659.3785-1-alexander.kapshuk@gmail.com
---
 arch/x86/tools/gen-insn-attr-x86.awk       | 4 ++--
 tools/arch/x86/tools/gen-insn-attr-x86.awk | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b..a42015b 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {
 
 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4
 
@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }
 
-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index
diff --git a/tools/arch/x86/tools/gen-insn-attr-x86.awk b/tools/arch/x86/tools/gen-insn-attr-x86.awk
index b02a36b..a42015b 100644
--- a/tools/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/tools/arch/x86/tools/gen-insn-attr-x86.awk
@@ -69,7 +69,7 @@ BEGIN {
 
 	lprefix1_expr = "\\((66|!F3)\\)"
 	lprefix2_expr = "\\(F3\\)"
-	lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)"
+	lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
 	lprefix_expr = "\\((66|F2|F3)\\)"
 	max_lprefix = 4
 
@@ -257,7 +257,7 @@ function convert_operands(count,opnd,       i,j,imm,mod)
 	return add_flags(imm, mod)
 }
 
-/^[0-9a-f]+\:/ {
+/^[0-9a-f]+:/ {
 	if (NR == 1)
 		next
 	# get index

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-10-01 10:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-21 11:37 [PATCH] gen-insn-attr-x86.awk: Fix regexp warnings Alexander Kapshuk
2019-09-22  8:33 ` kbuild test robot
2019-09-22 15:03   ` [PATCH RESEND] " Alexander Kapshuk
2019-09-23  9:19     ` Borislav Petkov
2019-09-23  9:56       ` Alexander Kapshuk
2019-09-23 10:27         ` Borislav Petkov
2019-09-23 10:31     ` Borislav Petkov
2019-09-23 10:54       ` Alexander Kapshuk
2019-09-23 18:49       ` Masami Hiramatsu
2019-09-24  4:46         ` Alexander Kapshuk
2019-09-30  5:34           ` Borislav Petkov
2019-09-30  5:48             ` Alexander Kapshuk
2019-10-01 10:19           ` [tip: core/objtool] x86/insn: Fix awk " tip-bot2 for Alexander Kapshuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).