On 07/07/2017 02:21 PM, Cornelia Huck wrote:
> If a guest running on a non-pci build issues a pci instruction,
> throw them an exception.
> 
> Signed-off-by: Cornelia Huck <coh...@redhat.com>
> ---
>  target/s390x/kvm.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index a3d00196f4..c5c7c27a21 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -1160,6 +1160,9 @@ static int kvm_clp_service_call(S390CPU *cpu, struct 
> kvm_run *run)
>  {
>      uint8_t r2 = (run->s390_sieic.ipb & 0x000f0000) >> 16;
> 
> +#ifndef CONFIG_PCI
> +    return -1;
> +#endif

Instead of this ifdefing, can you use the cpu model to decide if the instruction
should be available? We need to do this anyway for proper handling.

You can then fence off the PCI bits in the CPU model for
CONFIG_PCI == off.


Reply via email to