From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (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 1A63B3A7F5E for ; Thu, 9 Apr 2026 23:56:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775779005; cv=none; b=BdtBMFnNAZwjf2OJkVepM7E48dGtvHhOC9/4apN4Z4ANbQDY8rw9o04k2oPp15HdPjs4eYReADM+vBmXmgUFlr6DuOAcHA3qzrx+wkrwYlh1KuVDoHutHAg2IF0Dzzlb2Msk62+nATfrGEAkgeXKNL04SXOrGCw3EnDRksawsMg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775779005; c=relaxed/simple; bh=km6YOj5goX/XvbVUtkoW3Xk9iRiy++c/4OSOnwn/Er8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WcolCHMxfZ+9pyBuZL/wGCw/2vox5eDIeaaFO9gkO6X6NGZpUblPP/iRpwaddYQxxx4TCcVtgzlzRudEG70H8GCPEpxhaKQYbQzVFARx2OXxZwcPuFsGbd19kNg1FCgklRDOKL/zXmYXOCoePmpgkOkb0CbLE06uR7GyMBMntLY= 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=ZEwfkDMz; arc=none smtp.client-ip=209.85.216.73 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="ZEwfkDMz" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-354bc535546so1431821a91.3 for ; Thu, 09 Apr 2026 16:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1775779003; x=1776383803; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=qgfsXecMrfEVfBnUgRnO6VRKUmU+TYegYj1eRe4Wi0Q=; b=ZEwfkDMzIG/BamCLeoN4mDzvvgPYpjaSyWSYzSSNgHiGKcN4FELOYd1ycrOK1//ons +Q38OErqyoEWYhIm/j85UMcZZzUKkZE7yqMYom0upLqM+jHx11y63qYW5bp4FSdFXSaQ HLh1S0ctElW1XDkFd6DWzfhHjNk6XgXtrl37+pZxEYqJrhx8w8TgzmpFTSSAHzklIucj 3vHhKSdc8qrdi2W36txuKQmqae2Nmt9XU0u8NOSHebcZNFMyAF0+Y6YTuYBsGlI6qldr kT56QDMsaKXWeQcoU9xUyBQlcGBQbrne2hpzIapQP8qtFQ8OBeI9/STcCxmCtAy1Jl5a bGyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775779003; x=1776383803; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qgfsXecMrfEVfBnUgRnO6VRKUmU+TYegYj1eRe4Wi0Q=; b=WycHKGh5CR9fEjYlObOebhC+ppEWjAQHM6yw4nLNCQPfZYTBcnf51h42plrTWBymJI OLLfKp47QDr5TdjS6dMDQTOqLR7u4xm8aqhyvz+AkDPfpSZdKB7y/9gnMH0q17I2Su1+ FuqSHpWJOV55xkzIKq4jpOnouktf074PNJB05BKezLrCLYCZC+p3C9A1Z5xPKIfpsBjy nwk5bTADAFq9OmL8JZq3eWQ035W7TNvGahYQsB9G11rPzb76KdsD6i+6g/LD4ByG5aGY amADEPdxsO54bjzkIB3lrM//PhbnhDwyS02lVHzyFE+hZC21Fwh18IIm8u+pDYtOa8Ri 78Wg== X-Forwarded-Encrypted: i=1; AJvYcCUtUZvBxwF4UegDM8sYG0oQzR1HQx0miF0B8KIE3K21MgvKVAMoUgT3zunvsCrVbCuJJLKMbgWpeeQ6lyQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxM0M73oe8mWS8HLI6YA484qxrkua5jEFxamjdAZomzTC/w9A6b gXUQ1d19ZMKng7M34wEHaA1xsnsPCB3GixAvVVSZz4N4XdzQ5vVw5ySub9+vljDnc4o1wvDAUGo 2abJ/9g== X-Received: from pjbei2.prod.google.com ([2002:a17:90a:e542:b0:35c:251c:2305]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:4d83:b0:359:8a78:569c with SMTP id 98e67ed59e1d1-35e42827fd2mr992968a91.25.1775779003015; Thu, 09 Apr 2026 16:56:43 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 9 Apr 2026 16:56:19 -0700 In-Reply-To: <20260409235622.2052730-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260409235622.2052730-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.1213.gd9a14994de-goog Message-ID: <20260409235622.2052730-9-seanjc@google.com> Subject: [PATCH 08/11] KVM: x86: Drop non-raw kvm__write() helpers From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini , Vitaly Kuznetsov , David Woodhouse , Paul Durrant Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Type: text/plain; charset="UTF-8" Drop the non-raw, mode-aware kvm__write() helpers as there is no usage in KVM, and in all likelihood there will never be usage in KVM as use of hardcoded registers in instructions is uncommon, and *modifying* hardcoded registers is practically unheard of. While there are a few instructions that modify registers in mode-aware ways, e.g. REP string and some ENCLS varieties, the odds of KVM needing to emulate such instructions (outside of the fully emulator) are vanishingly small. Drop kvm__write() to prevent incorrect usage; _if_ a new instruction comes along that needs to modify a hardcoded register, this can be reverted. No functional change intended. Signed-off-by: Sean Christopherson --- arch/x86/kvm/x86.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index 2550380fa79e..cebea89b296c 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -435,11 +435,6 @@ static __always_inline unsigned long kvm_##lname##_read(struct kvm_vcpu *vcpu) { \ return vcpu->arch.regs[VCPU_REGS_##uname] & kvm_reg_mode_mask(vcpu); \ } \ -static __always_inline void kvm_##lname##_write(struct kvm_vcpu *vcpu, \ - unsigned long val) \ -{ \ - vcpu->arch.regs[VCPU_REGS_##uname] = val & kvm_reg_mode_mask(vcpu); \ -} \ static __always_inline unsigned long kvm_##lname##_read_raw(struct kvm_vcpu *vcpu) \ { \ return vcpu->arch.regs[VCPU_REGS_##uname]; \ -- 2.53.0.1213.gd9a14994de-goog