From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (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 54F5E17A300 for ; Tue, 11 Aug 2026 00:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786406604; cv=none; b=k/kM4CR5UXf8lNznNZp0RX7HP8eciEVprfjNHN8YUvk7jLoggweTxPgJwITmm3EFFU3CgVx5GbXAUsck0SeYvXfe7Ag85n9HDO/D7Lqgpe4ege7mInDcKVFqUvbEq3HvaGMsgbXHjXeT33+Rb3oFguRgODAdW6MKvAT7t9l2ILU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786406604; c=relaxed/simple; bh=VknSZXDkyZLJjuTzL9I1xTfQa1Mt40VNpMN4ud71R3w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=H/B3cLClkmO0HkOgJ3Ym020CWhlkdwfjvSkCKZxxtf7t5/6SinFAN6BVHVqhQUV8XP+nTSThWkLplypSlJjA9Qw8PAyuEgmO4rblLi9Sfmh+5ZX5MAr2NYmjfqHwjQpCLmYLBokVhostWRmZ6VVnsDxdVw6mJk4xS8lGyjfrulQ= 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=p3hEzK71; arc=none smtp.client-ip=209.85.210.198 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="p3hEzK71" Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-848568a6f62so4932265b3a.0 for ; Mon, 10 Aug 2026 17:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1786406598; x=1787011398; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=V34LZvL3zmDJfeGU5wjT5dtwNItHoDZBEfOxW5gT6qU=; b=p3hEzK71eqbtp4U1yuwk9B0EIYWdP2Nu2/DtHA7AUDBlQikTJF8fkWVF2GZ1kDwpy+ VYAOJA5UMxiih/DZCOgc7bAUOLasVQHCTqiPB0lLvnPS3bkFjyF0mhLjtJ+aWTRz5WxJ rzCvwYRcCoRtWT8gKosqTvXwr+RF0r850ex8HqaVIUomwjdK81x71mEE6UDbJKYJV8FP DwR0So6OpXl8peaxe2MLFoiUznlOrEtlzq0QgdXGRTh1asQHpZuBp5JtldhNrlum9HN2 29rnNnaPCLRFuAw5vVyBzb7cXaV8jcpzMu+BTnH/YaTPEjaMsLVIOm/RBbxvClVwSOQB 0ODw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786406598; x=1787011398; h=content-type: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:content-type; bh=V34LZvL3zmDJfeGU5wjT5dtwNItHoDZBEfOxW5gT6qU=; b=eEqvujxikSq8CmhxMfy1zH1F1/a25UtiEhcqmgXYPAkIfeGIrSUdQmtZ+C3ZCteAln sVsbu/+PEw5Zf+iDFd4xLdInrSsw8ckkibnbpwG9KzBfZKQNTf+f9TVRGcE8SrgsBm9i sLTwp1by4TWQqMbrDatZeRY200L+IV8RA6/EGJvXFCXWgikniHftJ69qkl8ek9ujqcdo UaDNCt8qEU0PcIEDTceeQZY/EkRih1Un36MdqaZ22HtM1en/YjD6ebiqxSfnVeEvxy/r l+KycpWQuSJgQzQ52WOb/DmBnVW92m8buK7v8P6KYH9yGNcd3FNFkmURODkQ2LzF4/e2 hRng== X-Forwarded-Encrypted: i=1; AHgh+RruDeruil5NuAAixUlWbX3xeQkMF1TJbiXDMg3iYqn6PCgM4NyHU/keOpoheD4b25tPagQpHxhp9+X22+4=@vger.kernel.org X-Gm-Message-State: AOJu0YwU23cLaUcR4b8VlNRCzKckJTjFHJmOPKGOoDmYpju7I5yKzOZy drFXaQFcwi5+BqjSXZS2dD/1mKWqOVsUtSw6eoTLcAK+pFR1vPNRzvNZ5HDBJoGSk/H3BQSf+YV hmchoDg== X-Received: from pfbgp14.prod.google.com ([2002:a05:6a00:3b8e:b0:847:8e58:df6f]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a00:4b11:b0:845:e41f:9696 with SMTP id d2e1a72fcca58-84f2e00ea6dmr48897452b3a.25.1786406597125; Mon, 10 Aug 2026 17:03:17 -0700 (PDT) Date: Mon, 10 Aug 2026 17:03:16 -0700 In-Reply-To: <20260810112200.2326727-3-xiaoyao.li@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260810112200.2326727-1-xiaoyao.li@intel.com> <20260810112200.2326727-3-xiaoyao.li@intel.com> Message-ID: Subject: Re: [PATCH v2 2/3] KVM: TDX: Fix the exit reason handling From: Sean Christopherson To: Xiaoyao Li Cc: Paolo Bonzini , Rick Edgecombe , Kiryl Shutsemau , Nikolay Borisov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev Content-Type: text/plain; charset="us-ascii" The shortlog is way too generic, and the changelog is light on details. Over the weekend, I managed to forget why this was necessary, and it took me a few seconds to recall why we need to avoid setting bits 31:16. Of course, one could argue that says as much about me as it does the shortlog+changelog... Oh, and shortlogs like "Fix the exit reason handling" sometimes lead to amusing follow-ups like "Really fix the exit reason handling". Don't be that person :-) Something like: KVM: TDX: Don't clobber exit_reason[31:16] when TDX-Module didn't try VM-Entry and then in the changelog explain precisely why KVM needs to avoid clobbering those bits. On Mon, Aug 10, 2026, Xiaoyao Li wrote: > Get and check the exit reason from the low 16 bits of vp_enter_ret, and > store the synthesized/transformed exit reason in the "basic" field. > > Some bits in the upper 16 bits in the exit reason have their own meanings > and they might be 1. When handling the exit reason, only do handling on > the lower 16 bits and keep the upper 16 bits unchanged. This change > also helps remove the additional check in tdx_failed_vmentry(). > > Note, due to the synthesized invalid exit reason, -1, is changed to > assigned to the "basic" field, adjust the checking in tdx_get_exit_info() > accordingly.