Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp144891ybl; Thu, 15 Aug 2019 14:23:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJo2zqGiJPm/2punacQsTG+CjeiRmbQ7AXSQ9rA+283Z49dz/vTFDgWfCBvrYcF6g8yL3W X-Received: by 2002:a17:902:b48f:: with SMTP id y15mr6266010plr.268.1565904217926; Thu, 15 Aug 2019 14:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565904217; cv=none; d=google.com; s=arc-20160816; b=hW82ABKw2TCx9cUpvErwnUx+SPuq/pFteVeaWAts00uASaNFusYOT0cR2TlsJy5CU9 XDZon3U3c/pqyVs99CrH7aD/t3KvQqnKrY/7ht6ZWrXw0JfqtRZAD8CSHg2/i77I5EWt 4y5f35CIQZDSaUolIvjiYyOTRz+dJHr6QvUl+QFyKZEJfKxlWv3ID+6HLKp441Ph1lhc HhsKD8qDQ+pD+JE7UpxXEgi0xUzgI+kGMVu6SuJUXAakaDSYMiqEwl7CUSuGwGCDFkr9 HU70UBxQpQtmx1u9PGc5VcaP0Kthfs9vvpt+e84u+a2D+8++5bd/oTJOrS81MqA1SXqF yjSw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3cTqspnxsRR+dFtWCSWAL1onU2pvC0uxIqpEe+/lcYY=; b=qIr6OckyJACvNcP+GZD9LKYRemaqOOnsirQcHVM8qdjE6LAWilT80m8po8uOdtuGl4 CEEJSBNYq19c9r1XtvjvvfAPgNx0NfBzwDG6gViYW3q/bjHFURDHwO8UXNgBEUQi5WLr ftb9BBwFsnM1TBu1tax+n3iyUQpXhMYTU1XeIiTpWDULRm/ImUEfMyG0ZRyamx4L1plh nNBtMJsuAhwI+n6Nhbpmpn3Wgl+q4IlgnDoRdUOdZp33g5T3G8r0RqvCjjFKkp2/IPw5 p8eOCoulWWrZPA6jxb7hIvbgVcNCLjEClktlGu3jGzD/6W1g9eQtIybSypSHXnvyU4ca 3N4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Ipq2V1iJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si2205246pfc.227.2019.08.15.14.23.21; Thu, 15 Aug 2019 14:23:37 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=Ipq2V1iJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732181AbfHOVFI (ORCPT + 99 others); Thu, 15 Aug 2019 17:05:08 -0400 Received: from mail.skyhub.de ([5.9.137.197]:35698 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729562AbfHOVFI (ORCPT ); Thu, 15 Aug 2019 17:05:08 -0400 Received: from zn.tnic (p200300EC2F0B5200F4090F5F0FC894B7.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:5200:f409:f5f:fc8:94b7]) (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 050B11EC074B; Thu, 15 Aug 2019 23:05:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1565903107; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=3cTqspnxsRR+dFtWCSWAL1onU2pvC0uxIqpEe+/lcYY=; b=Ipq2V1iJgsNLv9JZZ2ex9QwuIv/pOG9GfxP5YFImUmGL7w5NNfRH5wMrUzhU8THeFQi4YZ sgCc9SsMP0DxBvRnxTCF4crIRMPOhqkCroMfre5zzrgQGJk6t9m02uFUwdiBDjB1v8qoL0 j0sz2O37NXmrbpPn4o0ctrIpXqTRLv8= Date: Thu, 15 Aug 2019 23:05:47 +0200 From: Borislav Petkov To: Andrew Cooper Cc: "Lendacky, Thomas" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-pm@vger.kernel.org" , "x86@kernel.org" , Thomas Gleixner , Ingo Molnar , "Rafael J . Wysocki" , Pavel Machek , Chen Yu , Jonathan Corbet Subject: Re: [PATCH] x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h Message-ID: <20190815210547.GL15313@zn.tnic> References: <776cb5c2d33e7fd0d2893904724c0e52b394f24a.1565817448.git.thomas.lendacky@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 15, 2019 at 09:59:03PM +0100, Andrew Cooper wrote: > If you're virtualised, the write to MSR_AMD64_CPUID_FN_1 almost > certainly won't take effect, which means userspace will still be able to > see the bit. msr_clear_bit() has a return value. We should check it before doing anything further. I hope the HV actually signals the write success/failure properly so that we get a correct return value. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.