From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EABD2C85 for ; Thu, 21 Oct 2021 17:37:05 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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