Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78001C433E0 for ; Wed, 20 Jan 2021 05:09:10 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D7E162311C for ; Wed, 20 Jan 2021 05:09:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7E162311C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DLD8L01C9zDqwg for ; Wed, 20 Jan 2021 16:09:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.ru (client-ip=2607:f8b0:4864:20::102b; helo=mail-pj1-x102b.google.com; envelope-from=aik@ozlabs.ru; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ozlabs-ru.20150623.gappssmtp.com header.i=@ozlabs-ru.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=T+xxjS6n; dkim-atps=neutral Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DLD4T21dCzDqwF for ; Wed, 20 Jan 2021 16:05:43 +1100 (AEDT) Received: by mail-pj1-x102b.google.com with SMTP id g15so1412483pjd.2 for ; Tue, 19 Jan 2021 21:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ozlabs-ru.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cXSghafCoLyghf6a9xRFVTCEKKeerf091GAh1xBKiX0=; b=T+xxjS6ngUZXEL9PZSygGdcRGZlvjS0UdUGZMg4oUCjF18ltxXzhLuA//+XDrqtlSN 3YQZTABoyPB3NCjLwp8Vm7Jo7UD287RNuNsxOqceDMR+CPoEE330LumjGJrulfEAHETL Bhr/Swzmm0nXHCOKdjpoOzKCN+VQurkG1jbQ5Dz77X268zgofnl9KwFDPjyBGwx6aOg8 vLQVa2JiIRPPX086EFj2aNwo/RWUNVEYlsZ0U7pPDpAIquR7Tqw4urYXEzVMJkW8pm75 oyNnKIYIF/CGxIh9Bi7FAnKhP62porcQBGSsb1VJrCAnsio9Wu6ydzRWo9fbAmfCS5u6 OIzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cXSghafCoLyghf6a9xRFVTCEKKeerf091GAh1xBKiX0=; b=MQ+MZtq7la7yFtXR1Nsq9faLV9MP+FM1R5ERIK9TWiwjLc1xQDkFc+586Ni9p8+Zxm jLsWA2qQC3hSoHQJdunPGsmuvlRrV/+7Te1jv0LtfwWrevNtQgMPNLk46kWwCF5HItDN ZaFdfPqX87MUBBGT1oaq+TMoK+nV0x8kzecB1Ty05yFvMc0gKlmhpkEcbCoU7w8sz66a Y/lLzFu0YzZRxhvsCffJusoyFHcKnij0DsGjsROhawR86DYpBSSh99tX9p4VXUSEza19 mTgYVhG53LjgvrovXhJFzpSQTK2qNq6YlhrwENMkKMkFs//spelDZ1Bcmdu5wZqg9pHp RMZg== X-Gm-Message-State: AOAM530wNI9gIvDCicmPB0USLzuRFSn854NoMy/1o7ZzGFkr9oq0prf0 omWCiom7cJlOhNaUzmwYMCGoPwnvbVyzhA== X-Google-Smtp-Source: ABdhPJxEx1FT+hCD4SAfiwBcxNKAPxgPrjkIhqz0i6HNlFXsKHPvvYmGgKmrdPQ9/CXo1CNfBoYEzw== X-Received: by 2002:a17:90a:f0c1:: with SMTP id fa1mr3597985pjb.3.1611119137214; Tue, 19 Jan 2021 21:05:37 -0800 (PST) Received: from [192.168.10.23] (124-171-107-241.dyn.iinet.net.au. [124.171.107.241]) by smtp.gmail.com with UTF8SMTPSA id bj18sm622364pjb.40.2021.01.19.21.05.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Jan 2021 21:05:36 -0800 (PST) Subject: Re: [PATCH 5/6] powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE To: Nathan Lynch , linuxppc-dev@lists.ozlabs.org References: <20210114220004.1138993-1-nathanl@linux.ibm.com> <20210114220004.1138993-6-nathanl@linux.ibm.com> <87a6taxkgf.fsf@linux.ibm.com> <6905c3d2-e524-b6d8-036f-7812ea3f8b85@ozlabs.ru> <87y2gowgo6.fsf@linux.ibm.com> From: Alexey Kardashevskiy Message-ID: <7988dce5-6cf3-df79-1276-7bc91ce7c8b2@ozlabs.ru> Date: Wed, 20 Jan 2021 16:05:31 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:85.0) Gecko/20100101 Thunderbird/85.0 MIME-Version: 1.0 In-Reply-To: <87y2gowgo6.fsf@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tyreld@linux.ibm.com, brking@linux.ibm.com, ajd@linux.ibm.com, aneesh.kumar@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 20/01/2021 12:17, Nathan Lynch wrote: > Alexey Kardashevskiy writes: >> On 16/01/2021 02:56, Nathan Lynch wrote: >>> Alexey Kardashevskiy writes: >>>> On 15/01/2021 09:00, Nathan Lynch wrote: >>>>> diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h >>>>> index 332e1000ca0f..1aa7ab1cbc84 100644 >>>>> --- a/arch/powerpc/include/asm/rtas.h >>>>> +++ b/arch/powerpc/include/asm/rtas.h >>>>> @@ -19,8 +19,11 @@ >>>>> #define RTAS_UNKNOWN_SERVICE (-1) >>>>> #define RTAS_INSTANTIATE_MAX (1ULL<<30) /* Don't instantiate rtas at/above this value */ >>>>> >>>>> -/* Buffer size for ppc_rtas system call. */ >>>>> -#define RTAS_RMOBUF_MAX (64 * 1024) >>>>> +/* Work areas shared with RTAS must be 4K, naturally aligned. */ >>>> >>>> Why exactly 4K and not (for example) PAGE_SIZE? >>> >>> 4K is a platform requirement and isn't related to Linux's configured >>> page size. See the PAPR specification for RTAS functions such as >>> ibm,configure-connector, ibm,update-nodes, ibm,update-properties. >> >> Good, since we are documenting things here - add to the comment ("per >> PAPR")? > > But almost every constant in this header relates to a specification or > requirement in PAPR. Yup, "almost". > >>> There are other calls with work area parameters where alignment isn't >>> specified (e.g. ibm,get-system-parameter) but 4KB alignment is a safe >>> choice for those. >>> >>>>> +#define RTAS_WORK_AREA_SIZE 4096 >>>>> + >>>>> +/* Work areas allocated for user space access. */ >>>>> +#define RTAS_USER_REGION_SIZE (RTAS_WORK_AREA_SIZE * 16) >>>> >>>> This is still 64K but no clarity why. There is 16 of something, what >>>> is it? >>> >>> There are 16 4KB work areas in the region. I can name it >>> RTAS_NR_USER_WORK_AREAS or similar. >> >> >> Why 16? PAPR (then add "per PAPR") or we just like 16 ("should be >> enough")? > > PAPR doesn't know anything about the user region; it's a Linux > construct. It's been 64KB since pre-git days and I'm not sure what the > original reason is. At this point, maintaining a kernel-user ABI seems > like enough justification for the value. I am not arguing keeping the numbers but you are replacing one magic number with another and for neither it is horribly obvious where they came from. Is 16 the max number of concurrently running sys_rtas system calls? Does the userspace ensure there is no more than 16? btw where is that userspace code? I thought https://github.com/power-ras/ppc64-diag.git but no. Thanks, -- Alexey