From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95478C433EF for ; Wed, 29 Sep 2021 13:35:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5C0846137A for ; Wed, 29 Sep 2021 13:35:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5C0846137A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ihntwm6vKI1oLMnoWF/8QqF/WXu9KDRRMtpJbucKUeo=; b=YKsK6aE7QKW0kJ xQoBDlKvDfF2n1juJzb0EyLQ8MZGZOwDojmDEUDjAP6k+POmkDAhEGcYOia5cfeurZh4+VgEEg+75 o25gjngevOpOkYLR4huyqHBDc0PkxnZIxl5HPB5qMFp9eVr4wdAQ9AsBK8G5oKPlI1qG2Fvz2eLUL Vm4bg1lBbkDbk+yRm3iKtxMweuWYFVnZbXjRpgDsHh7nhnuXQGWzVvRJ1OgjSSfvsy27gBagMNhL7 WDAY1hdQdV/CybAEPYb3TvVLecX46nZIZ/9CLW0hN64jpH8LUWW8XKLT9rBqBUKQXHoihrApuwiU6 n/FOQa0tC0mdspS71/fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVZiL-00B9Q9-NR; Wed, 29 Sep 2021 13:33:37 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVZiI-00B9PR-Es for linux-arm-kernel@lists.infradead.org; Wed, 29 Sep 2021 13:33:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632922413; 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: in-reply-to:in-reply-to:references:references; bh=Dp0Dog3coHxj0QgucUNcGEsig+2bXpk05DYt8z5lf/4=; b=NjYHkJ4JIGSL1q6IGflR6PociCOKT0Kn2Xasp+HaZ/chkqhvYVnFjIE4gSlDEdOoREiOCB x3tdPccb9oHeq7Is28hatUqUQ4cRHX2hy0SfMowC67QBiZgWsrko5A4kWTaXstFlE+KHnC ftZbJx+5CQ0cGduMSm4wRwF6BZSnD50= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-274-OXt1m0ehMUuS71XL86bDog-1; Wed, 29 Sep 2021 09:33:31 -0400 X-MC-Unique: OXt1m0ehMUuS71XL86bDog-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51C2B1B2C980; Wed, 29 Sep 2021 13:33:25 +0000 (UTC) Received: from fuller.cnet (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C26219C79; Wed, 29 Sep 2021 13:33:24 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 0A35F416CE5D; Wed, 29 Sep 2021 10:33:21 -0300 (-03) Date: Wed, 29 Sep 2021 10:33:21 -0300 From: Marcelo Tosatti To: Oliver Upton Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, Andrew Jones , Will Deacon , Catalin Marinas Subject: Re: [PATCH v8 3/7] KVM: x86: Fix potential race in KVM_GET_CLOCK Message-ID: <20210929133320.GA10977@fuller.cnet> References: <20210916181538.968978-1-oupton@google.com> <20210916181538.968978-4-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210916181538.968978-4-oupton@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210929_063334_596557_A3C6D863 X-CRM114-Status: GOOD ( 12.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 16, 2021 at 06:15:34PM +0000, Oliver Upton wrote: > Sean noticed that KVM_GET_CLOCK was checking kvm_arch.use_master_clock > outside of the pvclock sync lock. This is problematic, as the clock > value written to the user may or may not actually correspond to a stable > TSC. > > Fix the race by populating the entire kvm_clock_data structure behind > the pvclock_gtod_sync_lock. > > Suggested-by: Sean Christopherson > Signed-off-by: Oliver Upton ACK patches 1-3, still reviewing the remaining ones... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel