From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B47D421A0A for ; Wed, 29 Apr 2026 18:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777488325; cv=none; b=NyIjqyTw18oGGa6lcisXKBEJtoDxazAmoRh/ThwvOzSYYkQYiQRON/HXZeRUnrQVEK86eYK51/pIyNz8cGffkuVGoMZhpVAj9Snr/aRDgVm79SnoZL1wPsZyfNRfGi+kGybpQIHSYh6A/+o898J6laI+PdoQPwCY2iuZNtfk8Ys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777488325; c=relaxed/simple; bh=yfoPAlMWGvTLaKKgzYaykHL4yOH6EvBpOfxQ4tQ+Jmw=; h=Subject:To:Cc:From:Date:Message-Id; b=R72q257eanHxKY9mPICiF4MBXbRQUWS4dFLe5ruA0UzAXI4peJTzHwJU7IIpFrcIAWuMHXVdbAVVGudfHXVjzrco8ci5QtIU9XPGJCfrq6iIBDjGx5ia74M7BvLY/dZiOPnz2Vlhg4p8hOwWH8gn2sGnWPLse2Pi+r/qhHteu1Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=U//351hB; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U//351hB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777488321; x=1809024321; h=subject:to:cc:from:date:message-id; bh=yfoPAlMWGvTLaKKgzYaykHL4yOH6EvBpOfxQ4tQ+Jmw=; b=U//351hB1jpXdJrtoRDAzrA005h3mDiN+yq+SZGNOvRWcDlj6pL7q8Q/ 9Gv4LYGkasZD1mFoaw+GU0FomLk1VsLrksMHRzsjd35sJC0TYdjy4pkjr ZcWEHHycpB3shco9ICeXpcKTF0MGo6CQUWEpwHHJhg2zQg8px4HFj3MMk xXrJ+kuFk8xdcdl3DQDJGi+5+UY183rKgQ+g2SWs8j5R6Ri5txlqkv6b0 eutHlt5W7DJCQBQEO0RS0wtb0rUc6g38ceqYhnrmrCDFO+GK0qAlP44Sd 1zhSqOFbdi90+/bHGq0pMUH54pxTr+LVIN1TLnNzIQrsee0KurbfB1zDT Q==; X-CSE-ConnectionGUID: h4OhgR4uRR2qI5TZLPpdiA== X-CSE-MsgGUID: pkgQGM+KQEOcr4ia5XHZiA== X-IronPort-AV: E=McAfee;i="6800,10657,11771"; a="78322250" X-IronPort-AV: E=Sophos;i="6.23,206,1770624000"; d="scan'208";a="78322250" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2026 11:45:18 -0700 X-CSE-ConnectionGUID: nAMkgiIwS52EGALqIzVdew== X-CSE-MsgGUID: H8oUJwY1TyuxGhXWwiSPzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,206,1770624000"; d="scan'208";a="229749543" Received: from davehans-spike.ostc.intel.com (HELO localhost.localdomain) ([10.165.164.11]) by fmviesa006.fm.intel.com with ESMTP; 29 Apr 2026 11:45:18 -0700 Subject: [PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Juergen Gross , virtualization@lists.linux.dev, Dave Hansen From: Dave Hansen Date: Wed, 29 Apr 2026 11:45:17 -0700 Message-Id: <20260429184517.7E078510@davehans-spike.ostc.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Changes from v1: - Remove "raw_" names. Just use "paravirt_" in the generic code. I'm thinking I'll just apply this in the coming days if nobody screams too loudly. -- This is old cruft, but it appears that having two copies of these MSR functions is enabling warnings to creep in[1]. I know there's also been some work to pare down the XXL code, but it's obviously not merged yet and this is a good baby step. Create helpers that both paravirt and native can use in common code and remove the paravirt implementations of the helpers. This reduces the amount of logic that is duplicated in the paravirt code. The wonky thing about this solution is that it has the common code always make literal "paravirt_" calls, even when paravirt is not in use for MSRs. In that case, the calls just go directly to the "native_" functions via #defines. Conceptually: - native: The bare-metal implementation. Might not be usable under paravirt XXL. - paravirt: Call the native version directly if paravirt is compiled out. Call into paravirt ops when available, which might ultimately call a native implementation. 1. https://lore.kernel.org/all/20260319152210.210854-1-aldocontelk@gmail.com/ msr.h | 124 +++++++++++++++++++++++++++++++------------------------------ paravirt.h | 44 --------------------- 2 files changed, 65 insertions(+), 103 deletions(-)