From patchwork Tue Dec 31 20:22:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 854427 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7090363wrq; Tue, 31 Dec 2024 12:26:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWChsb9nhlAE5V3vhKliXRnlOz1jboJWJYDok7Y0Q7biUOvoAyH6dbNHWhrozLDGXiozbCvKg==@linaro.org X-Google-Smtp-Source: AGHT+IFHuozMTEu0kPQN3zd7aJ9877UC+i1FWv6xauiOadE7TDyGpUFhzuOVbT3w2xTeCm/o7XUf X-Received: by 2002:a05:620a:40c1:b0:7b8:6242:18b8 with SMTP id af79cd13be357-7b9ba73f788mr5959491985a.16.1735676809737; Tue, 31 Dec 2024 12:26:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735676809; cv=none; d=google.com; s=arc-20240605; b=M9aI+krWN1F4JC4Mt6m9hgfrl++kyvEeyIFFbrKAq0Q0HQZeCyaKdg5tl9KrVjWK9w +MxqthYD23h5y7J4ykNLlWATRT9n0O80daLtvxl25z1y3Za32UxX9D/iH5m0dqq0jR+z 69ULxwPiXTh9HTyx2oimdyJAzqLOqH/MQJq6loMivu0EHR556aNhH9a5RP+1UgwVnmPh E5wUiz7ve6ixi2kGn9A+nzDzb62cIPgBWhD9++83q6hIG+LWUTmmUdAeXTBEn3C+BKow mCo0RNUUkB1YfisYYCmmvqORSfGMqxbG+2mEkmufplgqN3x7YU/qjrIS00cGF5YGkUbd F9+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1OsyYuL+27oK54ZGKawyCinUOguZIMyJUg2PlLlormY=; fh=WFBdicru1D9bSpCyezuvlbmKZ6DpYs++MhPzIQUvDzA=; b=LaFZi3r2XNRQZ99D5K3o1DLu6FVdrOZNClDJvDGZm7dSlZOqhOdflBDpdhSDqwgNRg FLwn9csvGT38pIU2T8EGZpeZR6ftgBJeVuRuYH4VMj9ywh1UYtrVMvQfb79y89waxqMl IIAwDNHLd496UnFX7WxSalV7ynqjXzV6Rw5JinDZck+mtammmvEkLGQqmyutPikv4NAG 9hhGkk0He9sn0IgkUAWLbkDS/Bg+su85Jn+c0NfaWidIfkEnC+Xz3ayDLol7qva09UMl +spGCd5tKXhFQ277AyCEkm5b5F8M6H0XNxuxulCdknxreelte0AOrhre4aNwyuuczRIp sNmg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGH+ILdZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2ad91asi3399800285a.39.2024.12.31.12.26.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Dec 2024 12:26:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RGH+ILdZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSin1-000726-UH; Tue, 31 Dec 2024 15:24:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSimr-0006ne-A6 for qemu-devel@nongnu.org; Tue, 31 Dec 2024 15:24:22 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSimp-0000yM-83 for qemu-devel@nongnu.org; Tue, 31 Dec 2024 15:24:20 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso67675895e9.0 for ; Tue, 31 Dec 2024 12:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735676657; x=1736281457; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1OsyYuL+27oK54ZGKawyCinUOguZIMyJUg2PlLlormY=; b=RGH+ILdZAKGJBYa2U4p4PmIkbx64MJPwmIHr1sWm5qCUjgFv9Ek+ZrSbvgVxbmZr11 nqsg8zbUrCbvnUzqAneapNyIt+TpjwqCb5aZW42U6J4+ayNCAr4xxed0oHC355txLQf3 BLAv+s2rRnBD+RlVeYVDHdfPpnjDCR574iDcHDWxPF8HSZln31bMSxG0VJM4leEimriS wiRy9ubRFeYV28b0P52GS7Ee20Vw7xTD8hYMXWgtwrovs+h7LtcNYBB9oeq+FLHCoXK7 IjdF/EIFkRLMlIufVKsgUBllu4nPXArgZkd8SjZjN9x8Rd6ZOoK0a+ZgPBdeH+BG7ZHC psfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735676657; x=1736281457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1OsyYuL+27oK54ZGKawyCinUOguZIMyJUg2PlLlormY=; b=i3XuDN1NbP5ap+ZV5WCiztn/QnoBAvIBHHpk1dyDZfzjUc9yFj0k20hLznBY85JTlI /0zz1tNEodH69mn9RVdeCmreik0CpZvHsVweXS3XUCqXz1S1fSoJSUM6J6a5gd7+S671 9EwtDLDpEC28VKVRsxY2cXXbfoyUF0jHrNh1I9w57oix05/Eo50LWi2glfbo6chcA4lf SPPZvgaUU4O9IcUxVTuZrEWfh4QAkCeM4BJuksvBPsSd+6m7FzNFLbCet8NgQCTlva3A BJK90GaJnKBitDOqBqLWmpWHc2ro+HgGXmEq75ZMsAmV4ws16/6Kol/+gg8YY9fRCrZl M4cw== X-Gm-Message-State: AOJu0Yw1EkJnJw9jPkj1lNmAoLBNzVdLJX202fEhJOYZd2NT58AcK1N4 uude0pAsZHs1GydmtEj/W3UWx3boQN336giQblqF0oQ7j+QAvzMvjqBxYMi6CntZaBxuC0Dmxr3 DdqI= X-Gm-Gg: ASbGncsd9wb6Lvw9ypVd4RX9mHfxVqta4Qq2IyxsZVA/Lmvrir4a75UBYptnYTVIzGG RyNQxBnBclkg7/bIdnBvNllzCiliGdAR0ZB8f9xGYe3EpL56dputuEPdgpKAjtJZ8nAXybynINz sT0Gt4B9xN5PjW5x78dGKCE6BqFBzgKb1r7TM0MpaD1uKRqOhTdkaHWEDjg11sFBWS9TvQyVLQZ o6kjjl8CJwaHH9wu1Uxa5fh3//jmYhqdvDllPJP6tEDyDrgVlCfqshw0TryT1feaQwawrbRZ8tu hER9jjevk8TwClg68qo1MfNwplGCOyY= X-Received: by 2002:a05:6000:2c3:b0:385:df73:2f3a with SMTP id ffacd0b85a97d-38a221fa8eemr31826814f8f.14.1735676657207; Tue, 31 Dec 2024 12:24:17 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c828a8dsm33868515f8f.2.2024.12.31.12.24.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 31 Dec 2024 12:24:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Phil Dennis-Jordan , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 22/29] hw/usb/hcd-xhci: Unimplemented/guest error logging for port MMIO Date: Tue, 31 Dec 2024 21:22:21 +0100 Message-ID: <20241231202228.28819-23-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241231202228.28819-1-philmd@linaro.org> References: <20241231202228.28819-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Phil Dennis-Jordan The XHCI device code uses tracing rather than logging on various code paths that are so far unimplemented. In some cases, these code paths actually indicate faulty guest software. This patch switches instances in the read and write handlers for the port MMIO region to use qemu_log_mask() with LOG_UNIMP or LOG_GUEST_ERROR, as appropriate in each case. Signed-off-by: Phil Dennis-Jordan Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241227121336.25838-5-phil@philjordan.eu> Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 3719c0f190d..7dc0994c89c 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2810,9 +2810,15 @@ static uint64_t xhci_port_read(void *ptr, hwaddr reg, unsigned size) case 0x08: /* PORTLI */ ret = 0; break; - case 0x0c: /* reserved */ + case 0x0c: /* PORTHLPMC */ + ret = 0; + qemu_log_mask(LOG_UNIMP, "%s: read from port register PORTHLPMC", + __func__); + break; default: - trace_usb_xhci_unimplemented("port read", reg); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: read from port offset 0x%" HWADDR_PRIx, + __func__, reg); ret = 0; } @@ -2881,9 +2887,22 @@ static void xhci_port_write(void *ptr, hwaddr reg, } break; case 0x04: /* PORTPMSC */ + case 0x0c: /* PORTHLPMC */ + qemu_log_mask(LOG_UNIMP, + "%s: write 0x%" PRIx64 + " (%u bytes) to port register at offset 0x%" HWADDR_PRIx, + __func__, val, size, reg); + break; case 0x08: /* PORTLI */ + qemu_log_mask(LOG_GUEST_ERROR, "%s: Write to read-only PORTLI register", + __func__); + break; default: - trace_usb_xhci_unimplemented("port write", reg); + qemu_log_mask(LOG_GUEST_ERROR, + "%s: write 0x%" PRIx64 " (%u bytes) to unknown port " + "register at offset 0x%" HWADDR_PRIx, + __func__, val, size, reg); + break; } }