From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F484C433F5 for ; Thu, 21 Oct 2021 17:47:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E1316121E for ; Thu, 21 Oct 2021 17:47:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3E1316121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id B3B246B006C; Thu, 21 Oct 2021 13:47:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AEB73900002; Thu, 21 Oct 2021 13:47:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 964D76B0073; Thu, 21 Oct 2021 13:47:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 823F26B006C for ; Thu, 21 Oct 2021 13:47:57 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3F80C183594EF for ; Thu, 21 Oct 2021 17:47:57 +0000 (UTC) X-FDA: 78721177794.07.DB71FDB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id B2041E001989 for ; Thu, 21 Oct 2021 17:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634838476; 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: in-reply-to:in-reply-to:references:references; bh=sdVy6FwDaq466AExZNtZZOl0E2m/+xf4V5tJYwOKByc=; b=eugDPjAcOFmIxVsh4ad+0OdKhkR40/LvJTeI92IFk1pXjalZ2RP0xkxKAvn397qtP222t2 Qz76xSDgujap/RGCf22oabsaRZ8CONB3e2Tbw77TLgTeDR1C5+PoPNp7uUsAzzeLxO3VvH FmU4u0Ghc36bQRFYU4zTe7ieDmPQNI8= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-544-4KtR37pTMaGwDmiKx75Cmw-1; Thu, 21 Oct 2021 13:47:55 -0400 X-MC-Unique: 4KtR37pTMaGwDmiKx75Cmw-1 Received: by mail-wm1-f72.google.com with SMTP id l39-20020a05600c1d2700b0030dba1dc6eeso123104wms.7 for ; Thu, 21 Oct 2021 10:47:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sdVy6FwDaq466AExZNtZZOl0E2m/+xf4V5tJYwOKByc=; b=YcDEVyGj+zz7ESHifkgu9bN4zMdpa9PUWbMzCFL7Z5bhJDRcohR/7viJrV/E1PBqr1 I8zRxhUhYdOJwAbkkeDbP3MPBlNGzlhSjLs+DImZvuCG/Px+S/8+gOnQx7cG7oOQyed2 PSR90PmGZW4ZilJTb2FCqbAjB+e2wAUEGzJzjCuCkElgF4deHc/M1mR29I/1e02N9rNp Sb2tjSj3CA1Znm0qeiqGHHfR8TpoqpY4sDtdvEeofT9xi4+VcaBfrL8KPicFWj9MNDeU 6YD73lEutLXtmoyrLx1F5DF2W7ANKpYETQSLG991x9f/KbsLrzjTtdUQgjJHFDKBWhaK CkjQ== X-Gm-Message-State: AOAM530O6Kt/koRlRe/H/SsPxbHiIF8tL6TJAdVNZd1r2x4Jc0jBcfUf ng2HVxpOTcxL+a0kv5K21ahoYUMwmeTkcFB+37mMy9lD51B3oDDGppdTdefd08vEipN8CgtmaBw MJk2du41mf3E= X-Received: by 2002:a7b:cbd1:: with SMTP id n17mr23050388wmi.113.1634838473750; Thu, 21 Oct 2021 10:47:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrJOA3K2+jcEdUJkI5yUOvDRbh0LHvWJK/dSXnO5HgNUEG6KoK85UuOyllpMd1Zyh5XoN7lA== X-Received: by 2002:a7b:cbd1:: with SMTP id n17mr23050368wmi.113.1634838473557; Thu, 21 Oct 2021 10:47:53 -0700 (PDT) Received: from work-vm (cpc109025-salf6-2-0-cust480.10-2.cable.virginm.net. [82.30.61.225]) by smtp.gmail.com with ESMTPSA id l40sm6144308wms.31.2021.10.21.10.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 10:47:52 -0700 (PDT) Date: Thu, 21 Oct 2021 18:47:50 +0100 From: "Dr. David Alan Gilbert" To: Borislav Petkov 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-9-brijesh.singh@amd.com> <20211018184003.3ob2uxcpd2rpee3s@amd.com> <20211020161023.hzbj53ehmzjrt4xd@amd.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B2041E001989 X-Stat-Signature: xehqc5akm8gi3ufym7u8mwosgyfiggqj Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eugDPjAc; spf=none (imf30.hostedemail.com: domain of dgilbert@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=dgilbert@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1634838470-891381 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: * Borislav Petkov (bp@alien8.de) wrote: > 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. > > :-) Hang on, I think it's perfectly fine for it to clear that bit - it just gets caught if it *sets* it (i.e. claims to be a chip unaffected by the bug). i.e. if guestval=0 then (GustVal & whatever) == GuestVal fine ? Dave > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK