Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
bc923cc9
Commit
bc923cc9
authored
May 13, 2010
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: s390: Centrally lock arch specific vcpu ioctls
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
526b78ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
23 deletions
+17
-23
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/kvm-s390.c
+17
-23
No files found.
arch/s390/kvm/kvm-s390.c
View file @
bc923cc9
...
@@ -363,9 +363,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
...
@@ -363,9 +363,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
static
int
kvm_arch_vcpu_ioctl_initial_reset
(
struct
kvm_vcpu
*
vcpu
)
static
int
kvm_arch_vcpu_ioctl_initial_reset
(
struct
kvm_vcpu
*
vcpu
)
{
{
vcpu_load
(
vcpu
);
kvm_s390_vcpu_initial_reset
(
vcpu
);
kvm_s390_vcpu_initial_reset
(
vcpu
);
vcpu_put
(
vcpu
);
return
0
;
return
0
;
}
}
...
@@ -415,14 +413,12 @@ static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw)
...
@@ -415,14 +413,12 @@ static int kvm_arch_vcpu_ioctl_set_initial_psw(struct kvm_vcpu *vcpu, psw_t psw)
{
{
int
rc
=
0
;
int
rc
=
0
;
vcpu_load
(
vcpu
);
if
(
atomic_read
(
&
vcpu
->
arch
.
sie_block
->
cpuflags
)
&
CPUSTAT_RUNNING
)
if
(
atomic_read
(
&
vcpu
->
arch
.
sie_block
->
cpuflags
)
&
CPUSTAT_RUNNING
)
rc
=
-
EBUSY
;
rc
=
-
EBUSY
;
else
{
else
{
vcpu
->
run
->
psw_mask
=
psw
.
mask
;
vcpu
->
run
->
psw_mask
=
psw
.
mask
;
vcpu
->
run
->
psw_addr
=
psw
.
addr
;
vcpu
->
run
->
psw_addr
=
psw
.
addr
;
}
}
vcpu_put
(
vcpu
);
return
rc
;
return
rc
;
}
}
...
@@ -573,7 +569,7 @@ static int __guestcopy(struct kvm_vcpu *vcpu, u64 guestdest, const void *from,
...
@@ -573,7 +569,7 @@ static int __guestcopy(struct kvm_vcpu *vcpu, u64 guestdest, const void *from,
* KVM_S390_STORE_STATUS_NOADDR: -> 0x1200 on 64 bit
* KVM_S390_STORE_STATUS_NOADDR: -> 0x1200 on 64 bit
* KVM_S390_STORE_STATUS_PREFIXED: -> prefix
* KVM_S390_STORE_STATUS_PREFIXED: -> prefix
*/
*/
int
__
kvm_s390_vcpu_store_status
(
struct
kvm_vcpu
*
vcpu
,
unsigned
long
addr
)
static
int
kvm_s390_vcpu_store_status
(
struct
kvm_vcpu
*
vcpu
,
unsigned
long
addr
)
{
{
const
unsigned
char
archmode
=
1
;
const
unsigned
char
archmode
=
1
;
int
prefix
;
int
prefix
;
...
@@ -635,45 +631,43 @@ int __kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
...
@@ -635,45 +631,43 @@ int __kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
return
0
;
return
0
;
}
}
static
int
kvm_s390_vcpu_store_status
(
struct
kvm_vcpu
*
vcpu
,
unsigned
long
addr
)
{
int
rc
;
vcpu_load
(
vcpu
);
rc
=
__kvm_s390_vcpu_store_status
(
vcpu
,
addr
);
vcpu_put
(
vcpu
);
return
rc
;
}
long
kvm_arch_vcpu_ioctl
(
struct
file
*
filp
,
long
kvm_arch_vcpu_ioctl
(
struct
file
*
filp
,
unsigned
int
ioctl
,
unsigned
long
arg
)
unsigned
int
ioctl
,
unsigned
long
arg
)
{
{
struct
kvm_vcpu
*
vcpu
=
filp
->
private_data
;
struct
kvm_vcpu
*
vcpu
=
filp
->
private_data
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
long
r
;
switch
(
ioctl
)
{
if
(
ioctl
==
KVM_S390_INTERRUPT
)
{
case
KVM_S390_INTERRUPT
:
{
struct
kvm_s390_interrupt
s390int
;
struct
kvm_s390_interrupt
s390int
;
if
(
copy_from_user
(
&
s390int
,
argp
,
sizeof
(
s390int
)))
if
(
copy_from_user
(
&
s390int
,
argp
,
sizeof
(
s390int
)))
return
-
EFAULT
;
return
-
EFAULT
;
return
kvm_s390_inject_vcpu
(
vcpu
,
&
s390int
);
return
kvm_s390_inject_vcpu
(
vcpu
,
&
s390int
);
}
}
vcpu_load
(
vcpu
);
switch
(
ioctl
)
{
case
KVM_S390_STORE_STATUS
:
case
KVM_S390_STORE_STATUS
:
return
kvm_s390_vcpu_store_status
(
vcpu
,
arg
);
r
=
kvm_s390_vcpu_store_status
(
vcpu
,
arg
);
break
;
case
KVM_S390_SET_INITIAL_PSW
:
{
case
KVM_S390_SET_INITIAL_PSW
:
{
psw_t
psw
;
psw_t
psw
;
r
=
-
EFAULT
;
if
(
copy_from_user
(
&
psw
,
argp
,
sizeof
(
psw
)))
if
(
copy_from_user
(
&
psw
,
argp
,
sizeof
(
psw
)))
return
-
EFAULT
;
break
;
return
kvm_arch_vcpu_ioctl_set_initial_psw
(
vcpu
,
psw
);
r
=
kvm_arch_vcpu_ioctl_set_initial_psw
(
vcpu
,
psw
);
break
;
}
}
case
KVM_S390_INITIAL_RESET
:
case
KVM_S390_INITIAL_RESET
:
return
kvm_arch_vcpu_ioctl_initial_reset
(
vcpu
);
r
=
kvm_arch_vcpu_ioctl_initial_reset
(
vcpu
);
break
;
default:
default:
;
r
=
-
EINVAL
;
}
}
return
-
EINVAL
;
vcpu_put
(
vcpu
);
return
r
;
}
}
/* Section: memory related */
/* Section: memory related */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment