mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	markgross@kernel.org
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, Borislav Petkov <bp@suse.de>
Subject: Re: [PATCH] platform/x86: intel-uncore-freq: Prevent driver loading in guests
Date: Wed, 27 Apr 2022 16:46:26 +0200	[thread overview]
Message-ID: <9df369cb-db52-d8be-c244-1f3ec04b063b@redhat.com> (raw)
In-Reply-To: <20220421184154.747721-1-srinivas.pandruvada@linux.intel.com>

Hi,

On 4/21/22 20:41, Srinivas Pandruvada wrote:
> Loading this driver in guests results in unchecked MSR access error for
> MSR 0x620.
> 
> There is no use of reading and modifying package/die scoped uncore MSRs
> in guests. So check for CPU feature X86_FEATURE_HYPERVISOR to prevent
> loading of this driver in guests.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215870
> Suggested-by: Borislav Petkov <bp@suse.de>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans



> ---
>  drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c
> index c61f804dd44e..8f9c571d7257 100644
> --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c
> +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c
> @@ -212,6 +212,9 @@ static int __init intel_uncore_init(void)
>  	const struct x86_cpu_id *id;
>  	int ret;
>  
> +	if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
> +		return -ENODEV;
> +
>  	id = x86_match_cpu(intel_uncore_cpu_ids);
>  	if (!id)
>  		return -ENODEV;


      reply	other threads:[~2022-04-27 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 18:41 Srinivas Pandruvada
2022-04-27 14:46 ` Hans de Goede [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9df369cb-db52-d8be-c244-1f3ec04b063b@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=bp@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®