diff mbox series

[v1] x86/hvm: Update code in HVMOP_altp2m_set_suppress_ve

Message ID 20191030130143.30964-1-aisaila@bitdefender.com (mailing list archive)
State New, archived
Headers show
Series [v1] x86/hvm: Update code in HVMOP_altp2m_set_suppress_ve | expand

Commit Message

Alexandru Stefan ISAILA Oct. 30, 2019, 1:02 p.m. UTC
Originally the gfn and altp2m_idx are assigned from the a.u.mem_access union.
This works because it's the same memory used. This patch addresses this
issue by changing the mem_access union with the suppress_ve union for
consistency.

Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
---
 xen/arch/x86/hvm/hvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrew Cooper Oct. 30, 2019, 2:14 p.m. UTC | #1
On 30/10/2019 13:02, Alexandru Stefan ISAILA wrote:
> Originally the gfn and altp2m_idx are assigned from the a.u.mem_access union.
> This works because it's the same memory used. This patch addresses this
> issue by changing the mem_access union with the suppress_ve union for
> consistency.
>
> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

CC Juergen. This wants backporting, so should be included in 4.13

~Andrew

> ---
>  xen/arch/x86/hvm/hvm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index e4c0425330..06a7b40107 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -4685,8 +4685,8 @@ static int do_altp2m_op(
>              rc = -EINVAL;
>          else
>          {
> -            gfn_t gfn = _gfn(a.u.mem_access.gfn);
> -            unsigned int altp2m_idx = a.u.mem_access.view;
> +            gfn_t gfn = _gfn(a.u.suppress_ve.gfn);
> +            unsigned int altp2m_idx = a.u.suppress_ve.view;
>              bool suppress_ve = a.u.suppress_ve.suppress_ve;
>  
>              rc = p2m_set_suppress_ve(d, gfn, suppress_ve, altp2m_idx);
Jan Beulich Oct. 30, 2019, 2:47 p.m. UTC | #2
On 30.10.2019 15:14, Andrew Cooper wrote:
> On 30/10/2019 13:02, Alexandru Stefan ISAILA wrote:
>> Originally the gfn and altp2m_idx are assigned from the a.u.mem_access union.
>> This works because it's the same memory used. This patch addresses this
>> issue by changing the mem_access union with the suppress_ve union for
>> consistency.
>>
>> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> CC Juergen. This wants backporting, so should be included in 4.13

I wouldn't have picked this up as backporting candidate, as
the generated code is correct, and the public interface isn't
supposed to change in the stable trees. I.e. I view this as a
purely cosmetic change, albeit a pretty helpful one.

Jan
Jürgen Groß Nov. 1, 2019, 10:32 a.m. UTC | #3
On 30.10.19 15:14, Andrew Cooper wrote:
> On 30/10/2019 13:02, Alexandru Stefan ISAILA wrote:
>> Originally the gfn and altp2m_idx are assigned from the a.u.mem_access union.
>> This works because it's the same memory used. This patch addresses this
>> issue by changing the mem_access union with the suppress_ve union for
>> consistency.
>>
>> Signed-off-by: Alexandru Isaila <aisaila@bitdefender.com>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> CC Juergen. This wants backporting, so should be included in 4.13

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index e4c0425330..06a7b40107 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4685,8 +4685,8 @@  static int do_altp2m_op(
             rc = -EINVAL;
         else
         {
-            gfn_t gfn = _gfn(a.u.mem_access.gfn);
-            unsigned int altp2m_idx = a.u.mem_access.view;
+            gfn_t gfn = _gfn(a.u.suppress_ve.gfn);
+            unsigned int altp2m_idx = a.u.suppress_ve.view;
             bool suppress_ve = a.u.suppress_ve.suppress_ve;
 
             rc = p2m_set_suppress_ve(d, gfn, suppress_ve, altp2m_idx);