On 2018/11/19 19:05, Robert Elz wrote:
Module Name:    src
Committed By:   kre
Date:           Mon Nov 19 10:05:09 UTC 2018

Modified Files:
        src/sys/arch/amd64/include: frame.h
        src/sys/arch/i386/include: frame.h
        src/sys/arch/xen/x86: hypervisor_machdep.c

Log Message:
Hide differences between i386 and amd64 interrupt frames so XEN does
not need to know there is one.   Hopefully unbreak i386 build.

_INTRFRAME_IP and _CS are reversed for amd64:

Index: src/sys/arch/amd64/include/frame.h
diff -u src/sys/arch/amd64/include/frame.h:1.18 
src/sys/arch/amd64/include/frame.h:1.19
--- src/sys/arch/amd64/include/frame.h:1.18     Wed Jun 14 00:40:05 2017
+++ src/sys/arch/amd64/include/frame.h  Mon Nov 19 10:05:09 2018
...
+#ifdef XEN
+/*
+ * Need arch independany way to access IP and CS from intrframe
+ */
+#define        _INTRFRAME_IP   if_tf.tf_cs
+#define        _INTRFRAME_CS   if_tf.tf_rip
+#endif

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.32 
src/sys/arch/xen/x86/hypervisor_machdep.c:1.33
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.32      Sun Nov 18 23:50:48 2018
+++ src/sys/arch/xen/x86/hypervisor_machdep.c   Mon Nov 19 10:05:09 2018
...
-       ci->ci_xen_clockf_usermode = USERMODE(regs->if_tf.tf_cs);
-       ci->ci_xen_clockf_pc = regs->if_tf.tf_rip;
+       ci->ci_xen_clockf_usermode = USERMODE(regs->_INTRFRAME_CS);
+       ci->ci_xen_clockf_pc = regs->_INTRFRAME_IP;

Let us stop committing untested codes in order to just fix build.
Compile-time errors are much better than bugs not detectable by
compilers.

Thanks,
rin

Reply via email to