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 D4FE63277AA for ; Fri, 14 Nov 2025 15:22:43 +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=1763133765; cv=none; b=Mle/nljRnqR960p3ByffVrS7ZBJUyeHUKZ/s3/PzQY6S8Fr5Vo+9Qr7uxVVwika8K++ZhEhvHM7RreRheqHvw/Z8/gFz1xGWuhm8rIb0Cx7LRt84vNmrJLZ1lMc4uRS3NYXRQkGhvN1NgCRPykMvbK3sFCdtVdmWZ5CRFKTlqDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763133765; c=relaxed/simple; bh=DpbKWxIyQ9KxrGiVD7t8GJpBnIreph23Cp44p8dMSM8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aQvHntZVBQQccirWw70xUgMTFUO1rcliDwZSV/8wO63HEh1I7Snad6v5ONVBb1pluwi7r5rYfKg0Qia9ZqPFqKFWQvuLOLs8ynXoxjeAuAylKCJcR4EKK1y0SUTt73pQXkRKoBwN1zIumbUgFaL0tNu8gbAUcEA1fpkqHgtPGSo= 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=R62pJoTG; 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="R62pJoTG" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-340c0604e3dso2725320a91.2 for ; Fri, 14 Nov 2025 07:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763133763; x=1763738563; 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=eKSpfoYNgcderQopBxLm/p146foAdZqVSD0ikjtaERA=; b=R62pJoTGeQuuLr0U2gT9vGARADabcJgf+cHzzeqgDUNHmDFLyEDMNoXZKNutEUJ4XV zDjsgxgXOryctn6yBIg4JvUr97aVuvRCPzYUAnPcjL6LMqz5pyoJCGIMUFcRj59ewbDG meODFMnifggCzuCI4r9bUL1DCtCMoKu0usimemmAMLLdY0FzYmtGw58i6b3XbJK9jZXX ofIGMayQtXWSubbERwlGmbnFo8a0PxgXgRgmcej0Z50g9WNXujkujM6vAjfL8zCnY5Fh Y/9ZNYYXl7dbCphfu4vwyFMpPgd31ZncasPpk3EV6qnknX0s7bW9XJZ+UJTYoqrXj6ID 6EWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763133763; x=1763738563; 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=eKSpfoYNgcderQopBxLm/p146foAdZqVSD0ikjtaERA=; b=QBK24xG3FoRNItFCGwS7ZRW4aX7JFmG2+Agj0hmrt69UxEyndd/7znfcLTjc3Hkhe3 9o14dDaomYCc0+Rof2Wv/tWh1sdWwpImw/ugPNp4li4aR0ofULUsH6muYmeS57MCt4VF leY9laYb2qTUB3UJrdEHzRz4jVkiw8V1cZL689EX2aaGPEq1//GVljhg+Ut14wKjvG0d eAm7blCMAMQ2Dn/aW1NSaRpWq00ywlM8bOLz1yM0pht9nbwcMCq605WA7SDJNFWJnF+4 jK8QpiuAh23B3iPldP7blZX7Eb4rgHvW0LGVDUD3a7fRik3yNgoI/CV40kOSSDRlptx1 V7yw== X-Forwarded-Encrypted: i=1; AJvYcCXzuePopC4WfE1OI/9hmAle1wv7rrvWZGErnKeAa4014T5iRaG9RnaUgpdsHmhOYp+R+5vnMmFx8D0fh40=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4NIZ8IxrJxFJmxp9iBxxp2L09jb+On8iv6kaSjlRYB3Aac1B3 EmiMXyXmVQ5SftjbIvi0ft4sXAV0XJgN2PRu0LJ3aEnAFQO8CJnoRZt6UlfxHK/wWDvpSd1GJ9a UQuyZNQ== X-Google-Smtp-Source: AGHT+IHguiFlQ0z5dlRYfgNcEgqZOl8+CF7sD5lgZUJiizDuYK4N6jAChUXIGNOe8U4ks8AdguhO7M/4KMw= X-Received: from pjtz18.prod.google.com ([2002:a17:90a:cb12:b0:340:b1b5:eb5e]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90a:e18c:b0:336:b60f:3936 with SMTP id 98e67ed59e1d1-343f9e9f23bmr4797401a91.12.1763133763161; Fri, 14 Nov 2025 07:22:43 -0800 (PST) Date: Fri, 14 Nov 2025 07:22:41 -0800 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251113225621.1688428-1-seanjc@google.com> <20251113225621.1688428-8-seanjc@google.com> Message-ID: Subject: Re: [PATCH 7/9] KVM: SVM: Treat exit_code as an unsigned 64-bit value through all of KVM From: Sean Christopherson To: Michael Kelley Cc: Paolo Bonzini , Vitaly Kuznetsov , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Nuno Das Neves , "kvm@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jim Mattson , Yosry Ahmed Content-Type: text/plain; charset="us-ascii" On Fri, Nov 14, 2025, Michael Kelley wrote: > From: Sean Christopherson Sent: Thursday, November 13, 2025 2:56 PM > > > > Adding Microsoft's Nuno Das Neves to the "To:" line since he > originated the work to keep the Linux headers such as hvgdk.h in > sync with the Windows counterparts from which they originate. ... > > /* Exit code reserved for hypervisor/software use */ > > -#define SVM_EXIT_SW 0xf0000000 > > +#define SVM_EXIT_SW 0xf0000000ull > > > > -#define SVM_EXIT_ERR -1 > > +#define SVM_EXIT_ERR -1ull > > > > [snip] > > > diff --git a/include/hyperv/hvgdk.h b/include/hyperv/hvgdk.h > > index dd6d4939ea29..56b695873a72 100644 > > --- a/include/hyperv/hvgdk.h > > +++ b/include/hyperv/hvgdk.h > > @@ -281,7 +281,7 @@ struct hv_vmcb_enlightenments { > > #define HV_VMCB_NESTED_ENLIGHTENMENTS 31 > > > > /* Synthetic VM-Exit */ > > -#define HV_SVM_EXITCODE_ENL 0xf0000000 > > +#define HV_SVM_EXITCODE_ENL 0xf0000000u > > Is there a reason for making this Hyper-V code just "u", while > making the SVM_VMGEXIT_* values "ull"? I don't think > "u" vs. "ull" shouldn't make any difference when assigning to a > u64, but the inconsistency piqued my interest .... I hedged and went for a more "minimal" change because it isn't KVM code, and at the time because I thought the value isn't defined by the APM. Though looking again at the APM, it does reserve that value for software F000_000h Unused Reserved for Host. and I can't find anything in the TLFS. Ah, my PDF copy is just stale, it's indeed defined as a synthetic exit. https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/nested-virtualization#synthetic-vm-exit Anyways, I'm in favor of making HV_SVM_EXITCODE_ENL an ull, though part of me wonders if we should do: #define HV_SVM_EXITCODE_ENL SVM_EXIT_SW