/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Helpers/definitions related to MSR access.3*/45#ifndef BOOT_MSR_H6#define BOOT_MSR_H78#include <asm/shared/msr.h>910/*11* The kernel proper already defines rdmsr()/wrmsr(), but they are not for the12* boot kernel since they rely on tracepoint/exception handling infrastructure13* that's not available here.14*/15static inline void boot_rdmsr(unsigned int reg, struct msr *m)16{17asm volatile("rdmsr" : "=a" (m->l), "=d" (m->h) : "c" (reg));18}1920static inline void boot_wrmsr(unsigned int reg, const struct msr *m)21{22asm volatile("wrmsr" : : "c" (reg), "a"(m->l), "d" (m->h) : "memory");23}2425#endif /* BOOT_MSR_H */262728