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

Re: [PATCH] x86: Fix check_ist_exit() assertions


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 19 Sep 2023 13:46:03 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wN9zawvMhjoZ53DoBECh7cxX9t4/BR8dWT0he8sNyz0=; b=i4/V1WGpCq2AYcaP4HBg8muvFXZQSAZ4lPtRljjFX+eWNXyKVFXaPYH5rQg+Kbmsf46v6ImOLRSj+elyYr5b9aPq3IZxK7YOgvmOcSbCHBCbC8agRIE2i6t6QUG+ry3nGZ+LGA5qcX5vcQ1SSGtak41GYBo/hE2OGKHjmKvZEi0bmE54cjY+bTM9LOhr51XixOE6T1oEssRbPB4H+VebWe1h58BxxDyNZXSjgFowSHUCNE2EEyQdam4BCyMgVWx5zfR1UFUvpvvcjojcvs+tnFh7/dF8cBMODSg8u1pS5inXncdZbOJyh6P9lM4LNYrPHVFb3VLbOZEjDdbxk2VV9w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VI27OGNb0/lbYZV1jOYyeFyj7kKu7G/Dobc+5LLKfzrWF5siDoQqkUW85uVqRwZdNGCM5TVDigIUcWGndCLqJxQvXcsufcQ6OWneBjLI2zcnJLGsJLEfYI8Lmvea0ZUby7D4bVfpQDCv7gvztIXTJCc0vBFIAlwBFvxiIV66MZ/jK/FcO4QqUJ2st/9YRgnK/PIXZeFeD1IaKLD0X+HeCCrO4l516DHDQyZzsr0dve3249cKEnJLfgbGRecN5D50DyBPXcQ1v6AywVUX9Fj0fFk5MtHFlLnRcYmqWitUPEzFUpJsjKamQdGrqbRE87n09qurgwTYdpFSEwlI/ozHaw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 19 Sep 2023 11:46:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.09.2023 12:35, Andrew Cooper wrote:
> The patch adding check_ist_exit() neglected to consider reset_stack_and_jump()
> leaving C and entering one of the Xen exit paths.  The value in %r12 is stale,
> and depending on compiler decisions may not be 0.
> 
> This shows up in Gitlab CI for the Clang build:
> 
>   https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/5112783827
> 
> and in OSSTest for GCC 8:
> 
>   
> http://logs.test-lab.xenproject.org/osstest/logs/183045/test-amd64-amd64-xl-qemuu-debianhvm-amd64/serial-pinot0.log
> 
> The justification for ensuring ist_exit is accurate in the exit paths still
> stands, so zero %r12 in reset_stack_and_jump() to indicate a non-IST exit.

I did think of this as an option, but I don't think this covers all cases.
If we take #DB while in a PV guest, that'll be an IST entry. Assume further
that we re-schedule before re-entering the guest. Upon the vCPU being
scheduled back in we'll have %r12 clear with an on-stack indication of
having taken an IST guest exit.

Jan



 


Rackspace

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