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 010661F3B85 for ; Fri, 13 Mar 2026 01:05:18 +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=1773363920; cv=none; b=UoVgdullpJonL4WsMAUeMERIOxiR4Nf3AJH/zHcALUGDKzy1MKscj2OogKDiI0Qlds22/DBrrQEaSrqD5tOR9ejUQ0YVnXBh/cFTf12gZb86S/KNoMT7uKMteOmTgba8OE+I0bLofFJxNAUrZgrAOcr7qV6haNuk7XM5aLSZoCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773363920; c=relaxed/simple; bh=wbuFVWAeiNckGIc/VTlN2vSDoLhJ4m/G7+o5JoybNew=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=imjxX9a8N2sS8qLwoPH8ncjVthLye/Pzn8506f8dB9GsYEi7BGP4xQsF4Hc20AUqKb4DoNqWQTqQYiNKArizb1837n9Vq3wRxJmy21vee4atbEl7GNjeOKWUHDYnGR9F/1YHWcUkyVIPCbii4aoVt7jiFx8l9gYXDx2BeHblcRw= 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=lgvAKMxz; 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="lgvAKMxz" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-35a0998a441so9715240a91.2 for ; Thu, 12 Mar 2026 18:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773363918; x=1773968718; 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=yafu8em2C82TADedFvrLvlfMY3we19GznUPlgpBFLgQ=; b=lgvAKMxzY3C8o+OCEg+1t5yJAAaK2OxlZVpcF5VcRLoGgrIwhCgKOSZkI4minaWoIB QasL/7PiEvZ5NNUGbZ/2WBpC3xlif8uAMosQSz7CoqyNyflp6uRyAEe7PpvW/Wel9KKA pSx7QQ+RG1BtN9afHh4Dvx8mp6yaLSBJNF+uZ5RXUIRqEyrsZEeBpxF//wy7hPWncY+6 SSgo0PSoCiSI1RUHRZ7OSkFe0gqd6cuoFUiSX5QUOmpioKCzy806Uqgh5M/7W9MgxmtJ nG+m+VvVw5c0uOMMKaboZ36y7ofrcERQUGU4s72VBzS/tLdpEmK4/br43tuB9tugLOfN 2GRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773363918; x=1773968718; 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=yafu8em2C82TADedFvrLvlfMY3we19GznUPlgpBFLgQ=; b=rm7oud3ccslmu/2D11Bak5UAhqQofeCIqG/6ZVzGMglYkpEpMt7ty60O1yacU9HCTG +ywvgF6Fo+srPA1CAvdQ+s/JgBp7PN7itt5eZl7/W16k8NDiQ4TULOufAJ7i1v6jvy45 dQCdSu6sUpgHscYldzMYln0xCmbD/Znr9MXxQaqIvEoyL2lEGhZ4hRo5R1fF3YX355v9 +kPEtmRBT48SN4N1Jy6lkP8MnTgTRhFwIZOZkiEvLwtbY/HCYkPhbiMHSBssW14r19ih IbZPqNAMYSj7YpVrOueW//pznA+sTW4q9DhBidQyibW5+0SgtvtzbCRcOtJT+TA4BRmK qj4A== X-Forwarded-Encrypted: i=1; AJvYcCV4BKoHci7Xr54IRkC8744CcnJPiqmlfV8AYKx9dXSfNxiJkupwJTIrKSneVLvXEzHSX41lF2ZVU8fSyGQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwH9Gnx1X1uiz3DyM6eqmAcfbm9phvNhD6ETdXxBunDzkE7cHxw uaq9HBe/95PqdRPjLjVWwavItxEsHagOWYLiNqSvWWoti3V/TnLaeuY84cJteH6z16+Wh78BYD4 gnZUQ4A== X-Received: from pjm12.prod.google.com ([2002:a17:90b:2fcc:b0:359:92b5:da6a]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:3b87:b0:359:9073:c368 with SMTP id 98e67ed59e1d1-35a22081e73mr1218081a91.28.1773363918125; Thu, 12 Mar 2026 18:05:18 -0700 (PDT) Date: Thu, 12 Mar 2026 18:05:16 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260112235408.168200-1-chang.seok.bae@intel.com> <20260112235408.168200-5-chang.seok.bae@intel.com> Message-ID: Subject: Re: [PATCH v2 04/16] KVM: VMX: Introduce unified instruction info structure From: Sean Christopherson To: "Chang S. Bae" Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, chao.gao@intel.com Content-Type: text/plain; charset="us-ascii" On Fri, Mar 06, 2026, Chang S. Bae wrote: > On 3/4/2026 8:21 PM, Sean Christopherson wrote: > > static inline int vmx_get_insn_info_reg(u64 insn_info) > > { > > return vmx_insn_info_extended() ? (insn_info >> ??) & 0x1f : > > (insn_info >> 3) & 0xf; > > } > > There is > > int get_vmx_mem_address(...) > { > ... > > /* > * According to Vol. 3B,... > */ > int scaling = vmx_instruction_info & 3; > int addr_size = (vmx_instruction_info >> 7) & 7; > bool is_reg = vmx_instruction_info & (1u << 10); > int seg_reg = (vmx_instruction_info >> 15) & 7; > int index_reg = (vmx_instruction_info >> 18) & 0xf; > bool index_is_valid = !(vmx_instruction_info & (1u << 22)); > int base_reg = (vmx_instruction_info >> 23) & 0xf; > bool base_is_valid = !(vmx_instruction_info & (1u << 27)); > > I'd assume wrappers like above for each line there. Ya. > But to confirm your preference: would you rather keep this open-coded, or > introduce another wrappers for each? Assuming the alternative is to open code both the extended and regular versions, yes, definitely add wrappers.