[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.17 v2 1/3] hvm/msr: load VIRT_SPEC_CTRL


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 31 Oct 2022 17:22:40 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gq9DuOI0BrKBl2/scw05GGHAC7mgzloluTb4Ec6eqe0=; b=lExKXBY7lQUJYEWVD02xFYL/xU3m/dsWjBPW+QsoskmSyyGgxMUbCJ1ReF9YMSV3H5YHswGVFiwamKQD1sJmWsVuoU9S8nMwULnyBXxjVtqpb+DGypE6eubD/R5/5delafKEQOElmcdsvdYREkiza+1SHrH5zLyjzyPjYacY4NwCDMJJrJgwhlKUXIrD/ezctURcc/fnEncbWZ6j+olUaTGFNkKNU6e335MCqmMzqN2hXnn4yqjn3e61SEQx5yihm1PBBKt9wrlGfkKKWKNtdxiMEa0wqzsS2hlkOg/xwj/K35x1AHC15nEtDUath4lfa4ArzCABi+dFqfPzYHyosQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HCRy5//z4Wwa7ZoN7ZSm4Rc85Q9TyQMpIyAiL4hlXlLG3SGW/DtYb+dUqtSAKU3G/8rKgNK5IXlWOzaUZqIW340vQonbBvdWEh3PEOR1rbp3+yCpL7nFzQeMn9oleeBFacqRycfnFRLUnBZHwEmAdPK5Gvk4/LZuUd5eWpn5z9u3wJiNA9/9XFqcGecPbhM2F3qgaVTLnL8a3/Enkrqlhk+Fyp8pc4MNpaplFLssjOug0CO573AR9G0WxJdo+aMYicN0cI+KcFrnfT5iA4a1C6TCIKm4jfIrkqkMcdAlq9H+IeNytL+2R32VCO1uX6z9Ipp7VOlWVdNpoZuXLi77sA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry.Wang@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 31 Oct 2022 16:22:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.10.2022 13:49, Roger Pau Monne wrote:
> Add MSR_VIRT_SPEC_CTRL to the list of MSRs handled by
> hvm_load_cpu_msrs(), or else it would be lost.
> 
> Fixes: 8ffd5496f4 ('amd/msr: implement VIRT_SPEC_CTRL for HVM guests on top 
> of SPEC_CTRL')
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> ---
> I'm confused as to why we have two different list of MSR to send and
> load, one in msrs_to_send[] and the other open-coded in
> hvm_load_cpu_msrs(), but given the release status it's no time to
> clean that up.

I guess this is an optimization, as looking up the MSR in msrs_to_send[]
would be an inefficient inner loop, with the result only used in a
boolean manner (entry present or not present). I do think though that
both places should have a comment referencing the respectively other one,
so both will (hopefully) be updated together. The same looks to apply to
arch_do_domctl()'s MSR handling, where I've screwed up for XFD{,_ERR}.

I'm puzzled by the ctxt->msr[i]._rsvd checking in the default: case. It
was me who added this 8.5 years ago, but I can't see the value of that
check considering the check in the next to final loop in the function.
Hmm, wait - this had an error checking purpose until commit f61685a66903
("x86: remove defunct init/load/save_msr() hvm_funcs"). I think the check
should have been removed at that point. That'll be a post-4.17 patch, I
suppose ...

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.