Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp859257pxb; Thu, 21 Oct 2021 10:49:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTbNlOjfzet8ceZENrEy56kq/ak9bhMxrNHM285qQdLHXu7d67DWC9E+6/CTO1yZ7Dhs0m X-Received: by 2002:a17:902:7885:b0:13e:ecb:f214 with SMTP id q5-20020a170902788500b0013e0ecbf214mr6436507pll.87.1634838561190; Thu, 21 Oct 2021 10:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634838561; cv=none; d=google.com; s=arc-20160816; b=lXdI1Bj9LKdpCTrivGJpzVfLeaOE5AEXUStkg8ZMpdrWEq6wK+VHGVg9t4pfQntbQb 8cEfVsCg8NBXihfPkhJGBlr0vGZb36CBi5b969ROwLpGyze7b7D6Z+TFpsjzaGGgboW+ a0mBjNAmcFUD0RIiTqMJnZMDOQP8vGo7HdEjkVzFF+WN2BJIX/u4DfLzPO0G/q01KQOW FAheIALVv2xdSe4vwoTr5COyM9X0zbizome8kOc+rEBPuACjgb+fv1OlmWxhUaKcQNwd CZWoFS+gWE/MOK3Yu2TZMsRXTze98siSqemjVWHO35DDakU/7HXzYeY2YKhF1xYA0IIU nifg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=sdVy6FwDaq466AExZNtZZOl0E2m/+xf4V5tJYwOKByc=; b=o2TF0cI8m+HwMcuhgrocBnoo5x2aOQbHmfP6Ys1ARhjlzrXFrqFBA0e4aJIxQB2jGo TvojNFgN3/7DowI3DpBGqq0Vz2y1XQrUGTntS3TrLTggZGFuvUiTP70Q0xQeXu3zKa6x WDS/FFsE0WYNAtdnEp41e1RwNWYJggGYOoMOiCXlM1w0cQpR58NI6fOYN2WjMAT3EQ0z rEDFnBbShQ6giOORcMCYQfvOI34A8/HBQ3ApCCjkxnUWX1S/9oG/wOanNYdu8aC+gQHP Gfmv6agIsDx1ecK3LaBazJo5lKdBfan9fOTDZwfLKgxLgkiyOGbsNyhUsypFdYSXrfDZ EKNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eugDPjAc; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x1si8564748pgr.287.2021.10.21.10.49.08; Thu, 21 Oct 2021 10:49:21 -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=@redhat.com header.s=mimecast20190719 header.b=eugDPjAc; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbhJURuP (ORCPT + 99 others); Thu, 21 Oct 2021 13:50:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31650 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232351AbhJURuM (ORCPT ); Thu, 21 Oct 2021 13:50:12 -0400 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-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-SLQoaVCbNoKrTHxVrYywjg-1; Thu, 21 Oct 2021 13:47:55 -0400 X-MC-Unique: SLQoaVCbNoKrTHxVrYywjg-1 Received: by mail-wm1-f70.google.com with SMTP id k9-20020a7bc409000000b0030d978403e9so169047wmi.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=huQFGGl4MBdL2mAbMsevYxiUCYDB2882CD8JDC2QFMlKFxXWudyxboszNZ6FMkgdoS K/CI+7zaMTrYv0K2VPSVZqcFomkOI2BlxxGyPUkuOzTIxS4ECoiiO4YqfftcRqyr6hQb 1QNJTrPN45cWoU8K5dSEwQujapyirnjiikRjQZW71pTvxO3uKXKFiyQROHSADwVeCI2e bCfcvu0ai96C9zjgJ1aOsKuM9A2sg4nA5cJzw3G/UW3ld532vyUAA9oGwfBpntd2PYPn vA/W1xUlR4/16cLoQfk42WjkRmjlWqQsg5tICV2i1ZD1GSEVB3UFc4Hken5BWWGfBIfD 0Nsw== X-Gm-Message-State: AOAM531x7zyqUBME3PZ46/qln6SbBva6I7AEAuUQ99LRVy5SSTw98nu/ mJBa51sBUgYIHgNZEYw+8FT+3DbemfAAVyyCtnqF6Vh3gvKW85mFwGQT8gfPsd59UztQcDEmg4a xz9c9yxVswrwGVq0LdfLmeFWL X-Received: by 2002:a7b:cbd1:: with SMTP id n17mr23050405wmi.113.1634838473755; Thu, 21 Oct 2021 10:47:53 -0700 (PDT) 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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