Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp63254lqq; Wed, 12 Jun 2024 17:02:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWP0645AZDl9Hmg86CHl2IweyHoipc/WvupF1ACj3wbygZiTwGCeuxgK7L7/pQ6riwNZfbe52/4GwzLD639zegzQKzOKpOUfqGvBlBXEQ== X-Google-Smtp-Source: AGHT+IH9iBxIcUsAPuTBrbsnmBQF8YpgAh8OddOA0eYVZbB4UOaqronCTMrmk9+p7psQ4TaLK0Xm X-Received: by 2002:a17:90a:5917:b0:2c2:e175:4076 with SMTP id 98e67ed59e1d1-2c4a76dd789mr3196725a91.32.1718236947761; Wed, 12 Jun 2024 17:02:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718236947; cv=pass; d=google.com; s=arc-20160816; b=vEkZHAJ9qFXge+I0KWo6uzCCUUEHorTTvqEBizvArZtCSmI29P4L6vzu+woNAbxASf v6RUlgjRyKQcvRNLKqzlowwU9l4L8V4P34hOVHqCTaFR6YydBOXigONAQ7smc8T7CZlv b1964fEZ8+Pzm6hqdCEWfQf5552o61K34FJgso7q9KvkjQuVSMDgDdVggjRamatYNxcR sp0rPw40RPDmOuaKlWGnyxWy0p1OpvC3eY6yTbebrbqGh2BIKAQTIV+gYMrn+4tIFWBL 6rgmKL7UWT3dPWaAdANMc6Lk9uK2P/Omc/ChsQ4HauKRnUf33ENWx0ogAYFIjROHjkWW vitA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=LbtqKKQm97BowZds9B5adCnW1KnZQCMsmfiIrci+y0c=; fh=ZwwngaQMdNIF+KyyxVsw37Ap0It58kLI0jDDCqyzRbI=; b=Q+gKz9rQBkCGzpjE3WR7wJAWPitIJZ6SpgIiQsQ85h/EhNX7siMS/FaGx1fptpQ35k 5wyZVOqJ5723F97L/8UQuonU4AQS3U1Iesu93oyOpGKwPcaY4gY06sNBYfyyN+BXx9bF DgU2iJwvl0FPf+oCG47ls+yIDh3EzTWzMx13rPwmKfi9dPNzInbyUqOZ3UyoCsedir29 zBX/gfkSe+qbkEKOKIuc5VRPvKltfTzTPcYauGtzpSmfjRiuaXy8Nq3CudzNCEKO5YbP KvMjHXBxPYGoFw3xGE+2wMf95HQvh8nz2ASP+2a+41Gx7DkbCSenErqGkmOOxDkUiywH eXOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jirNIJYY; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-212388-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a75de968si2433702a91.32.2024.06.12.17.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 17:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212388-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=jirNIJYY; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-212388-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 111DE283088 for ; Wed, 12 Jun 2024 23:55:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 696CD12DD8A; Wed, 12 Jun 2024 23:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jirNIJYY" Received: from mail-pf1-f202.google.com (mail-pf1-f202.google.com [209.85.210.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8601D12D20F for ; Wed, 12 Jun 2024 23:55:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718236534; cv=none; b=dyi7hMBvblKV4AQUkTGItzFfhfOhwdLytI+t2l1VWnC/DPznEhAaYbu5ZR9jRW+k0GWarimhNyelIdEWqFStY/EDHlLe3Xy8nTdl42511yPkK/Ypw0iGpqUY67tchcM60bnZw52oq/pwYUhbAXkX0myrIf7brMNwDXu6A88D+WU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718236534; c=relaxed/simple; bh=UExzSWlT64SRTujuwraGmriH1bXzmArZy7Cn25txElQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=K6G+rSuCc2St0EbCcXADil/l1mtAPBtWNtzW4dgvO8qI+k5IhmEGtmSZXSfzfNWnc6PJy2k9JimHeKosTlVzFyKIh6AeAQVn05BT59V40EBl8hh4SYqZDvIoTaq8ptE+kc11lXfgp0bMhgoFWT509E6OjwUwOhrw6K67pW0calc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jirNIJYY; arc=none smtp.client-ip=209.85.210.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-pf1-f202.google.com with SMTP id d2e1a72fcca58-70462a67378so324958b3a.0 for ; Wed, 12 Jun 2024 16:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718236532; x=1718841332; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=LbtqKKQm97BowZds9B5adCnW1KnZQCMsmfiIrci+y0c=; b=jirNIJYYKuHlN88ExgvTAXbzBT5huFy4GJFP0i7P5OP3701PKraGKtdsuHi9tq17uf rP4p+tjbRQFk2Pg7HYiyJoX34ie/ja4NbmDtp3jLVx1kAWhpgr0A080Ag86uERFnlpKd qNvnLn31puwbxsPh+KrOKJzAjMWAlNk5X2tdrmXlR9qNgtQL/kW7BBVHH/GGo1y+/wrh xwcPD0v+o1fijW9uK5iv3DQowwruNhsD5VP8JXpwv/azfaDoBREB3I6APEnpRhl8yKDJ pFaOL+Ta1zAArMnSzNup/eDXuynXsJ7li2kB9fNk7+o2ErtdnZHqqY/m/yMzjGAgn4hw /oVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718236532; x=1718841332; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LbtqKKQm97BowZds9B5adCnW1KnZQCMsmfiIrci+y0c=; b=dCUops4LusTomS4mUYv9UCVewTIsRnldhCiEdU2lt5cy1eodZPNVosxUCKnG8FprLl UYyDydvfZTNIUaH+d6V+U0Pyj6QHFnMfHhTzI+3TGVzhQ6RUU/IqeifO/yK68L6SkFqP gwDEFYNuqz03DJWhA41aeo/zFA3FEIqLho/uISvD9MqqXpzGmCAFdSOfX50dDh0NOqTX BWLJZTOhlVsm0YZ1WN7oqfPUCWWFb8ZD2GaLeSHILoSxYqcL2XAeeJOb9cy2PLyQxJmk FjeDJiJGqTrSnHsAMA4Xn4eSw5zK0ziq+hQToZJWvrulWQeuOC4vm/Fjr1I8BNEIMFjM xKsg== X-Forwarded-Encrypted: i=1; AJvYcCW5GKLX3hZIP83Tz08zNvKhwxLvzuQWDmXSZyPeruJqKc2gsZsuXaMpoGj32wowcomSIuCN77w0SpACLzLF6nI9x0n7L8WqNSEA1Xt7 X-Gm-Message-State: AOJu0YyMNf1viRIR+3tCpm49sQfvj3fruaZIs6UOi12naZOuZRaiZTxh GPHh1cf9Clg6cQoDEKeHI0CmkL54DbSkXgrBMnIGhaQiHfxxttilCbc8PzOX3kbmS8WPZD87dOz 2rw== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6a00:2d0f:b0:704:1a73:d008 with SMTP id d2e1a72fcca58-705bcddfb7emr13011b3a.1.1718236531660; Wed, 12 Jun 2024 16:55:31 -0700 (PDT) Date: Wed, 12 Jun 2024 16:55:30 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240207172646.3981-1-xin3.li@intel.com> <20240207172646.3981-16-xin3.li@intel.com> Message-ID: Subject: Re: [PATCH v2 15/25] KVM: VMX: Dump FRED context in dump_vmcs() From: Sean Christopherson To: Chao Gao Cc: Xin Li , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "pbonzini@redhat.com" , "corbet@lwn.net" , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "hpa@zytor.com" , "shuah@kernel.org" , "vkuznets@redhat.com" , "peterz@infradead.org" , Ravi V Shankar , "xin@zytor.com" Content-Type: text/plain; charset="us-ascii" On Tue, Apr 30, 2024, Chao Gao wrote: > On Thu, Feb 08, 2024 at 01:26:35AM +0800, Xin Li wrote: > >@@ -6449,6 +6451,19 @@ void dump_vmcs(struct kvm_vcpu *vcpu) > > vmx_dump_sel("LDTR:", GUEST_LDTR_SELECTOR); > > vmx_dump_dtsel("IDTR:", GUEST_IDTR_LIMIT); > > vmx_dump_sel("TR: ", GUEST_TR_SELECTOR); > >+#ifdef CONFIG_X86_64 > >+ if (kvm_is_fred_enabled(vcpu)) { > > FRED MSRs are accessible even if CR4.FRED isn't set and #ifdef is ugly, I think > you can simply do: > > if (vmentry_ctrl & VM_ENTRY_LOAD_IA32_FRED) > > just like below handling for EFER/PAT etc. +1