From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arbel Moshe Subject: [PATCH 4/5] x86: Add definition for 64 bit Segment descriptor Date: Sun, 24 Dec 2017 12:08:00 +0200 Message-ID: <20171224100801.145806-5-arbel.moshe@oracle.com> References: <20171224100801.145806-1-arbel.moshe@oracle.com> Cc: idan.brown@oracle.com, liran.alon@oracle.com, Arbel Moshe , Konrad Rzeszutek Wilk To: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org Return-path: Received: from userp2130.oracle.com ([156.151.31.86]:38401 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751453AbdLXKTS (ORCPT ); Sun, 24 Dec 2017 05:19:18 -0500 In-Reply-To: <20171224100801.145806-1-arbel.moshe@oracle.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Arbel Moshe Reviewed-by: Liran Alon Signed-off-by: Konrad Rzeszutek Wilk --- lib/x86/desc.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/x86/desc.h b/lib/x86/desc.h index 3bf8fbe..181b59e 100644 --- a/lib/x86/desc.h +++ b/lib/x86/desc.h @@ -167,6 +167,31 @@ typedef struct { u8 base_high; } gdt_entry_t; +struct segment_desc64 { + uint16_t limit1; + uint16_t base1; + uint8_t base2; + union { + uint16_t type_limit_flags; /* Type and limit flags */ + struct { + uint16_t type:4; + uint16_t s:1; + uint16_t dpl:2; + uint16_t p:1; + uint16_t limit:4; + uint16_t avl:1; + uint16_t l:1; + uint16_t db:1; + uint16_t g:1; + } __attribute__((__packed__)); + } __attribute__((__packed__)); + uint8_t base3; + uint32_t base4; + uint32_t zero; +} __attribute__((__packed__)); + +#define DESC_BUSY ((uint64_t) 1 << 41) + extern idt_entry_t boot_idt[256]; #ifndef __x86_64__ -- 2.14.1