All of lore.kernel.org
 help / color / mirror / Atom feed
* one question to p2m table entry type
@ 2010-05-05  8:17 Jiang, Yunhong
  2010-05-05  9:21 ` Keir Fraser
  2010-05-18 11:04 ` Tim Deegan
  0 siblings, 2 replies; 6+ messages in thread
From: Jiang, Yunhong @ 2010-05-05  8:17 UTC (permalink / raw)
  To: tim.deegan, Keir Fraser; +Cc: xen-devel

Tim/Keir, I noticed that when translatiing p2m table type and p2m pte entry flags, there are difference handling for x86_64 and x32 like:

in p2m_type_to_flags:
#ifdef __x86_64__
    flags = (unsigned long)(t & 0x3fff) << 9;
#else
    flags = (t & 0x7UL) << 9;
#endif

in p2m_flags_to_type:
    /* Type is stored in the "available" bits */
#ifdef __x86_64__
    return (flags >> 9) & 0x3fff;
#else
    return (flags >> 9) & 0x7;

But since we don't support pure 32 bit xen hypervisor any more, and for 32 PAE, we are sure have enough bit to keep these flags, why do we need these special handling? Are there any special reason for it?

Thanks
--jyh

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: one question to p2m table entry type
  2010-05-05  8:17 one question to p2m table entry type Jiang, Yunhong
@ 2010-05-05  9:21 ` Keir Fraser
  2010-05-18 11:04 ` Tim Deegan
  1 sibling, 0 replies; 6+ messages in thread
From: Keir Fraser @ 2010-05-05  9:21 UTC (permalink / raw)
  To: Jiang, Yunhong, Tim Deegan; +Cc: xen-devel

I think you're right, and this was probably too subtle to pick up in the
initial phase of code cleanup when non-pae support was removed. I think
Tim's away for a week or two now so you may not get a definitive response
for a little while.

 -- Keir

On 05/05/2010 09:17, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:

> Tim/Keir, I noticed that when translatiing p2m table type and p2m pte entry
> flags, there are difference handling for x86_64 and x32 like:
> 
> in p2m_type_to_flags:
> #ifdef __x86_64__
>     flags = (unsigned long)(t & 0x3fff) << 9;
> #else
>     flags = (t & 0x7UL) << 9;
> #endif
> 
> in p2m_flags_to_type:
>     /* Type is stored in the "available" bits */
> #ifdef __x86_64__
>     return (flags >> 9) & 0x3fff;
> #else
>     return (flags >> 9) & 0x7;
> 
> But since we don't support pure 32 bit xen hypervisor any more, and for 32
> PAE, we are sure have enough bit to keep these flags, why do we need these
> special handling? Are there any special reason for it?
> 
> Thanks
> --jyh
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: one question to p2m table entry type
  2010-05-05  8:17 one question to p2m table entry type Jiang, Yunhong
  2010-05-05  9:21 ` Keir Fraser
@ 2010-05-18 11:04 ` Tim Deegan
  2010-05-18 12:28   ` Keir Fraser
  2010-05-18 18:32   ` Jeremy Fitzhardinge
  1 sibling, 2 replies; 6+ messages in thread
From: Tim Deegan @ 2010-05-18 11:04 UTC (permalink / raw)
  To: Jiang, Yunhong; +Cc: xen-devel, Keir Fraser

At 09:17 +0100 on 05 May (1273051073), Jiang, Yunhong wrote:
> Tim/Keir, I noticed that when translatiing p2m table type and p2m pte entry flags, there are difference handling for x86_64 and x32 like:
> 
> in p2m_type_to_flags:
> #ifdef __x86_64__
>     flags = (unsigned long)(t & 0x3fff) << 9;
> #else
>     flags = (t & 0x7UL) << 9;
> #endif
> 
> in p2m_flags_to_type:
>     /* Type is stored in the "available" bits */
> #ifdef __x86_64__
>     return (flags >> 9) & 0x3fff;
> #else
>     return (flags >> 9) & 0x7;
> 
> But since we don't support pure 32 bit xen hypervisor any more, and
> for 32 PAE, we are sure have enough bit to keep these flags, why do we
> need these special handling? Are there any special reason for it?

The Intel SDMs (section 3.8.5, figure 3-20 in the copy in front of me)
only define three available bits in PAE PTEs; all bits above MAXPHYADDR
are reserved.  If we can rely on the manuals being wrong about that, we
can extend the number of p2m types on 32-bit XEN. :)

Cheers,

Tim.


-- 
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: one question to p2m table entry type
  2010-05-18 11:04 ` Tim Deegan
@ 2010-05-18 12:28   ` Keir Fraser
  2010-05-18 18:32   ` Jeremy Fitzhardinge
  1 sibling, 0 replies; 6+ messages in thread
From: Keir Fraser @ 2010-05-18 12:28 UTC (permalink / raw)
  To: Tim Deegan, Jiang, Yunhong; +Cc: xen-devel

On 18/05/2010 12:04, "Tim Deegan" <Tim.Deegan@eu.citrix.com> wrote:

>> But since we don't support pure 32 bit xen hypervisor any more, and
>> for 32 PAE, we are sure have enough bit to keep these flags, why do we
>> need these special handling? Are there any special reason for it?
> 
> The Intel SDMs (section 3.8.5, figure 3-20 in the copy in front of me)
> only define three available bits in PAE PTEs; all bits above MAXPHYADDR
> are reserved.  If we can rely on the manuals being wrong about that, we
> can extend the number of p2m types on 32-bit XEN. :)

If I previously replied positively about this patch, it's because I forgot
about the above PAE restriction.

 -- Keir

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: one question to p2m table entry type
  2010-05-18 11:04 ` Tim Deegan
  2010-05-18 12:28   ` Keir Fraser
@ 2010-05-18 18:32   ` Jeremy Fitzhardinge
  2010-05-19  3:02     ` Jiang, Yunhong
  1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2010-05-18 18:32 UTC (permalink / raw)
  To: Tim Deegan; +Cc: Jiang, Yunhong, xen-devel, Keir Fraser

On 05/18/2010 04:04 AM, Tim Deegan wrote:
> At 09:17 +0100 on 05 May (1273051073), Jiang, Yunhong wrote:
>   
>> Tim/Keir, I noticed that when translatiing p2m table type and p2m pte entry flags, there are difference handling for x86_64 and x32 like:
>>
>> in p2m_type_to_flags:
>> #ifdef __x86_64__
>>     flags = (unsigned long)(t & 0x3fff) << 9;
>> #else
>>     flags = (t & 0x7UL) << 9;
>> #endif
>>
>> in p2m_flags_to_type:
>>     /* Type is stored in the "available" bits */
>> #ifdef __x86_64__
>>     return (flags >> 9) & 0x3fff;
>> #else
>>     return (flags >> 9) & 0x7;
>>
>> But since we don't support pure 32 bit xen hypervisor any more, and
>> for 32 PAE, we are sure have enough bit to keep these flags, why do we
>> need these special handling? Are there any special reason for it?
>>     
> The Intel SDMs (section 3.8.5, figure 3-20 in the copy in front of me)
> only define three available bits in PAE PTEs; all bits above MAXPHYADDR
> are reserved.  If we can rely on the manuals being wrong about that, we
> can extend the number of p2m types on 32-bit XEN. :)
>   

No, the CPU will fault with a bad pte if you set the upper bits in a PAE
pte.

    J

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Re: one question to p2m table entry type
  2010-05-18 18:32   ` Jeremy Fitzhardinge
@ 2010-05-19  3:02     ` Jiang, Yunhong
  0 siblings, 0 replies; 6+ messages in thread
From: Jiang, Yunhong @ 2010-05-19  3:02 UTC (permalink / raw)
  To: Jeremy Fitzhardinge, Tim Deegan; +Cc: Keir, xen-devel, Fraser

Oops, sorry, I should notice the (must be 0) :$

--jyh

>-----Original Message-----
>From: Jeremy Fitzhardinge [mailto:jeremy@goop.org]
>Sent: Wednesday, May 19, 2010 2:32 AM
>To: Tim Deegan
>Cc: Jiang, Yunhong; xen-devel@lists.xensource.com; Keir Fraser
>Subject: Re: [Xen-devel] Re: one question to p2m table entry type
>
>On 05/18/2010 04:04 AM, Tim Deegan wrote:
>> At 09:17 +0100 on 05 May (1273051073), Jiang, Yunhong wrote:
>>
>>> Tim/Keir, I noticed that when translatiing p2m table type and p2m pte entry flags,
>there are difference handling for x86_64 and x32 like:
>>>
>>> in p2m_type_to_flags:
>>> #ifdef __x86_64__
>>>     flags = (unsigned long)(t & 0x3fff) << 9;
>>> #else
>>>     flags = (t & 0x7UL) << 9;
>>> #endif
>>>
>>> in p2m_flags_to_type:
>>>     /* Type is stored in the "available" bits */
>>> #ifdef __x86_64__
>>>     return (flags >> 9) & 0x3fff;
>>> #else
>>>     return (flags >> 9) & 0x7;
>>>
>>> But since we don't support pure 32 bit xen hypervisor any more, and
>>> for 32 PAE, we are sure have enough bit to keep these flags, why do we
>>> need these special handling? Are there any special reason for it?
>>>
>> The Intel SDMs (section 3.8.5, figure 3-20 in the copy in front of me)
>> only define three available bits in PAE PTEs; all bits above MAXPHYADDR
>> are reserved.  If we can rely on the manuals being wrong about that, we
>> can extend the number of p2m types on 32-bit XEN. :)
>>
>
>No, the CPU will fault with a bad pte if you set the upper bits in a PAE
>pte.
>
>    J

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-19  3:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-05  8:17 one question to p2m table entry type Jiang, Yunhong
2010-05-05  9:21 ` Keir Fraser
2010-05-18 11:04 ` Tim Deegan
2010-05-18 12:28   ` Keir Fraser
2010-05-18 18:32   ` Jeremy Fitzhardinge
2010-05-19  3:02     ` Jiang, Yunhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.