Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2210912imm; Thu, 14 Jun 2018 10:25:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLTZaGb6cgG18zqKjtb9lkmtXSGxmJeKEOC8dJt/kA4RSEGoiVNKf/FAm4Nulj4Q6KDKG3T X-Received: by 2002:a63:7f4e:: with SMTP id p14-v6mr3050125pgn.27.1528997147463; Thu, 14 Jun 2018 10:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528997147; cv=none; d=google.com; s=arc-20160816; b=YdqeTLNWqPlZfXJOKoX9a1ObPabFKKQq/mvOUdDgp/gsigaCI83e9EbmgsHkDmGst8 yGxAF6qBUkAjhE9Mo/SqPrcPvylQlvDMmokN27fjHwSP1KUtdlYDK/YNNAkJBpgI+5Fo caEiIcVjcAOS5CQx4Tz4mJ6vUyr0jGG1KbRpyeuGb8kPniuQHLbJfPwFY+lCgTaJLouU fzXIYL5MnZyYETyWHE6tZ4qPgGsNf92VJyWOqW8ME2JrujNIG5tc0jRCnNuzhC5I8D6g jZ+UiYp/MXYQ1+1Ox7DtzAfxiaLuW3zysPZVdJ4uVHbPHfzOu0ZAnhgtI14H7W1slKlK q8uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=EEzFuFrjC/qPr5tMiJ/Kj/mh8GlxzPsJcMQwQRMZSzs=; b=hLpDYs1wWA00N9VgPxVCCl54PatvmolJraVf1uzZuA4qcsgkDjPLAOsmxekD3azD8G nuF3I+7M3JhlbOEBnEu2FvVrBRpAf9vKGv8qgWHiuKgGUEdqRBA2pnakTSpjQzIc8ag1 Jp5/TU6djKHgRZqRDDNcYPwXA0635kZtX1LYd+JZPz8bQDnMS3b0ZkS3VK5ZTFCIwSfL qcRbYBIeMvDit/CM0kN6iyrHDRHY3WbhgjtBVtS2p17GMPEfC56v3FIC3LRZRvtyDxpv U0kgrVv1+RU97ysgp4ryhma2BTCk/s3Q17waPnanDT2F1DMTIi4XP/E6QAUoWG6s9965 Pu4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vfp90U9Q; 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 b62-v6si6041226pfm.104.2018.06.14.10.25.33; Thu, 14 Jun 2018 10:25:47 -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=vfp90U9Q; 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 S1755145AbeFNRZJ (ORCPT + 99 others); Thu, 14 Jun 2018 13:25:09 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:37846 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754526AbeFNRZF (ORCPT ); Thu, 14 Jun 2018 13:25:05 -0400 Received: by mail-ua0-f195.google.com with SMTP id l14-v6so1229396uao.4; Thu, 14 Jun 2018 10:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EEzFuFrjC/qPr5tMiJ/Kj/mh8GlxzPsJcMQwQRMZSzs=; b=vfp90U9QjyVgoY0ty0gqtpxqWP2tp6L9Ws0AicACd5d2872zHj/QCQwMU8hKN+9q+g ulOeNpQtefJn89AYITiglTt5uYAQqrqyXHXWORxxo9o1zfbvplAOdXXrBZBRpglCzYDE 3TUMfqO7khUR9EJOeXT+Qsd5jhHu6KcTRrG9ezthhqNUxWAFpr30q3+7/V8nuTWFlIC2 amm91FYHXdUxb9U7ywLvA+2gTLFjayBojWxRYZlWT9xfrd2SXDUhaaAu/ajfHE7nSVAY R07TP5N1c8n4z0HjyhcH+sopIU52+32H5W2MKO1IeVbRoGIM+9G25PKxMtQLh6HARNHe mtUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EEzFuFrjC/qPr5tMiJ/Kj/mh8GlxzPsJcMQwQRMZSzs=; b=M0bMV/0hxOvNXyQc7mkEpBvKOtV2qAx+WbeTh2/axluxH67uTlcwPGbSvAWiO47qGF wfSQweRN4ZQnGrF1RDY6RAuNEhYXUO+cHRfgoQo/aOBK488/rLFwJaeJjX5ZpHlLgb39 bWgnwsaMTxP7aLuW2JjWaO/SuQKHJkzMitUYy8UBZuqiqGFPiq1M6p6fhpghMjVow5ry uWRqc4QHngNEoaSSYy+KN0YNBldDk8upXRQtdZkuLMCKQ0S5byAX3tnsq8+yRc1NF2lS 1r3IZabBTslyLBoEQe8svAMAulCFwNYUI0XV/wX/jS7dGgZDvEArTJ3zN3+EDzBt7Nad xgcw== X-Gm-Message-State: APt69E21F3kmheqKNxX3HjT3gX0TdWe6LsPNB8Fz0/wC4qwuEkGjclkI Ydq2Rcq80OmN/Yq74cIcgS0itiNCsTFclkKoUBE= X-Received: by 2002:ab0:1a23:: with SMTP id a35-v6mr2299195uai.47.1528997104112; Thu, 14 Jun 2018 10:25:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:8b02:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 10:25:03 -0700 (PDT) In-Reply-To: <8307f1e0-c480-3f78-9327-e248208e5349@gmail.com> References: <45b8bde6-aaa8-3f3f-0528-81e5e931751c@gmail.com> <20180609010420.GA112645@localhost.localdomain> <8307f1e0-c480-3f78-9327-e248208e5349@gmail.com> From: Andy Shevchenko Date: Thu, 14 Jun 2018 20:25:03 +0300 Message-ID: Subject: Re: [PATCH v3] dcdbas: Add support for WSMT ACPI table To: Stuart Hayes Cc: Darren Hart , Douglas_Warzecha@dell.com, Mario Limonciello , Jared.Dominguez@dell.com, Linux Kernel Mailing List , Platform Driver Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 14, 2018 at 5:22 PM, Stuart Hayes wrote: > On 6/13/2018 3:54 AM, Andy Shevchenko wrote: >>> + * Provide physical address of command buffer field within >>> + * the struct smi_cmd... can't use virt_to_phys on smi_cmd >>> + * because address may be from memremap. >> >> Wait, memremap() might return a virtual address. How we be sure that >> we got still physical address here? > Before this patch, the address in smi_cmd always came from an alloc, so > virt_to_phys() was used to get the physical address here. With WSMT, we > could be using a BIOS-provided buffer for SMI, in which case the address in > smi_cmd will come from memremap(), so we can't use virt_to_phys() on it. > So instead I changed this to use the physical address of smi_data_buf that > is stored in smi_data_buf_phys_addr, which will be valid regardless of how > the address of smi_data_buf was generated. Yes, but what does guarantee that memremap() will return you still physical address? >>> + return 0; >>> + >>> + /* Scan for EPS (entry point structure) */ >>> + for (addr = (u8 *)__va(0xf0000); >>> + addr < (u8 *)__va(0x100000 - sizeof(struct smm_eps_table)); >> >>> + addr += 1) { >> >> This wasn't commented IIRC and changed. So, why? > I changed this is response to your earlier comment (7 june)... you had pointed > out that it would be better if I put an "if (eps) break;" inside the for loop > instead of having "&& !eps" in the condition of the for loop. I put the note > "Changed loop searching 0xf0000 to be more readable" in the list of changes for > patch version v3 to cover this change. Thanks, but here I meant += 1 vs += 16 step. -- With Best Regards, Andy Shevchenko