Skip to contentSkip to conversation

Return amount of ASIDs

PATCH Applied Alexander Graf 2 participants 2 messages Oct 15, 2008 – Oct 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Return amount of ASIDs

Return amount of ASIDs

With SVM the TLB supports tagging to distinguish TLB entries from different virtual CPUs. This tag is called an ASID. The amount of ASIDs is given in EBX of the SVM-CPUID-leaf. Currently we return 0, which might break hypervisors. Let's better return something >0 here, say 0x10. Since we're flushing the complete TLB on every VM entry and exit we're not making use of the ASID information anyways.

op_helper.c +3 -3
Index: target-i386/op_helper.c
===================================================================
@@ -2037,10 +2037,10 @@
         EDX = 0;
         break;
     case 0x8000000A:
-        EAX = 0x00000001;
-        EBX = 0;
+        EAX = 0x00000001; /* SVM Revision */
+        EBX = 0x00000010; /* nr of ASIDs */
         ECX = 0;
-        EDX = 0;
+        EDX = 0; /* optional features */
         break;
     default:
         /* reserved values: zero */
#1 lore raw
Quoted 11 lines · Alexander Graf

Return amount of ASIDs

With SVM the TLB supports tagging to distinguish TLB entries from different virtual CPUs. This tag is called an ASID. The amount of ASIDs is given in EBX of the SVM-CPUID-leaf. Currently we return 0, which might break hypervisors. Let's better return something >0 here, say 0x10. Since we're flushing the complete TLB on every VM entry and exit we're not making use of the ASID information anyways.

Applied, thanks.

Quoted 18 lines

Index: target-i386/op_helper.c
===================================================================

op_helper.c +3 -3
@@ -2037,10 +2037,10 @@
         EDX = 0;
         break;
     case 0x8000000A:
-        EAX = 0x00000001;
-        EBX = 0;
+        EAX = 0x00000001; /* SVM Revision */
+        EBX = 0x00000010; /* nr of ASIDs */
         ECX = 0;
-        EDX = 0;
+        EDX = 0; /* optional features */
         break;
     default:
         /* reserved values: zero */
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net