Prev: [PATCH v2] viafb: split global index up
Next: [PATCH v1 4/7] PCI: read bridge windows before filling in subtractive decode resources
From: Lu, Hongjiu on 3 Feb 2010 21:30 > > That is how processor works. > > We're not talking about the processor. > We're talking about the API of a Linux system call. > > To support XSAVE, gdb needs to know XCR0 as well as XSTATE size. We can get those info from kernel via system call or cpuid. I prefer cpuid over system call. H.J. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Roland McGrath on 4 Feb 2010 00:00 > To support XSAVE, gdb needs to know XCR0 as well as XSTATE size. > We can get those info from kernel via system call or cpuid. I > prefer cpuid over system call. Suresh's patch puts this value in the xsave block, in what Suresh calls "sw_usable_bytes". See the asm/ptrace-abi.h comment in the patch you signed off on. How is that not sufficient? If it is indeed not sufficient to usefully interpret the xsave block, then how could an xsave block in a core dump file ever possibly be examined if it might not have been generated on the same system and kernel where the debugger is doing the examination? If the NT_X86_XSTATE note as implemented in Suresh's patch is indeed not entirely self-contained in this way, then NAK on that new note format. Thanks, Roland -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Lu, Hongjiu on 4 Feb 2010 00:10 > > To support XSAVE, gdb needs to know XCR0 as well as XSTATE size. > > We can get those info from kernel via system call or cpuid. I > > prefer cpuid over system call. > > Suresh's patch puts this value in the xsave block, in what Suresh calls > "sw_usable_bytes". See the asm/ptrace-abi.h comment in the patch you > signed off on. > > How is that not sufficient? If it is indeed not sufficient to usefully > interpret the xsave block, then how could an xsave block in a core dump > file ever possibly be examined if it might not have been generated on the > same system and kernel where the debugger is doing the examination? If > the NT_X86_XSTATE note as implemented in Suresh's patch is indeed not > entirely self-contained in this way, then NAK on that new note format. > I use it when reading core dump, which doesn't involve a system call. I can analyze it on a totally different machine. FWIW, there is the header file I have in gdb --- /* XSAVE extended state information. */ /* The extended state status. */ enum xstate_status { XSTATE_UNKNOWN = 0, XSTATE_UNSUPPORTED, XSTATE_INITIALIZED }; /* The extended state feature bits. */ #define bit_XSTATE_X87 (1ULL << 0) #define bit_XSTATE_SSE (1ULL << 1) #define bit_XSTATE_AVX (1ULL << 2) /* Supported mask and size of the extended state. Used for qSupport. */ #define XSTATE_SSE_MASK 0x3 #define XSTATE_AVX_MASK 0x7 #define XSTATE_MAX_MASK 0x7 #define XSTATE_SSE_MASK_STRING "0x3" #define XSTATE_AVX_MASK_STRING "0x7" #define XSTATE_MAX_MASK_STRING "0x7" #define XSTATE_SSE_SIZE 576 #define XSTATE_AVX_SIZE 832 #define XSTATE_MAX_SIZE 832 #define XSTATE_SSE_SIZE_STRING "576" #define XSTATE_AVX_SIZE_STRING "832" #define XSTATE_MAX_SIZE_STRING "832" struct i386_xstate_type { /* The extended state status. */ enum xstate_status status; /* The extended control register 0 (the XFEATURE_ENABLED_MASK register). */ unsigned long long xcr0; /* The extended state size in bytes. */ unsigned int size; /* The extended state size in unit of int64. We use array of int64 for better alignment. */ unsigned int n_of_int64; }; extern struct i386_xstate_type i386_xstate; extern void i386_xstate_init (void); --- I don't need a system call to tell me xcr0 and size. If you really want, you can put it in glibc and doesn't involve kernel. We can use __cpu_features for it. H.J. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Roland McGrath on 4 Feb 2010 00:20 > > Suresh's patch puts this value in the xsave block, in what Suresh calls > > "sw_usable_bytes". See the asm/ptrace-abi.h comment in the patch you > > signed off on. > > > > How is that not sufficient? If it is indeed not sufficient to usefully > > interpret the xsave block, then how could an xsave block in a core dump > > file ever possibly be examined if it might not have been generated on the > > same system and kernel where the debugger is doing the examination? If > > the NT_X86_XSTATE note as implemented in Suresh's patch is indeed not > > entirely self-contained in this way, then NAK on that new note format. > > > > I use it when reading core dump, which doesn't involve a system call. > I can analyze it on a totally different machine. You did not answer any of my questions. Perhaps Suresh can be more helpful in explaining the situation. Thanks, Roland -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Lu, Hongjiu on 4 Feb 2010 00:40
> > > > Suresh's patch puts this value in the xsave block, in what Suresh calls > > > "sw_usable_bytes". See the asm/ptrace-abi.h comment in the patch you > > > signed off on. > > > > > > How is that not sufficient? If it is indeed not sufficient to usefully > > > interpret the xsave block, then how could an xsave block in a core dump > > > file ever possibly be examined if it might not have been generated on the > > > same system and kernel where the debugger is doing the examination? If > > > the NT_X86_XSTATE note as implemented in Suresh's patch is indeed not > > > entirely self-contained in this way, then NAK on that new note format. > > > > > > > I use it when reading core dump, which doesn't involve a system call. > > I can analyze it on a totally different machine. > > You did not answer any of my questions. > Perhaps Suresh can be more helpful in explaining the situation. > When gdb reads a core section, it only processes up to the maximum xsave size it supports and ignores the rest. It also reads the first 8 byte in sw_usable_bytes for xcr0. It only exams the xcr0 bits it supports. With this info, gdb can exams xsave core dump up to the state it supports. When it calls ptrace with XSTATE, it uses a buffer of the size returned by cpuid. But it only reads up to the xsave size it supports. The difference here is the size of core dump is recorded in core dump and I have to use cpuid returned size to make a ptrace call. H.J. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |