Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263640
b: refs/heads/master
c: 4fc1d39
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Sep 7, 2011
1 parent 705a575 commit 8f27f9b
Show file tree
Hide file tree
Showing 12 changed files with 270 additions and 86 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f020b007d5dd24597f5e985a6309bcb8393797ed
refs/heads/master: 4fc1d39e079e28a5daa2e6ffe6d27c064c7493ce
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/pvclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
#elif defined(__x86_64__)
__asm__ (
"mul %[mul_frac] ; shrd $32, %[hi], %[lo]"
"mulq %[mul_frac] ; shrd $32, %[hi], %[lo]"
: [lo]"=a"(product),
[hi]"=d"(tmp)
: "0"(delta),
Expand Down
19 changes: 19 additions & 0 deletions trunk/arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ static unsigned long __init xen_set_identity(const struct e820entry *list,
PFN_UP(start_pci), PFN_DOWN(last));
return identity;
}

static unsigned long __init xen_get_max_pages(void)
{
unsigned long max_pages = MAX_DOMAIN_PAGES;
domid_t domid = DOMID_SELF;
int ret;

ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid);
if (ret > 0)
max_pages = ret;
return min(max_pages, MAX_DOMAIN_PAGES);
}

/**
* machine_specific_memory_setup - Hook for machine specific memory setup.
**/
Expand Down Expand Up @@ -292,6 +305,12 @@ char * __init xen_memory_setup(void)

sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);

extra_limit = xen_get_max_pages();
if (extra_limit >= max_pfn)
extra_pages = extra_limit - max_pfn;
else
extra_pages = 0;

extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820);

/*
Expand Down
10 changes: 10 additions & 0 deletions trunk/arch/x86/xen/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <xen/page.h>
#include <xen/events.h>

#include <xen/hvc-console.h>
#include "xen-ops.h"
#include "mmu.h"

Expand Down Expand Up @@ -207,6 +208,15 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
unsigned cpu;
unsigned int i;

if (skip_ioapic_setup) {
char *m = (max_cpus == 0) ?
"The nosmp parameter is incompatible with Xen; " \
"use Xen dom0_max_vcpus=1 parameter" :
"The noapic parameter is incompatible with Xen";

xen_raw_printk(m);
panic(m);
}
xen_init_lock_cpu(0);

smp_store_cpu_info(0);
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/x86/xen/xen-asm_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ xen_iret_start_crit:

/*
* If there's something pending, mask events again so we can
* jump back into xen_hypervisor_callback
* jump back into xen_hypervisor_callback. Otherwise do not
* touch XEN_vcpu_info_mask.
*/
sete XEN_vcpu_info_mask(%eax)
jne 1f
movb $1, XEN_vcpu_info_mask(%eax)

popl %eax
1: popl %eax

/*
* From this point on the registers are restored and the stack
Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/9p/v9fs_vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ extern struct kmem_cache *v9fs_inode_cache;

struct inode *v9fs_alloc_inode(struct super_block *sb);
void v9fs_destroy_inode(struct inode *inode);
struct inode *v9fs_get_inode(struct super_block *sb, int mode);
struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t);
int v9fs_init_inode(struct v9fs_session_info *v9ses,
struct inode *inode, int mode);
struct inode *inode, int mode, dev_t);
void v9fs_evict_inode(struct inode *inode);
ino_t v9fs_qid2ino(struct p9_qid *qid);
void v9fs_stat2inode(struct p9_wstat *, struct inode *, struct super_block *);
Expand All @@ -83,4 +83,6 @@ static inline void v9fs_invalidate_inode_attr(struct inode *inode)
v9inode->cache_validity |= V9FS_INO_INVALID_ATTR;
return;
}

int v9fs_open_to_dotl_flags(int flags);
#endif
36 changes: 28 additions & 8 deletions trunk/fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
v9inode = V9FS_I(inode);
v9ses = v9fs_inode2v9ses(inode);
if (v9fs_proto_dotl(v9ses))
omode = file->f_flags;
omode = v9fs_open_to_dotl_flags(file->f_flags);
else
omode = v9fs_uflags2omode(file->f_flags,
v9fs_proto_dotu(v9ses));
Expand Down Expand Up @@ -169,7 +169,18 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)

/* convert posix lock to p9 tlock args */
memset(&flock, 0, sizeof(flock));
flock.type = fl->fl_type;
/* map the lock type */
switch (fl->fl_type) {
case F_RDLCK:
flock.type = P9_LOCK_TYPE_RDLCK;
break;
case F_WRLCK:
flock.type = P9_LOCK_TYPE_WRLCK;
break;
case F_UNLCK:
flock.type = P9_LOCK_TYPE_UNLCK;
break;
}
flock.start = fl->fl_start;
if (fl->fl_end == OFFSET_MAX)
flock.length = 0;
Expand Down Expand Up @@ -245,7 +256,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl)

/* convert posix lock to p9 tgetlock args */
memset(&glock, 0, sizeof(glock));
glock.type = fl->fl_type;
glock.type = P9_LOCK_TYPE_UNLCK;
glock.start = fl->fl_start;
if (fl->fl_end == OFFSET_MAX)
glock.length = 0;
Expand All @@ -257,17 +268,26 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl)
res = p9_client_getlock_dotl(fid, &glock);
if (res < 0)
return res;
if (glock.type != F_UNLCK) {
fl->fl_type = glock.type;
/* map 9p lock type to os lock type */
switch (glock.type) {
case P9_LOCK_TYPE_RDLCK:
fl->fl_type = F_RDLCK;
break;
case P9_LOCK_TYPE_WRLCK:
fl->fl_type = F_WRLCK;
break;
case P9_LOCK_TYPE_UNLCK:
fl->fl_type = F_UNLCK;
break;
}
if (glock.type != P9_LOCK_TYPE_UNLCK) {
fl->fl_start = glock.start;
if (glock.length == 0)
fl->fl_end = OFFSET_MAX;
else
fl->fl_end = glock.start + glock.length - 1;
fl->fl_pid = glock.proc_id;
} else
fl->fl_type = F_UNLCK;

}
return res;
}

Expand Down
Loading

0 comments on commit 8f27f9b

Please sign in to comment.