Thread (22 messages) 22 messages, 7 authors, 2017-02-22

Re: [PATCH v3 4/4] KVM: VMX: Simplify segment_base

From: Thomas Garnier <hidden>
Date: 2017-02-15 15:44:04
Also in: kvm, linux-efi

On Tue, Feb 14, 2017 at 7:57 PM, Andy Lutomirski [off-list ref] wrote:
On Tue, Feb 14, 2017 at 11:42 AM, Thomas Garnier [off-list ref] wrote:
quoted
The KVM segment_base function is confusing. This patch replaces integers
with appropriate flags, simplify constructs and add comments.
It could pay to put this first in the series, but last is probably fine, too.
:)
quoted
Signed-off-by: Thomas Garnier <redacted>
---
Based on next-20170213
---
 arch/x86/kvm/vmx.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 99167f20bc34..edb8326108dd 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2062,25 +2062,35 @@ static unsigned long segment_base(u16 selector)
        struct desc_struct *d;
        unsigned long table_base;
This should go away IMO.  It should be struct desc_struct *table;
quoted
+               table_base = get_current_gdt_rw_vaddr();
Then this can go away, too, and you can stop having the silly
get_current_gdt_rw_vaddr() function at all.
quoted
+       d = (struct desc_struct *)table_base + (selector >> 3);
And this cast goes away too.
No problem.

-- 
Thomas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help