[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] x86/debug: move debugger_trap_entry into debugger.c not inlined


  • To: Bobby Eshleman <bobby.eshleman@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 14 Jul 2021 11:52:38 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hdAtoLSIEf2zCB1qHtB+BxP6hO2ntve1Eqxc9+KcE38=; b=FBpONERSYbh7/U0bwa6/Bmdi18oSyO/11azL7MI7MSYHdF9sjpW5aPA+ao3pQO7Pcy1Wrzw+gmoCXATVDOFf5FzEvaTbVfo98FaNrEz+6qnpdMvXWWHSrY59+UtWShPD/kFGK/jcoW+pPNGZ+ZKLb4RB9a29JfKlIiYuRfFHlOg3+W1Wf+jsS/wMvn4aj3eOQY9NFVzqI/lI62S250ovm0ucaQAq0W5x+KK8D5P3wZL54R/czgKncgEYFd+YLmyZXVRG3IYZiNrlwkWl4XNhcBr6H9WsnwTRPPjf3F4D4zlBKLNHU/HK0OT4oh/sh/wNOXQZBvXSL4+/mGFiWiTTgA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ImRvnlQQCLb+q8HKlsNc/UMdzV85zxtq6Dbrbp7JNN44dusbEA4OXw8XNB0a1Z5RBgOIuJh/182WTW2Wa1rnFxWj1OYRh1BsI4t7LZaGhGp4HbJYYGbYnkvd5QycRQzz4ZBdBgu9J3Les7rXn99NjJOKpAIP3GHz4y1Nsc2AH0oS7wcHNjLpuyr9CnW5hsrzjzjPPF9X9V2KKtTTfXBb6p+2gjyKCtfYDYV2XB8ZSMyGVPBuYOt61aeyD+kyLwZ9GTPIc+z6zMDcBcVfQkW1DO9HGMvFyKx6pcHUJFufMKx6KUslJytN70g2EOFAS+gnhm1FZtKN/X8lginnT2GPcA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 14 Jul 2021 09:52:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.07.2021 03:59, Bobby Eshleman wrote:
> The function debugger_trap_entry() is rather large for an inlined
> function.

Well, yes, perhaps.

> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -32,6 +32,7 @@ obj-y += emul-i8254.o
>  obj-y += extable.o
>  obj-y += flushtlb.o
>  obj-$(CONFIG_CRASH_DEBUG) += gdbstub.o
> +obj-$(CONFIG_CRASH_DEBUG) += debugger.o

Please insert at the appropriate location, rather than breaking the
(mostly) alphabetical sorting.

> --- /dev/null
> +++ b/xen/arch/x86/debugger.c
> @@ -0,0 +1,41 @@
> +/******************************************************************************
> + * x86 crash debug hooks
> + *
> + * 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/>.
> + */
> +
> +#include <asm/debugger.h>
> +#include <xen/domain.h>
> +#include <xen/event.h>
> +#include <xen/sched.h>
> +
> +bool debugger_trap_entry(
> +    unsigned int vector, struct cpu_user_regs *regs)

As you have to touch this anyway, can you please bring it in line
with the stubs introduced in the first patch, by constifying the
2nd parameter?

> +{
> +    /*
> +     * This function is called before any checks are made.  Amongst other
> +     * things, be aware that during early boot, current is not a safe pointer
> +     * to follow.
> +     */
> +    struct vcpu *v = current;

This one can (and hence better would) gain a "const" as well.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.