2021-05-19 21:23:50

by H. Peter Anvin

[permalink] [raw]
Subject: [PATCH v3 1/8] x86/traps: add X86_NR_HW_TRAPS to <asm/trapnr.h>

From: "H. Peter Anvin (Intel)" <[email protected]>

The x86 architecture supports up to 32 trap vectors. Add that constant
to <asm/trapnr.h>.

Acked-by: Andy Lutomirski <[email protected]>
Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
---
arch/x86/include/asm/trapnr.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/include/asm/trapnr.h b/arch/x86/include/asm/trapnr.h
index f5d2325aa0b7..f0baf92da20b 100644
--- a/arch/x86/include/asm/trapnr.h
+++ b/arch/x86/include/asm/trapnr.h
@@ -27,6 +27,7 @@
#define X86_TRAP_VE 20 /* Virtualization Exception */
#define X86_TRAP_CP 21 /* Control Protection Exception */
#define X86_TRAP_VC 29 /* VMM Communication Exception */
+#define X86_NR_HW_TRAPS 32 /* Max hardware trap number */
#define X86_TRAP_IRET 32 /* IRET Exception */

#endif
--
2.31.1



2021-05-19 22:20:00

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH v3 1/8] x86/traps: add X86_NR_HW_TRAPS to <asm/trapnr.h>

On Wed, May 19 2021 at 14:21, H. Peter Anvin wrote:
> From: "H. Peter Anvin (Intel)" <[email protected]>
>
> The x86 architecture supports up to 32 trap vectors. Add that constant
> to <asm/trapnr.h>.

Where is that actually used?

Thanks,

tglx

2021-05-19 22:28:23

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH v3 1/8] x86/traps: add X86_NR_HW_TRAPS to <asm/trapnr.h>

It is not right now, but it will be used in the FRED enabling patchset at the very least (since the number of exception vectors and FIRST_EXTERNAL_VECTOR are not necessarily the same anymore.)

On May 19, 2021 3:17:57 PM PDT, Thomas Gleixner <[email protected]> wrote:
>On Wed, May 19 2021 at 14:21, H. Peter Anvin wrote:
>> From: "H. Peter Anvin (Intel)" <[email protected]>
>>
>> The x86 architecture supports up to 32 trap vectors. Add that
>constant
>> to <asm/trapnr.h>.
>
>Where is that actually used?
>
>Thanks,
>
> tglx

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

2021-05-20 07:11:50

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH v3 1/8] x86/traps: add X86_NR_HW_TRAPS to <asm/trapnr.h>

On Wed, May 19 2021 at 15:24, H. Peter Anvin wrote:

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

> On May 19, 2021 3:17:57 PM PDT, Thomas Gleixner <[email protected]> wrote:
>> On Wed, May 19 2021 at 14:21, H. Peter Anvin wrote:
>>> The x86 architecture supports up to 32 trap vectors. Add that
>>> constant to <asm/trapnr.h>.
>>
>> Where is that actually used?
>
> It is not right now, but it will be used in the FRED enabling patchset
> at the very least (since the number of exception vectors and
> FIRST_EXTERNAL_VECTOR are not necessarily the same anymore.)

Then add it with FRED. Defining unused stuff will just result in cleanup
patches which removed unused defines...

Thanks,

tglx