Message ID | 20240711131822.3909903-11-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | b88cfee90268cad376682da8f99ccf024d7aa304 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:fac3:0:b0:367:895a:4699 with SMTP id a3csp218684wrs; Thu, 11 Jul 2024 06:20:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUoQfOaTqrqRZ+ON/Kl+phAbh+bDbBC7UZ0vf4zW0aHXzMrWWJ74rWNrZl4FKfhnl1wk8PX56dT4vUU93nnCOV0 X-Google-Smtp-Source: AGHT+IHEJr8gI19XFPD3DsXc09aSGZYyhqJkzeeZlYVTIBCIRsKwwfG0lTT+Y8nZgRYf1AH4uWcL X-Received: by 2002:a05:6000:24b:b0:367:900c:c098 with SMTP id ffacd0b85a97d-367cea95fccmr6665122f8f.39.1720704017693; Thu, 11 Jul 2024 06:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720704017; cv=none; d=google.com; s=arc-20160816; b=ZZ2qApykHUxPDTNYy8fQVBK/2Es+kihQmhui1rlOsP9bHS/C1tpaYyGEamL9TBzP1V rZLwAmzi4BLOs7eY+MY5RniAvFzt6T2EGIplZcFEcH3uosu30w2/Dhyt501g4YqG26ph 3Vk8VYxwQbh4q1fOsJ0HVZ8VPH0PgdQaWq6je2pOLgzaPbgA0747dYSTxCGUx9fBqQ7m GDmBX0ji+7qTbw3ujQYrxXbE4EGe4mpeUMZhx/QLiK2gsBGhD63WUVaJpex23mPkkv8n g1jLWcAJLdD9UjNNjF4TbjjWlLMTIn34TckGA2Oo+xQz/h1yLcDWfipLV7b/Ek+IwPC+ UfrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:to:from :dkim-signature; bh=0oHQIPs0GoYkvLkiU1uUeK4MNvDVeEKdzAv+RB+FavI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=b2XeraIHv91+hf4vNCABNjdVDEjIh/LRK500KgzoiWcNFLMrO2EnQFA4Jk4hmBrilE 46Q67af2DilsezCY/Zxj7ljV8BLr9Nzs3rGX3VdFti2kQKsQNMiHHtX8tTkeGGs8p0rE 8u3GCMniaoymoELL1/pXCQvGlW5TNRkd1mBsFKMGXacz0JLlcKEiTOoyVN1d33Xk8sEU ZhjMa5sKZbxSC8mjLdJvLX8ADeoy/Zcg30IUG9pnCQ3hDqT4RRV9hZ4vF4Bhfx2+F06A Y1iPEt/qq0xpm7ZT62/dC17mk276OrIsmxiD4i1ae1Ky18BzhP51kxvc18cKA0FS5bS4 aE1w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ien7Zo6S; 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 Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ffacd0b85a97d-367cdfb67c4si4043067f8f.924.2024.07.11.06.20.17 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jul 2024 06:20:17 -0700 (PDT) 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=Ien7Zo6S; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1sRthF-0001ds-BZ; Thu, 11 Jul 2024 09:18:53 -0400 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 <peter.maydell@linaro.org>) id 1sRthA-0001Lo-Ce for qemu-devel@nongnu.org; Thu, 11 Jul 2024 09:18:48 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1sRth6-00063a-3O for qemu-devel@nongnu.org; Thu, 11 Jul 2024 09:18:47 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so6646585e9.2 for <qemu-devel@nongnu.org>; Thu, 11 Jul 2024 06:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720703910; x=1721308710; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0oHQIPs0GoYkvLkiU1uUeK4MNvDVeEKdzAv+RB+FavI=; b=Ien7Zo6S8sm9u7Su35IAt/O21haHiyEKY60UnuFLuwJybJxlFIJpF+LpF2XBQlzIe7 T5ST+qt6RkQlr5PjJL7tCWwQyiwHeH95xf/VGkohxFdb6UA4lAWaKcQlQVdGBezSJpVM n2q46xqaFMq8iwYolC8eW4JkgolYpHB0dFxJ3qKOoH1fZJDMroESd5cG+VUNYZzJ2iA8 WFDI9fUXVokU2idgvGYAhN8RCh/3SfTHsWpqJ2V4EGQcevzxnifkASZFDIyciXqPRp7Z BnAEmTGvEVq+/bSmepxxiSFAwdIR3aGmzVboun4Qb4EZGcksZuKjYmc39sc3z6rQecVO 0o6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720703910; x=1721308710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0oHQIPs0GoYkvLkiU1uUeK4MNvDVeEKdzAv+RB+FavI=; b=NBNBVLcOBOpVlGFZs56WWpR4yz0hAsINSRZ6FEXVQHBXi3QO1YbplqS4dJOSFuK8uN cD5hPii6xUrr8VHOBqQz+IqOhzbkgcYDoNb2RwSd7fXWWJN8yqEdVrIPWtImNYAjhc+1 Kr2aQpfQcxmLD1Mh6qtRT6KgoU9EV37dXms+TdDmzbwAVd+1nXErEPkV49mgWG0/PH0/ FaGSmJuMR1E6Rjru1Rskti5w4JXX0dHh5o5eCsjLc/1smwZJxZ4w6izZFdQh9nY6AOrm hrKXHGCQjl13/TEAfbEaRd40edD5CsclPXeXXuegRd2eAMGnEbaWH1KovFBAzVIHWdGy irHA== X-Gm-Message-State: AOJu0YzJDWMPMTl1caTRu0FkoZ9KiTXgIJ6iyDGTGuJkQo6Lv8Ea+Z7C QZptdg6NDmtB7ud6CEGc/ockhRKsnzThEfHRsLPJvzSjAlK1z0htBbSQxn7qWVUdN87Zm3iIv9V Taz8= X-Received: by 2002:a05:600c:48a5:b0:426:59fe:ac27 with SMTP id 5b1f17b1804b1-426707f83d7mr66077115e9.26.1720703909834; Thu, 11 Jul 2024 06:18:29 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4266f736939sm119412025e9.37.2024.07.11.06.18.29 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 06:18:29 -0700 (PDT) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL 10/24] hw/char/pl011: Avoid division-by-zero in pl011_get_baudrate() Date: Thu, 11 Jul 2024 14:18:08 +0100 Message-Id: <20240711131822.3909903-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240711131822.3909903-1-peter.maydell@linaro.org> References: <20240711131822.3909903-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
[PULL,01/24] target/arm: Correct comments about M-profile FPSCR
|
expand
|
diff --git a/hw/char/pl011.c b/hw/char/pl011.c index 8753b84a842..f8078aa216d 100644 --- a/hw/char/pl011.c +++ b/hw/char/pl011.c @@ -87,6 +87,12 @@ DeviceState *pl011_create(hwaddr addr, qemu_irq irq, Chardev *chr) #define CR_DTR (1 << 10) #define CR_LBE (1 << 7) +/* Integer Baud Rate Divider, UARTIBRD */ +#define IBRD_MASK 0x3f + +/* Fractional Baud Rate Divider, UARTFBRD */ +#define FBRD_MASK 0xffff + static const unsigned char pl011_id_arm[8] = { 0x11, 0x10, 0x14, 0x00, 0x0d, 0xf0, 0x05, 0xb1 }; static const unsigned char pl011_id_luminary[8] = @@ -374,11 +380,11 @@ static void pl011_write(void *opaque, hwaddr offset, s->ilpr = value; break; case 9: /* UARTIBRD */ - s->ibrd = value; + s->ibrd = value & IBRD_MASK; pl011_trace_baudrate_change(s); break; case 10: /* UARTFBRD */ - s->fbrd = value; + s->fbrd = value & FBRD_MASK; pl011_trace_baudrate_change(s); break; case 11: /* UARTLCR_H */ @@ -531,6 +537,9 @@ static int pl011_post_load(void *opaque, int version_id) s->read_pos = 0; } + s->ibrd &= IBRD_MASK; + s->fbrd &= FBRD_MASK; + return 0; }