From nobody Sun May 5 08:20:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1576741372; cv=none; d=zohomail.com; s=zohoarc; b=OP52wlQTxYhnUDom3jg0dMeUadA5+YgIvGaxj8urQzO6O6igvj1SxZJBwjkkJ+TIVFmorhRJzCQxhjRdL/fH/QKqlTnVOObZU0g9UmzVXk0oOjTlWnkSJxUmR1LNnA60oni+Nxk5uVP8yXyJ7uPAXE0gzv/zlGGZkCiFjbnN63U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576741372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Nex3Zt9ymbQUXd0jxPEIlSFHg4WnT7hbkvBdusH72F8=; b=JMMYNMsN8+KRt/nD7drHGATihg8wCfh7/sOgMmNb43ETGs1lf6or+MRhXyzO6CsBM6boJV3sKMOs1y6Buc2ktIFvV6RPB4i7U2Q8RnGGqC5Vo2OBQpkWMsYrdBPxXmJKK4F8ntUxGrTU1pR62ZXkaPl/0HjWmzQpRnts2WIuGzg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1576741372157854.3170037889247; Wed, 18 Dec 2019 23:42:52 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihqRv-0001Vs-VF; Thu, 19 Dec 2019 07:42:19 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihqRv-0001Vn-98 for xen-devel@lists.xenproject.org; Thu, 19 Dec 2019 07:42:19 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 13f5ac36-2233-11ea-915d-12813bfff9fa; Thu, 19 Dec 2019 07:42:16 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 689B2B281; Thu, 19 Dec 2019 07:42:15 +0000 (UTC) X-Inumbo-ID: 13f5ac36-2233-11ea-915d-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Thu, 19 Dec 2019 08:42:08 +0100 Message-Id: <20191219074209.17277-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191219074209.17277-1-jgross@suse.com> References: <20191219074209.17277-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v3 1/2] xen: put more code under CONFIG_CRASH_DEBUG X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Kevin Tian , Stefano Stabellini , Julien Grall , Jun Nakajima , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Some code is not needed with CONFIG_CRASH_DEBUG, so only include it if CONFIG_CRASH_DEBUG is defined. While at it remove CONFIG_HAS_GDBSX as it can easily be replaced by CONFIG_CRASH_DEBUG. Signed-off-by: Juergen Gross Acked-by: George Dunlap --- V3: - move domain_pause_for_debugger() into arch/x86/domain.c (Andrew Cooper) --- xen/arch/x86/Kconfig | 1 - xen/arch/x86/domain.c | 13 +++++++++++++ xen/arch/x86/hvm/vmx/realmode.c | 1 + xen/common/Kconfig | 3 --- xen/common/domain.c | 14 -------------- xen/include/asm-x86/debugger.h | 32 ++++++++++++++++++++------------ xen/include/xen/sched.h | 1 - 7 files changed, 34 insertions(+), 31 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 02bb05f42e..f853c04564 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -13,7 +13,6 @@ config X86 select HAS_EHCI select HAS_EX_TABLE select HAS_FAST_MULTIPLY - select HAS_GDBSX select HAS_IOPORTS select HAS_KEXEC select MEM_ACCESS_ALWAYS_ON diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 7cb7fd31dd..3a3fbde642 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -2318,6 +2318,19 @@ static int __init init_vcpu_kick_softirq(void) } __initcall(init_vcpu_kick_softirq); =20 +void domain_pause_for_debugger(void) +{ +#ifdef CONFIG_CRASH_DEBUG + struct vcpu *curr =3D current; + struct domain *d =3D curr->domain; + + domain_pause_by_systemcontroller_nosync(d); + + /* if gdbsx active, we just need to pause the domain */ + if ( curr->arch.gdbsx_vcpu_event =3D=3D 0 ) + send_global_virq(VIRQ_DEBUGGER); +#endif +} =20 /* * Local variables: diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmod= e.c index bb0b4439df..bdbd9cb921 100644 --- a/xen/arch/x86/hvm/vmx/realmode.c +++ b/xen/arch/x86/hvm/vmx/realmode.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 2f516da101..b3d161d057 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -57,9 +57,6 @@ config HAS_UBSAN config HAS_KEXEC bool =20 -config HAS_GDBSX - bool - config HAS_IOPORTS bool =20 diff --git a/xen/common/domain.c b/xen/common/domain.c index 611116c7fc..3a77d717db 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -915,20 +915,6 @@ void vcpu_end_shutdown_deferral(struct vcpu *v) vcpu_check_shutdown(v); } =20 -#ifdef CONFIG_HAS_GDBSX -void domain_pause_for_debugger(void) -{ - struct vcpu *curr =3D current; - struct domain *d =3D curr->domain; - - domain_pause_by_systemcontroller_nosync(d); - - /* if gdbsx active, we just need to pause the domain */ - if ( curr->arch.gdbsx_vcpu_event =3D=3D 0 ) - send_global_virq(VIRQ_DEBUGGER); -} -#endif - /* Complete domain destroy after RCU readers are not holding old reference= s. */ static void complete_domain_destroy(struct rcu_head *head) { diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h index b1b627f1fa..f58726daec 100644 --- a/xen/include/asm-x86/debugger.h +++ b/xen/include/asm-x86/debugger.h @@ -33,6 +33,8 @@ #include #include =20 +void domain_pause_for_debugger(void); + #ifdef CONFIG_CRASH_DEBUG =20 #include @@ -47,18 +49,6 @@ static inline bool debugger_trap_fatal( /* Int3 is a trivial way to gather cpu_user_regs context. */ #define debugger_trap_immediate() __asm__ __volatile__ ( "int3" ); =20 -#else - -static inline bool debugger_trap_fatal( - unsigned int vector, struct cpu_user_regs *regs) -{ - return false; -} - -#define debugger_trap_immediate() ((void)0) - -#endif - static inline bool debugger_trap_entry( unsigned int vector, struct cpu_user_regs *regs) { @@ -84,6 +74,24 @@ static inline bool debugger_trap_entry( return false; } =20 +#else + +static inline bool debugger_trap_fatal( + unsigned int vector, struct cpu_user_regs *regs) +{ + return false; +} + +#define debugger_trap_immediate() ((void)0) + +static inline bool debugger_trap_entry( + unsigned int vector, struct cpu_user_regs *regs) +{ + return false; +} + +#endif + unsigned int dbg_rw_mem(void * __user addr, void * __user buf, unsigned int len, domid_t domid, bool toaddr, uint64_t pgd3); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 9f7bc69293..0b41e936d5 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -652,7 +652,6 @@ void domain_destroy(struct domain *d); int domain_kill(struct domain *d); int domain_shutdown(struct domain *d, u8 reason); void domain_resume(struct domain *d); -void domain_pause_for_debugger(void); =20 int domain_soft_reset(struct domain *d); =20 --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Sun May 5 08:20:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1576741381; cv=none; d=zohomail.com; s=zohoarc; b=exZuvhNP9PLVjels5VbGrVrSmyFef7gOZkNPJy5iC65yUNQSq2KMCuyquEupt79689DBwOdV55MkeYzoPD7p0g2t8K1rDh1TYlJp33N/3whUiuzQygD7mdQaYG22zvlWxwDmf31S2MwZcjWHnIErPubtL+qqYqhFGsML0kuUNpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576741381; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lRGG3C38G/GTCGqFwCKgklxWhpR5bkvnaqXtA2h88o8=; b=PH8KE9y+5XMeQsq/y+HFUpyksiRvrh1tTm8JF6umUDIA4TV6/aewmvOnhnskEEw1kZNxbvSjYV0D7u7WO1wpsttsiCipDgHJS5ceh1gWEkMizQhOw7SJ14VmLWAMZ/iqIaZ9kFOFh5ERrQkn+tF2TElPfzNWJRoZ/mVmpnjEDkI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1576741381270719.0986438216213; Wed, 18 Dec 2019 23:43:01 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihqS4-0001Zv-K5; Thu, 19 Dec 2019 07:42:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihqS2-0001ZP-OY for xen-devel@lists.xenproject.org; Thu, 19 Dec 2019 07:42:26 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 13f53a62-2233-11ea-b6f1-bc764e2007e4; Thu, 19 Dec 2019 07:42:16 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 68A12B282; Thu, 19 Dec 2019 07:42:15 +0000 (UTC) X-Inumbo-ID: 13f53a62-2233-11ea-b6f1-bc764e2007e4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Thu, 19 Dec 2019 08:42:09 +0100 Message-Id: <20191219074209.17277-3-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191219074209.17277-1-jgross@suse.com> References: <20191219074209.17277-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v3 2/2] xen: make gdbsx support configurable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Elena Ufimtseva , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Gdbsx support in the hypervisor is rarely used and it is opening a way for dom0 to modify the running hypervisor by very easy means. Remove the possibility to read/write hypervisor memory, it was never used by gdbsx. Add a Kconfig option to control support of gdbsx. Default is on. While at it correct a wrong comment in related code and remove dead code. Signed-off-by: Juergen Gross --- V3: - default Kconfig option to Y (Andrew Cooper) - remove hypervisor memory access (Andrew Cooper) --- xen/Kconfig.debug | 8 +++++ xen/arch/x86/Makefile | 2 +- xen/arch/x86/debug.c | 78 +++++---------------------------------= ---- xen/arch/x86/domctl.c | 4 +++ xen/include/asm-x86/debugger.h | 2 ++ 5 files changed, 24 insertions(+), 70 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index cf42e5e7a0..b3511e81a2 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -20,6 +20,14 @@ config CRASH_DEBUG If you want to attach gdb to Xen to debug Xen if it crashes then say Y. =20 +config GDBSX + bool "Guest debugging with gdbsx" + depends on X86 + default y + ---help--- + If you want to enable support for debugging guests from dom0 via + gdbsx then say Y. + config DEBUG_INFO bool "Compile Xen with debug info" default y diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 7da5a2631e..6783688b00 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -19,7 +19,7 @@ obj-bin-y +=3D copy_page.o obj-y +=3D cpuid.o obj-$(CONFIG_PV) +=3D compat.o x86_64/compat.o obj-$(CONFIG_KEXEC) +=3D crash.o -obj-y +=3D debug.o +obj-$(CONFIG_GDBSX) +=3D debug.o obj-y +=3D delay.o obj-y +=3D desc.o obj-bin-y +=3D dmi_scan.init.o diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c index a500df01ac..5d8acdad71 100644 --- a/xen/arch/x86/debug.c +++ b/xen/arch/x86/debug.c @@ -22,22 +22,6 @@ #include #include =20 -/*=20 - * This file for general routines common to more than one debugger, like k= db, - * gdbsx, etc.. - */ - -#ifdef XEN_KDB_CONFIG -#include "../kdb/include/kdbdefs.h" -#include "../kdb/include/kdbproto.h" -#define DBGP(...) {(kdbdbg) ? kdbp(__VA_ARGS__):0;} -#define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_ARGS__):0;} -#define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;} -#else -#define DBGP1(...) ((void)0) -#define DBGP2(...) ((void)0) -#endif - typedef unsigned long dbgva_t; typedef unsigned char dbgbyte_t; =20 @@ -49,24 +33,13 @@ dbg_hvm_va2mfn(dbgva_t vaddr, struct domain *dp, int to= addr, gfn_t *gfn) uint32_t pfec =3D PFEC_page_present; p2m_type_t gfntype; =20 - DBGP2("vaddr:%lx domid:%d\n", vaddr, dp->domain_id); - *gfn =3D _gfn(paging_gva_to_gfn(dp->vcpu[0], vaddr, &pfec)); if ( gfn_eq(*gfn, INVALID_GFN) ) - { - DBGP2("kdb:bad gfn from gva_to_gfn\n"); return INVALID_MFN; - } =20 mfn =3D get_gfn(dp, gfn_x(*gfn), &gfntype); if ( p2m_is_readonly(gfntype) && toaddr ) - { - DBGP2("kdb:p2m_is_readonly: gfntype:%x\n", gfntype); mfn =3D INVALID_MFN; - } - else - DBGP2("X: vaddr:%lx domid:%d mfn:%#"PRI_mfn"\n", - vaddr, dp->domain_id, mfn_x(mfn)); =20 if ( mfn_eq(mfn, INVALID_MFN) ) { @@ -100,55 +73,36 @@ dbg_pv_va2mfn(dbgva_t vaddr, struct domain *dp, uint64= _t pgd3val) unsigned long cr3 =3D (pgd3val ? pgd3val : dp->vcpu[0]->arch.cr3); mfn_t mfn =3D maddr_to_mfn(cr3_pa(cr3)); =20 - DBGP2("vaddr:%lx domid:%d cr3:%lx pgd3:%lx\n", vaddr, dp->domain_id,=20 - cr3, pgd3val); - if ( pgd3val =3D=3D 0 ) { l4t =3D map_domain_page(mfn); l4e =3D l4t[l4_table_offset(vaddr)]; unmap_domain_page(l4t); mfn =3D l4e_get_mfn(l4e); - DBGP2("l4t:%p l4to:%lx l4e:%lx mfn:%#"PRI_mfn"\n", l4t, - l4_table_offset(vaddr), l4e, mfn_x(mfn)); if ( !(l4e_get_flags(l4e) & _PAGE_PRESENT) ) - { - DBGP1("l4 PAGE not present. vaddr:%lx cr3:%lx\n", vaddr, cr3); return INVALID_MFN; - } =20 l3t =3D map_domain_page(mfn); l3e =3D l3t[l3_table_offset(vaddr)]; unmap_domain_page(l3t); mfn =3D l3e_get_mfn(l3e); - DBGP2("l3t:%p l3to:%lx l3e:%lx mfn:%#"PRI_mfn"\n", l3t, - l3_table_offset(vaddr), l3e, mfn_x(mfn)); if ( !(l3e_get_flags(l3e) & _PAGE_PRESENT) || (l3e_get_flags(l3e) & _PAGE_PSE) ) - { - DBGP1("l3 PAGE not present. vaddr:%lx cr3:%lx\n", vaddr, cr3); return INVALID_MFN; - } } =20 l2t =3D map_domain_page(mfn); l2e =3D l2t[l2_table_offset(vaddr)]; unmap_domain_page(l2t); mfn =3D l2e_get_mfn(l2e); - DBGP2("l2t:%p l2to:%lx l2e:%lx mfn:%#"PRI_mfn"\n", - l2t, l2_table_offset(vaddr), l2e, mfn_x(mfn)); if ( !(l2e_get_flags(l2e) & _PAGE_PRESENT) || (l2e_get_flags(l2e) & _PAGE_PSE) ) - { - DBGP1("l2 PAGE not present. vaddr:%lx cr3:%lx\n", vaddr, cr3); return INVALID_MFN; - } + l1t =3D map_domain_page(mfn); l1e =3D l1t[l1_table_offset(vaddr)]; unmap_domain_page(l1t); mfn =3D l1e_get_mfn(l1e); - DBGP2("l1t:%p l1to:%lx l1e:%lx mfn:%#"PRI_mfn"\n", l1t, l1_table_offse= t(vaddr), - l1e, mfn_x(mfn)); =20 return mfn_valid(mfn) ? mfn : INVALID_MFN; } @@ -199,40 +153,26 @@ static unsigned int dbg_rw_guest_mem(struct domain *d= p, void * __user gaddr, return len; } =20 -/*=20 - * addr is hypervisor addr if domid =3D=3D DOMID_IDLE, else it's guest addr +/* + * addr is guest addr * buf is debugger buffer. * if toaddr, then addr =3D buf (write to addr), else buf =3D addr (rd fro= m guest) * pgd3: value of init_mm.pgd[3] in guest. see above. - * Returns: number of bytes remaining to be copied.=20 + * Returns: number of bytes remaining to be copied. */ unsigned int dbg_rw_mem(void * __user addr, void * __user buf, unsigned int len, domid_t domid, bool toaddr, uint64_t pgd3) { - DBGP2("gmem:addr:%lx buf:%p len:$%u domid:%d toaddr:%x\n", - addr, buf, len, domid, toaddr); - - if ( domid =3D=3D DOMID_IDLE ) - { - if ( toaddr ) - len =3D __copy_to_user(addr, buf, len); - else - len =3D __copy_from_user(buf, addr, len); - } - else - { struct domain *d =3D get_domain_by_id(domid); =20 - if ( d ) - { - if ( !d->is_dying ) - len =3D dbg_rw_guest_mem(d, addr, buf, len, toaddr, pgd3); - put_domain(d); - } + if ( d ) + { + if ( !d->is_dying ) + len =3D dbg_rw_guest_mem(d, addr, buf, len, toaddr, pgd3); + put_domain(d); } =20 - DBGP2("gmem:exit:len:$%d\n", len); return len; } =20 diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index b461aadbd6..43cd38b43f 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -36,6 +36,7 @@ #include #include =20 +#ifdef CONFIG_GDBSX static int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio= *iop) { void * __user gva =3D (void *)iop->gva, * __user uva =3D (void *)iop->= uva; @@ -45,6 +46,7 @@ static int gdbsx_guest_mem_io(domid_t domid, struct xen_d= omctl_gdbsx_memio *iop) =20 return iop->remain ? -EFAULT : 0; } +#endif =20 static void domain_cpu_policy_changed(struct domain *d) { @@ -932,6 +934,7 @@ long arch_do_domctl( } #endif =20 +#ifdef CONFIG_GDBSX case XEN_DOMCTL_gdbsx_guestmemio: domctl->u.gdbsx_guest_memio.remain =3D domctl->u.gdbsx_guest_memio= .len; ret =3D gdbsx_guest_mem_io(domctl->domain, &domctl->u.gdbsx_guest_= memio); @@ -996,6 +999,7 @@ long arch_do_domctl( copyback =3D true; break; } +#endif =20 case XEN_DOMCTL_setvcpuextstate: case XEN_DOMCTL_getvcpuextstate: diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h index f58726daec..a9ddb01433 100644 --- a/xen/include/asm-x86/debugger.h +++ b/xen/include/asm-x86/debugger.h @@ -92,8 +92,10 @@ static inline bool debugger_trap_entry( =20 #endif =20 +#ifdef CONFIG_GDBSX unsigned int dbg_rw_mem(void * __user addr, void * __user buf, unsigned int len, domid_t domid, bool toaddr, uint64_t pgd3); +#endif =20 #endif /* __X86_DEBUGGER_H__ */ --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel