Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp830160imu; Fri, 11 Jan 2019 09:46:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN6DeGcGIP0D4/jmu6r6bw9SU479ffV6m3iaTyl2U8eHXS8OPP4grkL1wr2gdeoiXJoybCqx X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr15529955plp.213.1547228804127; Fri, 11 Jan 2019 09:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547228804; cv=none; d=google.com; s=arc-20160816; b=KW2mTeanEyd1hMaykIP9l3CmbtGm9+wNTuIpEgor0NKerSZUEkRkx6F/wA7MzZ4EXa QBALiSo8/cdSOqrJVRMH5QYttkgduHhZWyomdXx32om+08H2lwHKKF1gfdX0muT2TwOD TyvNNiq5/K+hXO4b50kQWBdro6Gzxw5PpYX7wCWWEU2dBBmHaRycNUcCofM0ytZyKB4x olgdPwgZIRWwTGOSfpuYZ6Xynm66+qmfNpIlC2XnHnczilW0F+ekiwWt7zV0vpykvJD0 eUmaTlwvTiFPzVZPUSTUDbD53XTCVHkk134U7+V6fHUD+W8fXywxRxTRRkeyciev1yfj b/vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=u7GPW4nIBc6LfcCMP6rrRzbaOkT4qoYoWSIVsovfiHQ=; b=SDFHjRJ5N2WiItQ56qU8hd8TSNcgna1qEfQCfmDkAJHCovkChrghGYLdzLQa0NqQiT RoE128PuMnmEynm2lXcMyowkufExkXIW1glxrRiQWMuYUfqZyUpsVTIuxeLWwyVFycXh pyyBhYILhQWzo1Dgd/fC8PqkidDKezCQvSmhTNoq9LtMbLiC8qvzZUM33jRQz2pBMBgV mv23AsPQlbUxg/fjBl60RP3tPXsRIigsagswXeArTZ+T7A2fYBr/Py1bH/0120xXwCJ0 SEJrzcWkffL/ttdi/GyWQb98Vr7V/WKYoyVXTlP3N2pSIkOzKlTvPX/X2SFhdPxwmVki /1cA== 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 w12si76329412pfn.212.2019.01.11.09.46.28; Fri, 11 Jan 2019 09:46:44 -0800 (PST) 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 S1732870AbfAKNuc (ORCPT + 99 others); Fri, 11 Jan 2019 08:50:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48634 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728616AbfAKNub (ORCPT ); Fri, 11 Jan 2019 08:50:31 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A6F388BD27; Fri, 11 Jan 2019 13:50:31 +0000 (UTC) Received: from flask (unknown [10.40.205.161]) by smtp.corp.redhat.com (Postfix) with SMTP id 3B5F260BF6; Fri, 11 Jan 2019 13:50:27 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Fri, 11 Jan 2019 14:50:26 +0100 Date: Fri, 11 Jan 2019 14:50:26 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: David Rientjes Cc: Brijesh Singh , Joerg Roedel , Paolo Bonzini , Thomas Lendacky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [patch] kvm: sev: Fail KVM_SEV_INIT if already initialized Message-ID: <20190111135025.GF14852@flask> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 11 Jan 2019 13:50:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019-01-02 12:56-0800, David Rientjes: > By code inspection, it was found that multiple calls to KVM_SEV_INIT > could deplete asid bits and overwrite kvm_sev_info's regions_list. > > Multiple calls to KVM_SVM_INIT is not likely to occur with QEMU, but this > should likely be fixed anyway. > > This code is serialized by kvm->lock. > > Fixes: 1654efcbc431 ("KVM: SVM: Add KVM_SEV_INIT command") > Reported-by: Cfir Cohen > Signed-off-by: David Rientjes > --- Applied, thanks.