Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2465847ybl; Thu, 29 Aug 2019 08:32:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBigF1InP8oSGMsJ8NQFAcP2rEXEh3x9CCfDIM1DYH7IH4HQzc/sX4CeKABqHjdP8qxMED X-Received: by 2002:a17:902:183:: with SMTP id b3mr10733604plb.210.1567092770304; Thu, 29 Aug 2019 08:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567092770; cv=none; d=google.com; s=arc-20160816; b=hWKN8N4DcFfpJXRVdrAV8X341xRBpJbvDyBlQtOYyiGN7vH1j5qDuJ/VsKS2yxRQXa qHb8AYKYu0xeUU8A5gXGmTwDi0zZznPwK14Z8d794HmfImO9ie9SvLv9bEblsi00cAcj gb3F2Uei0Z5JzoceRt6d4ZbvDq1BwrorbkEi/Pw+mCCcStIAKDLyLdBqTdHNskBT5kH/ wBEWR73d+FVL6jeipUgHzs/VWZx9VIUtwEI6UhRqUjWk03oT6tDzLakYb7nq3PP2Rxt+ gVRxLLoXkhRl/1dyioIDv/Ph8eZsEzzvvD0ADSrUBtEu+RA8qayIsetighQ5QRm3D6W2 lU5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=eBUVuORGcKN8aXJcaLTUQHEsBJljgepshIH/+ybWP+4=; b=E7BjOSYxyAz4ir1RWiovRpPWMPzV/9oVbgucaL7qzNMsOZxPGODvyHOSk8qec+TyNp TOY37VFF+eJZyJn8HoGw31oWTLH0jrqxoSsqfubsHa5TzjbouumfQwXkrUWh1PRGvEiD pCcntXRCBQ44v221JdzAAVSlG54juv8X9sfV4pzcH/QpuBgaeXpH9YeCjEYKx0yxhGSR ZyFO5Cebp8fIw+1hJxTywI5VTGATDSIqjdSTv6KW70vt+JkkCvd0vG6JH29JKuReMMdz 8OnUddqqg0tWaJGgct14J6QnJ2tmsGoLOJ/P6H3xz8W7r/E5CSPNcXin/7C88F8XNN+w Ad/w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si2194677plt.13.2019.08.29.08.32.33; Thu, 29 Aug 2019 08:32:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbfH2PbE convert rfc822-to-8bit (ORCPT + 99 others); Thu, 29 Aug 2019 11:31:04 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:39754 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfH2PbD (ORCPT ); Thu, 29 Aug 2019 11:31:03 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id BFB7060632C8; Thu, 29 Aug 2019 17:31:00 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id l0ArbPxmnKEu; Thu, 29 Aug 2019 17:31:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 0359A6083139; Thu, 29 Aug 2019 17:31:00 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZIcI1Ha_Olgo; Thu, 29 Aug 2019 17:30:59 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id CE25460632C8; Thu, 29 Aug 2019 17:30:59 +0200 (CEST) Date: Thu, 29 Aug 2019 17:30:59 +0200 (CEST) From: Richard Weinberger To: Dark Cc: Richard Weinberger , linux-kernel , anton ivanov , linux-um Message-ID: <1851013915.76434.1567092659763.JavaMail.zimbra@nod.at> In-Reply-To: <20190829103628.61953f50@thedarkness.local> References: <20190828204609.02a7ff70@TheDarkness> <20190829103628.61953f50@thedarkness.local> Subject: Re: [PATCH] um: Rewrite host RNG driver. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF60 (Linux)/8.8.12_GA_3809) Thread-Topic: Rewrite host RNG driver. Thread-Index: 5ROVPaoIle6zHgGJuGUZ0lu9vjcmrw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "Dark" > An: "Richard Weinberger" , "linux-kernel" > CC: "richard" , "anton ivanov" , "linux-um" > > Gesendet: Donnerstag, 29. August 2019 16:36:28 > Betreff: Re: [PATCH] um: Rewrite host RNG driver. > On Thu, 29 Aug 2019 15:26:24 +0200, Richard Weinberger > wrote: >> So, you removed -EAGAIN handling, made everything synchronous, >> and changed the interface.t >> I'm not sure if this really a much better option. > > I should have been more clear here that I'm using the interfaces > provided by `drivers/char/hw_random/core.c` for consistency with the > other hardware RNG drivers and to avoid reimplementing stuff that's > already there. I got this, and this is a good thing! > It might be a bit hard to see in the diff, but I pass the file > descriptor to `os_set_fd_async()` to prevent it from blocking. Well, it does not block but passing -EAGAIN directly back is not nice. Or does the hw_random framework handle this? > For the -EAGAIN handling, I'm passing it onto the caller. Since you > mentioned it, It would be better to handle it in the driver itself > so I'll update the patch to address that. > >> Rewriting the driver in a modern manner is a good thing, but throwing the >> old one way with a little hand weaving just because of a unspecified issue >> is a little harsh. >> Can you at lest provide more infos what problem you're facing with the >> old driver? > > Most of it boiled down to it silently breaking if /dev/random on the > host were to block for any reason, and there was the userspace tool > requirement to properly make use of it. With that said, the interface > was also inconsistent with the other hardware RNG drivers which would > require a rewrite to address anyway. Maybe our -EAGAIN handling is buggy. That said I'm all for changing the driver to use the right framework but please make sure that we don't drop useful stuff like -EAGAIN handling. Thanks, //richard