Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3718165imd; Mon, 29 Oct 2018 11:13:24 -0700 (PDT) X-Google-Smtp-Source: AJdET5evpTULajWCaLJk2ABT4rqvKapBOZdRhLEiLrrlpwPCnpFvvpfBJW7/EQlc70YGJlXAtPpj X-Received: by 2002:a63:b90a:: with SMTP id z10-v6mr14735996pge.221.1540836804296; Mon, 29 Oct 2018 11:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540836804; cv=none; d=google.com; s=arc-20160816; b=sRU42g6iQlU8wfaSt+1sWTEBc5l8JpK+5xBDwWLTeQEOglE3xtNLpoi7FJGKIchlGY tAIngjimX1lRkxm7U0pvgZYFZ0B9UFtpcgS4Gbezsok44F46h5SBV5jEFHpeR0fdO/uL 8u3CgTVMUHZDDOYiSeHFQNWcxLMwpd+GOID1lYSJk6VhoaTQj7dtLUtlXv/GmfjERZ7v j6oimA9Dk67seZ7B2gQjOsG5iXIfr4Hwszz65aCzuN8euHEmKEI5Efl/OabJaJx5IWWq u9n4FqJs+ev3U15d9rr4JQx6Kvp/lh1iI5XVBQk63zZP9Elu3a9oR2IQh/ZA/qPDVTjD QSOA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=5a6ry7YS/1XocQEq1IL80cJaCAab2eR6B7M0r5JjgFc=; b=W1cq71JC2Yo2QmDsco6AXyhu2u5huALNsefVKHpy1MrMxuYdys44biC6guRHF3+uv/ R3cRAz6PHDLS6G+Ebyj9FTG57eoo/35zq5Itwy9eR72JlCJCrEGrRutBZrEfqPGh+NKF H4E2BMO/XQPh4LhIQJxMQu6WVWXgHOlVUdZcr4+1BXoT3wX+19JlhnneZ4QVwqKjqpxQ exAEj3kvlZGRZtpHhMCXU/QyLCG6bA9n+2OuacwmErHpJWIYCcQeiBQXRDmRDz+FTXfH gLRpGJm3eK6eJ624b1qGnsVcjFxqQqElwPLb9ubsy65F4OcyLmE0eQ8WFB5GG9K8vIAu qGjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WXg2v0Sc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5-v6si1982194pfg.226.2018.10.29.11.13.08; Mon, 29 Oct 2018 11:13:24 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WXg2v0Sc; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728311AbeJ3DCW (ORCPT + 99 others); Mon, 29 Oct 2018 23:02:22 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:34245 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbeJ3DCW (ORCPT ); Mon, 29 Oct 2018 23:02:22 -0400 Received: by mail-lf1-f68.google.com with SMTP id n26-v6so6818735lfl.1; Mon, 29 Oct 2018 11:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5a6ry7YS/1XocQEq1IL80cJaCAab2eR6B7M0r5JjgFc=; b=WXg2v0ScrzR9IYVwfUfjD37ZnceesvUK34sTAfMJUnhu1hne6NOMw5luNk5cOQyGcS TAAjXbwPfFO1P4BBydaPRj1Kbm8ZqVxiJI9vq1FwEBd0/0Ha2AucxC3COLyjBgoKg2d/ 0QXKSj72Ek95PHJMmY8QP+Xpbt6Vp5VXpUCkd+YIbhnEqQg5tzRqi0t1AR9AVDZATmCJ yRUMxCjUHi73rbZW9zziNcxMUf99lQ31tqI3ufksnPEhVvT3pP57s8WhLlpNHXS/L0eX ROCsdGjeetoJXAe8L2ChEOop147Cenx98dmxF6hSEmai/hzONbvjdjvdblTeMyQkcgZ1 15lg== 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=5a6ry7YS/1XocQEq1IL80cJaCAab2eR6B7M0r5JjgFc=; b=K9tLH5cAb6nyUG3Z1Do9eFztFR+ujp9hkSSlCLGWmYrpcGArrD/my//WIcq01/33z0 P0qVeXBhrxtESrXPodn9mjnAPMKBX2dsuKExygdQ1jPKy6Yxu7jSC9Y1JPV6HtZXtfNa Alkdjm0y1uSgZPqiy0GcUTLZks8qper5ecPD1NceondUVoppzw+GLVIHFdK685QK14YX lRFFa1cX0G5RZQSzffQtUnXoabEo5oMV2gen9zyqqJRozXq+OdiLX/Z7TZmzs2erSv/k lYBv0fzgNRseSglbLhBozOBhwaijtZhivLi+xT5fKnHHFeSG/XfFY4cECYrBagHFRxzc /RMA== X-Gm-Message-State: AGRZ1gJTLqGRNuT+SHsrAqprP4gHlZFehwAWu1GLSOGKsXyaEclLE7Dq pKO642+jk3MB/tRpJ0OVZzWP9XlXpTDTzw== X-Received: by 2002:a19:4c02:: with SMTP id z2-v6mr8555753lfa.48.1540836755411; Mon, 29 Oct 2018 11:12:35 -0700 (PDT) Received: from ?IPv6:2001:14bb:52:7be:f0bf:dd2d:f008:5213? (dmkd798g-7z2-yccwcp-4.rev.dnainternet.fi. [2001:14bb:52:7be:f0bf:dd2d:f008:5213]) by smtp.gmail.com with ESMTPSA id e201-v6sm3310177lfg.42.2018.10.29.11.12.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Oct 2018 11:12:34 -0700 (PDT) Subject: Re: [PATCH 05/17] prmem: shorthands for write rare on common types To: Dave Hansen , Mimi Zohar , Kees Cook , Matthew Wilcox , Dave Chinner , James Morris , Michal Hocko , kernel-hardening@lists.openwall.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org Cc: igor.stoppa@huawei.com, Dave Hansen , Jonathan Corbet , Laura Abbott , Vlastimil Babka , "Kirill A. Shutemov" , Andrew Morton , Pavel Tatashin , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20181023213504.28905-1-igor.stoppa@huawei.com> <20181023213504.28905-6-igor.stoppa@huawei.com> From: Igor Stoppa Message-ID: Date: Mon, 29 Oct 2018 20:12:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/10/2018 01:28, Dave Hansen wrote: > On 10/23/18 2:34 PM, Igor Stoppa wrote: >> Wrappers around the basic write rare functionality, addressing several >> common data types found in the kernel, allowing to specify the new >> values through immediates, like constants and defines. > > I have to wonder whether this is the right way, or whether a > size-agnostic function like put_user() is the right way. put_user() is > certainly easier to use. I definitely did not like it either. But it was the best that came to my mind ... The main purpose of this code was to show what I wanted to do. Once more, thanks for pointing out a better way to do it. -- igor