Received: from list by lists.gnu.org with archive (Exim 4.71) id 1h7RvO-00060g-Oz for mharc-grub-devel@gnu.org; Fri, 22 Mar 2019 17:42:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h7RvM-0005j8-1a for grub-devel@gnu.org; Fri, 22 Mar 2019 17:42:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h7RjX-0002I5-SQ for grub-devel@gnu.org; Fri, 22 Mar 2019 17:29:49 -0400 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:36866) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h7RjE-0001nk-U3 for grub-devel@gnu.org; Fri, 22 Mar 2019 17:29:47 -0400 Received: by mail-ed1-x542.google.com with SMTP id v21so2857135edq.4 for ; Fri, 22 Mar 2019 14:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=umMrBKevlzgmgB7GbibrbfaxhwQ/gxFPzopsxrbLfWo=; b=HydNmEcXB9I7uptE+ST49AmBdFYaZ3QP1qjhRk2au1JmO5CEk88bVqEekzsOIbq0sE /1LzPvkNLi1qpuVeG3WQv/6zaQU+Pwru0zCBlzBN1S+fZcMgwd//nkCv1Xdu9n2pWrWR 0D1Obs+vA7Kjmvkhg/jnCx8RWpajek4YOr8vsnr2qr61zNkL5BcU+zLPgTsWxYj267IT T9xxlOMOg+fY+QRUdzyxBVIP78QrGdpqdbNL9M8Hk6QLASzNtzbtcZVCN4xprRZB7OwO D+3bn2gk+vWYm47nHszGuRde947NVfaex32yfYdjs1OddxRgt+B153Ngh3pQ8r8Ozx+3 vNNQ== 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:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=umMrBKevlzgmgB7GbibrbfaxhwQ/gxFPzopsxrbLfWo=; b=VVEWOQ5Gzzq8m5vluVeglcS8WegMYQ2YZCsgGw0M0JD5o0tNNtQQuQcQIB6EH+ngoz dWdbVEiHc381FlK8IkLKbJ/nBTyPj8izSQw0FhqPf28njipgI+mMKea/hGWo/wtOZ4gk nlB5uoz1gfkWoZK77+5qcvSQtRNS+kirNPYujzDmLhVSLm21b+lj35CdpDoXp53yxaQH kUdNB/9W0hDqu0Kfxq+5ppAhP7nhggBuUJx9M7PLYp34uKuNFvD5fmI5nFZK84dChPCY /6B0h9hJpU2pRGoYG3vBrBCzEJE98cGNsa42hgsvpvyJkC3GXYPL2IejodWPc1mo9028 BH8w== X-Gm-Message-State: APjAAAWhzTIME/4pRBp4ZaIEaVVhit4Oxim21IzQagTd84QOymsOoIFy sIMITsM1iF+xGmCkv+bXDBEKVGQ8 X-Google-Smtp-Source: APXvYqyJz6TrUFt1WFNSYV+WksYzPLn8T1oa/FyvaGMJshbt739p1cFcQU/SXMTq2MdFnbQ1cQRxVw== X-Received: by 2002:a17:906:5584:: with SMTP id y4mr6803395ejp.36.1553290158612; Fri, 22 Mar 2019 14:29:18 -0700 (PDT) Received: from [192.168.1.11] (112.red-81-47-147.staticip.rima-tde.net. [81.47.147.112]) by smtp.googlemail.com with ESMTPSA id r48sm2903120edd.87.2019.03.22.14.29.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Mar 2019 14:29:18 -0700 (PDT) Subject: Re: [PATCH v3 2/2] Add new MSR modules (rdmsr/wrmsr) To: Daniel Kiper , Eric Snowberg Cc: The development of GNU GRUB References: <20190308002637.31530-1-jesusdf@gmail.com> <20190308002637.31530-3-jesusdf@gmail.com> <94E704D1-69AE-4B1F-8F07-338918114FDC@oracle.com> <20190322121646.ozlypri4lzz6zwys@tomti.i.net-space.pl> From: =?UTF-8?B?SmVzw7pzIERpw6lndWV6IEZlcm7DoW5kZXo=?= Openpgp: id=25B5907521F72F0D2A85805AF2B86990C97D83AE; url=http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF2B86990C97D83AE Autocrypt: addr=jesusdf@gmail.com; prefer-encrypt=mutual; keydata= mQENBE0EQN4BCADJd9SXqsXllmTx1IIMLUTnSoMAjNzD3JTakEwkDRO2mena5MQMYosSS/lv XFtlY+16IxPOP4rTIIvInqE9D7mwWvXsuqlR8GBUH7y0wssdCmm1STAQicVSfa8hW2Gi4vrk zH3aAWdguLZeuQwtITvpGHcZOcfOsmu5KesH4nHpgUmfrSY+5ZrKLeHIwOxH0K4vAX9Cu5+B RO/2PBMvuB50cCXKMrUtOrn7UitZ8UIlgVWFolRnMoZwoMTsaDR/59nYwCUZcR5U5EwcLTrx nGT23g8kAt+keCkQLyz23LpXoBLFv4umB0+ZUki18Nv5kdBxfAOiDUBSM/jj/8P8jViPABEB AAG0Lkplc8O6cyBEacOpZ3VleiBGZXJuw6FuZGV6IDxqZXN1c2RmQGdtYWlsLmNvbT6JATgE EwECACIFAk0EQN4CGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEPK4aZDJfYOuAucI ALN5iJnjNvRUsRLmCghisiLPbM8C2X0ctqr+fKYmN6tSZ7YKIe4dmuqnVS6PGPm2wAaW+X9E 3C/cg/ShSe9s55+v018Fq1UUXKPd6MM1CRohr5BR8YtA2uRC5hY0DpANdDop1hAM0DOb1M46 I1c/9P5NLA/mQinFikdPglzID1p2UgzoXeCNaYQuUBcOY8nXsfZM2IMtZPzXj6QT7Hpqh1qe Jw/ujucayQ5uo2ZQH2BfLhDCDG7S9YhKiy9S8CcSmgXb4a+V7r5U4kJIeu16ioKr7wMy1bjE bmN6YAEJcsddaQgH3qLi42tS2c7oIxrCPM22aqkuuOYEWjT4UPHQ3f+5AQ0ETQRA3gEIAMm6 gXWdJN8oQvYB5qxQdzXb+ph5JTzL+URMVuGJyePHIoxpy+saYlx05pPxtWmVtqTzHhahqgDw E5c8XpaY/LjJ/q3LHkUofwF1DhxbkuHYKTbIiVTXKQRiVS596N+CTECjF1WDBAtfO+AGOp98 tpPtHa5oeBuhS8X7va3qOhTIz7NXp9cM9gfZAH1y9gspxZxikVOgOHQQK3t9F34mdmfIQZj0 D3rWwCQW6kJzy0YSsB2w/ewYb1d3fS5QMZsfoVCrcN/Q3CcTR8dRtc41zDUv5zyherrCCWSk c3ghUWt6QEF4gCNJvOf22gBQBYJI/BCrLaVZuhczU2w9qAZnwdkAEQEAAYkBHwQYAQIACQUC TQRA3gIbDAAKCRDyuGmQyX2DrjRzB/0RTqLR6P+J+znCWrG+zTx/voXgUfenB1JF/lt8wDHw 9eSgmh+bvS+I6cGF0FLz9j+zpRggDGSKWuVrDZ8FsfsrMy0V6HfRJlkNtR1DpuRvM8mnTK8o or7yrwkGeGJ7IhhYMPCEPGOrWbQwiSuHUoO1B0GKMT0gqkFoCEnjp9RKwbORMdw3ya6l6SMK xKromJkKLYfwlt0Ju77k0n1CEv6b+VSHjPlctZLqu1eUyDKsewXb/K7/VyAePzg8elWCt6qK RtOfPf+43ULVI5r5uKOxDcH/nmSMJW86Jqtn6Vlyt1/YnKQQHGeed6io8XuLpl864dzTpReX 8XRRy5VFKUa8 Message-ID: Date: Fri, 22 Mar 2019 22:29:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190322121646.ozlypri4lzz6zwys@tomti.i.net-space.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::542 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 21:42:01 -0000 El 22/3/19 a las 13:16, Daniel Kiper escribió: > On Thu, Mar 21, 2019 at 05:23:58PM -0600, Eric Snowberg wrote: >>> On Mar 7, 2019, at 5:26 PM, Jesús Diéguez Fernández wrote: > > [...] > >>> diff --git a/include/grub/i386/rdmsr.h b/include/grub/i386/rdmsr.h >>> new file mode 100644 >>> index 000000000..f6d7b72ca >>> --- /dev/null >>> +++ b/include/grub/i386/rdmsr.h >>> @@ -0,0 +1,34 @@ >>> +/* >>> + * GRUB -- GRand Unified Bootloader >>> + * Copyright (C) 2019 Free Software Foundation, Inc. >>> + * >>> + * GRUB is free software: you can redistribute it and/or modify >>> + * it under the terms of the GNU General Public License as published by >>> + * the Free Software Foundation, either version 3 of the License, or >>> + * (at your option) any later version. >>> + * >>> + * GRUB is distributed in the hope that it will be useful, >>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of >>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >>> + * GNU General Public License for more details. >>> + * >>> + * You should have received a copy of the GNU General Public License >>> + * along with GRUB. If not, see . >>> + */ >>> + >>> +#ifndef GRUB_RDMSR_H >>> +#define GRUB_RDMSR_H 1 >>> + >>> +/* TODO: Add a general protection exception handler. >>> + Accessing a reserved or unimplemented MSR address results in a GP#. */ >>> + >>> +extern __inline grub_uint64_t grub_msr_read (grub_uint32_t msr_id) >> >> I’m seeing a compile error with this patch: >> >> In file included from commands/i386/rdmsr.c:29:0: >> ../include/grub/i386/rdmsr.h:27:29: error: no previous prototype for _grub_msr_read_ [-Werror=missing-prototypes] >> extern inline grub_uint64_t grub_msr_read (grub_uint32_t msr_id) >> ^ >> cc1: all warnings being treated as errors > > I am not able to reproduce this. Eric, could you tell us more about your > build environment and how you compile the GRUB? > > Anyway, I missed that during review but > > extern inline grub_uint64_t grub_msr_read (grub_uint32_t msr_id) > { > ... > > should be changed to > > grub_uint64_t inline > grub_msr_read (grub_uint32_t msr_id) > { > ... > > Jesús, please post the fix for that. > > Daniel > Done. I inverted the order (inline first) to prevent this warning: In file included from commands/i386/rdmsr.c:29:0: ../include/grub/i386/rdmsr.h:27:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] grub_uint64_t inline ^~~~~~~~~~~~~ In file included from commands/i386/wrmsr.c:29:0: ../include/grub/i386/wrmsr.h:27:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] void inline ^~~~ I also added the missing prototypes. Jesus.