From nobody Sat May 18 15:38:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1659001203; cv=none; d=zohomail.com; s=zohoarc; b=hElrR5hyf2GHdiqnov5bIX5YvwZiBouhb8k5sy4FRJIIX3uV612ZKXlmGpzT894x6KwLOL+7koK4x0qR+GmBiyzGyNaLPMVdh1HD4YsNGKM9EksgYR7RkNHTzuQhvvM2ootdEK/zTBHLsj7HKokdAYXkMe/DDI/cBq+GHaIn2uA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659001203; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2UJGgabuVFGHq5XUuV5VDhxy1w/UlIZ0G13KeLSGwEU=; b=AVo0HtZOZk2w0ew9WBr1upvGZzzsMzCKQNLLitKfZ1AH4xHmBPBU+pV/tT6kYy5om7+RYXaZIWz485oHlufsM0kBEbQJJei2YbGe4gUMKzR7nPu+6939YzhuXLrEeb4n+9/3pEMgBTygkVTqZOW1CIMi8LypfDA249Jlb4kaKE8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1659001203370459.02269156955776; Thu, 28 Jul 2022 02:40:03 -0700 (PDT) Received: from localhost ([::1]:45444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGzzt-0001Bf-Pj for importer@patchew.org; Thu, 28 Jul 2022 05:40:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGzw8-0006w2-G8 for qemu-devel@nongnu.org; Thu, 28 Jul 2022 05:36:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGzw4-0000O6-P7 for qemu-devel@nongnu.org; Thu, 28 Jul 2022 05:36:06 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-132-IQceuZz2PHyiFCPIzaofQw-1; Thu, 28 Jul 2022 05:36:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A93AA811E80; Thu, 28 Jul 2022 09:36:00 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99E001121319; Thu, 28 Jul 2022 09:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659000962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2UJGgabuVFGHq5XUuV5VDhxy1w/UlIZ0G13KeLSGwEU=; b=U/Z1JN6qGWFti4PDvgoe0LugJsnP58Jb6ybMzUhVyAY8sL6YMP89fccNfNKvljEC0fHR7K Xt8IcY/0Jj75LZ5VYqTyDiu1QjpO3S1a84djZDYuNiHda6Xvt/tIao0SnoP7EzKVI2dt7x zznqzuQ/wr2ZvB4hq2Djn6sj0Mfj/Xs= X-MC-Unique: IQceuZz2PHyiFCPIzaofQw-1 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, t0rr3sp3dr0@gmail.com, alex.bennee@linaro.org, dgilbert@redhat.com, agraf@suse.de, peter.maydell@linaro.org Subject: [PATCH for-7.1] applesmc: silence invalid key warning in case default one is used Date: Thu, 28 Jul 2022 05:35:58 -0400 Message-Id: <20220728093558.1163751-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659001205372100001 QEMU probably can't carry OSK key[1] for legal reasons so it can't supply the valid default key. However when tests are run applesmc will pollute test log with distracting warning, silence that warning so it won't distract maintainers/CI. If user launches MacOS guest without supplying valid or any key they will get upset MacOS (and legality of specifying valid key on CLI is also questionable). This patch favors QEMU/tests vs MacOS guest. A patch from Apple needed to change default to the valid key, until then prefer QEMU maintainers sanity/cleaner test logs vs any inconvenience users running MacOS guest might suffer. 1) After some googling, it seems 'secret' key is the same for all Mac hardware and is widely known but whether it's permited to use that is up to lawyers/Apple to decide. Signed-off-by: Igor Mammedov --- hw/misc/applesmc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 5f9c742e50..bce27b0950 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -84,7 +84,7 @@ enum { #define smc_debug(...) do { } while (0) #endif =20 -static char default_osk[64] =3D "This is a dummy key. Enter the real key " +static char default_osk[65] =3D "This is a dummy key. Enter the real key " "using the -osk parameter"; =20 struct AppleSMCData { @@ -335,10 +335,12 @@ static void applesmc_isa_realize(DeviceState *dev, Er= ror **errp) isa_register_ioport(&s->parent_obj, &s->io_err, s->iobase + APPLESMC_ERR_PORT); =20 - if (!s->osk || (strlen(s->osk) !=3D 64)) { - warn_report("Using AppleSMC with invalid key"); + if (!s->osk) { s->osk =3D default_osk; } + if (strlen(s->osk) !=3D 64) { + warn_report("Using AppleSMC with invalid key"); + } =20 QLIST_INIT(&s->data_def); qdev_applesmc_isa_reset(dev); --=20 2.31.1