Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp865140ybp; Wed, 9 Oct 2019 05:32:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZB63O7q6NE8ytG333v23gGfNeng/X2X24Te3WxbMP3mSz+lLdCHfGH9h67JAamlPA9UvL X-Received: by 2002:aa7:d582:: with SMTP id r2mr2752924edq.196.1570624346747; Wed, 09 Oct 2019 05:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570624346; cv=none; d=google.com; s=arc-20160816; b=VPY+2QQ+flYR3nlWkFBbcDMapI/LbJtm4pQEPWydCI3Ejbc9H6eLYyojdKgdxJvx15 U5wGJA3yTBqUHQ6/1gdik903a6Sgw9VBnogABclqYjY0fGs7U9k+ar5EWQbf8wm/ehRM Gh6a4yf5WrPNImOciT1Ho7hD3mHvyxRDhoVp6WoEUSGafsg9lqTgUNeC9WVOlRSQbmci 3QEsnOSfPpN9Tqolt6XpfZzJkVjaqz98kzcFB6leDAmu1HWqzPWX5OW4D7CDh3BCArn4 dPly81VVE52Rkb2ghff6P2Ev+HOuR3ywAqYa+qUktTxQvZY26dh1aPDL45k/twdYydvQ qePg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=xvThJK+yx5Ccn9NmhrAQG/4aOZL4annIFveYbxX7LRY=; b=soH/IAodE9xwCsuyOVaVDvrgKEZjUnNtQB3xezYPI4IUPx9ODlvas+oxxz29dCuKE8 pH69hszD1VtTl8pc8LKPA4sNpVbyQ2TWKmX4mgMEU75TuRDhJkKCWSTerClTmECUHaTS zxZDhvkN7DFgUC6IeaAiONwsG7FpyQew5qp5u3SkuNF8DspbFpm8lVz7tfVYzbTVaieG 9Rs8YfgiABPIi/o/GXOvhYcreT9IHbq2IBZjTnZNOR6dMbFkG7gpxMw4+xDPoPwUMW+p Z44KX41McCWWHWZydCoCRdzlAh8/dHcwEp0HO437+moDkkjwSAccmffLHXcPylErADCW 5oEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si1039589ejm.367.2019.10.09.05.32.02; Wed, 09 Oct 2019 05:32:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730921AbfJIM3t (ORCPT + 99 others); Wed, 9 Oct 2019 08:29:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42612 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727029AbfJIM3s (ORCPT ); Wed, 9 Oct 2019 08:29:48 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9061434CC for ; Wed, 9 Oct 2019 12:29:48 +0000 (UTC) Received: by mail-wm1-f69.google.com with SMTP id 190so991985wme.4 for ; Wed, 09 Oct 2019 05:29:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=xvThJK+yx5Ccn9NmhrAQG/4aOZL4annIFveYbxX7LRY=; b=PiY62UuC9RHHxnofqDuidHBZE10TMkZfMKaxrLNBwLqReKlDLMhTfHoPbCCvr9B9Rm 4NxwoZ/ISrFDknyXxvmc5FvkxW4R2f7TpC9hCnQu7f/t3qHjRjpTpG/WXHu9psbAy8pD p/tPdNl6ZTGhKaxeg/w98lDF9gLKqtMqGFgc1vcmZXqXwkRH6PbkwqgkJmvQr7uiIELX /UtZkn59GPZBFyPsE227yx/Ap0koDZBxgCxnY6RHNKe1FFgCxKn47nkEgCwFMCqxrHb2 GQFotuwAKOGEyJeZ5/FloR9SZxId84pC0EgXpLHfmPxpjvByYpgHgIZKDKU31/Dnc19d eFaA== X-Gm-Message-State: APjAAAWrQ2C3MuExIX14dPg5M2BZuzgq1abTsPUEqeZEAbjWkl5dERz7 bkn1b4Gzyt6T21tPtLBGkGUfm0PjlrU1G+Y35U4OXe3HP33Vy5i49CX7D6vih2n/2VOI3n3DVzb OH0aoyyTawMWeZy0jKoK1+Nao X-Received: by 2002:a1c:6389:: with SMTP id x131mr2379539wmb.77.1570624187334; Wed, 09 Oct 2019 05:29:47 -0700 (PDT) X-Received: by 2002:a1c:6389:: with SMTP id x131mr2379523wmb.77.1570624187133; Wed, 09 Oct 2019 05:29:47 -0700 (PDT) Received: from vitty.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 59sm3512855wrc.23.2019.10.09.05.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 05:29:46 -0700 (PDT) From: Vitaly Kuznetsov To: Paolo Bonzini , Sean Christopherson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Jim Mattson Subject: Re: [PATCH] selftests: kvm: fix sync_regs_test with newer gccs In-Reply-To: <5b1b95e5-4836-ab55-fe4d-e9cc78a7a95e@redhat.com> References: <20191008180808.14181-1-vkuznets@redhat.com> <20191008183634.GF14020@linux.intel.com> <87d0f6yzd3.fsf@vitty.brq.redhat.com> <5b1b95e5-4836-ab55-fe4d-e9cc78a7a95e@redhat.com> Date: Wed, 09 Oct 2019 14:29:45 +0200 Message-ID: <874l0iyudi.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paolo Bonzini writes: > On 09/10/19 12:42, Vitaly Kuznetsov wrote: >> Paolo Bonzini writes: >>> There is no practical difference with Vitaly's patch. The first >>> _vcpu_run has no pre-/post-conditions on the value of %rbx: >> >> I think what Sean was suggesting is to prevent GCC from inserting >> anything (and thus clobbering RBX) between the call to guest_call() and >> the beginning of 'asm volatile' block by calling *inside* 'asm volatile' >> block instead. > > Yes, but there is no way that clobbering RBX will break the test, > because RBX is not initialized until after the first _vcpu_run succeeds. > Right, we're always resuming after so potential clobbering doesn't matter. Thanks! -- Vitaly