Received: by 10.223.185.116 with SMTP id b49csp910505wrg; Wed, 14 Feb 2018 08:46:28 -0800 (PST) X-Google-Smtp-Source: AH8x224nNZmzk1k9W5vYSbQzWgV6XAZpd8BdapLtXgRKs+MWX0WjSlNHVBKQ09CFHb73T3McZLWz X-Received: by 2002:a17:902:529:: with SMTP id 38-v6mr4937896plf.327.1518626788347; Wed, 14 Feb 2018 08:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518626788; cv=none; d=google.com; s=arc-20160816; b=UyawCimq+WJ6NM55T7QeHxZoEx5qeDGpRs+D3LhUt/JAxdBw7LMbJR5MblH9um//DM UaLFvf3n2JzWSrBmGtBSaM3d0CpFGPnugf/Gx0Sp86sMREe2/ICxoC5WyQMCRJUN4S8m GF8Qyi0NG6+qsl2idSzT0oOYUyQDdtxSvlIBr1JbHGyLFz/Jxc2P+xGugHZN4Vx4z7md /RDUKiSzKVDZPwkmdp/ANgbb8ZmM0xm3VgDBbBZBSHApzf6fzFAR3EGfghXrXd9PbN0R jUlwAEKebxyRX3gmRoc3OAxVT8IJTqcFh/OZi3xES6mCRsCOj3xofq9ZP45AJBQ+g68X BkyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=yQnqDPB5TdqJsYK01iIglvgaHyQkazvb8iScfjgLeXw=; b=K7WqZF0kuUf8j857W3YQ6zOs+jWkSE7Ku10qGAKt3B/wRlXMhNVrCqbqjiZ6Pj39T5 GOJkEtdSkO7cfq7OgtRkiMdZSdzZcF2S4yUx83MI4a5xQTCj9dO3krUOWGSWzS3UyUlN /XiVpYizMLqO5Qe8M7AWF+LJE39V/7b683oCvaSD61a4ITABmp7ogN/kpaUGjYbI/TTo O3kdaCyCl41WiK/OYzkECutvwGlrGlFq7jyGr5CBNT6V5urAL2OGh+LWew/mB7FTeyIE ZlA1I7Vd99/vLSF8FjJvPvwubV31YKQsqPNoJSGyYUgnXgiA3bwsVyHOpAhfW3TJ0eta HsPQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si938846pgs.425.2018.02.14.08.46.13; Wed, 14 Feb 2018 08:46:28 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032892AbeBNQoo (ORCPT + 99 others); Wed, 14 Feb 2018 11:44:44 -0500 Received: from mail.skyhub.de ([5.9.137.197]:41534 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032623AbeBNQon (ORCPT ); Wed, 14 Feb 2018 11:44:43 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id taQ4nsQocwyj; Wed, 14 Feb 2018 17:44:42 +0100 (CET) Received: from pd.tnic (p200300EC2BC9550024931BD807293D49.dip0.t-ipconnect.de [IPv6:2003:ec:2bc9:5500:2493:1bd8:729:3d49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 098361EC0341; Wed, 14 Feb 2018 17:44:42 +0100 (CET) Date: Wed, 14 Feb 2018 17:44:39 +0100 From: Borislav Petkov To: Tom Lendacky Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Joerg Roedel , Thomas Gleixner , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [RFC PATCH 1/2] KVM: x86: Add a framework for supporting MSR-based features Message-ID: <20180214164438.GI18349@pd.tnic> References: <20180208225833.22074.25995.stgit@tlendack-t1.amdoffice.net> <20180208225846.22074.70944.stgit@tlendack-t1.amdoffice.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180208225846.22074.70944.stgit@tlendack-t1.amdoffice.net> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 08, 2018 at 04:58:46PM -0600, Tom Lendacky wrote: > @@ -2681,11 +2731,15 @@ static int __msr_io(struct kvm_vcpu *vcpu, struct kvm_msrs *msrs, > { > int i, idx; > > - idx = srcu_read_lock(&vcpu->kvm->srcu); > + if (vcpu) > + idx = srcu_read_lock(&vcpu->kvm->srcu); > + > for (i = 0; i < msrs->nmsrs; ++i) > if (do_msr(vcpu, entries[i].index, &entries[i].data)) > break; > - srcu_read_unlock(&vcpu->kvm->srcu, idx); > + > + if (vcpu) > + srcu_read_unlock(&vcpu->kvm->srcu, idx); ./include/linux/srcu.h:175:2: warning: ‘idx’ may be used uninitialized in this function [-Wmaybe-uninitialized] __srcu_read_unlock(sp, idx); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/kvm/x86.c:2739:9: note: ‘idx’ was declared here int i, idx; ^~~ I know, silly gcc. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.