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

Re: [Xen-devel] [PATCH] SVM: correct CPUID event processing


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alexandru Stefan ISAILA <aisaila@xxxxxxxxxxxxxxx>
  • Date: Fri, 20 Sep 2019 08:39:42 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bitdefender.com; dmarc=pass action=none header.from=bitdefender.com; dkim=pass header.d=bitdefender.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-SenderADCheck; bh=6+zkElLgczWd0vST0WAZh+7xGBch1RT7aosb0g7aXdk=; b=chJQh1lsUOgTve/qMI4oZYLYQaHmNL4j6FjvKWuXyT071jUTwX4ZvZME5h1LHhtIyYKadjJyczRW/p8N128ZrYgPIHHg8RD4xYYhzZxiaGe1OkWuh++dljuspBb2rJ5s2cY6z/wDek8utSaVNr+4hCt3yOeSArtvuOc6+C2QQHbzruSye5bcd56wefZK1i7AqZIDvadI1iQWjMor9/g7Hs9HqrxISCzY8AmqvaCCvml0bVjUAQuL5em2Tfj0xXBR4+9ufG2/+Wl1DFSBSJFBVVKLlbA3Wl6p+rGHkF1prvX0rjm+y/RlqSjav5lKKU9YAZrkKkXI0ODPaSlm5pu4sA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzCQU5tTV+3AldeEyGIXrbv8Jra1nO7UaZ8NbTvLwNk+NE9VXntJI4gmUIK7jyrVlFXjrbhPyvBU5aDiGa39XkaD8O3HoucuATVv0PqELNEGpuD/aKVgTKmh0MX10UAZH9YuN4popnNqTqej2GJ3sRtrDugmcWBEPU/vzj6ndbaqawi53RZD6a1XK9cRbVeK673kAOOWuoKR707kVJCnMJjAfT5Dt2Zkrjtw5paO6+ej5gfDJXl3BUiqfCv79q5rh38Uuvd3fFMTWT5blI+XhDyyrb6E3r9arq/bgUAkCIZFNHPoaVdO0HFiJqVDqK0npUCY25wT73RQL0udQ7NpWQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisaila@xxxxxxxxxxxxxxx;
  • Cc: Petre Ovidiu PIRCALABU <ppircalabu@xxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Razvan COJOCARU <rcojocaru@xxxxxxxxxxxxxxx>, Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 20 Sep 2019 08:39:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVbtZJ1LbqTNDLJ0GkbcyAkLC/kqc0QDUA
  • Thread-topic: [PATCH] SVM: correct CPUID event processing


On 19.09.2019 13:37, Jan Beulich wrote:
> hvm_monitor_cpuid() expects the input registers, not two of the outputs.
> 
> However, once having made the necessary adjustment, the SVM and VMX
> functions are so similar that they should be folded (thus avoiding
> further similar asymmetries to get introduced). Use the best of both
> worlds by e.g. using "curr" consistently. This then being the only
> caller of hvm_check_cpuid_faulting(), fold in that function as well.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>

> 
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3349,14 +3349,28 @@ unsigned long copy_from_user_hvm(void *t
>       return rc ? len : 0; /* fake a copy_from_user() return code */
>   }
>

Useful fold. Maybe a small comment with the reason to have one function 
would help. Something like both SVM and VMX do the same thing, but it's 
up to you if it is necessary.

> -bool hvm_check_cpuid_faulting(struct vcpu *v)
> +int hvm_vmexit_cpuid(struct cpu_user_regs *regs, unsigned int inst_len)

Alex
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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