Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2407716imm; Mon, 24 Sep 2018 03:59:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SFQYVbDeqh0XodrgqhG/WnFAEbCYSUj+FGbBxYY1OveXYInLu1XgSBBcSW7Rew6ofxm/y X-Received: by 2002:a63:9752:: with SMTP id d18-v6mr9208648pgo.405.1537786746483; Mon, 24 Sep 2018 03:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537786746; cv=none; d=google.com; s=arc-20160816; b=M+rTRnA6eKCxMpS6cOX2/Qg0vqsXgGwRGnTGmC8bNCDf16mkjvYdNsWr5w4ZjuRjaL YSHD1XLAcgAPPONFpSZbxy1QA8fCkyHtFGnD4BDPvWvEVpnfsYVQ5WcQedsU7DUOjvFH pQjjJWAgrIqDZX/NoKy2DKZ5tnZ6vVYpW1ZgK4rjdKrNIFxpagOSTFBYh5JH1eYQ3sc+ a47vlL42Y6TmhjSPFoAI0U6g3rCZ1rawkWeXLqHl16gAFAVcBNqQUNLf4ARlAn/3oUlx /tHPx5kEj34xpzeULf8tIsqVi36FGY2jTdG8E1oZt5KJlDbwf9WcjJawtsUJU26Y2Cm8 0hFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=IVCvtSrvVZ9XeZ/IQPlgCXHyBtalHipMsYdpEsRbiw4=; b=TqUYymtUzAlT73rf8F09SK3Wj5IRF67fTk6pxByjBwnQx8ZJPdQD08zK7/v0pZPd/6 fBrUm7ic0pLuhSht82a5QsK6W6elO4oKGb3Uf9KWCamZvqZujFOirPUb6SA8XxJnRqu6 9ODC27zjYJfzso4odC1CydVkS2DNKlEEH6Oqma0b3D48C4L/1Ts/ggOg1bjOnZsCEuyl Wv6QwmOhXB7UfaTXybW7hge9JyZDl0VTo4lpnapkRp4Hb39xKSLCh2bzUBIOo6zltaMA SUMc+/JVNxaRmkEtEgA4j/TwtLT99KR1xVH2Epei+LnSF1KjNwQ+6yV9IHBuomHJ6CNB YdsQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s25-v6si34791525pgd.539.2018.09.24.03.58.51; Mon, 24 Sep 2018 03:59:06 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728637AbeIXQ7g (ORCPT + 99 others); Mon, 24 Sep 2018 12:59:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49100 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbeIXQ7g (ORCPT ); Mon, 24 Sep 2018 12:59:36 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFA873082E24; Mon, 24 Sep 2018 10:58:05 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBC105C1B4; Mon, 24 Sep 2018 10:57:58 +0000 (UTC) Date: Mon, 24 Sep 2018 12:57:56 +0200 From: Cornelia Huck To: Tony Krowiak Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.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, frankja@linux.ibm.com, Tony Krowiak Subject: Re: [PATCH v10 08/26] s390: vfio-ap: sysfs interfaces to configure control domains Message-ID: <20180924125756.1ea6c31a.cohuck@redhat.com> In-Reply-To: <1536781396-13601-9-git-send-email-akrowiak@linux.vnet.ibm.com> References: <1536781396-13601-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1536781396-13601-9-git-send-email-akrowiak@linux.vnet.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 24 Sep 2018 10:58:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Sep 2018 15:42:58 -0400 Tony Krowiak wrote: > From: Tony Krowiak > > Provides the sysfs interfaces for: > > 1. Assigning AP control domains to the mediated matrix device > > 2. Unassigning AP control domains from a mediated matrix device > > 3. Displaying the control domains assigned to a mediated matrix > device > > The IDs of the AP control domains assigned to the mediated matrix > device are stored in an AP domain mask (ADM). The bits in the ADM, > from most significant to least significant bit, correspond to > AP domain numbers 0 to 255. On some systems, the maximum allowable > domain number may be less than 255 - depending upon the host's > AP configuration - and assignment may be rejected if the input > domain ID exceeds the limit. > > When a control domain is assigned, the bit corresponding its domain > ID will be set in the ADM. Likewise, when a domain is unassigned, > the bit corresponding to its domain ID will be cleared in the ADM. > > The relevant sysfs structures are: > > /sys/devices/vfio_ap/matrix/ > ...... [mdev_supported_types] > ......... [vfio_ap-passthrough] > ............ [devices] > ...............[$uuid] > .................. assign_control_domain > .................. unassign_control_domain > > To assign a control domain to the $uuid mediated matrix device's > ADM, write its domain number to the assign_control_domain file. > To unassign a domain, write its domain number to the > unassign_control_domain file. The domain number is specified > using conventional semantics: If it begins with 0x the number > will be parsed as a hexadecimal (case insensitive) number; > if it begins with 0, it is parsed as an octal number; > otherwise, it will be parsed as a decimal number. > > For example, to assign control domain 173 (0xad) to the mediated > matrix device $uuid: > > echo 173 > assign_control_domain > > or > > echo 0255 > assign_control_domain > > or > > echo 0xad > assign_control_domain > > To unassign control domain 173 (0xad): > > echo 173 > unassign_control_domain > > or > > echo 0255 > unassign_control_domain > > or > > echo 0xad > unassign_control_domain > > The assignment will be rejected if the APQI exceeds the maximum > value for an AP domain: > * If the AP Extended Addressing (APXA) facility is installed, > the max value is 255 > * Else the max value is 15 > > Signed-off-by: Tony Krowiak > Reviewed-by: Halil Pasic > Tested-by: Michael Mueller > Tested-by: Farhan Ali > Tested-by: Pierre Morel > Signed-off-by: Christian Borntraeger > --- > drivers/s390/crypto/vfio_ap_ops.c | 112 +++++++++++++++++++++++++++++++++++++ > 1 files changed, 112 insertions(+), 0 deletions(-) > Reviewed-by: Cornelia Huck