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

Re: [Xen-devel] [PATCH for-4.13] xen/arm: livepatch: Prevent CPUs to fetch stale instructions after livepatching


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Wed, 18 Sep 2019 16:21:21 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=7YOwNOdSnX4JvSxy39YZzNmxYH1ZTl79OD2ReWDPExY=; b=c3sojwMg0iHZIPBoLtefD1WcId1NTBojfJB39x42DFI6/6WKb3Z9xTHXw0xBTVBRgMqzEeREaPI6ups+wXqEKhhNiazXI/uv6jIdsuFbqEqCoqKJwSDSZ5PfG2KADYOCYNDRMXYP52mFw1DgyS6tH2X0E+m7tgFcTojlBunL9Uur39EgMWdGuLWEJpLOBr2XzqiJLbM+dRswc70dqHjP6AfyHzStcrbSDmaJXz1IwWims3E964yf5D8tpMXY4aN8Yg62OfjXXyVA2QosY7nshXmKUQHNQrXi3iUt1/YmFzR9xNWiCXyPZ4oCekPT3SGbXR5o45VZZ1twvJcZW4tvYQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZVdUJUldf/+Cp2a8vv7K3PZ8iy88Xl51sG6Bge3ezSsg5JYPmVrYFv8fP0X2Tboi2BhYA6GZOe9Q2Cjx4Y8QxApr2bwfG8EPQesOpmLAFTgTh8WVboILhfaPuho+k9R710Et4W5Caw/oFmU7VSukDZtkWXL4ZN5Ly7LW72jv7QoZZIWxNGR6Tn6JztIH7xg8HuM6HJgMbWPFb1ni1EsA6puDWdFGJmZmM4fk3HKds8jaP6M/CYqTcVT8g79uKzknb1lw/KEjD4JG8I8q+4eXHI4Fe6GTcxZTjMLr9T0O5hoif5VPUmBFvVjbrYepE3YqzG08bPdo2IGuDxnCJNZUMg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
  • Delivery-date: Wed, 18 Sep 2019 16:21:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVbihnGtEnz+DRBU2uPBeBBR2oJacxneQA
  • Thread-topic: [PATCH for-4.13] xen/arm: livepatch: Prevent CPUs to fetch stale instructions after livepatching

Hi Julien,

Julien Grall writes:

> During livepatch, a single CPU will take care of applying the patch and
> all the others will wait for the action to complete. They will then once
> execute arch_livepatch_post_action() to flush the pipeline.
>
> Per B2.2.5 "Concurrent modification and execution of instructions" in
> DDI 0487E.a, flushing the instruction cache is not enough to ensure new
> instructions are seen. All the PEs should also do an isb() to
> synchronize the fetched instruction stream.
>
> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>

> ---
>  xen/arch/arm/livepatch.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/livepatch.c b/xen/arch/arm/livepatch.c
> index 279d52cc6c..00c5e2bc45 100644
> --- a/xen/arch/arm/livepatch.c
> +++ b/xen/arch/arm/livepatch.c
> @@ -88,7 +88,8 @@ void arch_livepatch_revert(const struct livepatch_func 
> *func)
>  
>  void arch_livepatch_post_action(void)
>  {
> -    /* arch_livepatch_revive has nuked the instruction cache. */
> +    /* Discard any stale instructions that may have been fetched. */
> +    isb();
>  }
>  
>  void arch_livepatch_mask(void)


-- 
Volodymyr Babchuk at EPAM
_______________________________________________
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®.