Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp630778imu; Wed, 9 Jan 2019 03:51:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN6S4xYJtspb15bsNTlbHXqu992a4yMyDunFCoeMaEdPlLmddMEfvf8T8IUdr4BUjCUPRUbf X-Received: by 2002:a63:4c04:: with SMTP id z4mr5160999pga.312.1547034686940; Wed, 09 Jan 2019 03:51:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547034686; cv=none; d=google.com; s=arc-20160816; b=0C7n1tO5yAHNl10UK46wA0rZ+vPn5UbJ6sxfliffYNdd9A9uZ6M4Pi1Lnq/p0vHp2L bfBiVvb6jzDyYQx6nYNyr6L5r3unv5Eu8dGFVHwh3toHlNxYtUuxxp4EjOF0URwV+szl TF88sVqs3ssBu5o5yw9QDnuEqEGGvrTnb4UGBi7yOnV5anj9USxnxz6jQ6BEuiOvvJcv +R0J/Nly/Lyb1LVeSyUuKcwg0Ovu7fPpaQCfdpfA6lQPgowRutihYDJNkfcVJB0yfcyF XRzXZbVrlr1dbz83eHfvdy5cnUBDhZjuANuh4KgxTPTVMRGdjMl4w4GAO3i90epoljie GgBQ== 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=O64S/Pgx+ufo7VPMedv5rxFREieQ/PwtcyPrmYesS3I=; b=zRZGygUjw3KjQ6OVxbyRkCKui5Ejjftv3Wx88kh1Rwp4aSSIGiNPk6qoJKsTO3qhv7 7JW9zoZ2rtFk78K7WcmaDctMh4OK1XOQqOKyWBvvaesvHe0FzMAANWwWluiAr/scRlKF kQ1bCRP/GFuJ54PBu68dlrtXL7srr96lwekCpTAV6Sm77Iq0KgBKq1e1mIGrK9Rh33GO o0WjR1K3nvG2XOxppJlPhCpwIkhCqGoOm8vxDdNjD1Boni50NABdQ2hO6hMXDLwGQS4S XeW3BX5XB3TrW9l5A3vnPFFD08EVJjoH8LFyVIX9VVejNrC910KK617n+aV32BE06h8d 4HZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=qD4u8DbU; 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 b14si2867839pfc.156.2019.01.09.03.51.11; Wed, 09 Jan 2019 03:51:26 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=qD4u8DbU; 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 S1730915AbfAILj0 (ORCPT + 99 others); Wed, 9 Jan 2019 06:39:26 -0500 Received: from mail.skyhub.de ([5.9.137.197]:33060 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730882AbfAILjZ (ORCPT ); Wed, 9 Jan 2019 06:39:25 -0500 Received: from zn.tnic (p200300EC2BEA1000E56F05EB9FFDE1E7.dip0.t-ipconnect.de [IPv6:2003:ec:2bea:1000:e56f:5eb:9ffd:e1e7]) (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 85EE71EC00E5; Wed, 9 Jan 2019 12:39:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1547033963; 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=O64S/Pgx+ufo7VPMedv5rxFREieQ/PwtcyPrmYesS3I=; b=qD4u8DbUKDZu+JCtDXJzI5EMUaXKXutQyYVuev+AIrCJpf5K5Sf33WY8g8YdSksT3eLDPz cLyXu8MEAwqjQD6HfX3TeFbigjkuSMbtjMOeBb2d12kNpMMsxr4qklu42WLS9JWxP9hYfk cWK7XY65eT9wqXRnGfNX2QkTKhpaf4g= Date: Wed, 9 Jan 2019 12:39:15 +0100 From: Borislav Petkov To: Reinette Chatre Cc: Vitaly Kuznetsov , Babu Moger , x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Jan =?utf-8?Q?H=2E_Sch=C3=B6nherr?= , David Duncan Subject: Re: [PATCH] x86/intel_rdt: use rdmsr_safe() to workaround AWS host issue Message-ID: <20190109113915.GB15665@zn.tnic> References: <20181220134046.7916-1-vkuznets@redhat.com> <20181220161722.GD31403@zn.tnic> <51dcb13a-4751-47f5-1e01-f6731a2c6f3c@intel.com> <20521afe-09af-7acf-6f32-3f6e9a971091@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20521afe-09af-7acf-6f32-3f6e9a971091@intel.com> 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 Tue, Jan 08, 2019 at 09:39:46PM -0800, Reinette Chatre wrote: > To clarify please the last sentence applies to real Haswell server CPUs > (not virtualized as prompted this work, my apologies for the confusion) > that support Intel RDT but does not have CPUID enumeration for this > feature. With Vitaly's patch this hardware would still be detected as > supporting CAT but if CPUID enumeration is moved earlier then from what > I can tell this hardware would be considered as not supporting the > feature anymore. Ok, so hw "forgot" to add CPUID again. And CPU guys should know better but everytime we hear "important reasons" why they dropped the ball there. So, assuming RDT is not going to be supported in a guest, we need a proper fix to disable it when in a guest. So the RDT init path needs something like this then: --- diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index c3a9dc63edf2..1e5a1cb49e9c 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -969,6 +969,9 @@ static int __init resctrl_late_init(void) struct rdt_resource *r; int state, ret; + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) + return -ENODEV; + /* * Initialize functions(or definitions) that are different * between vendors here. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.