[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 4/6] x86/gdbsx: expand dbg_rw_mem() inline
- To: Bobby Eshleman <bobby.eshleman@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 24 Aug 2021 14:21:43 +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=MQRZWO6ZlMpw+i5AqLxdNypH5SSyoLYTkZVASba+Cx0=; b=joUoI8r+6jULk4JWTqgcyPa74gQeGK+p3udeZOIqErAFfGavmlaYUnseaqeKuN53+eZmiWHU/rvR8VTI15RzVIoLum0G+ul+AbiA0r7/vSc6C09onfHnnyqGu+YZfcZBDJ0UGulJgJqxbvyuobfX3GFbfQYUJASIQSogdwC0yGuERqgB3NkbgVR/02tZhHGVgvuYecyQo+a9F4Z0X4A0qoGNMGi4DHTW0joqP1nZc/ye1iFyf7gKqVeXwB7LDcwjh1Skexw4AILHOil1DfBUfXY2aQve1rOUBgRllyXtG8lPMyJFJOd4aiefMumMd8iNaJTmb+b5++o7xdCkMkzi1w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KiwF5gwCZruJsaZ+EIVCF7Ihh454oLtLxQ9UYHAJearH1QAjjHU50qCAzjtPYAlT9j4ciSmQFk4GR+KgOOETLvGVqrMvo0p/POxfWfEhmR3aHSvnKstG26SfA/EIRhK0z8xjgkYVjjigzSE9bdxnkh/MY1vvMSj5GOroJRfdlQY9Hmu/dqalhBpq46kwq+ihK3/Gkw+NXal29OUhqteO9IN/9QTdZKy/c8/RzZ2LwSqAw1EkhAEJuqPZ60B2bbJ7/L3zctffFLXAkAABJGcXsJuWUq+kbIWj8kbIQQ6gFQSeWO2hPrpowQCvsirA9p7eRfPqXOK8ZsaeagnB9ReUvQ==
- 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>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Elena Ufimtseva <elena.ufimtseva@xxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 24 Aug 2021 12:21:57 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 18.08.2021 22:29, Bobby Eshleman wrote:
> --- a/xen/arch/x86/gdbsx.c
> +++ b/xen/arch/x86/gdbsx.c
> @@ -151,33 +151,23 @@ static unsigned int dbg_rw_guest_mem(struct domain *dp,
> unsigned long addr,
> return len;
> }
>
> -/*
> - * addr is guest addr
> - * buf is debugger buffer.
> - * if toaddr, then addr = buf (write to addr), else buf = addr (rd from
> guest)
> - * pgd3: value of init_mm.pgd[3] in guest. see above.
> - * Returns: number of bytes remaining to be copied.
> - */
> -static unsigned int dbg_rw_mem(unsigned long gva,
> XEN_GUEST_HANDLE_PARAM(void) buf,
> - unsigned int len, domid_t domid, bool toaddr,
> - uint64_t pgd3)
> +int gdbsx_guest_mem_io(domid_t domid, struct xen_domctl_gdbsx_memio *iop)
> {
> struct domain *d = rcu_lock_domain_by_id(domid);
>
> - if ( d )
> + if ( d && !d->is_dying )
> {
> - if ( !d->is_dying )
> - len = dbg_rw_guest_mem(d, gva, buf, len, toaddr, pgd3);
> - rcu_unlock_domain(d);
> + iop->remain = dbg_rw_guest_mem(
> + d, iop->gva, guest_handle_from_ptr(iop->uva, void),
> + iop->len, domid, iop->pgd3val);
> + }
> + else
> + {
> + iop->remain = iop->len;
> }
Nit: Generally we omit the braces in cases like this one.
Jan
|