On 18/08/2021 21:29, Bobby Eshleman wrote: > diff --git a/xen/include/xen/debugger.h b/xen/include/xen/debugger.h > new file mode 100644 > index 0000000000..166fad9d2e > --- /dev/null > +++ b/xen/include/xen/debugger.h > @@ -0,0 +1,51 @@ > +/****************************************************************************** > + * Generic hooks into arch-dependent Xen. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; If not, see <http://www.gnu.org/licenses/>. > + * > + * Each debugger should define two functions here: > + * > + * 1. debugger_trap_fatal(): > + * Called when Xen is about to give up and crash. Typically you will use > this > + * hook to drop into a debug session. It can also be used to hook off > + * deliberately caused traps (which you then handle and return non-zero). > + * > + * 2. debugger_trap_immediate(): > + * Called if we want to drop into a debugger now. This is essentially the > + * same as debugger_trap_fatal, except that we use the current register > state > + * rather than the state which was in effect when we took the trap. > + * For example: if we're dying because of an unhandled exception, we call > + * debugger_trap_fatal; if we're dying because of a panic() we call > + * debugger_trap_immediate(). > + */ > + > +#ifndef __XEN_DEBUGGER_H__ > +#define __XEN_DEBUGGER_H__ > + > +#ifdef CONFIG_CRASH_DEBUG > + > +#include <asm/debugger.h> > + > +#else > + > +#include <asm/regs.h>
This include should be deleted, and replaced with simply struct cpu_user_regs; ~Andrew > + > +static inline bool debugger_trap_fatal( > + unsigned int vector, const struct cpu_user_regs *regs) > +{ > + return false; > +} > + > +static inline void debugger_trap_immediate(void) > +{ > +} > + > +#endif /* CONFIG_CRASH_DEBUG */ > + > +#endif /* __XEN_DEBUGGER_H__ */