Re: [PATCH v2] x86: Document -mcet-switch

2022-05-19 Thread H.J. Lu via Gcc-patches
On Thu, May 19, 2022 at 1:49 PM Florian Weimer wrote: > > * H. J. Lu: > > > How about this? > > > > @item -mcet-switch > > @opindex mcet-switch > > By default, CET instrumentation is turned off on switch statements that > > use a jump table and indirect branch track is disabled. > > Maybe add here

Re: [PATCH v2] x86: Document -mcet-switch

2022-05-19 Thread Florian Weimer via Gcc-patches
* H. J. Lu: > How about this? > > @item -mcet-switch > @opindex mcet-switch > By default, CET instrumentation is turned off on switch statements that > use a jump table and indirect branch track is disabled. Maybe add here: “Since jump tables are stored in read-only memory, this does not result i

Re: [PATCH v2] x86: Document -mcet-switch

2022-05-19 Thread H.J. Lu via Gcc-patches
On Wed, May 18, 2022 at 11:02 PM Richard Biener wrote: > > On Wed, May 18, 2022 at 7:32 PM H.J. Lu via Gcc-patches > wrote: > > > > On Wed, May 11, 2022 at 1:52 PM H.J. Lu wrote: > > > > > > When -fcf-protection=branch is used, the compiler will generate jump > > > tables for switch statements w

Re: [PATCH v2] x86: Document -mcet-switch

2022-05-18 Thread Richard Biener via Gcc-patches
On Wed, May 18, 2022 at 7:32 PM H.J. Lu via Gcc-patches wrote: > > On Wed, May 11, 2022 at 1:52 PM H.J. Lu wrote: > > > > When -fcf-protection=branch is used, the compiler will generate jump > > tables for switch statements where the indirect jump is prefixed with > > the NOTRACK prefix, so it ca

Re: [PATCH v2] x86: Document -mcet-switch

2022-05-18 Thread H.J. Lu via Gcc-patches
On Wed, May 11, 2022 at 1:52 PM H.J. Lu wrote: > > When -fcf-protection=branch is used, the compiler will generate jump > tables for switch statements where the indirect jump is prefixed with > the NOTRACK prefix, so it can jump to non-ENDBR targets. Since the > indirect jump targets are generate

[PATCH v2] x86: Document -mcet-switch

2022-05-11 Thread H.J. Lu via Gcc-patches
When -fcf-protection=branch is used, the compiler will generate jump tables for switch statements where the indirect jump is prefixed with the NOTRACK prefix, so it can jump to non-ENDBR targets. Since the indirect jump targets are generated by the compiler, they are always valid. Document -mcet-