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 823F53B7769 for ; Fri, 5 Jun 2026 20:32:23 +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=1780691554; cv=none; b=EQQ3CKcRYfKXzXp0Sj41JjzG30iTVfiUi01s65rw99uEi+Kpyb6Y+D0hVpF2Y3jtZ6KYuwGOyOEJsujGa89KnrZNaMaQhlh2d+aXOdcTV+gQJSjKikZA1U1SeH3XkSCsw3vFMac/3PUhKlPbeHthIj/dZX8N3goiZGecY6bQoX8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780691554; c=relaxed/simple; bh=xBeTeNgOMhbVCxDyTV9Ycy9P1eFTWTr4AHqZNcVLI4Y=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=e15BrLXm6HeQA8Jn80hOXsJ4M8v40Bc7UgKpNnctKs/bMiGNFOe7H4ZilelNejcecxMKwuWlsEjhjM886kpk3POOjsvltZasNpgFqgKwwB6CYuTiZH3cRVBddaUkL/JB+G36DJe5BxL0CJ/0TIGu5fsuTjoq4arSUNLrFuuwWIo= 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=TXq7zZyD; 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="TXq7zZyD" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-36d99181eaaso3169794a91.3 for ; Fri, 05 Jun 2026 13:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780691543; x=1781296343; 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=6/Jk6A1lSCRKf4bHG005bLI05hHS5HnTN0oBfxEaA1s=; b=TXq7zZyDo+r58s7tCNnsuzOokk2o7B2m6eU/zo1rxTTr8MB23rMhCAkit/WEoLfyiN 5J56iMeSzmCTSAfG21SmKfdofk8TNwDoRGkT0YRUMX5960Zh6F4hZxHKWFIG1awH2/c6 KGC3PjBWZ/RC91iBXIOt3RdTUimxNhfntL0dfkGKnEGyL+3+dIDAJcBIIop/TcQKptSy ndtPxGkZt/DhZhQROM/CJjtjiVf3h195jO4ijn2/5yiJTtBsP7ylQlXx6KGG0AKTsSB0 8pcfxdgH5J/aOo9x7pNg8ADKip95+iGxHnjItQfmZH+wmgNassgHeElNR3lWkmR8k5xT wuZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780691543; x=1781296343; 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=6/Jk6A1lSCRKf4bHG005bLI05hHS5HnTN0oBfxEaA1s=; b=KYjzFxKePcAqnHg80UO0Ito1ursZCD5Y+ekK/YUygOKzezGEYutGZvg0XgWfKrL7Jf 2QHkgF1PhRVoMuGC92f91+9eaLtnZDo3tocbunFjIAnUHaGA+FU8BPYBYL54R8ptlG7P VEv+rUZ+aW0Xy66UcaGYah2j1rpr4qeC+vlJgHkKxlfeKkuw6oP40WVJrH1/vJB+p5lt xo9onVFA2fglsngJRyGrV26tuIzM9uCVwXoBMQnkZurLBKFg6V841TlvDMJIjp9JB2Ni AODOJp5U9Jr1V5HOdE58DaUZ2lmrfHFhtApTN0vlSfHjykrV1Y57pCCJA//GMKujx9gc 1KZA== X-Forwarded-Encrypted: i=1; AFNElJ92QlPANP7vkgxyT6u/IYNmMmPIa3n+H/S9+btqKM8Z4G5eR8v5rV0TJMjfYVWieWJ+afHhnl/ZSThjbCc=@vger.kernel.org X-Gm-Message-State: AOJu0YyLUfJjUYcsVL8g3NSncrtvbjGWrKUBoho7cLGJeZSB5S1X64ip 2vImUpps1F9+/Ac+VaIOrDuD2FMpRmj8+Spr2qaechzczr0Kj9gvvCtI65fCQzdia7UhUgmoDUS 9PveZVg== X-Received: from pgct17.prod.google.com ([2002:a05:6a02:5291:b0:c82:7a7f:9bf6]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6a20:6a20:b0:3ab:2fa:756c with SMTP id adf61e73a8af0-3b4cccfdd57mr6432481637.1.1780691542593; Fri, 05 Jun 2026 13:32:22 -0700 (PDT) Date: Fri, 5 Jun 2026 13:32:21 -0700 In-Reply-To: <0dbe94ba88bc2c9de04233cb72964fec762e228e.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260529222223.870923-1-seanjc@google.com> <20260529222223.870923-35-seanjc@google.com> <0dbe94ba88bc2c9de04233cb72964fec762e228e.camel@intel.com> Message-ID: Subject: Re: [PATCH v3 34/40] KVM: x86: Move misc "VALID MASK" defines from kvm_host.h => x86.c From: Sean Christopherson To: Kai Huang Cc: "pbonzini@redhat.com" , "vkuznets@redhat.com" , "dwmw2@infradead.org" , "paul@xen.org" , "kvm@vger.kernel.org" , "dwmw@amazon.co.uk" , "linux-kernel@vger.kernel.org" , "yosry@kernel.org" , "binbin.wu@linux.intel.com" Content-Type: text/plain; charset="us-ascii" On Fri, Jun 05, 2026, Kai Huang wrote: > On Fri, 2026-05-29 at 15:22 -0700, Sean Christopherson wrote: > > Move a variety of "VALID MASK" defines, e.g. that capture which flags in > > a given ioctl are supported by KVM, from kvm_host.h to x86.c. The set of > > valid flags/bits is very much a KVM-internal detail, as the hardcoded > > defines are often massaged at runtime, i.e. *directly* using the macros > > outside of KVM x86 would be actively dangerous. > > I am bit confused about what do you mean by "hardcoded defines are ofen > massaged at runtime". Do you mean the supported flags can be changed at runtime > via ioctl? But if we are talking about ioctl, then the flags must be part of > uABI, which shouldn't change? Not by ioctl, but by KVM's setup code. Is this more clear? Move a variety of "VALID MASK" defines, e.g. that capture which flags in a given ioctl are supported by KVM, from kvm_host.h to x86.c. The set of valid flags/bits is very much a KVM-internal detail, as the values from the hardcoded #defines are often captured and massaged by KVM's setup code, i.e. *directly* using the macros outside of KVM x86 would be actively dangerous.