All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Bobby Eshleman <bobby.eshleman@gmail.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"Jun Nakajima" <jun.nakajima@intel.com>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 4/6] x86/gdbsx: expand dbg_rw_mem() inline
Date: Tue, 24 Aug 2021 14:21:43 +0200	[thread overview]
Message-ID: <625e262a-394f-a63d-2617-7aabe0b2b294@suse.com> (raw)
In-Reply-To: <7833b4a327212ff0fc816d17f91fa09291d6afc2.1629315873.git.bobby.eshleman@gmail.com>

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



  parent reply	other threads:[~2021-08-24 12:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 20:29 [PATCH v3 0/6] Remove unconditional arch dependency on asm/debugger.h Bobby Eshleman
2021-08-18 20:29 ` [PATCH v3 1/6] arm/traps: remove debugger_trap_fatal() calls Bobby Eshleman
2021-08-24 12:45   ` Julien Grall
2021-08-18 20:29 ` [PATCH v3 2/6] x86/debugger: separate Xen and guest debugging debugger_trap_* functions Bobby Eshleman
2021-08-24 11:26   ` Andrew Cooper
2021-08-24 12:16   ` Jan Beulich
2021-08-24 12:41     ` Andrew Cooper
2021-08-24 13:07       ` Jan Beulich
2021-08-18 20:29 ` [PATCH v3 3/6] arch/x86: rename debug.c to gdbsx.c Bobby Eshleman
2021-08-24 11:31   ` Andrew Cooper
2021-08-24 12:19   ` Jan Beulich
2021-08-24 14:32     ` Bobby Eshleman
2021-08-18 20:29 ` [PATCH v3 4/6] x86/gdbsx: expand dbg_rw_mem() inline Bobby Eshleman
2021-08-24 11:32   ` Andrew Cooper
2021-08-24 12:21   ` Jan Beulich [this message]
2021-08-18 20:29 ` [PATCH v3 5/6] arch/x86: move domain_pause_for_debugger() to domain.h Bobby Eshleman
2021-08-24 12:26   ` Jan Beulich
2021-08-18 20:29 ` [PATCH v3 6/6] x86: change asm/debugger.h to xen/debugger.h Bobby Eshleman
2021-08-24 11:40   ` Andrew Cooper
2021-08-24 12:48   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=625e262a-394f-a63d-2617-7aabe0b2b294@suse.com \
    --to=jbeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bobby.eshleman@gmail.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=julien@xen.org \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.