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

Re: [Xen-devel] [PATCH v5 1/7] x86/hvm: allow ASID flush when v != current


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 28 Feb 2020 17:20:46 +0100
  • Authentication-results: esa4.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@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 28 Feb 2020 16:20:57 +0000
  • Ironport-sdr: DWk0Plt7s1WceukixiDWRdmgxwSxgbQOI1lWPG3063ZUi5IGIKOCNTLF3ZiCjDhIb9gLJyauUT qDFH/boaTy+ng1oXAA57OfLdgww5NZD3FOCQOiyVZJ5YC0kj8ALBT2suwgL5k/HcDHJeJiI7BU tH2aBdgvegjTIB/w16zQRh5KNpzhwb7JBqXUgWBvirK1uzcEbAmLCak/+yNibQlv/jbCRWNff9 SDNFUJ78WUBiFgruo/cS189wmESrYjqXlUONYu84JNvMLuXVpjrrO8vp62rFr24tucJeTsIjc6 n7Q=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Feb 28, 2020 at 04:47:57PM +0100, Jan Beulich wrote:
> On 28.02.2020 16:27, Roger Pau Monné wrote:
> > On Fri, Feb 28, 2020 at 02:29:09PM +0100, Jan Beulich wrote:
> >> On 19.02.2020 18:43, Roger Pau Monne wrote:
> >>> Current implementation of hvm_asid_flush_vcpu is not safe to use
> >>> unless the target vCPU is either paused or the currently running one,
> >>> as it modifies the generation without any locking.
> >>
> >> Indeed, but the issue you're taking care of is highly theoretical:
> >> I don't think any sane compiler will split writes of the fields
> >> to multiple insns. It would be nice if this was made clear here.
> > 
> > What about adding:
> > 
> >>> Fix this by using atomic operations when accessing the generation
> >>> field, both in hvm_asid_flush_vcpu_asid and other ASID functions. This
> >>> allows to safely flush the current ASID generation. Note that for the
> >>> flush to take effect if the vCPU is currently running a vmexit is
> >>> required.
> > 
> > "Most compilers will already do such writes and reads as a single
> > instruction, so the usage of atomic operations is mostly used as a
> > safety measure."
> > 
> > Here?
> 
> Could you perhaps start with "Compilers will normally ..." I'm fine
> with the rest, it's just that "most compilers" still feels like
> an understatement.

Sure, that's fine.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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