From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 10AAE3D5DBC for ; Thu, 15 Jan 2026 18:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768500418; cv=none; b=uBDjPimZCCXpfd2KgBwVdmNTgtWXN5Zg9Nq/3jV/HqnMfee0m/pZA0MsAO5ZBWwQCVXpWOSSmbfLvEFFJDtc44rA1bItYk90x5dKLexObJhNqhqVWjPiLOEjVgzycjbQ/iY/z8/4EoQq0xGczLrorfVanISQiXKNnkxqafMHTHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768500418; c=relaxed/simple; bh=RhHr0pJFJ26CbuLBfKjiOOVCWk5pWWlWGWHHOUt+22k=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I60OQSFEIw4PRe2veJNlznQzDZV5x82cIa3MfX7bN3m63f8tsQdYhsUHTQSCVeprZBYjHCnhh5sRt+ye1LUkb54kMZ89DzaKTyYQnYINCeyBYTc8ZH1fn8VtXc9p52JHeVrdS5gfXcbfLT5n4mMxiCRlQJhrx9Oc48Ie775A6P8= 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=oXpZe6hP; arc=none smtp.client-ip=209.85.216.74 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="oXpZe6hP" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-34c6e05af3bso1050780a91.3 for ; Thu, 15 Jan 2026 10:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768500416; x=1769105216; 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=X+pM2AdAUHzZiIsyDHjpvI0YAYlBBlp6EV0LHIGDuJM=; b=oXpZe6hPcYiywf61VKhttw12/x7m2prt5E8cIcGe7B2QtuQR47kmc5O8bQwBwmMUBD ysiki0dWBNnoWXuGdEcWBF4T7ytwuqI76Wff6yA1AdbvHiaGCGbDVuUnzs+WA+BnnDCt +8xTEFuaPOybckUH2ZQHAMpxrZhNDYxy7bHpE2DrU7uTBt/kLDgBT9UCHGvHSg0HL/Wt YkvQ+vWlpNMFvZXHeDlNY0aJW48/GEU79bLP2noizTactC9u9Dcb3O7Y4nzuc9cpMgwH e7DYZhdywjTBCVZjzVHuSi2mk6H0ezCBkczfaGoeLQXu5PTPhjH8ym1S58xrUEtEHJSU etfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768500416; x=1769105216; 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=X+pM2AdAUHzZiIsyDHjpvI0YAYlBBlp6EV0LHIGDuJM=; b=A0EEMv2Bvlnw29R7DdjJHQvRMI98qeE+JAWvG3a+EMoqinbUXEHMQQUUThA1DvcEKO Bfdo19sDJeutNV1JCGGQu0xvvaIwLJDVv0PUj1b2lhtTWicrK3+H5QJdTwn2zlujyP92 X28DeqBE25r4uq2Ntg70Muzay6ltEU3Mdo7CDag81WiQ1fuBC5fXsVyDhzq/cGEhYwKt hISl1nfZnyh2vUz9uBAqOYJ/WJS+FqSLUV4wgZJUcRU8d/7HmEFEpXh/FG90rZCB0cDC SlAV3ba5WcFDCsRqLee+Zwhxkqd3BL0jvDg3W4x6ywabuEy+Q65CuD5+tQlTj8f6dbiH 5Bmw== X-Forwarded-Encrypted: i=1; AJvYcCUYoo7DQylhWmooCUGPOZnFOkvlRgm0uXXTeiddWuenLDvbBtlubJfEuaXdNJWUnRUabm9jlJkSG+RVCHw=@vger.kernel.org X-Gm-Message-State: AOJu0YysI+uQoFgAmNw8ro2EL0oveD+9PYQh8GmmFGje3XCGHAKYMjZx WspdhHqlhdaGjjcn4At4cScL02XtIDUOl3S9FyBaVbJUi7De2YyZEdm+ncfrWUEzuYoc5s17fDg L76XfjQ== X-Received: from pjbcl2.prod.google.com ([2002:a17:90a:f682:b0:34c:88ca:9ef8]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4ece:b0:340:2a3a:71b7 with SMTP id 98e67ed59e1d1-35273166040mr173393a91.12.1768500416337; Thu, 15 Jan 2026 10:06:56 -0800 (PST) Date: Thu, 15 Jan 2026 10:03:34 -0800 In-Reply-To: <20251230211347.4099600-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-hyperv@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251230211347.4099600-1-seanjc@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <176849898589.719783.8437609817202022715.b4-ty@google.com> Subject: Re: [PATCH v2 0/8] KVM: SVM: Fix exit_code bugs From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li Cc: kvm@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, Jim Mattson , Yosry Ahmed Content-Type: text/plain; charset="utf-8" On Tue, 30 Dec 2025 13:13:39 -0800, Sean Christopherson wrote: > Fix (mostly benign) bugs in SVM where KVM treats exit codes as 32-bit values > instead of 64-bit values. > > The most dangerous aspect of the mess is that simply fixing KVM would likely > break KVM-on-KVM setups if only L1 is patched. To try and avoid such > breakage while also fixing KVM, I opted to have KVM retain its checks on > only bits 31:0 if KVM is running as a VM (as detected by > X86_FEATURE_HYPERVISOR). > > [...] Applied to kvm-x86 svm, thanks! [1/8] KVM: SVM: Add a helper to detect VMRUN failures https://github.com/kvm-x86/linux/commit/217463aa329e [2/8] KVM: SVM: Open code handling of unexpected exits in svm_invoke_exit_handler() https://github.com/kvm-x86/linux/commit/2450c9774510 [3/8] KVM: SVM: Check for an unexpected VM-Exit after RETPOLINE "fast" handling https://github.com/kvm-x86/linux/commit/194c17bf5eba [4/8] KVM: SVM: Filter out 64-bit exit codes when invoking exit handlers on bare metal https://github.com/kvm-x86/linux/commit/405fce694bd1 [5/8] KVM: SVM: Treat exit_code as an unsigned 64-bit value through all of KVM https://github.com/kvm-x86/linux/commit/d7507a94a072 [6/8] KVM: SVM: Limit incorrect check on SVM_EXIT_ERR to running as a VM https://github.com/kvm-x86/linux/commit/a08ca6691fd3 [7/8] KVM: SVM: Harden exit_code against being used in Spectre-like attacks https://github.com/kvm-x86/linux/commit/1e3dddafecee [8/8] KVM: SVM: Assert that Hyper-V's HV_SVM_EXITCODE_ENL == SVM_EXIT_SW https://github.com/kvm-x86/linux/commit/d6c20d19f7d3 -- https://github.com/kvm-x86/linux/tree/next