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

Re: [PATCH] x86/ioemul: Rewrite stub generation


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 27 Apr 2020 18:23:59 +0200
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>
  • Delivery-date: Mon, 27 Apr 2020 16:24:41 +0000
  • Ironport-sdr: pzsfqlt2MCbZV+Y8lSRxc85fTCPutaEfwwRMIXJNWAg98B/0vCmgd2lpRibYKcsJHmgWOYqzPL cKG+zvNhxOVGtUeUomfNnz91zc7OX7oFnUZpngi+/Zeive5HgmIqpUY19wym1/IhLG/sZuM5WH LtCb8/MYjQUx5X/naJL4kGTdg5GYiqU3wOslOhPInurDPfP5gSsBLOdJwfqj804zcWtRnwdqLk tj4MEpGNVNCfG4AVKItYF3x4KDVt5UL86G3SMOYMf8PBJPiSj9ErbD55V2M1oMXuHGe2Jf6lsF k18=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Apr 27, 2020 at 05:18:52PM +0100, Andrew Cooper wrote:
> On 27/04/2020 16:18, Roger Pau Monné wrote:
> > On Mon, Apr 27, 2020 at 01:20:41PM +0100, Andrew Cooper wrote:
> >> +    /* Helpers - Read outer scope but only modify p. */
> >> +#define APPEND_BUFF(b) ({ memcpy(p, b, sizeof(b)); p += sizeof(b); })
> >> +#define APPEND_CALL(f)                                                  \
> >> +    ({                                                                  \
> >> +        long disp = (long)(f) - (stub_va + p - ctxt->io_emul_stub + 5); \
> >> +        BUG_ON((int32_t)disp != disp);                                  \
> > I'm not sure I get the point of using signed integers instead of
> > unsigned ones, AFAICT you just want to check that the displacement is
> > < 4GB so that a relative call can be used?
> 
> Displacements are +/- 2G, not <4G.
> 
> Using unsigned here would be buggy.

Right, sorry for the noise:

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

With the minor nits pointed above in the ioemul_handle_quirk.

Thanks, Roger.



 


Rackspace

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