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 X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 87F5EC4338F for ; Thu, 19 Aug 2021 18:46:05 +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 524A9610A0 for ; Thu, 19 Aug 2021 18:46:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 524A9610A0 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=KzIRCviXXLTvul+agBMY6AaFaTPzfcKuv2sx6iPFXOg=; b=lKFRs9UsN1RCI5 7DKEItjnBjKmKL/rAbrtMsqP3KuXgaHBTVfGl12Xr70mzi5gFGNOXMVb4vigD7PHbWXyrf2SZwDV8 aS0bkNyrLP8kPhHUcq5Z+wh7gxIPEJtnrvy4Ym0Kwc5z/DqW0kAxlK8ONP1b/M8oNKVeuws5l0spt E9hVgJcf0RUv/BsLyVmWsRjEHN/LPgf6R4XsvtEOvyjO6W8+GGODuq4h7q4lAlGH0tYQ6Apd54E2I r1Ma/niGrn9lcS8KxHGCKfnBlMAfuE5LR3Z2FzIKfm5KRI82ALOCmCFGKPxogZhmhYkUnwEG7gm3y tOv73QlQNaJwBfFFwJUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGn1F-009GO0-F2; Thu, 19 Aug 2021 18:44:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGn18-009GLC-Pu for linux-arm-kernel@lists.infradead.org; Thu, 19 Aug 2021 18:43:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629398632; 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=H/wl8m/9lH1CHxbJFAhOGRrmreud5t/3OP9MGx3avmE=; b=K1W7t4kq+L2iZ1HzMxadLiqU2xbveO0ZLH/V55kRt8qIU0AajT7+rgnhhtQH9sfNlEl5sG kfZdf7AEn+6c+tSc6qrYOS/eAMvREwWcD4DBs3GEYsYdxXNBEVirrKquB2PoHSSZBtgvxh Pxpf59CqHmbz23t+eS9MZCVv3labbRY= 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-563-aKQUDwrROzmaDp7OcHlfzA-1; Thu, 19 Aug 2021 14:43:46 -0400 X-MC-Unique: aKQUDwrROzmaDp7OcHlfzA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58EA1107ACF5; Thu, 19 Aug 2021 18:43:44 +0000 (UTC) Received: from fuller.cnet (ovpn-112-6.gru2.redhat.com [10.97.112.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1C3F188E4; Thu, 19 Aug 2021 18:43:43 +0000 (UTC) Received: by fuller.cnet (Postfix, from userid 1000) id 054DB434F000; Thu, 19 Aug 2021 15:24:22 -0300 (-03) Date: Thu, 19 Aug 2021 15:24:22 -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 v7 1/6] KVM: x86: Fix potential race in KVM_GET_CLOCK Message-ID: <20210819182422.GA25923@fuller.cnet> References: <20210816001130.3059564-1-oupton@google.com> <20210816001130.3059564-2-oupton@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210816001130.3059564-2-oupton@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210819_114354_969446_742D8B85 X-CRM114-Status: GOOD ( 13.10 ) 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 Mon, Aug 16, 2021 at 12:11:25AM +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. Oliver, Can you please describe the race in more detail? Is it about host TSC going unstable VS parallel KVM_GET_CLOCK ? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel