Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B23F6C4363D for ; Thu, 24 Sep 2020 13:57:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F9FD20888 for ; Thu, 24 Sep 2020 13:57:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="Xbxuqf6k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F9FD20888 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kLRkB-0000kl-AY; Thu, 24 Sep 2020 13:57:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kLRkA-0000kd-Ag for xen-devel@lists.xenproject.org; Thu, 24 Sep 2020 13:57:06 +0000 X-Inumbo-ID: 0e25af03-774e-4bd1-b7ba-93cc1266fb2c Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0e25af03-774e-4bd1-b7ba-93cc1266fb2c; Thu, 24 Sep 2020 13:57:05 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1600955825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kMkKFU8JZMqFZmxjQU9djdmjoC3W0J2Xrpey80MwLAw=; b=Xbxuqf6kWAUF3JHMcswGJWJP5J67T78jKSU+U9Yv5Q9DyKp5uHdkgoZ3bjJWAI8uL3jo8Z F0il6nUPQ+cqZsZ5voTwbhF5cBYc4RjQnV+I2bNtzy4OAiQaojBbaBr3VWqPqyFYAQaCz+ nAwj/9VoXRhrkab4gSU/VtxzQTAfDOY= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 0F2DEAE44; Thu, 24 Sep 2020 13:57:05 +0000 (UTC) Subject: Re: [PATCH 2/3] x86/pv: Don't clobber NT on return-to-guest To: Andrew Cooper Cc: Xen-devel , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= , Wei Liu , Andy Lutomirski References: <20200923101848.29049-1-andrew.cooper3@citrix.com> <20200923101848.29049-3-andrew.cooper3@citrix.com> From: Jan Beulich Message-ID: <339f0abd-65ad-7be0-a3f0-149fcac9a0a3@suse.com> Date: Thu, 24 Sep 2020 15:57:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200923101848.29049-3-andrew.cooper3@citrix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 23.09.2020 12:18, Andrew Cooper wrote: > A 64bit IRET can restore NT - the faulting case is when NT is set in the live > flags. This change had an unintended consequence of causing the NT flag to > spontaneously disappear from guest context whenever a interrupt/exception > occurred. > > In combination with a SYSENTER which sets both TF and NT, Xen's handling of > the #DB exceptions clears NT before it is even recorded suitably in the guest > kernel's view of what userspace was doing. > > Reported-by: Andy Lutomirski > Fixes: 0e47f92b0 ("x86: force EFLAGS.IF on when exiting to PV guests") > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich