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

Re: [PATCH 1/3] x86/msr: Split MSR_SPEC_CTRL handling


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Jan 2022 12:07:38 +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=ihUnC56vuaM9FzmZhn8NfOhIp3Vv8NxTu0GYUJs7XcQ=; b=LiVP5jqXB+bqsd8GD7Ug29yoxRsVMlOE/kymnpzj6PaEQcQmqUVZDed16oV4sUypIZUTupv0Lq1j0OeTjWf8fzfj9HjQIkoYqjfPVqzdjh4xwKB7WL0+VZbl2pqojNGj7XAkxHfMHgCdic7uYgm1TvLdMA0SwmQ91MmFZXWoNVxkuqY/12g210oTh9J7D8BBu1D4s8cs+bdi5bx3/ZRVG3KvDVDgQVefm7bB+26IkjC9nn4maaLBsr5QZjChK614DGlqKfEKWv054UYJLtoFtXpsybHeO4cQlBZM0ICIrx3kisje6EjKvTXTC7BtRvEtADEh5ubt0SAkZcob6gg1dg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gr5l2VQ5mQFG8gDGM4swD3CTOuzLgngXSqn0JjOk+spteIl7LnOOd4xyFZReIeWd76hmJ1HsiiNTM/MsFwpCYkQEyUAdg/GkZs1Vt4gQlWMTYJUPT5p9SKQ/SH+V+gapk3LNPE7iVW3ZDfZtiVktT7tXvDcorhw37OXFPTkyuovEv7JM3domKngWwz01RJW3pX+22pHJ/Xo/Jun9yy26OjYgcDwwyBcyZn3eP3jV3ymhZKBbpXuDtskRWj9v410Hyvqm2L3mY/MK0hotcPfz5iOwGSfa6+7Tl+JzTEgkH4vhuNZVyJHyXrvmbThfya5gFR2xyvBIm24K3EobeG0oyQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 17 Jan 2022 11:07:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.01.2022 17:38, Andrew Cooper wrote:
> In order to fix a VT-x bug, and support MSR_SPEC_CTRL on AMD, there will need
> to be three different access methods for where the guest's value lives.
> However, it would be better not to duplicate the #GP checking logic.
> 
> guest_{rd,wr}msr() are always called first in the PV and HVM MSR paths, so we
> can repurpose X86EMUL_UNHANDLEABLE slightly for this.  This is going to be a
> common pattern for other MSRs too in the future.

I consider this repurposing risky. Did you consider using e.g.
X86EMUL_DONE or X86EMUL_RETRY instead? Neither of the two is
presently used by the MSR machinery afaics.

What's worse, aren't you making it possible to hit the
ASSERT_UNREACHABLE() in hvm_save_cpu_msrs() as well as in
XEN_DOMCTL_get_vcpu_msrs handling? And have hvm_load_cpu_msrs()
produce -ENXIO and XEN_DOMCTL_set_vcpu_msrs return -EINVAL?

Jan




 


Rackspace

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