Re: [PATCH v8 02/33] x86/fred: make unions for the cs and ss fields in struct pt_regs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 10, 2023 at 01:14:07AM -0700, Xin Li wrote:
> diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
> index f4db78b09c8f..2abb23e6c1e2 100644
> --- a/arch/x86/include/asm/ptrace.h
> +++ b/arch/x86/include/asm/ptrace.h
> @@ -82,12 +82,40 @@ struct pt_regs {
>   * On hw interrupt, it's IRQ number:
>   */
>  	unsigned long orig_ax;
> -/* Return frame for iretq */
> +/* Return frame for iretq/eretu/erets */
>  	unsigned long ip;
> -	unsigned long cs;
> +	union {
> +		unsigned long  csx;	/* cs extended: CS + any fields above it */
> +		struct __attribute__((__packed__)) {

diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 2abb23e6c1e2..d850d3072263 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -86,7 +86,7 @@ struct pt_regs {
 	unsigned long ip;
 	union {
 		unsigned long  csx;	/* cs extended: CS + any fields above it */
-		struct __attribute__((__packed__)) {
+		struct {
 			unsigned short cs;	/* CS selector proper */
 			unsigned int current_stack_level: 2;
 			unsigned int __csx_resv1	: 6;
@@ -96,13 +96,13 @@ struct pt_regs {
 			unsigned int nmi		: 1;
 			unsigned int __csx_resv3	: 3;
 			unsigned int __csx_resv4	: 32;
-		};
+		} __packed;
 	};
 	unsigned long flags;
 	unsigned long sp;
 	union {
 		unsigned long  ssx;	/* ss extended: SS + any fields above it */
-		struct __attribute__((__packed__)) {
+		struct {
 			unsigned short ss;	/* SS selector proper */
 			unsigned int __ssx_resv1	: 16;
 			unsigned int vector		: 8;
@@ -114,7 +114,7 @@ struct pt_regs {
 			unsigned int nested		: 1;
 			unsigned int __ssx_resv4	: 1;
 			unsigned int instr_len		: 4;
-		};
+		} __packed;
 	};
 /* top of stack page */
 };

> +			unsigned short cs;	/* CS selector proper */

Also, please put all those comments above the members, like the rest of the
file does.

-- 
Regards/Gruss,
    Boris.

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



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux