From patchwork Tue Apr 4 17:01:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 9662101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A06EF6032D for ; Tue, 4 Apr 2017 17:02:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92A7826BE9 for ; Tue, 4 Apr 2017 17:02:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879B32841C; Tue, 4 Apr 2017 17:02:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28EC126BE9 for ; Tue, 4 Apr 2017 17:02:35 +0000 (UTC) Received: from localhost ([::1]:36792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvRqk-0003zs-6S for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Apr 2017 13:02:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvRpV-0003xv-P7 for qemu-devel@nongnu.org; Tue, 04 Apr 2017 13:01:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvRpU-00030e-Td for qemu-devel@nongnu.org; Tue, 04 Apr 2017 13:01:17 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:36396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvRpU-00030L-QS for qemu-devel@nongnu.org; Tue, 04 Apr 2017 13:01:16 -0400 Received: by mail-qk0-x241.google.com with SMTP id v75so4257767qkb.3 for ; Tue, 04 Apr 2017 10:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fA2UsosnlOp8U1SzbVpCo+1RdWLhYMDKlpFnYFGyuKo=; b=bRkSt/82Liu00fpcHTnqd+3fhCJ4ygFnLyZR0G51duE79LHpTrakeG5jpTTzvZggx7 aQ4huQontmJ1b/nI2mnI7kWxCd/+Xdo23hyBDNoayVj96xjKYoh4uJzCgHnTycT3VTnO Q92ARKSI4pOFduWzVP3qlpilHzZ8McQKBatBjBknB77ebMslFE/rHxfSAOreuj/UTqCZ qmhX2VMhDkA3vrEMPwQuNrwSp5VKGJf9ufbzd/1dU2lDOHJkRtnJA4I/BNO3VYQ//PHf sfuLSIfI3351/60NzBk3kma8sxzeddpHaWCUpc+5SywCUr8E1OQCW93w2bOzmi8w/pxD d8Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fA2UsosnlOp8U1SzbVpCo+1RdWLhYMDKlpFnYFGyuKo=; b=hNZF7iddq5XZmaEyyCZCIhG20yVedITewJwRQIIX0mKBNFMAUwbNBvQjFuuEG9GWCk wNptRYFbjwCWhu6o4dn4a7ZAR6yYB6lXbcJQgYNzb6vpuSVQAa4XyvbKQfJqDnKk9juO v3ZtF5IKs6oYHCB8Z9K7a7wVMNwHag38m7cx7DoDH/2ZtwWxdwTXDShS1r0B/8Mts2aX 0BO32FvFg1ocz54BPXdz3IzWnVLw2JxGVOPLEbnSPU63BcEZSbm2noVuxTfvK0EhyCII 6wZHYFkbrDJe692RuR1vaHVhftgLbMbqQqy7uGDM9GNZxPyu5Xyqhl4lII0JNB1V6v6f 1NqA== X-Gm-Message-State: AN3rC/5y9pXdao5oy7VqSc5icTU5YYVouv7rZn7UuEufhXZxyk4toa8RdkBCEjLBpUzThw== X-Received: by 10.55.12.213 with SMTP id 204mr6230065qkm.233.1491325276063; Tue, 04 Apr 2017 10:01:16 -0700 (PDT) Received: from HEDWIG.ini.cmu.edu (HEDWIG.INI.CMU.EDU. [128.2.16.51]) by smtp.gmail.com with ESMTPSA id z196sm12239899qkb.42.2017.04.04.10.01.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 10:01:15 -0700 (PDT) From: "Gabriel L. Somlo" To: qemu-devel@nongnu.org Date: Tue, 4 Apr 2017 13:01:04 -0400 Message-Id: <1491325264-14502-4-git-send-email-gsomlo@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491325264-14502-1-git-send-email-gsomlo@gmail.com> References: <1491325264-14502-1-git-send-email-gsomlo@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH v2 3/3] applesmc: fix port i/o access width X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, eshelton@pobox.com, f4bug@amsat.org, agraf@suse.de Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Set width of the two i/o regions dedicated to the AppleSMC's 8-bit data and command ports to 1 byte. Signed-off-by: Gabriel Somlo --- Setting these to 1-byte width works fine on any OS X version I could find to test on: 10.(6-12), inclusive. On linux, the applesmc kernel module tries *hard* to avoid loading on anything that's not a Mac, by checking DMI board vendor and product strings. If I force it using: -smbios type=1,manufacturer='Apple Inc.',product='iMac2',family='iMac' \ -smbios type=2,manufacturer='Apple Inc.',version='iMac' \ -device isa-applesmc the module fails both before and after this whole series, suggesting it's not (just) the access width but rather the overall incomplete emulation that's the issue. If we decide to go for implementing a more complete emulation, beyond simply the minimum necessary to satisfy OS X, we should definitely ensure that Linux is also happily able to initialize its applesmc driver... hw/misc/applesmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 0d882e8..7896812 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -316,12 +316,12 @@ static void applesmc_isa_realize(DeviceState *dev, Error **errp) AppleSMCState *s = APPLE_SMC(dev); memory_region_init_io(&s->io_data, OBJECT(s), &applesmc_data_io_ops, s, - "applesmc-data", 4); + "applesmc-data", 1); isa_register_ioport(&s->parent_obj, &s->io_data, s->iobase + APPLESMC_DATA_PORT); memory_region_init_io(&s->io_cmd, OBJECT(s), &applesmc_cmd_io_ops, s, - "applesmc-cmd", 4); + "applesmc-cmd", 1); isa_register_ioport(&s->parent_obj, &s->io_cmd, s->iobase + APPLESMC_CMD_PORT);