This commit is contained in:
emellor@leeni.uk.xensource.com committed 2006-05-19 16:21:49 +01:00
commit 09eb4b87f7
12 files changed
+43 -28

No files matched your search

@@ -1045,8 +1045,6 @@ static void network_connect(struct net_device *dev)
notify_remote_via_irq(np->irq);
network_tx_buf_gc(dev);
network_maybe_wake_tx(dev);
spin_unlock(&np->rx_lock);
spin_unlock_irq(&np->tx_lock);
}
+1 -1
View File
@@ -1264,7 +1264,7 @@ class XendDomainInfo:
m = self.image.getDomainMemory(self.info['memory'] * 1024)
balloon.free(m)
xc.domain_setmaxmem(self.domid, m)
xc.domain_memory_increase_reservation(self.domid, m, 0, 0)
xc.domain_memory_increase_reservation(self.domid, self.info['memory'] * 1024, 0, 0)
self.createChannels()
+16 -8
View File
@@ -19,6 +19,7 @@
import os, string
import re
import math
import xen.lowlevel.xc
from xen.xend import sxp
@@ -141,11 +142,13 @@ class ImageHandler:
% (self.ostype, self.vm.getDomid(), str(result)))
def getDomainMemory(self, mem):
def getDomainMemory(self, mem_kb):
"""@return The memory required, in KiB, by the domain to store the
given amount, also in KiB. This is normally just mem, but HVM domains
have overheads to account for."""
return mem
given amount, also in KiB. This is normally just mem, but if HVM is
supported, keep a little extra free."""
if 'hvm' in xc.xeninfo()['xen_caps']:
mem_kb += 4*1024;
return mem_kb
def buildDomain(self):
"""Build the domain. Define in subclass."""
@@ -377,15 +380,20 @@ class HVMImageHandler(ImageHandler):
os.waitpid(self.pid, 0)
self.pid = 0
def getDomainMemory(self, mem):
def getDomainMemory(self, mem_kb):
"""@see ImageHandler.getDomainMemory"""
page_kb = 4
extra_pages = 0
if os.uname()[4] == 'ia64':
page_kb = 16
# ROM size for guest firmware, ioreq page and xenstore page
extra_pages = 1024 + 2
return mem + extra_pages * page_kb
else:
page_kb = 4
# This was derived emperically:
# 2.4 MB overhead per 1024 MB RAM + 8 MB constant
# + 4 to avoid low-memory condition
extra_mb = (2.4/1024) * (mem_kb/1024.0) + 12;
extra_pages = int( math.ceil( extra_mb*1024 / page_kb ))
return mem_kb + extra_pages * page_kb
def register_shutdown_watch(self):
""" add xen store watch on control/shutdown """
@@ -44,7 +44,7 @@ try:
lofails=""
for size in trysizes:
out = console.runCmd("hping2 127.0.0.1 -E /dev/urandom -q -c 20 "
+ "--fast -d " + str(size))
+ "--fast -d " + str(size) + " -N " + str(size))
if out["return"]:
lofails += " " + str(size)
@@ -54,7 +54,7 @@ try:
ip = netdev.getNetDevIP()
for size in trysizes:
out = console.runCmd("hping2 " + ip + " -E /dev/urandom -q -c 20 "
+ "--fast -d "+ str(size))
+ "--fast -d "+ str(size) + " -N " + str(size))
if out["return"]:
eth0fails += " " + str(size)
except ConsoleError, e:
@@ -43,7 +43,7 @@ try:
lofails=""
for size in trysizes:
out = console.runCmd("hping2 127.0.0.1 -E /dev/urandom -2 -q -c 20 "
+ "--fast -d " + str(size))
+ "--fast -d " + str(size) + " -N " + str(size))
if out["return"]:
lofails += " " + str(size)
print out["output"]
@@ -54,7 +54,7 @@ try:
ip = netdev.getNetDevIP()
for size in trysizes:
out = console.runCmd("hping2 " + ip + " -E /dev/urandom -2 -q -c 20 "
+ "--fast -d " + str(size))
+ "--fast -d " + str(size) + " -N " + str(size))
if out["return"]:
eth0fails += " " + str(size)
print out["output"]
@@ -44,7 +44,7 @@ try:
dom0ip = netdev.getDom0AliasIP()
for size in trysizes:
out = console.runCmd("hping2 " + dom0ip + " -E /dev/urandom -q -c 20 "
+ "--fast -d " + str(size))
+ "--fast -d " + str(size) + " -N " + str(size))
if out["return"]:
fails += " " + str(size)
print out["output"]
@@ -43,7 +43,7 @@ try:
dom0ip = netdev.getDom0AliasIP()
for size in trysizes:
out = console.runCmd("hping2 " + dom0ip + " -E /dev/urandom -2 -q -c 20"
+ " --fast -d " + str(size))
+ " --fast -d " + str(size) + " -N " + str(size))
if out["return"]:
fails += " " + str(size)
print out["output"]
@@ -50,7 +50,7 @@ try:
ip2 = dst_netdev.getNetDevIP()
for size in pingsizes:
out = src_console.runCmd("hping2 " + ip2 + " -E /dev/urandom -q -c 20 "
+ "--fast -d " + str(size))
+ "--fast -d " + str(size) + " -N " + str(size))
if out["return"]:
fails += " " + str(size)
print out["output"]
@@ -50,7 +50,7 @@ try:
ip2 = dst_netdev.getNetDevIP()
for size in pingsizes:
out = src_console.runCmd("hping2 " + ip2 + " -E /dev/urandom -2 -q "
+ "-c 20 --fast -d " + str(size))
+ "-c 20 --fast -d " + str(size) + " -N " + str(size))
if out["return"]:
fails += " " + str(size)
print out["output"]
+5 -1
View File
@@ -189,7 +189,11 @@ void hvm_setup_platform(struct domain* d)
if ( !hvm_guest(current) || (current->vcpu_id != 0) )
return;
shadow_direct_map_init(d);
if ( shadow_direct_map_init(d) == 0 )
{
printk("Can not allocate shadow direct map for HVM domain.\n");
domain_crash_synchronous();
}
hvm_map_io_shared_page(d);
hvm_get_info(d);
+3 -1
View File
@@ -458,6 +458,9 @@ int start_svm(void)
if (!(test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability)))
return 0;
svm_globals[cpu].hsa = alloc_host_save_area();
if (! svm_globals[cpu].hsa)
return 0;
rdmsr(MSR_EFER, eax, edx);
eax |= EFER_SVME;
@@ -466,7 +469,6 @@ int start_svm(void)
printk("AMD SVM Extension is enabled for cpu %d.\n", cpu );
/* Initialize the HSA for this core */
svm_globals[cpu].hsa = alloc_host_save_area();
phys_hsa = (u64) virt_to_maddr( svm_globals[cpu].hsa );
phys_hsa_lo = (u32) phys_hsa;
phys_hsa_hi = (u32) (phys_hsa >> 32);
+10 -7
View File
@@ -139,18 +139,21 @@ static int construct_vmcb_controls(struct arch_svm_struct *arch_svm)
/* The following is for I/O and MSR permision map */
iopm = alloc_xenheap_pages(get_order_from_bytes(IOPM_SIZE));
ASSERT(iopm);
memset(iopm, 0xff, IOPM_SIZE);
clear_bit(PC_DEBUG_PORT, iopm);
if (iopm)
{
memset(iopm, 0xff, IOPM_SIZE);
clear_bit(PC_DEBUG_PORT, iopm);
}
msrpm = alloc_xenheap_pages(get_order_from_bytes(MSRPM_SIZE));
ASSERT(msrpm);
memset(msrpm, 0xff, MSRPM_SIZE);
if (msrpm)
memset(msrpm, 0xff, MSRPM_SIZE);
arch_svm->iopm = iopm;
arch_svm->msrpm = msrpm;
if (! iopm || ! msrpm)
return 1;
vmcb->iopm_base_pa = (u64) virt_to_maddr(iopm);
vmcb->msrpm_base_pa = (u64) virt_to_maddr(msrpm);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.