Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp16630pxh; Thu, 7 Apr 2022 21:24:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpCiurg/MyWQ04Jwgw1DHIdyrOyXDnTQ+cnfyFJTX9PxDeIsbwqfcet0VeJBJxqRUNoNcf X-Received: by 2002:a05:6a00:21c2:b0:4fe:81f:46c7 with SMTP id t2-20020a056a0021c200b004fe081f46c7mr17396808pfj.5.1649391886565; Thu, 07 Apr 2022 21:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649391886; cv=none; d=google.com; s=arc-20160816; b=e/7SVevfxyEFHvjn/XI+ynwUodYkKESQnYzEfYroxpe7+lDWVqcGeqyX50XJuQOqnV 1Ao5ZAziJF3r11l7LoaztXX64JGalFOaqgUhb1Rplph5plmbgfkd1r2sKbDjouB6rbIb Lhl88jIUShu/f+kvKI0T/OtN16urXKQ2uTnQkK5wBVm5agZDQsGxoRwI9LzjXx3NFx3B 2gAYA5DbQydxquOa8RIsw/z98hlfz7zH/bijodTkNeH8FKFnwLL9xEts/qJBeRbk/nGN DyCMizHz7882WKqVh12Sj/nVnq3fp9EkVRwcySULaIP4Qvx0skHjeS38BFhRp9IVnEpM nJmw== 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=pGPSjdqFhm6JbWsLEGkHGwtIOYGZCPpDVeSUP4v73cA=; b=JBewT/2CwA+VTt3nfxWCGFzasIBTv8RT8eALmA517fvzrGs5ewwgH0Zh8ko40F1KmQ H8Jf1J9q4qRaWR9iX7nw9BEsjHNwvyc+OrXW4Na6+9dNboSQb32A1Jw9URHVLFqSrfXy /uNPchcVD7983OuJnvwC91+nZZS1kWC6gdYGZR9Ivc8OeCdP1rbqedR5zw2AwQRN8A/H 8l+d+Mwym7m8UnmsU34qUgyJ023K/5uVCkpsW8mz7ALjtKhDR16g+hXwpwd7th8AZ1WB b+etrBVpS+TetO04Aep1DrPyMVCCSbylDJFFnusrPvcbO71vs8x0WAx0NojP/Uiwp/TR hV/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=khNzBrZQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e12-20020a63d94c000000b0039ad8a5b075si234712pgj.214.2022.04.07.21.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 21:24:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=khNzBrZQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9175CBE9FD; Thu, 7 Apr 2022 20:50:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233981AbiDHDwm (ORCPT + 99 others); Thu, 7 Apr 2022 23:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234039AbiDHDwf (ORCPT ); Thu, 7 Apr 2022 23:52:35 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69359B823B; Thu, 7 Apr 2022 20:50:32 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id p8so7319382pfh.8; Thu, 07 Apr 2022 20:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pGPSjdqFhm6JbWsLEGkHGwtIOYGZCPpDVeSUP4v73cA=; b=khNzBrZQA9Zi9WGe0/dhPo+UEjVpCb97erCc7tj/bNgXPVwSpD8c7kP7v8tqgcmDpL hdkUmEyE4KQLoXRIn7IgPeb/m+/hveO7p3KS6BAMkiC1tLgo380tjYOf2aB7M6J3weU2 9zJLAdVXo435elDtaeT1k6AljhSzxKbqzr0BWct7CM2ZwKjyZhWynb1UwvjJm7dTkUXf 56pAAfI3v4hMwr55lioXLmMDyNoKjwa9lPJX/kgOHbefuoHiJmXIT3dGFPrPsRPcA+lp 5nJ2SdR9qFSCRbNdLNZPeuioohw41cOYp+r+xqTME1/9yu6B0tkr5L/AT8J84RcTefMl YoTA== 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; bh=pGPSjdqFhm6JbWsLEGkHGwtIOYGZCPpDVeSUP4v73cA=; b=WipsZTlheZHRFWHHvKGHNPVv3lUq9Qqyuq0mzTz9pSUUZUnk0ZELkvu/Lo/pKnaGa7 I0QSHzxeUf5Eicrg7LNdqwKPCgiE4BauKE5RRB0Z5UfZPXiEwWOuXlAYZYhXGaggW+dU 34GJYnuWYcNhkkPNjY9dAj3rNAU9LYpEzACpQmmdxLQykBQqDwzkLNqhDUMQtuqU49S5 tG/FaShbWcVDD55My99WzAnmXrPsPlzgpUA6zqcNSEd/TPJKuXM2IG0fTDAfS8EWRzx/ mqlx/WbcoZEcmB5HFoXltHoD3fCaizih+9TQhmNRfPP4NPb7frAoDWUcsgkbYCYa5HRI ZQkA== X-Gm-Message-State: AOAM531gYC3aedz8/XmaqdeDoYiT0siLzFQqsgwRGfaANE5Y+rS8wccV 6ydFrRDowp+v5IX5Sd/xoTY= X-Received: by 2002:a65:670b:0:b0:382:243d:fa with SMTP id u11-20020a65670b000000b00382243d00famr13816032pgf.360.1649389831816; Thu, 07 Apr 2022 20:50:31 -0700 (PDT) Received: from localhost ([192.55.54.52]) by smtp.gmail.com with ESMTPSA id g5-20020a056a0023c500b004fae15ab86dsm23944711pfc.52.2022.04.07.20.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 20:50:30 -0700 (PDT) Date: Thu, 7 Apr 2022 20:50:29 -0700 From: Isaku Yamahata To: Paolo Bonzini Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson Subject: Re: [RFC PATCH v5 102/104] KVM: TDX: Add methods to ignore accesses to CPU state Message-ID: <20220408035029.GH2864606@ls.amr.corp.intel.com> References: <3a278829a8617b86b36c32b68a82bc727013ace8.1646422845.git.isaku.yamahata@intel.com> <7ec77c3c-7819-38bb-96ac-ca249e2e0f42@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7ec77c3c-7819-38bb-96ac-ca249e2e0f42@redhat.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 05, 2022 at 05:56:36PM +0200, Paolo Bonzini wrote: > On 3/4/22 20:49, isaku.yamahata@intel.com wrote: > > From: Sean Christopherson > > > > TDX protects TDX guest state from VMM. Implements to access methods for > > TDX guest state to ignore them or return zero. > > > > Signed-off-by: Sean Christopherson > > Signed-off-by: Isaku Yamahata > > For most of these, it would be interesting to see which paths actually can > be hit. For SEV, it's all cut out by > > if (vcpu->arch.guest_state_protected) > return 0; > > in functions such as __set_sregs_common. Together with the fact that TDX > does not get to e.g. handle_set_cr0, this should prevent most such calls > from happening. So most of these should be KVM_BUG_ON or WARN_ON, not just > returns. If debug mode is enabled, guest state isn't protected. memory/cpu state can be read/written via SEAMCALLs. So guest_state_protected isn't set to true. Anyway for now with this patch series, debug mode isn't supported well, I will go with adding KVM_BUG_ON/WARN_ON. -- Isaku Yamahata