From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: RFC: EFER in crash notes Date: Tue, 25 Sep 2012 15:18:54 +0100 Message-ID: <5061BD4E.6000905@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040108090504000407090903" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org --------------040108090504000407090903 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit While this patch is very simple, and I hope without any objection, it is RFC for the reason that our crash ABI is private. The comments for XEN_ELFNOTE_CRASH_REGS does state that it is architecture specific, and makes no indication about the size or contents of the crash note. However, any code trying to use one of these types of notes has to make an assumption that it if the note desc length is 4*8 bytes long, it is representing CR{0,2-4}. I guess my question boils down to whether it is acceptable to change a private ABI which is not really so private, or whether we should make a formal public ABI for all of the inards of the crash notes and use that. I have some upcoming plans to put quite a lot more information into this (or an equivalent) structure for extra analysis of the environment at the point of a crash, so perhaps putting in the proper work to make a public ABI would be the best course of action. -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com --------------040108090504000407090903 Content-Type: text/x-patch; name="kexec-efer-in-crash-notes.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kexec-efer-in-crash-notes.patch" # HG changeset patch # Parent d364becfb0835f69e85d273fe2b29035c2d975df diff -r d364becfb083 xen/include/asm-x86/elf.h --- a/xen/include/asm-x86/elf.h +++ b/xen/include/asm-x86/elf.h @@ -3,6 +3,7 @@ typedef struct { unsigned long cr0, cr2, cr3, cr4; + unsigned long efer; } crash_xen_core_t; #include diff -r d364becfb083 xen/include/asm-x86/x86_64/elf.h --- a/xen/include/asm-x86/x86_64/elf.h +++ b/xen/include/asm-x86/x86_64/elf.h @@ -1,6 +1,8 @@ #ifndef __X86_64_ELF_H__ #define __X86_64_ELF_H__ +#include + typedef struct { unsigned long r15; unsigned long r14; @@ -75,6 +77,8 @@ static inline void elf_core_save_regs(EL asm volatile("mov %%cr4, %0" : "=r" (tmp) : ); xen_core_regs->cr4 = tmp; + + rdmsrl(MSR_EFER, xen_core_regs->efer); } #endif /* __X86_64_ELF_H__ */ --------------040108090504000407090903 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------040108090504000407090903--