[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b6bdde6-2a6d-4792-ff5c-86b6fc7a2dca@linux.ibm.com>
Date: Wed, 25 May 2022 09:19:08 -0400
From: Matthew Rosato <mjrosato@...ux.ibm.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: linux-s390@...r.kernel.org, cohuck@...hat.com,
schnelle@...ux.ibm.com, farman@...ux.ibm.com, pmorel@...ux.ibm.com,
borntraeger@...ux.ibm.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
gerald.schaefer@...ux.ibm.com, agordeev@...ux.ibm.com,
svens@...ux.ibm.com, frankja@...ux.ibm.com, david@...hat.com,
imbrenda@...ux.ibm.com, vneethv@...ux.ibm.com,
oberpar@...ux.ibm.com, freude@...ux.ibm.com, thuth@...hat.com,
pasic@...ux.ibm.com, pbonzini@...hat.com, corbet@....net,
jgg@...dia.com, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org
Subject: Re: [PATCH v8 11/22] KVM: s390: pci: add basic kvm_zdev structure
On 5/24/22 6:50 PM, Alex Williamson wrote:
> On Tue, 24 May 2022 14:58:56 -0400
> Matthew Rosato <mjrosato@...ux.ibm.com> wrote:
>> diff --git a/arch/s390/kvm/pci.c b/arch/s390/kvm/pci.c
>> new file mode 100644
>> index 000000000000..21c2be5c2713
>> --- /dev/null
>> +++ b/arch/s390/kvm/pci.c
>> @@ -0,0 +1,36 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * s390 kvm PCI passthrough support
>> + *
>> + * Copyright IBM Corp. 2022
>> + *
>> + * Author(s): Matthew Rosato <mjrosato@...ux.ibm.com>
>> + */
>> +
>> +#include <linux/kvm_host.h>
>> +#include <linux/pci.h>
>> +#include "pci.h"
>> +
>> +static int kvm_s390_pci_dev_open(struct zpci_dev *zdev)
>> +{
>> + struct kvm_zdev *kzdev;
>> +
>> + kzdev = kzalloc(sizeof(struct kvm_zdev), GFP_KERNEL);
>> + if (!kzdev)
>> + return -ENOMEM;
>> +
>> + kzdev->zdev = zdev;
>> + zdev->kzdev = kzdev;
>> +
>> + return 0;
>> +}
>> +
>> +static void kvm_s390_pci_dev_release(struct zpci_dev *zdev)
>> +{
>> + struct kvm_zdev *kzdev;
>> +
>> + kzdev = zdev->kzdev;
>> + WARN_ON(kzdev->zdev != zdev);
>> + zdev->kzdev = 0;
>
> I imagine this should be s/0/NULL/, right? I feel like there was a
> recent similar discussion, but I can't think of any unique search terms
> to sort it out of my inbox. Thanks,
>
Yup, I recall a similar comment on a prior version but I don't recall if
it was this particular patch or not -- anyway will change
Powered by blists - more mailing lists