Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1889759imm; Wed, 16 May 2018 04:45:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpxgj0yei/6hCocJcDOh/+7r1oEMWNq1YreQedJ8+paFilrEtjJJBGIqe3g9cRN+3y1LSH1 X-Received: by 2002:a17:902:8c81:: with SMTP id t1-v6mr610093plo.310.1526471144689; Wed, 16 May 2018 04:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526471144; cv=none; d=google.com; s=arc-20160816; b=ySeb17mTO5ep4KZbPBBPwKEY2XBqHY/xwK9gSu7IVm80/+ePMUpRhvV10+1xPpSG9w GaF8V7gzHgZpUoP3BAQHmdsomRQ1+29XQjVksKf7GlWWGR9ekS2HXYPk230jK5IOuEGO BUWDppTgzh79oK/iBcc06kd7K3W7mgVNuble/tPaijogsQOhyeEaZ1IM8lXE7pdusOtY fM/apaOnJ/KmLss1oM838IMO3XwgnnQidCtetBTLlkumFs6TTc7FxyC7i07zmnFz9svk RQHiGnZtfKPAfJuu7IgW4klmjrrWhCVhQ9tQCCyq8flFUmqu8LjEEMjWXRnmU1wg6bka p6mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=HfH6p274spmLiegVuwt92+yAeeD+aVS/bx0bNKAI6I8=; b=q68z0IUPeW3FfQjguqC09i6rqTFUOl7Lb46SbeY1oKYNRzzDX+idqdpWlclOcNVoFl jPjpbnHFJjQri/EmGIi1wNjbGe1mqW7NqKbIWTJPeAlO6gapx15PDojfBVU43Houg0D2 Cxlea5Fb+pRpQVRf3B6/ptGC+MFVcNiWmyvFM4IyJCv/9HCtyjjoNJ+W9hfbmvavIl4m 1GCefuix/ad+AN95+NJqN5XFTYC6LdqN3HeD3Ab2RcOreSPNgzl9K3oqVxnpcPuBAee0 TwgOYMNii5CqxdqJba1eoYlpXOpqLBa06eiHP6ky0YEznbXRvB5j4rtYUeIkb3jCnU5z x11g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si2324514plk.112.2018.05.16.04.45.29; Wed, 16 May 2018 04:45:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752597AbeEPLpM (ORCPT + 99 others); Wed, 16 May 2018 07:45:12 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45210 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751844AbeEPLpK (ORCPT ); Wed, 16 May 2018 07:45:10 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4GBhpC6005249 for ; Wed, 16 May 2018 07:45:10 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 2j0kyug4e5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 May 2018 07:45:10 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 16 May 2018 05:45:09 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 16 May 2018 05:45:06 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4GBj5oa12779972; Wed, 16 May 2018 04:45:05 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E95416E038; Wed, 16 May 2018 05:45:04 -0600 (MDT) Received: from oc8043147753.ibm.com (unknown [9.80.200.126]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 70C316E045; Wed, 16 May 2018 05:45:01 -0600 (MDT) Subject: Re: [PATCH v5 04/13] s390: vfio-ap: base implementation of VFIO AP device driver To: pmorel@linux.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.com, pmorel@linux.vnet.ibm.com, alifm@linux.vnet.ibm.com, mjrosato@linux.vnet.ibm.com, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com, berrange@redhat.com, fiuczy@linux.vnet.ibm.com, buendgen@de.ibm.com References: <1525705912-12815-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1525705912-12815-5-git-send-email-akrowiak@linux.vnet.ibm.com> <9ee148c9-1d3b-860a-32d8-8a1584628233@linux.ibm.com> From: Tony Krowiak Date: Wed, 16 May 2018 07:45:00 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <9ee148c9-1d3b-860a-32d8-8a1584628233@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18051611-0028-0000-0000-000009A08C9E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009034; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000260; SDB=6.01033107; UDB=6.00528218; IPR=6.00812239; MB=3.00021143; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-16 11:45:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18051611-0029-0000-0000-00003AD97985 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-16_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805160120 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/16/2018 04:21 AM, Pierre Morel wrote: > On 07/05/2018 17:11, Tony Krowiak wrote: >> Introduces a new AP device driver. This device driver >> is built on the VFIO mediated device framework. The framework >> provides sysfs interfaces that facilitate passthrough >> access by guests to devices installed on the linux host. > ...snip... >> +static int vfio_ap_queue_dev_probe(struct ap_device *apdev) >> +{ > > You should take care of the ap devices when they are added or removed > from the matrix. > I suggest you add a remove callback to avoid unbinding a queue while > it is assigned to a guest. This is not possible without a change to the AP bus. The remove callback returns void, so there is no way to indicate to the AP bus not to remove the queue device. I'll talk to Harald about this. > > >> + return 0; >> +} >> + >> +static void vfio_ap_matrix_dev_release(struct device *dev) >> +{ >> + struct ap_matrix *ap_matrix = dev_get_drvdata(dev); >> + >> + kfree(ap_matrix); >> +} > ...snip... >