Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp853079pxb; Thu, 21 Oct 2021 10:41:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwvsWTigKBxJEhQtBAAmPpwuLMFTe7C/D91ak7d/8H2D6dpPMVyJaO5d3e1RTvXMO8GYS1 X-Received: by 2002:a50:e108:: with SMTP id h8mr9549697edl.42.1634838095931; Thu, 21 Oct 2021 10:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634838095; cv=none; d=google.com; s=arc-20160816; b=CM4Z+WUcKWayY54NI4XFQm4VD9MbB0E+bKk1sHx3+ctpZXrG1V0MZ2IP+8TxjU3eMd 3v7kGFrZio5zN94lnfluichoXfi18vjQuOh3pesH+Xf3BAe1q2l2iiLMQdvmYKZo8dng LThdScHgHOudzs3FbCshkJxPJHart8zvDFpASuFU3cfc4fbZH4QTI/WQueFHZ7vr2Y+d W5Xk9YZFot78dy+2nVta9hEmGXcBl8kCuJ7k5w9AjvdZSgRyLWnzRm05eldagTwP4X3t 2dOS+LIfa3j4CKv4yQnuyh1bZvu/KKJkke3vbB6c0MdYTD48wZTXSwYG9EwRA1C/xeoD DVVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=00cbYgpw2dYSkF28MjWjljWuNsD4cmUAI68U4oIyQGk=; b=dQAgfgDcmJZ3Ohv/Y3nqKV9zBv8oUKJ7VICwKas26k6ERf3L4uodhCdDLjYZvGVBO7 Qac2mPLY15zr8ZOzpA/vkvxW29uBYYNmB/HZBpMfpFhcGJge/njf0drXAuZDYgxVFF5t Xp/Lx5+k8+VIhDRmjnxxrOZHqsIhoDUf0KmLKJzb9NuS+0QgC1z4HUyVe7tsl8ZWYD3f PSm0Gb24naij3MZ3l9JB6LpO9TKbMizHk0vscFiO7wwabXWiGkKGA9kFjb1qYiTztXGY TzFITIhRzSL4SloXZZRdb9uReXPy5zCnZDCUPGLfZ+rgzjmYH1LY6pB9+a0fW4j9X/LM py1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=D7PSMCkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id r20si6618398edd.587.2021.10.21.10.41.12; Thu, 21 Oct 2021 10:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=D7PSMCkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232130AbhJURjW (ORCPT + 99 others); Thu, 21 Oct 2021 13:39:22 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57572 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbhJURjV (ORCPT ); Thu, 21 Oct 2021 13:39:21 -0400 Received: from zn.tnic (p200300ec2f1912009d2c3fdc96041a10.dip0.t-ipconnect.de [IPv6:2003:ec:2f19:1200:9d2c:3fdc:9604:1a10]) (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 8838A1EC0298; Thu, 21 Oct 2021 19:37:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1634837823; 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=00cbYgpw2dYSkF28MjWjljWuNsD4cmUAI68U4oIyQGk=; b=D7PSMCkJQL+v+1ot4TxJ+1kfVS4aSDOp1t/3Qw7drrEY4xHhy8cXgf4p4PWGAEFQUcfMEM BrHQk3X/xxlgVn8o+Ho9se8qQoRiD84RfQDQQ3aUXdbtb0MXUbHVtEBXogaegim8IH3/U+ eYTYjhcKwS9RFw0qUW7F9IQPdqpiYlM= Date: Thu, 21 Oct 2021 19:37:01 +0200 From: Borislav Petkov To: "Dr. David Alan Gilbert" Cc: Michael Roth , Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH v6 08/42] x86/sev-es: initialize sev_status/features within #VC handler Message-ID: References: <20211008180453.462291-1-brijesh.singh@amd.com> <20211008180453.462291-9-brijesh.singh@amd.com> <20211018184003.3ob2uxcpd2rpee3s@amd.com> <20211020161023.hzbj53ehmzjrt4xd@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 06:12:53PM +0100, Dr. David Alan Gilbert wrote: > OK, so that bit is 8...21 Eax ext2eax bit 6 page 1-109 > > then 2.1.5.3 CPUID policy enforcement shows 8...21 EAX as > 'bitmask' > 'bits set in the GuestVal must also be set in HostVal. > This is often applied to feature fields where each bit indicates > support for a feature' > > So that's right isn't it? Yap, AFAIRC, it would fail the check if: (GuestVal & HostVal) != GuestVal and GuestVal is "the CPUID result value created by the hypervisor that it wants to give to the guest". Let's say it clears bit 6 there. Then HostVal comes in which is "the actual CPUID result value specified in this PPR" and there the guest catches the HV lying its *ss off. :-) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette